diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/CHANGELOG.md b/sdk/resourcemanager/containerservice/armcontainerservice/CHANGELOG.md index 5298593e035e..78e362c60927 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/CHANGELOG.md +++ b/sdk/resourcemanager/containerservice/armcontainerservice/CHANGELOG.md @@ -1,5 +1,426 @@ # Release History +## 0.4.0 (2022-04-08) +### Breaking Changes + +- Function `*ManagedClustersClient.BeginRunCommand` return value(s) have been changed from `(ManagedClustersClientRunCommandPollerResponse, error)` to `(*armruntime.Poller[ManagedClustersClientRunCommandResponse], error)` +- Function `*ManagedClustersClient.BeginCreateOrUpdate` return value(s) have been changed from `(ManagedClustersClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[ManagedClustersClientCreateOrUpdateResponse], error)` +- Function `*ManagedClustersClient.BeginResetAADProfile` return value(s) have been changed from `(ManagedClustersClientResetAADProfilePollerResponse, error)` to `(*armruntime.Poller[ManagedClustersClientResetAADProfileResponse], error)` +- Function `*ManagedClustersClient.BeginDelete` return value(s) have been changed from `(ManagedClustersClientDeletePollerResponse, error)` to `(*armruntime.Poller[ManagedClustersClientDeleteResponse], error)` +- Function `*ManagedClustersClient.BeginStart` return value(s) have been changed from `(ManagedClustersClientStartPollerResponse, error)` to `(*armruntime.Poller[ManagedClustersClientStartResponse], error)` +- Function `*ManagedClustersClient.ListByResourceGroup` return value(s) have been changed from `(*ManagedClustersClientListByResourceGroupPager)` to `(*runtime.Pager[ManagedClustersClientListByResourceGroupResponse])` +- Function `*ManagedClustersClient.BeginResetServicePrincipalProfile` return value(s) have been changed from `(ManagedClustersClientResetServicePrincipalProfilePollerResponse, error)` to `(*armruntime.Poller[ManagedClustersClientResetServicePrincipalProfileResponse], error)` +- Function `*OperationsClient.List` parameter(s) have been changed from `(context.Context, *OperationsClientListOptions)` to `(*OperationsClientListOptions)` +- Function `*OperationsClient.List` return value(s) have been changed from `(OperationsClientListResponse, error)` to `(*runtime.Pager[OperationsClientListResponse])` +- Function `NewManagedClustersClient` return value(s) have been changed from `(*ManagedClustersClient)` to `(*ManagedClustersClient, error)` +- Function `*ManagedClustersClient.BeginUpdateTags` return value(s) have been changed from `(ManagedClustersClientUpdateTagsPollerResponse, error)` to `(*armruntime.Poller[ManagedClustersClientUpdateTagsResponse], error)` +- Function `*SnapshotsClient.ListByResourceGroup` return value(s) have been changed from `(*SnapshotsClientListByResourceGroupPager)` to `(*runtime.Pager[SnapshotsClientListByResourceGroupResponse])` +- Function `*SnapshotsClient.List` return value(s) have been changed from `(*SnapshotsClientListPager)` to `(*runtime.Pager[SnapshotsClientListResponse])` +- Function `NewPrivateEndpointConnectionsClient` return value(s) have been changed from `(*PrivateEndpointConnectionsClient)` to `(*PrivateEndpointConnectionsClient, error)` +- Function `*AgentPoolsClient.BeginDelete` return value(s) have been changed from `(AgentPoolsClientDeletePollerResponse, error)` to `(*armruntime.Poller[AgentPoolsClientDeleteResponse], error)` +- Function `NewResolvePrivateLinkServiceIDClient` return value(s) have been changed from `(*ResolvePrivateLinkServiceIDClient)` to `(*ResolvePrivateLinkServiceIDClient, error)` +- Function `*MaintenanceConfigurationsClient.ListByManagedCluster` return value(s) have been changed from `(*MaintenanceConfigurationsClientListByManagedClusterPager)` to `(*runtime.Pager[MaintenanceConfigurationsClientListByManagedClusterResponse])` +- Function `NewAgentPoolsClient` return value(s) have been changed from `(*AgentPoolsClient)` to `(*AgentPoolsClient, error)` +- Function `*ManagedClustersClient.ListOutboundNetworkDependenciesEndpoints` return value(s) have been changed from `(*ManagedClustersClientListOutboundNetworkDependenciesEndpointsPager)` to `(*runtime.Pager[ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse])` +- Function `NewPrivateLinkResourcesClient` return value(s) have been changed from `(*PrivateLinkResourcesClient)` to `(*PrivateLinkResourcesClient, error)` +- Function `*AgentPoolsClient.BeginCreateOrUpdate` return value(s) have been changed from `(AgentPoolsClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[AgentPoolsClientCreateOrUpdateResponse], error)` +- Function `NewSnapshotsClient` return value(s) have been changed from `(*SnapshotsClient)` to `(*SnapshotsClient, error)` +- Function `NewMaintenanceConfigurationsClient` return value(s) have been changed from `(*MaintenanceConfigurationsClient)` to `(*MaintenanceConfigurationsClient, error)` +- Function `*ManagedClustersClient.List` return value(s) have been changed from `(*ManagedClustersClientListPager)` to `(*runtime.Pager[ManagedClustersClientListResponse])` +- Function `*AgentPoolsClient.BeginUpgradeNodeImageVersion` return value(s) have been changed from `(AgentPoolsClientUpgradeNodeImageVersionPollerResponse, error)` to `(*armruntime.Poller[AgentPoolsClientUpgradeNodeImageVersionResponse], error)` +- Function `*ManagedClustersClient.BeginRotateClusterCertificates` return value(s) have been changed from `(ManagedClustersClientRotateClusterCertificatesPollerResponse, error)` to `(*armruntime.Poller[ManagedClustersClientRotateClusterCertificatesResponse], error)` +- Function `NewOperationsClient` return value(s) have been changed from `(*OperationsClient)` to `(*OperationsClient, error)` +- Function `*PrivateEndpointConnectionsClient.BeginDelete` return value(s) have been changed from `(PrivateEndpointConnectionsClientDeletePollerResponse, error)` to `(*armruntime.Poller[PrivateEndpointConnectionsClientDeleteResponse], error)` +- Function `*ManagedClustersClient.BeginStop` return value(s) have been changed from `(ManagedClustersClientStopPollerResponse, error)` to `(*armruntime.Poller[ManagedClustersClientStopResponse], error)` +- Function `*AgentPoolsClient.List` return value(s) have been changed from `(*AgentPoolsClientListPager)` to `(*runtime.Pager[AgentPoolsClientListResponse])` +- Function `ExtendedLocationTypes.ToPtr` has been removed +- Function `*ManagedClustersClientResetServicePrincipalProfilePoller.ResumeToken` has been removed +- Function `UpgradeChannel.ToPtr` has been removed +- Function `*ManagedClustersClientUpdateTagsPoller.Done` has been removed +- Function `*AgentPoolsClientCreateOrUpdatePollerResponse.Resume` has been removed +- Function `ManagedClusterPodIdentityProvisioningState.ToPtr` has been removed +- Function `*ManagedClustersClientCreateOrUpdatePoller.Done` has been removed +- Function `*ManagedClustersClientStopPoller.FinalResponse` has been removed +- Function `*ManagedClustersClientResetServicePrincipalProfilePollerResponse.Resume` has been removed +- Function `*SnapshotsClientListPager.Err` has been removed +- Function `*ManagedClustersClientUpdateTagsPoller.FinalResponse` has been removed +- Function `*ManagedClustersClientResetAADProfilePoller.FinalResponse` has been removed +- Function `ManagedClustersClientStopPollerResponse.PollUntilDone` has been removed +- Function `*ManagedClustersClientRotateClusterCertificatesPoller.Poll` has been removed +- Function `*ManagedClustersClientUpdateTagsPoller.ResumeToken` has been removed +- Function `SnapshotType.ToPtr` has been removed +- Function `*AgentPoolsClientCreateOrUpdatePoller.Done` has been removed +- Function `Code.ToPtr` has been removed +- Function `*AgentPoolsClientUpgradeNodeImageVersionPoller.ResumeToken` has been removed +- Function `OSDiskType.ToPtr` has been removed +- Function `ManagedClustersClientUpdateTagsPollerResponse.PollUntilDone` has been removed +- Function `ManagedClusterSKUTier.ToPtr` has been removed +- Function `ScaleDownMode.ToPtr` has been removed +- Function `NetworkMode.ToPtr` has been removed +- Function `ConnectionStatus.ToPtr` has been removed +- Function `ManagedClustersClientResetServicePrincipalProfilePollerResponse.PollUntilDone` has been removed +- Function `*ManagedClustersClientUpdateTagsPollerResponse.Resume` has been removed +- Function `*ManagedClustersClientListPager.NextPage` has been removed +- Function `*AgentPoolsClientUpgradeNodeImageVersionPoller.FinalResponse` has been removed +- Function `*AgentPoolsClientCreateOrUpdatePoller.FinalResponse` has been removed +- Function `PrivateEndpointConnectionProvisioningState.ToPtr` has been removed +- Function `*ManagedClustersClientStopPollerResponse.Resume` has been removed +- Function `*ManagedClustersClientListByResourceGroupPager.PageResponse` has been removed +- Function `*SnapshotsClientListPager.PageResponse` has been removed +- Function `*AgentPoolsClientListPager.PageResponse` has been removed +- Function `*ManagedClustersClientCreateOrUpdatePoller.Poll` has been removed +- Function `*PrivateEndpointConnectionsClientDeletePoller.Done` has been removed +- Function `GPUInstanceProfile.ToPtr` has been removed +- Function `*ManagedClustersClientStartPoller.FinalResponse` has been removed +- Function `*ManagedClustersClientStopPoller.Done` has been removed +- Function `*ManagedClustersClientResetServicePrincipalProfilePoller.Poll` has been removed +- Function `NetworkPolicy.ToPtr` has been removed +- Function `LoadBalancerSKU.ToPtr` has been removed +- Function `PrivateEndpointConnectionsClientDeletePollerResponse.PollUntilDone` has been removed +- Function `*SnapshotsClientListByResourceGroupPager.PageResponse` has been removed +- Function `AgentPoolsClientDeletePollerResponse.PollUntilDone` has been removed +- Function `PublicNetworkAccess.ToPtr` has been removed +- Function `*AgentPoolsClientDeletePoller.Poll` has been removed +- Function `IPFamily.ToPtr` has been removed +- Function `*ManagedClustersClientDeletePoller.Done` has been removed +- Function `AgentPoolMode.ToPtr` has been removed +- Function `*ManagedClustersClientListPager.PageResponse` has been removed +- Function `*ManagedClustersClientUpdateTagsPoller.Poll` has been removed +- Function `*ManagedClustersClientRotateClusterCertificatesPoller.FinalResponse` has been removed +- Function `ScaleSetPriority.ToPtr` has been removed +- Function `*ManagedClustersClientRunCommandPoller.ResumeToken` has been removed +- Function `*ManagedClustersClientDeletePollerResponse.Resume` has been removed +- Function `*AgentPoolsClientDeletePoller.Done` has been removed +- Function `*ManagedClustersClientListByResourceGroupPager.NextPage` has been removed +- Function `*ManagedClustersClientStopPoller.Poll` has been removed +- Function `ManagedClustersClientDeletePollerResponse.PollUntilDone` has been removed +- Function `Count.ToPtr` has been removed +- Function `AgentPoolType.ToPtr` has been removed +- Function `*ManagedClustersClientRunCommandPollerResponse.Resume` has been removed +- Function `*PrivateEndpointConnectionsClientDeletePoller.Poll` has been removed +- Function `*PrivateEndpointConnectionsClientDeletePoller.FinalResponse` has been removed +- Function `*ManagedClustersClientCreateOrUpdatePoller.ResumeToken` has been removed +- Function `*ManagedClustersClientResetAADProfilePoller.Done` has been removed +- Function `*ManagedClustersClientListPager.Err` has been removed +- Function `*ManagedClustersClientStopPoller.ResumeToken` has been removed +- Function `*AgentPoolsClientListPager.Err` has been removed +- Function `CreatedByType.ToPtr` has been removed +- Function `*AgentPoolsClientCreateOrUpdatePoller.ResumeToken` has been removed +- Function `WorkloadRuntime.ToPtr` has been removed +- Function `*ManagedClustersClientDeletePoller.ResumeToken` has been removed +- Function `*ManagedClustersClientResetServicePrincipalProfilePoller.FinalResponse` has been removed +- Function `*PrivateEndpointConnectionsClientDeletePoller.ResumeToken` has been removed +- Function `OSType.ToPtr` has been removed +- Function `*AgentPoolsClientUpgradeNodeImageVersionPoller.Done` has been removed +- Function `*ManagedClustersClientStartPoller.Poll` has been removed +- Function `*AgentPoolsClientListPager.NextPage` has been removed +- Function `*ManagedClustersClientResetAADProfilePollerResponse.Resume` has been removed +- Function `*ManagedClustersClientListOutboundNetworkDependenciesEndpointsPager.PageResponse` has been removed +- Function `ManagedClustersClientResetAADProfilePollerResponse.PollUntilDone` has been removed +- Function `*ManagedClustersClientStartPollerResponse.Resume` has been removed +- Function `*MaintenanceConfigurationsClientListByManagedClusterPager.PageResponse` has been removed +- Function `*ManagedClustersClientRunCommandPoller.FinalResponse` has been removed +- Function `ScaleSetEvictionPolicy.ToPtr` has been removed +- Function `*MaintenanceConfigurationsClientListByManagedClusterPager.NextPage` has been removed +- Function `ResourceIdentityType.ToPtr` has been removed +- Function `*ManagedClustersClientStartPoller.Done` has been removed +- Function `*ManagedClustersClientResetAADProfilePoller.ResumeToken` has been removed +- Function `ManagedClustersClientStartPollerResponse.PollUntilDone` has been removed +- Function `*SnapshotsClientListPager.NextPage` has been removed +- Function `ManagedClustersClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed +- Function `*ManagedClustersClientRunCommandPoller.Done` has been removed +- Function `*SnapshotsClientListByResourceGroupPager.Err` has been removed +- Function `*AgentPoolsClientDeletePoller.FinalResponse` has been removed +- Function `*ManagedClustersClientRotateClusterCertificatesPoller.ResumeToken` has been removed +- Function `*AgentPoolsClientDeletePollerResponse.Resume` has been removed +- Function `LicenseType.ToPtr` has been removed +- Function `ManagedClusterSKUName.ToPtr` has been removed +- Function `OSSKU.ToPtr` has been removed +- Function `*MaintenanceConfigurationsClientListByManagedClusterPager.Err` has been removed +- Function `*ManagedClustersClientListOutboundNetworkDependenciesEndpointsPager.Err` has been removed +- Function `OutboundType.ToPtr` has been removed +- Function `*PrivateEndpointConnectionsClientDeletePollerResponse.Resume` has been removed +- Function `*ManagedClustersClientDeletePoller.FinalResponse` has been removed +- Function `NetworkPlugin.ToPtr` has been removed +- Function `*AgentPoolsClientUpgradeNodeImageVersionPoller.Poll` has been removed +- Function `*ManagedClustersClientStartPoller.ResumeToken` has been removed +- Function `AgentPoolsClientUpgradeNodeImageVersionPollerResponse.PollUntilDone` has been removed +- Function `*SnapshotsClientListByResourceGroupPager.NextPage` has been removed +- Function `*ManagedClustersClientDeletePoller.Poll` has been removed +- Function `*ManagedClustersClientRunCommandPoller.Poll` has been removed +- Function `*ManagedClustersClientCreateOrUpdatePollerResponse.Resume` has been removed +- Function `AgentPoolsClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed +- Function `*ManagedClustersClientListByResourceGroupPager.Err` has been removed +- Function `ManagedClustersClientRotateClusterCertificatesPollerResponse.PollUntilDone` has been removed +- Function `*ManagedClustersClientRotateClusterCertificatesPoller.Done` has been removed +- Function `KubeletDiskType.ToPtr` has been removed +- Function `ManagedClustersClientRunCommandPollerResponse.PollUntilDone` has been removed +- Function `*ManagedClustersClientResetAADProfilePoller.Poll` has been removed +- Function `*AgentPoolsClientUpgradeNodeImageVersionPollerResponse.Resume` has been removed +- Function `*AgentPoolsClientDeletePoller.ResumeToken` has been removed +- Function `Expander.ToPtr` has been removed +- Function `WeekDay.ToPtr` has been removed +- Function `*ManagedClustersClientCreateOrUpdatePoller.FinalResponse` has been removed +- Function `ContainerServiceVMSizeTypes.ToPtr` has been removed +- Function `*ManagedClustersClientRotateClusterCertificatesPollerResponse.Resume` has been removed +- Function `*AgentPoolsClientCreateOrUpdatePoller.Poll` has been removed +- Function `ContainerServiceStorageProfileTypes.ToPtr` has been removed +- Function `*ManagedClustersClientResetServicePrincipalProfilePoller.Done` has been removed +- Function `*ManagedClustersClientListOutboundNetworkDependenciesEndpointsPager.NextPage` has been removed +- Struct `AgentPoolsClientCreateOrUpdatePoller` has been removed +- Struct `AgentPoolsClientCreateOrUpdatePollerResponse` has been removed +- Struct `AgentPoolsClientCreateOrUpdateResult` has been removed +- Struct `AgentPoolsClientDeletePoller` has been removed +- Struct `AgentPoolsClientDeletePollerResponse` has been removed +- Struct `AgentPoolsClientGetAvailableAgentPoolVersionsResult` has been removed +- Struct `AgentPoolsClientGetResult` has been removed +- Struct `AgentPoolsClientGetUpgradeProfileResult` has been removed +- Struct `AgentPoolsClientListPager` has been removed +- Struct `AgentPoolsClientListResult` has been removed +- Struct `AgentPoolsClientUpgradeNodeImageVersionPoller` has been removed +- Struct `AgentPoolsClientUpgradeNodeImageVersionPollerResponse` has been removed +- Struct `AgentPoolsClientUpgradeNodeImageVersionResult` has been removed +- Struct `MaintenanceConfigurationsClientCreateOrUpdateResult` has been removed +- Struct `MaintenanceConfigurationsClientGetResult` has been removed +- Struct `MaintenanceConfigurationsClientListByManagedClusterPager` has been removed +- Struct `MaintenanceConfigurationsClientListByManagedClusterResult` has been removed +- Struct `ManagedClustersClientCreateOrUpdatePoller` has been removed +- Struct `ManagedClustersClientCreateOrUpdatePollerResponse` has been removed +- Struct `ManagedClustersClientCreateOrUpdateResult` has been removed +- Struct `ManagedClustersClientDeletePoller` has been removed +- Struct `ManagedClustersClientDeletePollerResponse` has been removed +- Struct `ManagedClustersClientGetAccessProfileResult` has been removed +- Struct `ManagedClustersClientGetCommandResultResult` has been removed +- Struct `ManagedClustersClientGetOSOptionsResult` has been removed +- Struct `ManagedClustersClientGetResult` has been removed +- Struct `ManagedClustersClientGetUpgradeProfileResult` has been removed +- Struct `ManagedClustersClientListByResourceGroupPager` has been removed +- Struct `ManagedClustersClientListByResourceGroupResult` has been removed +- Struct `ManagedClustersClientListClusterAdminCredentialsResult` has been removed +- Struct `ManagedClustersClientListClusterMonitoringUserCredentialsResult` has been removed +- Struct `ManagedClustersClientListClusterUserCredentialsResult` has been removed +- Struct `ManagedClustersClientListOutboundNetworkDependenciesEndpointsPager` has been removed +- Struct `ManagedClustersClientListOutboundNetworkDependenciesEndpointsResult` has been removed +- Struct `ManagedClustersClientListPager` has been removed +- Struct `ManagedClustersClientListResult` has been removed +- Struct `ManagedClustersClientResetAADProfilePoller` has been removed +- Struct `ManagedClustersClientResetAADProfilePollerResponse` has been removed +- Struct `ManagedClustersClientResetServicePrincipalProfilePoller` has been removed +- Struct `ManagedClustersClientResetServicePrincipalProfilePollerResponse` has been removed +- Struct `ManagedClustersClientRotateClusterCertificatesPoller` has been removed +- Struct `ManagedClustersClientRotateClusterCertificatesPollerResponse` has been removed +- Struct `ManagedClustersClientRunCommandPoller` has been removed +- Struct `ManagedClustersClientRunCommandPollerResponse` has been removed +- Struct `ManagedClustersClientRunCommandResult` has been removed +- Struct `ManagedClustersClientStartPoller` has been removed +- Struct `ManagedClustersClientStartPollerResponse` has been removed +- Struct `ManagedClustersClientStopPoller` has been removed +- Struct `ManagedClustersClientStopPollerResponse` has been removed +- Struct `ManagedClustersClientUpdateTagsPoller` has been removed +- Struct `ManagedClustersClientUpdateTagsPollerResponse` has been removed +- Struct `ManagedClustersClientUpdateTagsResult` has been removed +- Struct `OperationsClientListResult` has been removed +- Struct `PrivateEndpointConnectionsClientDeletePoller` has been removed +- Struct `PrivateEndpointConnectionsClientDeletePollerResponse` has been removed +- Struct `PrivateEndpointConnectionsClientGetResult` has been removed +- Struct `PrivateEndpointConnectionsClientListResult` has been removed +- Struct `PrivateEndpointConnectionsClientUpdateResult` has been removed +- Struct `PrivateLinkResourcesClientListResult` has been removed +- Struct `ResolvePrivateLinkServiceIDClientPOSTResult` has been removed +- Struct `SnapshotsClientCreateOrUpdateResult` has been removed +- Struct `SnapshotsClientGetResult` has been removed +- Struct `SnapshotsClientListByResourceGroupPager` has been removed +- Struct `SnapshotsClientListByResourceGroupResult` has been removed +- Struct `SnapshotsClientListPager` has been removed +- Struct `SnapshotsClientListResult` has been removed +- Struct `SnapshotsClientUpdateTagsResult` has been removed +- Field `RawResponse` of struct `ManagedClustersClientDeleteResponse` has been removed +- Field `SnapshotsClientCreateOrUpdateResult` of struct `SnapshotsClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `SnapshotsClientCreateOrUpdateResponse` has been removed +- Field `PrivateLinkResourcesClientListResult` of struct `PrivateLinkResourcesClientListResponse` has been removed +- Field `RawResponse` of struct `PrivateLinkResourcesClientListResponse` has been removed +- Field `ResolvePrivateLinkServiceIDClientPOSTResult` of struct `ResolvePrivateLinkServiceIDClientPOSTResponse` has been removed +- Field `RawResponse` of struct `ResolvePrivateLinkServiceIDClientPOSTResponse` has been removed +- Field `AgentPoolsClientGetResult` of struct `AgentPoolsClientGetResponse` has been removed +- Field `RawResponse` of struct `AgentPoolsClientGetResponse` has been removed +- Field `RawResponse` of struct `ManagedClustersClientStopResponse` has been removed +- Field `RawResponse` of struct `ManagedClustersClientResetServicePrincipalProfileResponse` has been removed +- Field `RawResponse` of struct `ManagedClustersClientStartResponse` has been removed +- Field `AgentPoolsClientListResult` of struct `AgentPoolsClientListResponse` has been removed +- Field `RawResponse` of struct `AgentPoolsClientListResponse` has been removed +- Field `ManagedClustersClientGetAccessProfileResult` of struct `ManagedClustersClientGetAccessProfileResponse` has been removed +- Field `RawResponse` of struct `ManagedClustersClientGetAccessProfileResponse` has been removed +- Field `AgentPoolsClientGetUpgradeProfileResult` of struct `AgentPoolsClientGetUpgradeProfileResponse` has been removed +- Field `RawResponse` of struct `AgentPoolsClientGetUpgradeProfileResponse` has been removed +- Field `RawResponse` of struct `PrivateEndpointConnectionsClientDeleteResponse` has been removed +- Field `SnapshotsClientGetResult` of struct `SnapshotsClientGetResponse` has been removed +- Field `RawResponse` of struct `SnapshotsClientGetResponse` has been removed +- Field `ManagedClustersClientGetOSOptionsResult` of struct `ManagedClustersClientGetOSOptionsResponse` has been removed +- Field `RawResponse` of struct `ManagedClustersClientGetOSOptionsResponse` has been removed +- Field `ManagedClustersClientListClusterMonitoringUserCredentialsResult` of struct `ManagedClustersClientListClusterMonitoringUserCredentialsResponse` has been removed +- Field `RawResponse` of struct `ManagedClustersClientListClusterMonitoringUserCredentialsResponse` has been removed +- Field `OperationsClientListResult` of struct `OperationsClientListResponse` has been removed +- Field `RawResponse` of struct `OperationsClientListResponse` has been removed +- Field `RawResponse` of struct `ManagedClustersClientRotateClusterCertificatesResponse` has been removed +- Field `ManagedClustersClientRunCommandResult` of struct `ManagedClustersClientRunCommandResponse` has been removed +- Field `RawResponse` of struct `ManagedClustersClientRunCommandResponse` has been removed +- Field `ManagedClustersClientGetUpgradeProfileResult` of struct `ManagedClustersClientGetUpgradeProfileResponse` has been removed +- Field `RawResponse` of struct `ManagedClustersClientGetUpgradeProfileResponse` has been removed +- Field `MaintenanceConfigurationsClientGetResult` of struct `MaintenanceConfigurationsClientGetResponse` has been removed +- Field `RawResponse` of struct `MaintenanceConfigurationsClientGetResponse` has been removed +- Field `RawResponse` of struct `ManagedClustersClientResetAADProfileResponse` has been removed +- Field `RawResponse` of struct `AgentPoolsClientDeleteResponse` has been removed +- Field `AgentPoolsClientUpgradeNodeImageVersionResult` of struct `AgentPoolsClientUpgradeNodeImageVersionResponse` has been removed +- Field `RawResponse` of struct `AgentPoolsClientUpgradeNodeImageVersionResponse` has been removed +- Field `PrivateEndpointConnectionsClientGetResult` of struct `PrivateEndpointConnectionsClientGetResponse` has been removed +- Field `RawResponse` of struct `PrivateEndpointConnectionsClientGetResponse` has been removed +- Field `PrivateEndpointConnectionsClientListResult` of struct `PrivateEndpointConnectionsClientListResponse` has been removed +- Field `RawResponse` of struct `PrivateEndpointConnectionsClientListResponse` has been removed +- Field `RawResponse` of struct `SnapshotsClientDeleteResponse` has been removed +- Field `SnapshotsClientUpdateTagsResult` of struct `SnapshotsClientUpdateTagsResponse` has been removed +- Field `RawResponse` of struct `SnapshotsClientUpdateTagsResponse` has been removed +- Field `PrivateEndpointConnectionsClientUpdateResult` of struct `PrivateEndpointConnectionsClientUpdateResponse` has been removed +- Field `RawResponse` of struct `PrivateEndpointConnectionsClientUpdateResponse` has been removed +- Field `ManagedClustersClientListClusterAdminCredentialsResult` of struct `ManagedClustersClientListClusterAdminCredentialsResponse` has been removed +- Field `RawResponse` of struct `ManagedClustersClientListClusterAdminCredentialsResponse` has been removed +- Field `ManagedClustersClientGetCommandResultResult` of struct `ManagedClustersClientGetCommandResultResponse` has been removed +- Field `RawResponse` of struct `ManagedClustersClientGetCommandResultResponse` has been removed +- Field `ManagedClustersClientGetResult` of struct `ManagedClustersClientGetResponse` has been removed +- Field `RawResponse` of struct `ManagedClustersClientGetResponse` has been removed +- Field `ManagedClustersClientCreateOrUpdateResult` of struct `ManagedClustersClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `ManagedClustersClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `MaintenanceConfigurationsClientDeleteResponse` has been removed +- Field `ManagedClustersClientListByResourceGroupResult` of struct `ManagedClustersClientListByResourceGroupResponse` has been removed +- Field `RawResponse` of struct `ManagedClustersClientListByResourceGroupResponse` has been removed +- Field `MaintenanceConfigurationsClientCreateOrUpdateResult` of struct `MaintenanceConfigurationsClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `MaintenanceConfigurationsClientCreateOrUpdateResponse` has been removed +- Field `ManagedClustersClientListOutboundNetworkDependenciesEndpointsResult` of struct `ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse` has been removed +- Field `RawResponse` of struct `ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse` has been removed +- Field `MaintenanceConfigurationsClientListByManagedClusterResult` of struct `MaintenanceConfigurationsClientListByManagedClusterResponse` has been removed +- Field `RawResponse` of struct `MaintenanceConfigurationsClientListByManagedClusterResponse` has been removed +- Field `SnapshotsClientListResult` of struct `SnapshotsClientListResponse` has been removed +- Field `RawResponse` of struct `SnapshotsClientListResponse` has been removed +- Field `AgentPoolsClientCreateOrUpdateResult` of struct `AgentPoolsClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `AgentPoolsClientCreateOrUpdateResponse` has been removed +- Field `ManagedClustersClientListResult` of struct `ManagedClustersClientListResponse` has been removed +- Field `RawResponse` of struct `ManagedClustersClientListResponse` has been removed +- Field `ManagedClustersClientListClusterUserCredentialsResult` of struct `ManagedClustersClientListClusterUserCredentialsResponse` has been removed +- Field `RawResponse` of struct `ManagedClustersClientListClusterUserCredentialsResponse` has been removed +- Field `ManagedClustersClientUpdateTagsResult` of struct `ManagedClustersClientUpdateTagsResponse` has been removed +- Field `RawResponse` of struct `ManagedClustersClientUpdateTagsResponse` has been removed +- Field `AgentPoolsClientGetAvailableAgentPoolVersionsResult` of struct `AgentPoolsClientGetAvailableAgentPoolVersionsResponse` has been removed +- Field `RawResponse` of struct `AgentPoolsClientGetAvailableAgentPoolVersionsResponse` has been removed +- Field `SnapshotsClientListByResourceGroupResult` of struct `SnapshotsClientListByResourceGroupResponse` has been removed +- Field `RawResponse` of struct `SnapshotsClientListByResourceGroupResponse` has been removed + +### Features Added + +- New const `SnapshotTypeManagedCluster` +- New const `FormatExec` +- New const `FormatAzure` +- New const `NetworkPluginNone` +- New function `*ManagedClusterSnapshotsClient.Delete(context.Context, string, string, *ManagedClusterSnapshotsClientDeleteOptions) (ManagedClusterSnapshotsClientDeleteResponse, error)` +- New function `PossibleFormatValues() []Format` +- New function `ManagedClusterSnapshot.MarshalJSON() ([]byte, error)` +- New function `*ManagedClusterSnapshotsClient.CreateOrUpdate(context.Context, string, string, ManagedClusterSnapshot, *ManagedClusterSnapshotsClientCreateOrUpdateOptions) (ManagedClusterSnapshotsClientCreateOrUpdateResponse, error)` +- New function `*ManagedClustersClient.BeginRotateServiceAccountSigningKeys(context.Context, string, string, *ManagedClustersClientBeginRotateServiceAccountSigningKeysOptions) (*armruntime.Poller[ManagedClustersClientRotateServiceAccountSigningKeysResponse], error)` +- New function `NewManagedClusterSnapshotsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ManagedClusterSnapshotsClient, error)` +- New function `*ManagedClusterSnapshotsClient.List(*ManagedClusterSnapshotsClientListOptions) *runtime.Pager[ManagedClusterSnapshotsClientListResponse]` +- New function `*ManagedClusterSnapshotsClient.ListByResourceGroup(string, *ManagedClusterSnapshotsClientListByResourceGroupOptions) *runtime.Pager[ManagedClusterSnapshotsClientListByResourceGroupResponse]` +- New function `*ManagedClusterSnapshotsClient.Get(context.Context, string, string, *ManagedClusterSnapshotsClientGetOptions) (ManagedClusterSnapshotsClientGetResponse, error)` +- New function `*ManagedClusterSnapshotsClient.UpdateTags(context.Context, string, string, TagsObject, *ManagedClusterSnapshotsClientUpdateTagsOptions) (ManagedClusterSnapshotsClientUpdateTagsResponse, error)` +- New function `ManagedClusterSnapshotListResult.MarshalJSON() ([]byte, error)` +- New struct `AzureKeyVaultKms` +- New struct `ManagedClusterIngressProfile` +- New struct `ManagedClusterIngressProfileWebAppRouting` +- New struct `ManagedClusterPropertiesForSnapshot` +- New struct `ManagedClusterSecurityProfileWorkloadIdentity` +- New struct `ManagedClusterSnapshot` +- New struct `ManagedClusterSnapshotListResult` +- New struct `ManagedClusterSnapshotProperties` +- New struct `ManagedClusterSnapshotsClient` +- New struct `ManagedClusterSnapshotsClientCreateOrUpdateOptions` +- New struct `ManagedClusterSnapshotsClientCreateOrUpdateResponse` +- New struct `ManagedClusterSnapshotsClientDeleteOptions` +- New struct `ManagedClusterSnapshotsClientDeleteResponse` +- New struct `ManagedClusterSnapshotsClientGetOptions` +- New struct `ManagedClusterSnapshotsClientGetResponse` +- New struct `ManagedClusterSnapshotsClientListByResourceGroupOptions` +- New struct `ManagedClusterSnapshotsClientListByResourceGroupResponse` +- New struct `ManagedClusterSnapshotsClientListOptions` +- New struct `ManagedClusterSnapshotsClientListResponse` +- New struct `ManagedClusterSnapshotsClientUpdateTagsOptions` +- New struct `ManagedClusterSnapshotsClientUpdateTagsResponse` +- New struct `ManagedClusterStorageProfile` +- New struct `ManagedClusterStorageProfileDiskCSIDriver` +- New struct `ManagedClusterStorageProfileFileCSIDriver` +- New struct `ManagedClusterStorageProfileSnapshotController` +- New struct `ManagedClustersClientBeginRotateServiceAccountSigningKeysOptions` +- New struct `ManagedClustersClientRotateServiceAccountSigningKeysResponse` +- New struct `NetworkProfileForSnapshot` +- New anonymous field `ManagedClusterAccessProfile` in struct `ManagedClustersClientGetAccessProfileResponse` +- New anonymous field `CredentialResults` in struct `ManagedClustersClientListClusterUserCredentialsResponse` +- New anonymous field `AgentPoolUpgradeProfile` in struct `AgentPoolsClientGetUpgradeProfileResponse` +- New field `ResumeToken` in struct `ManagedClustersClientBeginRotateClusterCertificatesOptions` +- New field `ResumeToken` in struct `ManagedClustersClientBeginResetServicePrincipalProfileOptions` +- New anonymous field `PrivateEndpointConnection` in struct `PrivateEndpointConnectionsClientGetResponse` +- New anonymous field `Snapshot` in struct `SnapshotsClientUpdateTagsResponse` +- New anonymous field `OSOptionProfile` in struct `ManagedClustersClientGetOSOptionsResponse` +- New field `ResumeToken` in struct `ManagedClustersClientBeginRunCommandOptions` +- New field `IngressProfile` in struct `ManagedClusterProperties` +- New field `CreationData` in struct `ManagedClusterProperties` +- New anonymous field `RunCommandResult` in struct `ManagedClustersClientRunCommandResponse` +- New field `ResumeToken` in struct `ManagedClustersClientBeginStartOptions` +- New anonymous field `RunCommandResult` in struct `ManagedClustersClientGetCommandResultResponse` +- New field `IgnorePodDisruptionBudget` in struct `AgentPoolsClientBeginDeleteOptions` +- New field `ResumeToken` in struct `AgentPoolsClientBeginDeleteOptions` +- New field `SystemData` in struct `ManagedCluster` +- New anonymous field `ManagedClusterUpgradeProfile` in struct `ManagedClustersClientGetUpgradeProfileResponse` +- New anonymous field `MaintenanceConfiguration` in struct `MaintenanceConfigurationsClientGetResponse` +- New anonymous field `PrivateEndpointConnectionListResult` in struct `PrivateEndpointConnectionsClientListResponse` +- New field `CurrentOrchestratorVersion` in struct `ManagedClusterAgentPoolProfile` +- New field `HostGroupID` in struct `ManagedClusterAgentPoolProfile` +- New anonymous field `ManagedCluster` in struct `ManagedClustersClientUpdateTagsResponse` +- New anonymous field `PrivateEndpointConnection` in struct `PrivateEndpointConnectionsClientUpdateResponse` +- New field `ResumeToken` in struct `ManagedClustersClientBeginResetAADProfileOptions` +- New field `Format` in struct `ManagedClustersClientListClusterUserCredentialsOptions` +- New anonymous field `AgentPoolAvailableVersions` in struct `AgentPoolsClientGetAvailableAgentPoolVersionsResponse` +- New anonymous field `AgentPool` in struct `AgentPoolsClientGetResponse` +- New anonymous field `Snapshot` in struct `SnapshotsClientGetResponse` +- New anonymous field `OutboundEnvironmentEndpointCollection` in struct `ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse` +- New field `SystemData` in struct `ManagedClusterAccessProfile` +- New anonymous field `MaintenanceConfiguration` in struct `MaintenanceConfigurationsClientCreateOrUpdateResponse` +- New field `IgnorePodDisruptionBudget` in struct `ManagedClustersClientBeginDeleteOptions` +- New field `ResumeToken` in struct `ManagedClustersClientBeginDeleteOptions` +- New anonymous field `AgentPool` in struct `AgentPoolsClientUpgradeNodeImageVersionResponse` +- New field `ResumeToken` in struct `AgentPoolsClientBeginUpgradeNodeImageVersionOptions` +- New anonymous field `SnapshotListResult` in struct `SnapshotsClientListResponse` +- New anonymous field `MaintenanceConfigurationListResult` in struct `MaintenanceConfigurationsClientListByManagedClusterResponse` +- New anonymous field `SnapshotListResult` in struct `SnapshotsClientListByResourceGroupResponse` +- New anonymous field `PrivateLinkResource` in struct `ResolvePrivateLinkServiceIDClientPOSTResponse` +- New field `ResumeToken` in struct `ManagedClustersClientBeginStopOptions` +- New anonymous field `CredentialResults` in struct `ManagedClustersClientListClusterMonitoringUserCredentialsResponse` +- New anonymous field `OperationListResult` in struct `OperationsClientListResponse` +- New anonymous field `AgentPoolListResult` in struct `AgentPoolsClientListResponse` +- New field `ResumeToken` in struct `ManagedClustersClientBeginUpdateTagsOptions` +- New anonymous field `ManagedClusterListResult` in struct `ManagedClustersClientListByResourceGroupResponse` +- New field `HostGroupID` in struct `ManagedClusterAgentPoolProfileProperties` +- New field `CurrentOrchestratorVersion` in struct `ManagedClusterAgentPoolProfileProperties` +- New field `AzureKeyVaultKms` in struct `ManagedClusterSecurityProfile` +- New field `WorkloadIdentity` in struct `ManagedClusterSecurityProfile` +- New anonymous field `ManagedCluster` in struct `ManagedClustersClientGetResponse` +- New anonymous field `ManagedCluster` in struct `ManagedClustersClientCreateOrUpdateResponse` +- New anonymous field `AgentPool` in struct `AgentPoolsClientCreateOrUpdateResponse` +- New anonymous field `Snapshot` in struct `SnapshotsClientCreateOrUpdateResponse` +- New anonymous field `CredentialResults` in struct `ManagedClustersClientListClusterAdminCredentialsResponse` +- New field `ResumeToken` in struct `ManagedClustersClientBeginCreateOrUpdateOptions` +- New anonymous field `PrivateLinkResourcesListResult` in struct `PrivateLinkResourcesClientListResponse` +- New field `ResumeToken` in struct `PrivateEndpointConnectionsClientBeginDeleteOptions` +- New field `ResumeToken` in struct `AgentPoolsClientBeginCreateOrUpdateOptions` +- New anonymous field `ManagedClusterListResult` in struct `ManagedClustersClientListResponse` +- New field `SystemData` in struct `Resource` + + ## 0.3.1 (2022-02-22) ### Other Changes diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/autorest.md b/sdk/resourcemanager/containerservice/armcontainerservice/autorest.md index b3e3587d21e6..0b18a15bcfb4 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/autorest.md +++ b/sdk/resourcemanager/containerservice/armcontainerservice/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/8e4746332979ed6ff3577bdc97dd2065a7577598/specification/containerservice/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/8e4746332979ed6ff3577bdc97dd2065a7577598/specification/containerservice/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/containerservice/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/containerservice/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.3.1 +module-version: 0.4.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/go.mod b/sdk/resourcemanager/containerservice/armcontainerservice/go.mod index 7a73d839a9b6..99cc07c891fc 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/go.mod +++ b/sdk/resourcemanager/containerservice/armcontainerservice/go.mod @@ -1,8 +1,11 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice -go 1.16 +go 1.18 + +require github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0 + github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 // indirect + golang.org/x/net v0.0.0-20210610132358-84b48f89b13b // indirect + golang.org/x/text v0.3.6 // indirect ) diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/go.sum b/sdk/resourcemanager/containerservice/armcontainerservice/go.sum index 2ce51d3b8174..a7eaa30576c1 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/go.sum +++ b/sdk/resourcemanager/containerservice/armcontainerservice/go.sum @@ -1,26 +1,11 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 h1:8wVJL0HUP5yDFXvotdewORTw7Yu88JbreWN/mobSvsQ= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0 h1:bLRntPH25SkY1uZ/YZW+dmxNky9r1fAHvDFrzluo+4Q= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0/go.mod h1:TmXReXZ9yPp5D5TBRMTAtyz+UyOl15Py4hL5E5p6igQ= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3 h1:E+m3SkZCN0Bf5q7YdTs5lSm2CYY3CK4spn5OmUIiQtk= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 h1:D7l5jspkc4kwBYRWoZE4DQnu6LVpLwDsMZjBKS4wZLQ= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0/go.mod h1:w5pDIZuawUmY3Bj4tVx3Xb8KS96ToB0j315w9rqpAg0= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 h1:sLZ/Y+P/5RRtsXWylBjB5lkgixYfm0MQPiwrSX//JSo= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= -github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -28,32 +13,20 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNmw2api+jEfxLoykJVice/E= -golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210610132358-84b48f89b13b h1:k+E048sYJHyVnsr1GDrRZWQ32D2C7lWs9JRc0bel53A= golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_agentpools_client_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_agentpools_client_test.go deleted file mode 100644 index 9ba6f89c7676..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_agentpools_client_test.go +++ /dev/null @@ -1,177 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcontainerservice_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice" -) - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/AgentPoolsList.json -func ExampleAgentPoolsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewAgentPoolsClient("", cred, nil) - pager := client.List("", - "", - nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/AgentPoolsGet.json -func ExampleAgentPoolsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewAgentPoolsClient("", cred, nil) - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.AgentPoolsClientGetResult) -} - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/AgentPoolsAssociate_CRG.json -func ExampleAgentPoolsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewAgentPoolsClient("", cred, nil) - poller, err := client.BeginCreateOrUpdate(ctx, - "", - "", - "", - armcontainerservice.AgentPool{ - Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ - CapacityReservationGroupID: to.StringPtr(""), - Count: to.Int32Ptr(3), - OrchestratorVersion: to.StringPtr(""), - OSType: armcontainerservice.OSType("Linux").ToPtr(), - VMSize: to.StringPtr(""), - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.AgentPoolsClientCreateOrUpdateResult) -} - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/AgentPoolsDelete.json -func ExampleAgentPoolsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewAgentPoolsClient("", cred, nil) - poller, err := client.BeginDelete(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } -} - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/AgentPoolsGetUpgradeProfile.json -func ExampleAgentPoolsClient_GetUpgradeProfile() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewAgentPoolsClient("", cred, nil) - res, err := client.GetUpgradeProfile(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.AgentPoolsClientGetUpgradeProfileResult) -} - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/AgentPoolsGetAgentPoolAvailableVersions.json -func ExampleAgentPoolsClient_GetAvailableAgentPoolVersions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewAgentPoolsClient("", cred, nil) - res, err := client.GetAvailableAgentPoolVersions(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.AgentPoolsClientGetAvailableAgentPoolVersionsResult) -} - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/AgentPoolsUpgradeNodeImageVersion.json -func ExampleAgentPoolsClient_BeginUpgradeNodeImageVersion() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewAgentPoolsClient("", cred, nil) - poller, err := client.BeginUpgradeNodeImageVersion(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_maintenanceconfigurations_client_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_maintenanceconfigurations_client_test.go deleted file mode 100644 index 0cbe30d40a68..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_maintenanceconfigurations_client_test.go +++ /dev/null @@ -1,117 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcontainerservice_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice" -) - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/MaintenanceConfigurationsList.json -func ExampleMaintenanceConfigurationsClient_ListByManagedCluster() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewMaintenanceConfigurationsClient("", cred, nil) - pager := client.ListByManagedCluster("", - "", - nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/MaintenanceConfigurationsGet.json -func ExampleMaintenanceConfigurationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewMaintenanceConfigurationsClient("", cred, nil) - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.MaintenanceConfigurationsClientGetResult) -} - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/MaintenanceConfigurationsCreate_Update.json -func ExampleMaintenanceConfigurationsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewMaintenanceConfigurationsClient("", cred, nil) - res, err := client.CreateOrUpdate(ctx, - "", - "", - "", - armcontainerservice.MaintenanceConfiguration{ - Properties: &armcontainerservice.MaintenanceConfigurationProperties{ - NotAllowedTime: []*armcontainerservice.TimeSpan{ - { - End: to.TimePtr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-30T12:00:00Z"); return t }()), - Start: to.TimePtr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-26T03:00:00Z"); return t }()), - }}, - TimeInWeek: []*armcontainerservice.TimeInWeek{ - { - Day: armcontainerservice.WeekDay("Monday").ToPtr(), - HourSlots: []*int32{ - to.Int32Ptr(1), - to.Int32Ptr(2)}, - }}, - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.MaintenanceConfigurationsClientCreateOrUpdateResult) -} - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/MaintenanceConfigurationsDelete.json -func ExampleMaintenanceConfigurationsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewMaintenanceConfigurationsClient("", cred, nil) - _, err = client.Delete(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_managedclusters_client_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_managedclusters_client_test.go deleted file mode 100644 index 22666548fded..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_managedclusters_client_test.go +++ /dev/null @@ -1,510 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcontainerservice_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice" -) - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/ContainerServiceGetOSOptions.json -func ExampleManagedClustersClient_GetOSOptions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewManagedClustersClient("", cred, nil) - res, err := client.GetOSOptions(ctx, - "", - &armcontainerservice.ManagedClustersClientGetOSOptionsOptions{ResourceType: nil}) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ManagedClustersClientGetOSOptionsResult) -} - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/ManagedClustersList.json -func ExampleManagedClustersClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewManagedClustersClient("", cred, nil) - pager := client.List(nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/ManagedClustersListByResourceGroup.json -func ExampleManagedClustersClient_ListByResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewManagedClustersClient("", cred, nil) - pager := client.ListByResourceGroup("", - nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/ManagedClustersGetUpgradeProfile.json -func ExampleManagedClustersClient_GetUpgradeProfile() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewManagedClustersClient("", cred, nil) - res, err := client.GetUpgradeProfile(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ManagedClustersClientGetUpgradeProfileResult) -} - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/ManagedClustersGetAccessProfile.json -func ExampleManagedClustersClient_GetAccessProfile() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewManagedClustersClient("", cred, nil) - res, err := client.GetAccessProfile(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ManagedClustersClientGetAccessProfileResult) -} - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/ManagedClustersListClusterCredentialResult.json -func ExampleManagedClustersClient_ListClusterAdminCredentials() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewManagedClustersClient("", cred, nil) - res, err := client.ListClusterAdminCredentials(ctx, - "", - "", - &armcontainerservice.ManagedClustersClientListClusterAdminCredentialsOptions{ServerFqdn: nil}) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ManagedClustersClientListClusterAdminCredentialsResult) -} - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/ManagedClustersListClusterCredentialResult.json -func ExampleManagedClustersClient_ListClusterUserCredentials() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewManagedClustersClient("", cred, nil) - res, err := client.ListClusterUserCredentials(ctx, - "", - "", - &armcontainerservice.ManagedClustersClientListClusterUserCredentialsOptions{ServerFqdn: nil}) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ManagedClustersClientListClusterUserCredentialsResult) -} - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/ManagedClustersListClusterCredentialResult.json -func ExampleManagedClustersClient_ListClusterMonitoringUserCredentials() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewManagedClustersClient("", cred, nil) - res, err := client.ListClusterMonitoringUserCredentials(ctx, - "", - "", - &armcontainerservice.ManagedClustersClientListClusterMonitoringUserCredentialsOptions{ServerFqdn: nil}) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ManagedClustersClientListClusterMonitoringUserCredentialsResult) -} - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/ManagedClustersGet.json -func ExampleManagedClustersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewManagedClustersClient("", cred, nil) - res, err := client.Get(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ManagedClustersClientGetResult) -} - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/ManagedClustersAssociate_CRG.json -func ExampleManagedClustersClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewManagedClustersClient("", cred, nil) - poller, err := client.BeginCreateOrUpdate(ctx, - "", - "", - armcontainerservice.ManagedCluster{ - Location: to.StringPtr(""), - Tags: map[string]*string{ - "archv2": to.StringPtr(""), - "tier": to.StringPtr("production"), - }, - Properties: &armcontainerservice.ManagedClusterProperties{ - AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{}, - AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{ - { - Type: armcontainerservice.AgentPoolType("VirtualMachineScaleSets").ToPtr(), - CapacityReservationGroupID: to.StringPtr(""), - Count: to.Int32Ptr(3), - EnableNodePublicIP: to.BoolPtr(true), - Mode: armcontainerservice.AgentPoolMode("System").ToPtr(), - OSType: armcontainerservice.OSType("Linux").ToPtr(), - VMSize: to.StringPtr(""), - Name: to.StringPtr(""), - }}, - AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ - ScaleDownDelayAfterAdd: to.StringPtr(""), - ScanInterval: to.StringPtr(""), - }, - DiskEncryptionSetID: to.StringPtr(""), - DNSPrefix: to.StringPtr(""), - EnablePodSecurityPolicy: to.BoolPtr(true), - EnableRBAC: to.BoolPtr(true), - KubernetesVersion: to.StringPtr(""), - LinuxProfile: &armcontainerservice.LinuxProfile{ - AdminUsername: to.StringPtr(""), - SSH: &armcontainerservice.SSHConfiguration{ - PublicKeys: []*armcontainerservice.SSHPublicKey{ - { - KeyData: to.StringPtr(""), - }}, - }, - }, - NetworkProfile: &armcontainerservice.NetworkProfile{ - LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{ - ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ - Count: to.Int32Ptr(2), - }, - }, - LoadBalancerSKU: armcontainerservice.LoadBalancerSKU("standard").ToPtr(), - OutboundType: armcontainerservice.OutboundType("loadBalancer").ToPtr(), - }, - ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ - ClientID: to.StringPtr(""), - Secret: to.StringPtr(""), - }, - WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ - AdminPassword: to.StringPtr(""), - AdminUsername: to.StringPtr(""), - }, - }, - SKU: &armcontainerservice.ManagedClusterSKU{ - Name: armcontainerservice.ManagedClusterSKUName("Basic").ToPtr(), - Tier: armcontainerservice.ManagedClusterSKUTier("Free").ToPtr(), - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ManagedClustersClientCreateOrUpdateResult) -} - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/ManagedClustersUpdateTags.json -func ExampleManagedClustersClient_BeginUpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewManagedClustersClient("", cred, nil) - poller, err := client.BeginUpdateTags(ctx, - "", - "", - armcontainerservice.TagsObject{ - Tags: map[string]*string{ - "archv3": to.StringPtr(""), - "tier": to.StringPtr("testing"), - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ManagedClustersClientUpdateTagsResult) -} - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/ManagedClustersDelete.json -func ExampleManagedClustersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewManagedClustersClient("", cred, nil) - poller, err := client.BeginDelete(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } -} - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/ManagedClustersResetServicePrincipalProfile.json -func ExampleManagedClustersClient_BeginResetServicePrincipalProfile() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewManagedClustersClient("", cred, nil) - poller, err := client.BeginResetServicePrincipalProfile(ctx, - "", - "", - armcontainerservice.ManagedClusterServicePrincipalProfile{ - ClientID: to.StringPtr(""), - Secret: to.StringPtr(""), - }, - nil) - if err != nil { - log.Fatal(err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } -} - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/ManagedClustersResetAADProfile.json -func ExampleManagedClustersClient_BeginResetAADProfile() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewManagedClustersClient("", cred, nil) - poller, err := client.BeginResetAADProfile(ctx, - "", - "", - armcontainerservice.ManagedClusterAADProfile{ - ClientAppID: to.StringPtr(""), - ServerAppID: to.StringPtr(""), - ServerAppSecret: to.StringPtr(""), - TenantID: to.StringPtr(""), - }, - nil) - if err != nil { - log.Fatal(err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } -} - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/ManagedClustersRotateClusterCertificates.json -func ExampleManagedClustersClient_BeginRotateClusterCertificates() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewManagedClustersClient("", cred, nil) - poller, err := client.BeginRotateClusterCertificates(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } -} - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/ManagedClustersStop.json -func ExampleManagedClustersClient_BeginStop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewManagedClustersClient("", cred, nil) - poller, err := client.BeginStop(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } -} - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/ManagedClustersStart.json -func ExampleManagedClustersClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewManagedClustersClient("", cred, nil) - poller, err := client.BeginStart(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } -} - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/RunCommandRequest.json -func ExampleManagedClustersClient_BeginRunCommand() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewManagedClustersClient("", cred, nil) - poller, err := client.BeginRunCommand(ctx, - "", - "", - armcontainerservice.RunCommandRequest{ - ClusterToken: to.StringPtr(""), - Command: to.StringPtr(""), - Context: to.StringPtr(""), - }, - nil) - if err != nil { - log.Fatal(err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ManagedClustersClientRunCommandResult) -} - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/RunCommandResultFailed.json -func ExampleManagedClustersClient_GetCommandResult() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewManagedClustersClient("", cred, nil) - res, err := client.GetCommandResult(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ManagedClustersClientGetCommandResultResult) -} - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/OutboundNetworkDependenciesEndpointsList.json -func ExampleManagedClustersClient_ListOutboundNetworkDependenciesEndpoints() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewManagedClustersClient("", cred, nil) - pager := client.ListOutboundNetworkDependenciesEndpoints("", - "", - nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_operations_client_test.go deleted file mode 100644 index 296ea58dac72..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_operations_client_test.go +++ /dev/null @@ -1,33 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcontainerservice_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice" -) - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/Operation_List.json -func ExampleOperationsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewOperationsClient(cred, nil) - res, err := client.List(ctx, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.OperationsClientListResult) -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_privateendpointconnections_client_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_privateendpointconnections_client_test.go deleted file mode 100644 index 95d3edb13108..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_privateendpointconnections_client_test.go +++ /dev/null @@ -1,104 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcontainerservice_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice" -) - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/PrivateEndpointConnectionsList.json -func ExamplePrivateEndpointConnectionsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewPrivateEndpointConnectionsClient("", cred, nil) - res, err := client.List(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.PrivateEndpointConnectionsClientListResult) -} - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/PrivateEndpointConnectionsGet.json -func ExamplePrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewPrivateEndpointConnectionsClient("", cred, nil) - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.PrivateEndpointConnectionsClientGetResult) -} - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/PrivateEndpointConnectionsUpdate.json -func ExamplePrivateEndpointConnectionsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewPrivateEndpointConnectionsClient("", cred, nil) - res, err := client.Update(ctx, - "", - "", - "", - armcontainerservice.PrivateEndpointConnection{ - Properties: &armcontainerservice.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armcontainerservice.PrivateLinkServiceConnectionState{ - Status: armcontainerservice.ConnectionStatus("Approved").ToPtr(), - }, - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.PrivateEndpointConnectionsClientUpdateResult) -} - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/PrivateEndpointConnectionsDelete.json -func ExamplePrivateEndpointConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewPrivateEndpointConnectionsClient("", cred, nil) - poller, err := client.BeginDelete(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_privatelinkresources_client_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_privatelinkresources_client_test.go deleted file mode 100644 index 76f217467de1..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_privatelinkresources_client_test.go +++ /dev/null @@ -1,35 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcontainerservice_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice" -) - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/PrivateLinkResourcesList.json -func ExamplePrivateLinkResourcesClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewPrivateLinkResourcesClient("", cred, nil) - res, err := client.List(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.PrivateLinkResourcesClientListResult) -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_resolveprivatelinkserviceid_client_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_resolveprivatelinkserviceid_client_test.go deleted file mode 100644 index 2aff575a54e9..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_resolveprivatelinkserviceid_client_test.go +++ /dev/null @@ -1,39 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcontainerservice_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/containerservice/armcontainerservice" -) - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/ResolvePrivateLinkServiceId.json -func ExampleResolvePrivateLinkServiceIDClient_POST() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewResolvePrivateLinkServiceIDClient("", cred, nil) - res, err := client.POST(ctx, - "", - "", - armcontainerservice.PrivateLinkResource{ - Name: to.StringPtr(""), - }, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ResolvePrivateLinkServiceIDClientPOSTResult) -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_snapshots_client_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_snapshots_client_test.go deleted file mode 100644 index 019f7a387de6..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_snapshots_client_test.go +++ /dev/null @@ -1,154 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcontainerservice_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/containerservice/armcontainerservice" -) - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/SnapshotsList.json -func ExampleSnapshotsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewSnapshotsClient("", cred, nil) - pager := client.List(nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/SnapshotsListByResourceGroup.json -func ExampleSnapshotsClient_ListByResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewSnapshotsClient("", cred, nil) - pager := client.ListByResourceGroup("", - nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/SnapshotsGet.json -func ExampleSnapshotsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewSnapshotsClient("", cred, nil) - res, err := client.Get(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.SnapshotsClientGetResult) -} - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/SnapshotsCreate.json -func ExampleSnapshotsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewSnapshotsClient("", cred, nil) - res, err := client.CreateOrUpdate(ctx, - "", - "", - armcontainerservice.Snapshot{ - Location: to.StringPtr(""), - Tags: map[string]*string{ - "key1": to.StringPtr("val1"), - "key2": to.StringPtr("val2"), - }, - Properties: &armcontainerservice.SnapshotProperties{ - CreationData: &armcontainerservice.CreationData{ - SourceResourceID: to.StringPtr(""), - }, - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.SnapshotsClientCreateOrUpdateResult) -} - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/SnapshotsUpdateTags.json -func ExampleSnapshotsClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewSnapshotsClient("", cred, nil) - res, err := client.UpdateTags(ctx, - "", - "", - armcontainerservice.TagsObject{ - Tags: map[string]*string{ - "key2": to.StringPtr("new-val2"), - "key3": to.StringPtr("val3"), - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.SnapshotsClientUpdateTagsResult) -} - -// x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2021-11-01-preview/examples/SnapshotsDelete.json -func ExampleSnapshotsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armcontainerservice.NewSnapshotsClient("", cred, nil) - _, err = client.Delete(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_agentpools_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_agentpools_client.go index f2524c582ae6..0e3613ea4954 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_agentpools_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_agentpools_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,10 +14,12 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "net/url" + "strconv" "strings" ) @@ -30,50 +32,47 @@ type AgentPoolsClient struct { } // NewAgentPoolsClient creates a new instance of AgentPoolsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewAgentPoolsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *AgentPoolsClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewAgentPoolsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AgentPoolsClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &AgentPoolsClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // BeginCreateOrUpdate - Creates or updates an agent pool in the specified managed cluster. // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // agentPoolName - The name of the agent pool. // parameters - The agent pool to create or update. // options - AgentPoolsClientBeginCreateOrUpdateOptions contains the optional parameters for the AgentPoolsClient.BeginCreateOrUpdate // method. -func (client *AgentPoolsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, parameters AgentPool, options *AgentPoolsClientBeginCreateOrUpdateOptions) (AgentPoolsClientCreateOrUpdatePollerResponse, error) { - resp, err := client.createOrUpdate(ctx, resourceGroupName, resourceName, agentPoolName, parameters, options) - if err != nil { - return AgentPoolsClientCreateOrUpdatePollerResponse{}, err - } - result := AgentPoolsClientCreateOrUpdatePollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("AgentPoolsClient.CreateOrUpdate", "", resp, client.pl) - if err != nil { - return AgentPoolsClientCreateOrUpdatePollerResponse{}, err - } - result.Poller = &AgentPoolsClientCreateOrUpdatePoller{ - pt: pt, +func (client *AgentPoolsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, parameters AgentPool, options *AgentPoolsClientBeginCreateOrUpdateOptions) (*armruntime.Poller[AgentPoolsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, resourceName, agentPoolName, parameters, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[AgentPoolsClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[AgentPoolsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) } - return result, nil } // CreateOrUpdate - Creates or updates an agent pool in the specified managed cluster. @@ -117,7 +116,7 @@ func (client *AgentPoolsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) @@ -125,26 +124,20 @@ func (client *AgentPoolsClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Deletes an agent pool in the specified managed cluster. // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // agentPoolName - The name of the agent pool. // options - AgentPoolsClientBeginDeleteOptions contains the optional parameters for the AgentPoolsClient.BeginDelete method. -func (client *AgentPoolsClient) BeginDelete(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *AgentPoolsClientBeginDeleteOptions) (AgentPoolsClientDeletePollerResponse, error) { - resp, err := client.deleteOperation(ctx, resourceGroupName, resourceName, agentPoolName, options) - if err != nil { - return AgentPoolsClientDeletePollerResponse{}, err - } - result := AgentPoolsClientDeletePollerResponse{ - RawResponse: resp, +func (client *AgentPoolsClient) BeginDelete(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *AgentPoolsClientBeginDeleteOptions) (*armruntime.Poller[AgentPoolsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, resourceName, agentPoolName, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[AgentPoolsClientDeleteResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[AgentPoolsClientDeleteResponse](options.ResumeToken, client.pl, nil) } - pt, err := armruntime.NewPoller("AgentPoolsClient.Delete", "", resp, client.pl) - if err != nil { - return AgentPoolsClientDeletePollerResponse{}, err - } - result.Poller = &AgentPoolsClientDeletePoller{ - pt: pt, - } - return result, nil } // Delete - Deletes an agent pool in the specified managed cluster. @@ -188,7 +181,10 @@ func (client *AgentPoolsClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") + if options != nil && options.IgnorePodDisruptionBudget != nil { + reqQP.Set("ignore-pod-disruption-budget", strconv.FormatBool(*options.IgnorePodDisruptionBudget)) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -196,7 +192,7 @@ func (client *AgentPoolsClient) deleteCreateRequest(ctx context.Context, resourc // Get - Gets the specified managed cluster agent pool. // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // agentPoolName - The name of the agent pool. // options - AgentPoolsClientGetOptions contains the optional parameters for the AgentPoolsClient.Get method. @@ -239,7 +235,7 @@ func (client *AgentPoolsClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -247,7 +243,7 @@ func (client *AgentPoolsClient) getCreateRequest(ctx context.Context, resourceGr // getHandleResponse handles the Get response. func (client *AgentPoolsClient) getHandleResponse(resp *http.Response) (AgentPoolsClientGetResponse, error) { - result := AgentPoolsClientGetResponse{RawResponse: resp} + result := AgentPoolsClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.AgentPool); err != nil { return AgentPoolsClientGetResponse{}, err } @@ -257,7 +253,7 @@ func (client *AgentPoolsClient) getHandleResponse(resp *http.Response) (AgentPoo // GetAvailableAgentPoolVersions - See supported Kubernetes versions [https://docs.microsoft.com/azure/aks/supported-kubernetes-versions] // for more details about the version lifecycle. // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - AgentPoolsClientGetAvailableAgentPoolVersionsOptions contains the optional parameters for the AgentPoolsClient.GetAvailableAgentPoolVersions // method. @@ -296,7 +292,7 @@ func (client *AgentPoolsClient) getAvailableAgentPoolVersionsCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -304,7 +300,7 @@ func (client *AgentPoolsClient) getAvailableAgentPoolVersionsCreateRequest(ctx c // getAvailableAgentPoolVersionsHandleResponse handles the GetAvailableAgentPoolVersions response. func (client *AgentPoolsClient) getAvailableAgentPoolVersionsHandleResponse(resp *http.Response) (AgentPoolsClientGetAvailableAgentPoolVersionsResponse, error) { - result := AgentPoolsClientGetAvailableAgentPoolVersionsResponse{RawResponse: resp} + result := AgentPoolsClientGetAvailableAgentPoolVersionsResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.AgentPoolAvailableVersions); err != nil { return AgentPoolsClientGetAvailableAgentPoolVersionsResponse{}, err } @@ -313,7 +309,7 @@ func (client *AgentPoolsClient) getAvailableAgentPoolVersionsHandleResponse(resp // GetUpgradeProfile - Gets the upgrade profile for an agent pool. // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // agentPoolName - The name of the agent pool. // options - AgentPoolsClientGetUpgradeProfileOptions contains the optional parameters for the AgentPoolsClient.GetUpgradeProfile @@ -357,7 +353,7 @@ func (client *AgentPoolsClient) getUpgradeProfileCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -365,7 +361,7 @@ func (client *AgentPoolsClient) getUpgradeProfileCreateRequest(ctx context.Conte // getUpgradeProfileHandleResponse handles the GetUpgradeProfile response. func (client *AgentPoolsClient) getUpgradeProfileHandleResponse(resp *http.Response) (AgentPoolsClientGetUpgradeProfileResponse, error) { - result := AgentPoolsClientGetUpgradeProfileResponse{RawResponse: resp} + result := AgentPoolsClientGetUpgradeProfileResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.AgentPoolUpgradeProfile); err != nil { return AgentPoolsClientGetUpgradeProfileResponse{}, err } @@ -374,19 +370,35 @@ func (client *AgentPoolsClient) getUpgradeProfileHandleResponse(resp *http.Respo // List - Gets a list of agent pools in the specified managed cluster. // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - AgentPoolsClientListOptions contains the optional parameters for the AgentPoolsClient.List method. -func (client *AgentPoolsClient) List(resourceGroupName string, resourceName string, options *AgentPoolsClientListOptions) *AgentPoolsClientListPager { - return &AgentPoolsClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, resourceName, options) +func (client *AgentPoolsClient) List(resourceGroupName string, resourceName string, options *AgentPoolsClientListOptions) *runtime.Pager[AgentPoolsClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[AgentPoolsClientListResponse]{ + More: func(page AgentPoolsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp AgentPoolsClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.AgentPoolListResult.NextLink) + Fetcher: func(ctx context.Context, page *AgentPoolsClientListResponse) (AgentPoolsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, resourceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return AgentPoolsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AgentPoolsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AgentPoolsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) }, - } + }) } // listCreateRequest creates the List request. @@ -409,7 +421,7 @@ func (client *AgentPoolsClient) listCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -417,7 +429,7 @@ func (client *AgentPoolsClient) listCreateRequest(ctx context.Context, resourceG // listHandleResponse handles the List response. func (client *AgentPoolsClient) listHandleResponse(resp *http.Response) (AgentPoolsClientListResponse, error) { - result := AgentPoolsClientListResponse{RawResponse: resp} + result := AgentPoolsClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.AgentPoolListResult); err != nil { return AgentPoolsClientListResponse{}, err } @@ -428,27 +440,21 @@ func (client *AgentPoolsClient) listHandleResponse(resp *http.Response) (AgentPo // to the nodes. AKS provides one new image per week with the latest updates. For more details on node image // versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // agentPoolName - The name of the agent pool. // options - AgentPoolsClientBeginUpgradeNodeImageVersionOptions contains the optional parameters for the AgentPoolsClient.BeginUpgradeNodeImageVersion // method. -func (client *AgentPoolsClient) BeginUpgradeNodeImageVersion(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *AgentPoolsClientBeginUpgradeNodeImageVersionOptions) (AgentPoolsClientUpgradeNodeImageVersionPollerResponse, error) { - resp, err := client.upgradeNodeImageVersion(ctx, resourceGroupName, resourceName, agentPoolName, options) - if err != nil { - return AgentPoolsClientUpgradeNodeImageVersionPollerResponse{}, err +func (client *AgentPoolsClient) BeginUpgradeNodeImageVersion(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *AgentPoolsClientBeginUpgradeNodeImageVersionOptions) (*armruntime.Poller[AgentPoolsClientUpgradeNodeImageVersionResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.upgradeNodeImageVersion(ctx, resourceGroupName, resourceName, agentPoolName, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[AgentPoolsClientUpgradeNodeImageVersionResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[AgentPoolsClientUpgradeNodeImageVersionResponse](options.ResumeToken, client.pl, nil) } - result := AgentPoolsClientUpgradeNodeImageVersionPollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("AgentPoolsClient.UpgradeNodeImageVersion", "", resp, client.pl) - if err != nil { - return AgentPoolsClientUpgradeNodeImageVersionPollerResponse{}, err - } - result.Poller = &AgentPoolsClientUpgradeNodeImageVersionPoller{ - pt: pt, - } - return result, nil } // UpgradeNodeImageVersion - Upgrading the node image version of an agent pool applies the newest OS and runtime updates to @@ -494,7 +500,7 @@ func (client *AgentPoolsClient) upgradeNodeImageVersionCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_constants.go b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_constants.go index 291277f79dd9..12a57cd3bb2f 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_constants.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_constants.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -10,7 +10,7 @@ package armcontainerservice const ( moduleName = "armcontainerservice" - moduleVersion = "v0.3.1" + moduleVersion = "v0.4.0" ) // AgentPoolMode - A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent @@ -33,11 +33,6 @@ func PossibleAgentPoolModeValues() []AgentPoolMode { } } -// ToPtr returns a *AgentPoolMode pointing to the current value. -func (c AgentPoolMode) ToPtr() *AgentPoolMode { - return &c -} - // AgentPoolType - The type of Agent Pool. type AgentPoolType string @@ -56,11 +51,6 @@ func PossibleAgentPoolTypeValues() []AgentPoolType { } } -// ToPtr returns a *AgentPoolType pointing to the current value. -func (c AgentPoolType) ToPtr() *AgentPoolType { - return &c -} - // Code - Tells whether the cluster is Running or Stopped type Code string @@ -79,11 +69,6 @@ func PossibleCodeValues() []Code { } } -// ToPtr returns a *Code pointing to the current value. -func (c Code) ToPtr() *Code { - return &c -} - // ConnectionStatus - The private link service connection status. type ConnectionStatus string @@ -104,11 +89,6 @@ func PossibleConnectionStatusValues() []ConnectionStatus { } } -// ToPtr returns a *ConnectionStatus pointing to the current value. -func (c ConnectionStatus) ToPtr() *ConnectionStatus { - return &c -} - // ContainerServiceStorageProfileTypes - Specifies what kind of storage to use. If omitted, the default will be chosen on // your behalf based on the choice of orchestrator. type ContainerServiceStorageProfileTypes string @@ -126,11 +106,6 @@ func PossibleContainerServiceStorageProfileTypesValues() []ContainerServiceStora } } -// ToPtr returns a *ContainerServiceStorageProfileTypes pointing to the current value. -func (c ContainerServiceStorageProfileTypes) ToPtr() *ContainerServiceStorageProfileTypes { - return &c -} - // ContainerServiceVMSizeTypes - Size of agent VMs. Note: This is no longer maintained. type ContainerServiceVMSizeTypes string @@ -491,11 +466,6 @@ func PossibleContainerServiceVMSizeTypesValues() []ContainerServiceVMSizeTypes { } } -// ToPtr returns a *ContainerServiceVMSizeTypes pointing to the current value. -func (c ContainerServiceVMSizeTypes) ToPtr() *ContainerServiceVMSizeTypes { - return &c -} - // Count - Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is // 1. type Count int32 @@ -515,11 +485,6 @@ func PossibleCountValues() []Count { } } -// ToPtr returns a *Count pointing to the current value. -func (c Count) ToPtr() *Count { - return &c -} - // CreatedByType - The type of identity that created the resource. type CreatedByType string @@ -540,11 +505,6 @@ func PossibleCreatedByTypeValues() []CreatedByType { } } -// ToPtr returns a *CreatedByType pointing to the current value. -func (c CreatedByType) ToPtr() *CreatedByType { - return &c -} - // Expander - If not specified, the default is 'random'. See expanders [https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-expanders] // for more information. type Expander string @@ -575,11 +535,6 @@ func PossibleExpanderValues() []Expander { } } -// ToPtr returns a *Expander pointing to the current value. -func (c Expander) ToPtr() *Expander { - return &c -} - // ExtendedLocationTypes - The type of extendedLocation. type ExtendedLocationTypes string @@ -594,9 +549,21 @@ func PossibleExtendedLocationTypesValues() []ExtendedLocationTypes { } } -// ToPtr returns a *ExtendedLocationTypes pointing to the current value. -func (c ExtendedLocationTypes) ToPtr() *ExtendedLocationTypes { - return &c +type Format string + +const ( + // FormatAzure - Return azure auth-provider kubeconfig. This format is deprecated in 1.22 and will be fully removed in 1.25. + FormatAzure Format = "azure" + // FormatExec - Return exec format kubeconfig. This format requires kubelogin binary in the path. + FormatExec Format = "exec" +) + +// PossibleFormatValues returns the possible values for the Format const type. +func PossibleFormatValues() []Format { + return []Format{ + FormatAzure, + FormatExec, + } } // GPUInstanceProfile - GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. @@ -621,11 +588,6 @@ func PossibleGPUInstanceProfileValues() []GPUInstanceProfile { } } -// ToPtr returns a *GPUInstanceProfile pointing to the current value. -func (c GPUInstanceProfile) ToPtr() *GPUInstanceProfile { - return &c -} - // IPFamily - The IP version to use for cluster networking and IP assignment. type IPFamily string @@ -642,11 +604,6 @@ func PossibleIPFamilyValues() []IPFamily { } } -// ToPtr returns a *IPFamily pointing to the current value. -func (c IPFamily) ToPtr() *IPFamily { - return &c -} - // KubeletDiskType - Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. type KubeletDiskType string @@ -665,11 +622,6 @@ func PossibleKubeletDiskTypeValues() []KubeletDiskType { } } -// ToPtr returns a *KubeletDiskType pointing to the current value. -func (c KubeletDiskType) ToPtr() *KubeletDiskType { - return &c -} - // LicenseType - The license type to use for Windows VMs. See Azure Hybrid User Benefits [https://azure.microsoft.com/pricing/hybrid-benefit/faq/] // for more details. type LicenseType string @@ -689,11 +641,6 @@ func PossibleLicenseTypeValues() []LicenseType { } } -// ToPtr returns a *LicenseType pointing to the current value. -func (c LicenseType) ToPtr() *LicenseType { - return &c -} - // LoadBalancerSKU - The default is 'standard'. See Azure Load Balancer SKUs [https://docs.microsoft.com/azure/load-balancer/skus] // for more information about the differences between load balancer SKUs. type LoadBalancerSKU string @@ -715,11 +662,6 @@ func PossibleLoadBalancerSKUValues() []LoadBalancerSKU { } } -// ToPtr returns a *LoadBalancerSKU pointing to the current value. -func (c LoadBalancerSKU) ToPtr() *LoadBalancerSKU { - return &c -} - // ManagedClusterPodIdentityProvisioningState - The current provisioning state of the pod identity. type ManagedClusterPodIdentityProvisioningState string @@ -740,11 +682,6 @@ func PossibleManagedClusterPodIdentityProvisioningStateValues() []ManagedCluster } } -// ToPtr returns a *ManagedClusterPodIdentityProvisioningState pointing to the current value. -func (c ManagedClusterPodIdentityProvisioningState) ToPtr() *ManagedClusterPodIdentityProvisioningState { - return &c -} - // ManagedClusterSKUName - The name of a managed cluster SKU. type ManagedClusterSKUName string @@ -759,11 +696,6 @@ func PossibleManagedClusterSKUNameValues() []ManagedClusterSKUName { } } -// ToPtr returns a *ManagedClusterSKUName pointing to the current value. -func (c ManagedClusterSKUName) ToPtr() *ManagedClusterSKUName { - return &c -} - // ManagedClusterSKUTier - If not specified, the default is 'Free'. See uptime SLA [https://docs.microsoft.com/azure/aks/uptime-sla] // for more details. type ManagedClusterSKUTier string @@ -784,11 +716,6 @@ func PossibleManagedClusterSKUTierValues() []ManagedClusterSKUTier { } } -// ToPtr returns a *ManagedClusterSKUTier pointing to the current value. -func (c ManagedClusterSKUTier) ToPtr() *ManagedClusterSKUTier { - return &c -} - // NetworkMode - This cannot be specified if networkPlugin is anything other than 'azure'. type NetworkMode string @@ -808,11 +735,6 @@ func PossibleNetworkModeValues() []NetworkMode { } } -// ToPtr returns a *NetworkMode pointing to the current value. -func (c NetworkMode) ToPtr() *NetworkMode { - return &c -} - // NetworkPlugin - Network plugin used for building the Kubernetes network. type NetworkPlugin string @@ -823,6 +745,9 @@ const ( // NetworkPluginKubenet - Use the Kubenet network plugin. See [Kubenet (basic) networking](https://docs.microsoft.com/azure/aks/concepts-network#kubenet-basic-networking) // for more information. NetworkPluginKubenet NetworkPlugin = "kubenet" + // NetworkPluginNone - Do not use a network plugin. A custom CNI will need to be installed after cluster creation for networking + // functionality. + NetworkPluginNone NetworkPlugin = "none" ) // PossibleNetworkPluginValues returns the possible values for the NetworkPlugin const type. @@ -830,14 +755,10 @@ func PossibleNetworkPluginValues() []NetworkPlugin { return []NetworkPlugin{ NetworkPluginAzure, NetworkPluginKubenet, + NetworkPluginNone, } } -// ToPtr returns a *NetworkPlugin pointing to the current value. -func (c NetworkPlugin) ToPtr() *NetworkPlugin { - return &c -} - // NetworkPolicy - Network policy used for building the Kubernetes network. type NetworkPolicy string @@ -858,11 +779,6 @@ func PossibleNetworkPolicyValues() []NetworkPolicy { } } -// ToPtr returns a *NetworkPolicy pointing to the current value. -func (c NetworkPolicy) ToPtr() *NetworkPolicy { - return &c -} - // OSDiskType - The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. // Otherwise, defaults to 'Managed'. May not be changed after creation. For more information // see Ephemeral OS [https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os]. @@ -887,11 +803,6 @@ func PossibleOSDiskTypeValues() []OSDiskType { } } -// ToPtr returns a *OSDiskType pointing to the current value. -func (c OSDiskType) ToPtr() *OSDiskType { - return &c -} - // OSSKU - Specifies an OS SKU. This value must not be specified if OSType is Windows. type OSSKU string @@ -908,11 +819,6 @@ func PossibleOSSKUValues() []OSSKU { } } -// ToPtr returns a *OSSKU pointing to the current value. -func (c OSSKU) ToPtr() *OSSKU { - return &c -} - // OSType - The operating system type. The default is Linux. type OSType string @@ -931,11 +837,6 @@ func PossibleOSTypeValues() []OSType { } } -// ToPtr returns a *OSType pointing to the current value. -func (c OSType) ToPtr() *OSType { - return &c -} - // OutboundType - This can only be set at cluster creation time and cannot be changed later. For more information see egress // outbound type [https://docs.microsoft.com/azure/aks/egress-outboundtype]. type OutboundType string @@ -964,11 +865,6 @@ func PossibleOutboundTypeValues() []OutboundType { } } -// ToPtr returns a *OutboundType pointing to the current value. -func (c OutboundType) ToPtr() *OutboundType { - return &c -} - // PrivateEndpointConnectionProvisioningState - The current provisioning state. type PrivateEndpointConnectionProvisioningState string @@ -989,11 +885,6 @@ func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpoin } } -// ToPtr returns a *PrivateEndpointConnectionProvisioningState pointing to the current value. -func (c PrivateEndpointConnectionProvisioningState) ToPtr() *PrivateEndpointConnectionProvisioningState { - return &c -} - // PublicNetworkAccess - Allow or deny public network access for AKS type PublicNetworkAccess string @@ -1010,11 +901,6 @@ func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { } } -// ToPtr returns a *PublicNetworkAccess pointing to the current value. -func (c PublicNetworkAccess) ToPtr() *PublicNetworkAccess { - return &c -} - // ResourceIdentityType - For more information see use managed identities in AKS [https://docs.microsoft.com/azure/aks/use-managed-identity]. type ResourceIdentityType string @@ -1040,11 +926,6 @@ func PossibleResourceIdentityTypeValues() []ResourceIdentityType { } } -// ToPtr returns a *ResourceIdentityType pointing to the current value. -func (c ResourceIdentityType) ToPtr() *ResourceIdentityType { - return &c -} - // ScaleDownMode - Describes how VMs are added to or removed from Agent Pools. See billing states [https://docs.microsoft.com/azure/virtual-machines/states-billing]. type ScaleDownMode string @@ -1064,11 +945,6 @@ func PossibleScaleDownModeValues() []ScaleDownMode { } } -// ToPtr returns a *ScaleDownMode pointing to the current value. -func (c ScaleDownMode) ToPtr() *ScaleDownMode { - return &c -} - // ScaleSetEvictionPolicy - The eviction policy specifies what to do with the VM when it is evicted. The default is Delete. // For more information about eviction see spot VMs // [https://docs.microsoft.com/azure/virtual-machines/spot-vms] @@ -1091,11 +967,6 @@ func PossibleScaleSetEvictionPolicyValues() []ScaleSetEvictionPolicy { } } -// ToPtr returns a *ScaleSetEvictionPolicy pointing to the current value. -func (c ScaleSetEvictionPolicy) ToPtr() *ScaleSetEvictionPolicy { - return &c -} - // ScaleSetPriority - The Virtual Machine Scale Set priority. type ScaleSetPriority string @@ -1115,15 +986,12 @@ func PossibleScaleSetPriorityValues() []ScaleSetPriority { } } -// ToPtr returns a *ScaleSetPriority pointing to the current value. -func (c ScaleSetPriority) ToPtr() *ScaleSetPriority { - return &c -} - // SnapshotType - The type of a snapshot. The default is NodePool. type SnapshotType string const ( + // SnapshotTypeManagedCluster - The snapshot is a snapshot of a managed cluster. + SnapshotTypeManagedCluster SnapshotType = "ManagedCluster" // SnapshotTypeNodePool - The snapshot is a snapshot of a node pool. SnapshotTypeNodePool SnapshotType = "NodePool" ) @@ -1131,15 +999,11 @@ const ( // PossibleSnapshotTypeValues returns the possible values for the SnapshotType const type. func PossibleSnapshotTypeValues() []SnapshotType { return []SnapshotType{ + SnapshotTypeManagedCluster, SnapshotTypeNodePool, } } -// ToPtr returns a *SnapshotType pointing to the current value. -func (c SnapshotType) ToPtr() *SnapshotType { - return &c -} - // UpgradeChannel - For more information see setting the AKS cluster auto-upgrade channel [https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel]. type UpgradeChannel string @@ -1178,11 +1042,6 @@ func PossibleUpgradeChannelValues() []UpgradeChannel { } } -// ToPtr returns a *UpgradeChannel pointing to the current value. -func (c UpgradeChannel) ToPtr() *UpgradeChannel { - return &c -} - // WeekDay - The weekday enum. type WeekDay string @@ -1209,11 +1068,6 @@ func PossibleWeekDayValues() []WeekDay { } } -// ToPtr returns a *WeekDay pointing to the current value. -func (c WeekDay) ToPtr() *WeekDay { - return &c -} - // WorkloadRuntime - Determines the type of workload a node can run. type WorkloadRuntime string @@ -1231,8 +1085,3 @@ func PossibleWorkloadRuntimeValues() []WorkloadRuntime { WorkloadRuntimeWasmWasi, } } - -// ToPtr returns a *WorkloadRuntime pointing to the current value. -func (c WorkloadRuntime) ToPtr() *WorkloadRuntime { - return &c -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_maintenanceconfigurations_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_maintenanceconfigurations_client.go index e96c760008c0..ec7b7535ea71 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_maintenanceconfigurations_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_maintenanceconfigurations_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -30,29 +31,32 @@ type MaintenanceConfigurationsClient struct { } // NewMaintenanceConfigurationsClient creates a new instance of MaintenanceConfigurationsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewMaintenanceConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *MaintenanceConfigurationsClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewMaintenanceConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MaintenanceConfigurationsClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &MaintenanceConfigurationsClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // CreateOrUpdate - Creates or updates a maintenance configuration in the specified managed cluster. // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // configName - The name of the maintenance configuration. // parameters - The maintenance configuration to create or update. @@ -97,7 +101,7 @@ func (client *MaintenanceConfigurationsClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) @@ -105,7 +109,7 @@ func (client *MaintenanceConfigurationsClient) createOrUpdateCreateRequest(ctx c // createOrUpdateHandleResponse handles the CreateOrUpdate response. func (client *MaintenanceConfigurationsClient) createOrUpdateHandleResponse(resp *http.Response) (MaintenanceConfigurationsClientCreateOrUpdateResponse, error) { - result := MaintenanceConfigurationsClientCreateOrUpdateResponse{RawResponse: resp} + result := MaintenanceConfigurationsClientCreateOrUpdateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.MaintenanceConfiguration); err != nil { return MaintenanceConfigurationsClientCreateOrUpdateResponse{}, err } @@ -114,7 +118,7 @@ func (client *MaintenanceConfigurationsClient) createOrUpdateHandleResponse(resp // Delete - Deletes a maintenance configuration. // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // configName - The name of the maintenance configuration. // options - MaintenanceConfigurationsClientDeleteOptions contains the optional parameters for the MaintenanceConfigurationsClient.Delete @@ -131,7 +135,7 @@ func (client *MaintenanceConfigurationsClient) Delete(ctx context.Context, resou if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return MaintenanceConfigurationsClientDeleteResponse{}, runtime.NewResponseError(resp) } - return MaintenanceConfigurationsClientDeleteResponse{RawResponse: resp}, nil + return MaintenanceConfigurationsClientDeleteResponse{}, nil } // deleteCreateRequest creates the Delete request. @@ -158,7 +162,7 @@ func (client *MaintenanceConfigurationsClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -166,7 +170,7 @@ func (client *MaintenanceConfigurationsClient) deleteCreateRequest(ctx context.C // Get - Gets the specified maintenance configuration of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // configName - The name of the maintenance configuration. // options - MaintenanceConfigurationsClientGetOptions contains the optional parameters for the MaintenanceConfigurationsClient.Get @@ -210,7 +214,7 @@ func (client *MaintenanceConfigurationsClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -218,7 +222,7 @@ func (client *MaintenanceConfigurationsClient) getCreateRequest(ctx context.Cont // getHandleResponse handles the Get response. func (client *MaintenanceConfigurationsClient) getHandleResponse(resp *http.Response) (MaintenanceConfigurationsClientGetResponse, error) { - result := MaintenanceConfigurationsClientGetResponse{RawResponse: resp} + result := MaintenanceConfigurationsClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.MaintenanceConfiguration); err != nil { return MaintenanceConfigurationsClientGetResponse{}, err } @@ -227,20 +231,36 @@ func (client *MaintenanceConfigurationsClient) getHandleResponse(resp *http.Resp // ListByManagedCluster - Gets a list of maintenance configurations in the specified managed cluster. // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - MaintenanceConfigurationsClientListByManagedClusterOptions contains the optional parameters for the MaintenanceConfigurationsClient.ListByManagedCluster // method. -func (client *MaintenanceConfigurationsClient) ListByManagedCluster(resourceGroupName string, resourceName string, options *MaintenanceConfigurationsClientListByManagedClusterOptions) *MaintenanceConfigurationsClientListByManagedClusterPager { - return &MaintenanceConfigurationsClientListByManagedClusterPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listByManagedClusterCreateRequest(ctx, resourceGroupName, resourceName, options) +func (client *MaintenanceConfigurationsClient) ListByManagedCluster(resourceGroupName string, resourceName string, options *MaintenanceConfigurationsClientListByManagedClusterOptions) *runtime.Pager[MaintenanceConfigurationsClientListByManagedClusterResponse] { + return runtime.NewPager(runtime.PageProcessor[MaintenanceConfigurationsClientListByManagedClusterResponse]{ + More: func(page MaintenanceConfigurationsClientListByManagedClusterResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp MaintenanceConfigurationsClientListByManagedClusterResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.MaintenanceConfigurationListResult.NextLink) + Fetcher: func(ctx context.Context, page *MaintenanceConfigurationsClientListByManagedClusterResponse) (MaintenanceConfigurationsClientListByManagedClusterResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByManagedClusterCreateRequest(ctx, resourceGroupName, resourceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return MaintenanceConfigurationsClientListByManagedClusterResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return MaintenanceConfigurationsClientListByManagedClusterResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return MaintenanceConfigurationsClientListByManagedClusterResponse{}, runtime.NewResponseError(resp) + } + return client.listByManagedClusterHandleResponse(resp) }, - } + }) } // listByManagedClusterCreateRequest creates the ListByManagedCluster request. @@ -263,7 +283,7 @@ func (client *MaintenanceConfigurationsClient) listByManagedClusterCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -271,7 +291,7 @@ func (client *MaintenanceConfigurationsClient) listByManagedClusterCreateRequest // listByManagedClusterHandleResponse handles the ListByManagedCluster response. func (client *MaintenanceConfigurationsClient) listByManagedClusterHandleResponse(resp *http.Response) (MaintenanceConfigurationsClientListByManagedClusterResponse, error) { - result := MaintenanceConfigurationsClientListByManagedClusterResponse{RawResponse: resp} + result := MaintenanceConfigurationsClientListByManagedClusterResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.MaintenanceConfigurationListResult); err != nil { return MaintenanceConfigurationsClientListByManagedClusterResponse{}, err } diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_managedclusters_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_managedclusters_client.go index dd7b5877a686..9a9fa18ae00c 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_managedclusters_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_managedclusters_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,10 +14,12 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "net/url" + "strconv" "strings" ) @@ -30,49 +32,46 @@ type ManagedClustersClient struct { } // NewManagedClustersClient creates a new instance of ManagedClustersClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewManagedClustersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ManagedClustersClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewManagedClustersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedClustersClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &ManagedClustersClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // BeginCreateOrUpdate - Creates or updates a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // parameters - The managed cluster to create or update. // options - ManagedClustersClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedClustersClient.BeginCreateOrUpdate // method. -func (client *ManagedClustersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedCluster, options *ManagedClustersClientBeginCreateOrUpdateOptions) (ManagedClustersClientCreateOrUpdatePollerResponse, error) { - resp, err := client.createOrUpdate(ctx, resourceGroupName, resourceName, parameters, options) - if err != nil { - return ManagedClustersClientCreateOrUpdatePollerResponse{}, err - } - result := ManagedClustersClientCreateOrUpdatePollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("ManagedClustersClient.CreateOrUpdate", "", resp, client.pl) - if err != nil { - return ManagedClustersClientCreateOrUpdatePollerResponse{}, err +func (client *ManagedClustersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedCluster, options *ManagedClustersClientBeginCreateOrUpdateOptions) (*armruntime.Poller[ManagedClustersClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, resourceName, parameters, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[ManagedClustersClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[ManagedClustersClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) } - result.Poller = &ManagedClustersClientCreateOrUpdatePoller{ - pt: pt, - } - return result, nil } // CreateOrUpdate - Creates or updates a managed cluster. @@ -112,7 +111,7 @@ func (client *ManagedClustersClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) @@ -120,26 +119,20 @@ func (client *ManagedClustersClient) createOrUpdateCreateRequest(ctx context.Con // BeginDelete - Deletes a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientBeginDeleteOptions contains the optional parameters for the ManagedClustersClient.BeginDelete // method. -func (client *ManagedClustersClient) BeginDelete(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginDeleteOptions) (ManagedClustersClientDeletePollerResponse, error) { - resp, err := client.deleteOperation(ctx, resourceGroupName, resourceName, options) - if err != nil { - return ManagedClustersClientDeletePollerResponse{}, err - } - result := ManagedClustersClientDeletePollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("ManagedClustersClient.Delete", "", resp, client.pl) - if err != nil { - return ManagedClustersClientDeletePollerResponse{}, err +func (client *ManagedClustersClient) BeginDelete(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginDeleteOptions) (*armruntime.Poller[ManagedClustersClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, resourceName, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[ManagedClustersClientDeleteResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[ManagedClustersClientDeleteResponse](options.ResumeToken, client.pl, nil) } - result.Poller = &ManagedClustersClientDeletePoller{ - pt: pt, - } - return result, nil } // Delete - Deletes a managed cluster. @@ -179,7 +172,10 @@ func (client *ManagedClustersClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") + if options != nil && options.IgnorePodDisruptionBudget != nil { + reqQP.Set("ignore-pod-disruption-budget", strconv.FormatBool(*options.IgnorePodDisruptionBudget)) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -187,7 +183,7 @@ func (client *ManagedClustersClient) deleteCreateRequest(ctx context.Context, re // Get - Gets a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientGetOptions contains the optional parameters for the ManagedClustersClient.Get method. func (client *ManagedClustersClient) Get(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientGetOptions) (ManagedClustersClientGetResponse, error) { @@ -225,7 +221,7 @@ func (client *ManagedClustersClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -233,7 +229,7 @@ func (client *ManagedClustersClient) getCreateRequest(ctx context.Context, resou // getHandleResponse handles the Get response. func (client *ManagedClustersClient) getHandleResponse(resp *http.Response) (ManagedClustersClientGetResponse, error) { - result := ManagedClustersClientGetResponse{RawResponse: resp} + result := ManagedClustersClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ManagedCluster); err != nil { return ManagedClustersClientGetResponse{}, err } @@ -244,7 +240,7 @@ func (client *ManagedClustersClient) getHandleResponse(resp *http.Response) (Man // or ListClusterAdminCredentials // [https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials] . // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // roleName - The name of the role for managed cluster accessProfile resource. // options - ManagedClustersClientGetAccessProfileOptions contains the optional parameters for the ManagedClustersClient.GetAccessProfile @@ -288,7 +284,7 @@ func (client *ManagedClustersClient) getAccessProfileCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -296,7 +292,7 @@ func (client *ManagedClustersClient) getAccessProfileCreateRequest(ctx context.C // getAccessProfileHandleResponse handles the GetAccessProfile response. func (client *ManagedClustersClient) getAccessProfileHandleResponse(resp *http.Response) (ManagedClustersClientGetAccessProfileResponse, error) { - result := ManagedClustersClientGetAccessProfileResponse{RawResponse: resp} + result := ManagedClustersClientGetAccessProfileResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ManagedClusterAccessProfile); err != nil { return ManagedClustersClientGetAccessProfileResponse{}, err } @@ -305,7 +301,7 @@ func (client *ManagedClustersClient) getAccessProfileHandleResponse(resp *http.R // GetCommandResult - Gets the results of a command which has been run on the Managed Cluster. // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // commandID - Id of the command. // options - ManagedClustersClientGetCommandResultOptions contains the optional parameters for the ManagedClustersClient.GetCommandResult @@ -349,7 +345,7 @@ func (client *ManagedClustersClient) getCommandResultCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -357,7 +353,7 @@ func (client *ManagedClustersClient) getCommandResultCreateRequest(ctx context.C // getCommandResultHandleResponse handles the GetCommandResult response. func (client *ManagedClustersClient) getCommandResultHandleResponse(resp *http.Response) (ManagedClustersClientGetCommandResultResponse, error) { - result := ManagedClustersClientGetCommandResultResponse{RawResponse: resp} + result := ManagedClustersClientGetCommandResultResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.RunCommandResult); err != nil { return ManagedClustersClientGetCommandResultResponse{}, err } @@ -366,7 +362,7 @@ func (client *ManagedClustersClient) getCommandResultHandleResponse(resp *http.R // GetOSOptions - Gets supported OS options in the specified subscription. // If the operation fails it returns an *azcore.ResponseError type. -// location - The name of a supported Azure region. +// location - The name of Azure region. // options - ManagedClustersClientGetOSOptionsOptions contains the optional parameters for the ManagedClustersClient.GetOSOptions // method. func (client *ManagedClustersClient) GetOSOptions(ctx context.Context, location string, options *ManagedClustersClientGetOSOptionsOptions) (ManagedClustersClientGetOSOptionsResponse, error) { @@ -400,7 +396,7 @@ func (client *ManagedClustersClient) getOSOptionsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") if options != nil && options.ResourceType != nil { reqQP.Set("resource-type", *options.ResourceType) } @@ -411,7 +407,7 @@ func (client *ManagedClustersClient) getOSOptionsCreateRequest(ctx context.Conte // getOSOptionsHandleResponse handles the GetOSOptions response. func (client *ManagedClustersClient) getOSOptionsHandleResponse(resp *http.Response) (ManagedClustersClientGetOSOptionsResponse, error) { - result := ManagedClustersClientGetOSOptionsResponse{RawResponse: resp} + result := ManagedClustersClientGetOSOptionsResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.OSOptionProfile); err != nil { return ManagedClustersClientGetOSOptionsResponse{}, err } @@ -420,7 +416,7 @@ func (client *ManagedClustersClient) getOSOptionsHandleResponse(resp *http.Respo // GetUpgradeProfile - Gets the upgrade profile of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientGetUpgradeProfileOptions contains the optional parameters for the ManagedClustersClient.GetUpgradeProfile // method. @@ -459,7 +455,7 @@ func (client *ManagedClustersClient) getUpgradeProfileCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -467,7 +463,7 @@ func (client *ManagedClustersClient) getUpgradeProfileCreateRequest(ctx context. // getUpgradeProfileHandleResponse handles the GetUpgradeProfile response. func (client *ManagedClustersClient) getUpgradeProfileHandleResponse(resp *http.Response) (ManagedClustersClientGetUpgradeProfileResponse, error) { - result := ManagedClustersClientGetUpgradeProfileResponse{RawResponse: resp} + result := ManagedClustersClientGetUpgradeProfileResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ManagedClusterUpgradeProfile); err != nil { return ManagedClustersClientGetUpgradeProfileResponse{}, err } @@ -477,16 +473,32 @@ func (client *ManagedClustersClient) getUpgradeProfileHandleResponse(resp *http. // List - Gets a list of managed clusters in the specified subscription. // If the operation fails it returns an *azcore.ResponseError type. // options - ManagedClustersClientListOptions contains the optional parameters for the ManagedClustersClient.List method. -func (client *ManagedClustersClient) List(options *ManagedClustersClientListOptions) *ManagedClustersClientListPager { - return &ManagedClustersClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, options) +func (client *ManagedClustersClient) List(options *ManagedClustersClientListOptions) *runtime.Pager[ManagedClustersClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[ManagedClustersClientListResponse]{ + More: func(page ManagedClustersClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp ManagedClustersClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.ManagedClusterListResult.NextLink) + Fetcher: func(ctx context.Context, page *ManagedClustersClientListResponse) (ManagedClustersClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ManagedClustersClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedClustersClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedClustersClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) }, - } + }) } // listCreateRequest creates the List request. @@ -501,7 +513,7 @@ func (client *ManagedClustersClient) listCreateRequest(ctx context.Context, opti return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -509,7 +521,7 @@ func (client *ManagedClustersClient) listCreateRequest(ctx context.Context, opti // listHandleResponse handles the List response. func (client *ManagedClustersClient) listHandleResponse(resp *http.Response) (ManagedClustersClientListResponse, error) { - result := ManagedClustersClientListResponse{RawResponse: resp} + result := ManagedClustersClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ManagedClusterListResult); err != nil { return ManagedClustersClientListResponse{}, err } @@ -518,19 +530,35 @@ func (client *ManagedClustersClient) listHandleResponse(resp *http.Response) (Ma // ListByResourceGroup - Lists managed clusters in the specified subscription and resource group. // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // options - ManagedClustersClientListByResourceGroupOptions contains the optional parameters for the ManagedClustersClient.ListByResourceGroup // method. -func (client *ManagedClustersClient) ListByResourceGroup(resourceGroupName string, options *ManagedClustersClientListByResourceGroupOptions) *ManagedClustersClientListByResourceGroupPager { - return &ManagedClustersClientListByResourceGroupPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) +func (client *ManagedClustersClient) ListByResourceGroup(resourceGroupName string, options *ManagedClustersClientListByResourceGroupOptions) *runtime.Pager[ManagedClustersClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PageProcessor[ManagedClustersClientListByResourceGroupResponse]{ + More: func(page ManagedClustersClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp ManagedClustersClientListByResourceGroupResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.ManagedClusterListResult.NextLink) + Fetcher: func(ctx context.Context, page *ManagedClustersClientListByResourceGroupResponse) (ManagedClustersClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ManagedClustersClientListByResourceGroupResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedClustersClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedClustersClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) }, - } + }) } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. @@ -549,7 +577,7 @@ func (client *ManagedClustersClient) listByResourceGroupCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -557,7 +585,7 @@ func (client *ManagedClustersClient) listByResourceGroupCreateRequest(ctx contex // listByResourceGroupHandleResponse handles the ListByResourceGroup response. func (client *ManagedClustersClient) listByResourceGroupHandleResponse(resp *http.Response) (ManagedClustersClientListByResourceGroupResponse, error) { - result := ManagedClustersClientListByResourceGroupResponse{RawResponse: resp} + result := ManagedClustersClientListByResourceGroupResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ManagedClusterListResult); err != nil { return ManagedClustersClientListByResourceGroupResponse{}, err } @@ -566,7 +594,7 @@ func (client *ManagedClustersClient) listByResourceGroupHandleResponse(resp *htt // ListClusterAdminCredentials - Lists the admin credentials of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientListClusterAdminCredentialsOptions contains the optional parameters for the ManagedClustersClient.ListClusterAdminCredentials // method. @@ -605,7 +633,7 @@ func (client *ManagedClustersClient) listClusterAdminCredentialsCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") if options != nil && options.ServerFqdn != nil { reqQP.Set("server-fqdn", *options.ServerFqdn) } @@ -616,7 +644,7 @@ func (client *ManagedClustersClient) listClusterAdminCredentialsCreateRequest(ct // listClusterAdminCredentialsHandleResponse handles the ListClusterAdminCredentials response. func (client *ManagedClustersClient) listClusterAdminCredentialsHandleResponse(resp *http.Response) (ManagedClustersClientListClusterAdminCredentialsResponse, error) { - result := ManagedClustersClientListClusterAdminCredentialsResponse{RawResponse: resp} + result := ManagedClustersClientListClusterAdminCredentialsResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.CredentialResults); err != nil { return ManagedClustersClientListClusterAdminCredentialsResponse{}, err } @@ -625,7 +653,7 @@ func (client *ManagedClustersClient) listClusterAdminCredentialsHandleResponse(r // ListClusterMonitoringUserCredentials - Lists the cluster monitoring user credentials of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientListClusterMonitoringUserCredentialsOptions contains the optional parameters for the ManagedClustersClient.ListClusterMonitoringUserCredentials // method. @@ -664,7 +692,7 @@ func (client *ManagedClustersClient) listClusterMonitoringUserCredentialsCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") if options != nil && options.ServerFqdn != nil { reqQP.Set("server-fqdn", *options.ServerFqdn) } @@ -675,7 +703,7 @@ func (client *ManagedClustersClient) listClusterMonitoringUserCredentialsCreateR // listClusterMonitoringUserCredentialsHandleResponse handles the ListClusterMonitoringUserCredentials response. func (client *ManagedClustersClient) listClusterMonitoringUserCredentialsHandleResponse(resp *http.Response) (ManagedClustersClientListClusterMonitoringUserCredentialsResponse, error) { - result := ManagedClustersClientListClusterMonitoringUserCredentialsResponse{RawResponse: resp} + result := ManagedClustersClientListClusterMonitoringUserCredentialsResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.CredentialResults); err != nil { return ManagedClustersClientListClusterMonitoringUserCredentialsResponse{}, err } @@ -684,7 +712,7 @@ func (client *ManagedClustersClient) listClusterMonitoringUserCredentialsHandleR // ListClusterUserCredentials - Lists the user credentials of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientListClusterUserCredentialsOptions contains the optional parameters for the ManagedClustersClient.ListClusterUserCredentials // method. @@ -723,10 +751,13 @@ func (client *ManagedClustersClient) listClusterUserCredentialsCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") if options != nil && options.ServerFqdn != nil { reqQP.Set("server-fqdn", *options.ServerFqdn) } + if options != nil && options.Format != nil { + reqQP.Set("format", string(*options.Format)) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -734,7 +765,7 @@ func (client *ManagedClustersClient) listClusterUserCredentialsCreateRequest(ctx // listClusterUserCredentialsHandleResponse handles the ListClusterUserCredentials response. func (client *ManagedClustersClient) listClusterUserCredentialsHandleResponse(resp *http.Response) (ManagedClustersClientListClusterUserCredentialsResponse, error) { - result := ManagedClustersClientListClusterUserCredentialsResponse{RawResponse: resp} + result := ManagedClustersClientListClusterUserCredentialsResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.CredentialResults); err != nil { return ManagedClustersClientListClusterUserCredentialsResponse{}, err } @@ -744,20 +775,36 @@ func (client *ManagedClustersClient) listClusterUserCredentialsHandleResponse(re // ListOutboundNetworkDependenciesEndpoints - Gets a list of egress endpoints (network endpoints of all outbound dependencies) // in the specified managed cluster. The operation returns properties of each egress endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientListOutboundNetworkDependenciesEndpointsOptions contains the optional parameters for the // ManagedClustersClient.ListOutboundNetworkDependenciesEndpoints method. -func (client *ManagedClustersClient) ListOutboundNetworkDependenciesEndpoints(resourceGroupName string, resourceName string, options *ManagedClustersClientListOutboundNetworkDependenciesEndpointsOptions) *ManagedClustersClientListOutboundNetworkDependenciesEndpointsPager { - return &ManagedClustersClientListOutboundNetworkDependenciesEndpointsPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listOutboundNetworkDependenciesEndpointsCreateRequest(ctx, resourceGroupName, resourceName, options) +func (client *ManagedClustersClient) ListOutboundNetworkDependenciesEndpoints(resourceGroupName string, resourceName string, options *ManagedClustersClientListOutboundNetworkDependenciesEndpointsOptions) *runtime.Pager[ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse] { + return runtime.NewPager(runtime.PageProcessor[ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse]{ + More: func(page ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.OutboundEnvironmentEndpointCollection.NextLink) + Fetcher: func(ctx context.Context, page *ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse) (ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listOutboundNetworkDependenciesEndpointsCreateRequest(ctx, resourceGroupName, resourceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse{}, runtime.NewResponseError(resp) + } + return client.listOutboundNetworkDependenciesEndpointsHandleResponse(resp) }, - } + }) } // listOutboundNetworkDependenciesEndpointsCreateRequest creates the ListOutboundNetworkDependenciesEndpoints request. @@ -780,7 +827,7 @@ func (client *ManagedClustersClient) listOutboundNetworkDependenciesEndpointsCre return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -788,7 +835,7 @@ func (client *ManagedClustersClient) listOutboundNetworkDependenciesEndpointsCre // listOutboundNetworkDependenciesEndpointsHandleResponse handles the ListOutboundNetworkDependenciesEndpoints response. func (client *ManagedClustersClient) listOutboundNetworkDependenciesEndpointsHandleResponse(resp *http.Response) (ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse, error) { - result := ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse{RawResponse: resp} + result := ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.OutboundEnvironmentEndpointCollection); err != nil { return ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse{}, err } @@ -797,27 +844,21 @@ func (client *ManagedClustersClient) listOutboundNetworkDependenciesEndpointsHan // BeginResetAADProfile - Reset the AAD Profile of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // parameters - The AAD profile to set on the Managed Cluster // options - ManagedClustersClientBeginResetAADProfileOptions contains the optional parameters for the ManagedClustersClient.BeginResetAADProfile // method. -func (client *ManagedClustersClient) BeginResetAADProfile(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterAADProfile, options *ManagedClustersClientBeginResetAADProfileOptions) (ManagedClustersClientResetAADProfilePollerResponse, error) { - resp, err := client.resetAADProfile(ctx, resourceGroupName, resourceName, parameters, options) - if err != nil { - return ManagedClustersClientResetAADProfilePollerResponse{}, err - } - result := ManagedClustersClientResetAADProfilePollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("ManagedClustersClient.ResetAADProfile", "", resp, client.pl) - if err != nil { - return ManagedClustersClientResetAADProfilePollerResponse{}, err - } - result.Poller = &ManagedClustersClientResetAADProfilePoller{ - pt: pt, +func (client *ManagedClustersClient) BeginResetAADProfile(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterAADProfile, options *ManagedClustersClientBeginResetAADProfileOptions) (*armruntime.Poller[ManagedClustersClientResetAADProfileResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.resetAADProfile(ctx, resourceGroupName, resourceName, parameters, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[ManagedClustersClientResetAADProfileResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[ManagedClustersClientResetAADProfileResponse](options.ResumeToken, client.pl, nil) } - return result, nil } // ResetAADProfile - Reset the AAD Profile of a managed cluster. @@ -857,7 +898,7 @@ func (client *ManagedClustersClient) resetAADProfileCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) @@ -865,27 +906,21 @@ func (client *ManagedClustersClient) resetAADProfileCreateRequest(ctx context.Co // BeginResetServicePrincipalProfile - This action cannot be performed on a cluster that is not using a service principal // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // parameters - The service principal profile to set on the managed cluster. // options - ManagedClustersClientBeginResetServicePrincipalProfileOptions contains the optional parameters for the ManagedClustersClient.BeginResetServicePrincipalProfile // method. -func (client *ManagedClustersClient) BeginResetServicePrincipalProfile(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterServicePrincipalProfile, options *ManagedClustersClientBeginResetServicePrincipalProfileOptions) (ManagedClustersClientResetServicePrincipalProfilePollerResponse, error) { - resp, err := client.resetServicePrincipalProfile(ctx, resourceGroupName, resourceName, parameters, options) - if err != nil { - return ManagedClustersClientResetServicePrincipalProfilePollerResponse{}, err - } - result := ManagedClustersClientResetServicePrincipalProfilePollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("ManagedClustersClient.ResetServicePrincipalProfile", "", resp, client.pl) - if err != nil { - return ManagedClustersClientResetServicePrincipalProfilePollerResponse{}, err +func (client *ManagedClustersClient) BeginResetServicePrincipalProfile(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterServicePrincipalProfile, options *ManagedClustersClientBeginResetServicePrincipalProfileOptions) (*armruntime.Poller[ManagedClustersClientResetServicePrincipalProfileResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.resetServicePrincipalProfile(ctx, resourceGroupName, resourceName, parameters, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[ManagedClustersClientResetServicePrincipalProfileResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[ManagedClustersClientResetServicePrincipalProfileResponse](options.ResumeToken, client.pl, nil) } - result.Poller = &ManagedClustersClientResetServicePrincipalProfilePoller{ - pt: pt, - } - return result, nil } // ResetServicePrincipalProfile - This action cannot be performed on a cluster that is not using a service principal @@ -925,7 +960,7 @@ func (client *ManagedClustersClient) resetServicePrincipalProfileCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) @@ -934,26 +969,20 @@ func (client *ManagedClustersClient) resetServicePrincipalProfileCreateRequest(c // BeginRotateClusterCertificates - See Certificate rotation [https://docs.microsoft.com/azure/aks/certificate-rotation] for // more details about rotating managed cluster certificates. // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientBeginRotateClusterCertificatesOptions contains the optional parameters for the ManagedClustersClient.BeginRotateClusterCertificates // method. -func (client *ManagedClustersClient) BeginRotateClusterCertificates(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginRotateClusterCertificatesOptions) (ManagedClustersClientRotateClusterCertificatesPollerResponse, error) { - resp, err := client.rotateClusterCertificates(ctx, resourceGroupName, resourceName, options) - if err != nil { - return ManagedClustersClientRotateClusterCertificatesPollerResponse{}, err +func (client *ManagedClustersClient) BeginRotateClusterCertificates(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginRotateClusterCertificatesOptions) (*armruntime.Poller[ManagedClustersClientRotateClusterCertificatesResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.rotateClusterCertificates(ctx, resourceGroupName, resourceName, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[ManagedClustersClientRotateClusterCertificatesResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[ManagedClustersClientRotateClusterCertificatesResponse](options.ResumeToken, client.pl, nil) } - result := ManagedClustersClientRotateClusterCertificatesPollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("ManagedClustersClient.RotateClusterCertificates", "", resp, client.pl) - if err != nil { - return ManagedClustersClientRotateClusterCertificatesPollerResponse{}, err - } - result.Poller = &ManagedClustersClientRotateClusterCertificatesPoller{ - pt: pt, - } - return result, nil } // RotateClusterCertificates - See Certificate rotation [https://docs.microsoft.com/azure/aks/certificate-rotation] for more @@ -994,37 +1023,92 @@ func (client *ManagedClustersClient) rotateClusterCertificatesCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil } -// BeginRunCommand - AKS will create a pod to run the command. This is primarily useful for private clusters. For more information -// see AKS Run Command -// [https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview]. +// BeginRotateServiceAccountSigningKeys - Rotates the service account signing keys of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. -// requestPayload - The run command request -// options - ManagedClustersClientBeginRunCommandOptions contains the optional parameters for the ManagedClustersClient.BeginRunCommand +// options - ManagedClustersClientBeginRotateServiceAccountSigningKeysOptions contains the optional parameters for the ManagedClustersClient.BeginRotateServiceAccountSigningKeys // method. -func (client *ManagedClustersClient) BeginRunCommand(ctx context.Context, resourceGroupName string, resourceName string, requestPayload RunCommandRequest, options *ManagedClustersClientBeginRunCommandOptions) (ManagedClustersClientRunCommandPollerResponse, error) { - resp, err := client.runCommand(ctx, resourceGroupName, resourceName, requestPayload, options) +func (client *ManagedClustersClient) BeginRotateServiceAccountSigningKeys(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginRotateServiceAccountSigningKeysOptions) (*armruntime.Poller[ManagedClustersClientRotateServiceAccountSigningKeysResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.rotateServiceAccountSigningKeys(ctx, resourceGroupName, resourceName, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[ManagedClustersClientRotateServiceAccountSigningKeysResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[ManagedClustersClientRotateServiceAccountSigningKeysResponse](options.ResumeToken, client.pl, nil) + } +} + +// RotateServiceAccountSigningKeys - Rotates the service account signing keys of a managed cluster. +// If the operation fails it returns an *azcore.ResponseError type. +func (client *ManagedClustersClient) rotateServiceAccountSigningKeys(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginRotateServiceAccountSigningKeysOptions) (*http.Response, error) { + req, err := client.rotateServiceAccountSigningKeysCreateRequest(ctx, resourceGroupName, resourceName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) if err != nil { - return ManagedClustersClientRunCommandPollerResponse{}, err + return nil, err } - result := ManagedClustersClientRunCommandPollerResponse{ - RawResponse: resp, + if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// rotateServiceAccountSigningKeysCreateRequest creates the RotateServiceAccountSigningKeys request. +func (client *ManagedClustersClient) rotateServiceAccountSigningKeysCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginRotateServiceAccountSigningKeysOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateServiceAccountSigningKeys" + 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 resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") } - pt, err := armruntime.NewPoller("ManagedClustersClient.RunCommand", "", resp, client.pl) + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) if err != nil { - return ManagedClustersClientRunCommandPollerResponse{}, err + return nil, err } - result.Poller = &ManagedClustersClientRunCommandPoller{ - pt: pt, + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// BeginRunCommand - AKS will create a pod to run the command. This is primarily useful for private clusters. For more information +// see AKS Run Command +// [https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview]. +// If the operation fails it returns an *azcore.ResponseError type. +// resourceGroupName - The name of the resource group. The name is case insensitive. +// resourceName - The name of the managed cluster resource. +// requestPayload - The run command request +// options - ManagedClustersClientBeginRunCommandOptions contains the optional parameters for the ManagedClustersClient.BeginRunCommand +// method. +func (client *ManagedClustersClient) BeginRunCommand(ctx context.Context, resourceGroupName string, resourceName string, requestPayload RunCommandRequest, options *ManagedClustersClientBeginRunCommandOptions) (*armruntime.Poller[ManagedClustersClientRunCommandResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.runCommand(ctx, resourceGroupName, resourceName, requestPayload, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[ManagedClustersClientRunCommandResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[ManagedClustersClientRunCommandResponse](options.ResumeToken, client.pl, nil) } - return result, nil } // RunCommand - AKS will create a pod to run the command. This is primarily useful for private clusters. For more information @@ -1066,7 +1150,7 @@ func (client *ManagedClustersClient) runCommandCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, requestPayload) @@ -1075,26 +1159,20 @@ func (client *ManagedClustersClient) runCommandCreateRequest(ctx context.Context // BeginStart - See starting a cluster [https://docs.microsoft.com/azure/aks/start-stop-cluster] for more details about starting // a cluster. // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientBeginStartOptions contains the optional parameters for the ManagedClustersClient.BeginStart // method. -func (client *ManagedClustersClient) BeginStart(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginStartOptions) (ManagedClustersClientStartPollerResponse, error) { - resp, err := client.start(ctx, resourceGroupName, resourceName, options) - if err != nil { - return ManagedClustersClientStartPollerResponse{}, err - } - result := ManagedClustersClientStartPollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("ManagedClustersClient.Start", "", resp, client.pl) - if err != nil { - return ManagedClustersClientStartPollerResponse{}, err - } - result.Poller = &ManagedClustersClientStartPoller{ - pt: pt, +func (client *ManagedClustersClient) BeginStart(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginStartOptions) (*armruntime.Poller[ManagedClustersClientStartResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.start(ctx, resourceGroupName, resourceName, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[ManagedClustersClientStartResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[ManagedClustersClientStartResponse](options.ResumeToken, client.pl, nil) } - return result, nil } // Start - See starting a cluster [https://docs.microsoft.com/azure/aks/start-stop-cluster] for more details about starting @@ -1135,7 +1213,7 @@ func (client *ManagedClustersClient) startCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -1146,26 +1224,20 @@ func (client *ManagedClustersClient) startCreateRequest(ctx context.Context, res // cluster does not accrue charges while it is stopped. See stopping a cluster [https://docs.microsoft.com/azure/aks/start-stop-cluster] // for more details about stopping a cluster. // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientBeginStopOptions contains the optional parameters for the ManagedClustersClient.BeginStop // method. -func (client *ManagedClustersClient) BeginStop(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginStopOptions) (ManagedClustersClientStopPollerResponse, error) { - resp, err := client.stop(ctx, resourceGroupName, resourceName, options) - if err != nil { - return ManagedClustersClientStopPollerResponse{}, err +func (client *ManagedClustersClient) BeginStop(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginStopOptions) (*armruntime.Poller[ManagedClustersClientStopResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.stop(ctx, resourceGroupName, resourceName, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[ManagedClustersClientStopResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[ManagedClustersClientStopResponse](options.ResumeToken, client.pl, nil) } - result := ManagedClustersClientStopPollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("ManagedClustersClient.Stop", "", resp, client.pl) - if err != nil { - return ManagedClustersClientStopPollerResponse{}, err - } - result.Poller = &ManagedClustersClientStopPoller{ - pt: pt, - } - return result, nil } // Stop - This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the control @@ -1208,7 +1280,7 @@ func (client *ManagedClustersClient) stopCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -1216,27 +1288,21 @@ func (client *ManagedClustersClient) stopCreateRequest(ctx context.Context, reso // BeginUpdateTags - Updates tags on a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // parameters - Parameters supplied to the Update Managed Cluster Tags operation. // options - ManagedClustersClientBeginUpdateTagsOptions contains the optional parameters for the ManagedClustersClient.BeginUpdateTags // method. -func (client *ManagedClustersClient) BeginUpdateTags(ctx context.Context, resourceGroupName string, resourceName string, parameters TagsObject, options *ManagedClustersClientBeginUpdateTagsOptions) (ManagedClustersClientUpdateTagsPollerResponse, error) { - resp, err := client.updateTags(ctx, resourceGroupName, resourceName, parameters, options) - if err != nil { - return ManagedClustersClientUpdateTagsPollerResponse{}, err - } - result := ManagedClustersClientUpdateTagsPollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("ManagedClustersClient.UpdateTags", "", resp, client.pl) - if err != nil { - return ManagedClustersClientUpdateTagsPollerResponse{}, err - } - result.Poller = &ManagedClustersClientUpdateTagsPoller{ - pt: pt, +func (client *ManagedClustersClient) BeginUpdateTags(ctx context.Context, resourceGroupName string, resourceName string, parameters TagsObject, options *ManagedClustersClientBeginUpdateTagsOptions) (*armruntime.Poller[ManagedClustersClientUpdateTagsResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.updateTags(ctx, resourceGroupName, resourceName, parameters, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[ManagedClustersClientUpdateTagsResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[ManagedClustersClientUpdateTagsResponse](options.ResumeToken, client.pl, nil) } - return result, nil } // UpdateTags - Updates tags on a managed cluster. @@ -1276,7 +1342,7 @@ func (client *ManagedClustersClient) updateTagsCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_managedclustersnapshots_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_managedclustersnapshots_client.go new file mode 100644 index 000000000000..7b7a64b10233 --- /dev/null +++ b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_managedclustersnapshots_client.go @@ -0,0 +1,395 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armcontainerservice + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// ManagedClusterSnapshotsClient contains the methods for the ManagedClusterSnapshots group. +// Don't use this type directly, use NewManagedClusterSnapshotsClient() instead. +type ManagedClusterSnapshotsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewManagedClusterSnapshotsClient creates a new instance of ManagedClusterSnapshotsClient with the specified values. +// subscriptionID - The ID of the target subscription. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewManagedClusterSnapshotsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedClusterSnapshotsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &ManagedClusterSnapshotsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates a managed cluster snapshot. +// If the operation fails it returns an *azcore.ResponseError type. +// resourceGroupName - The name of the resource group. The name is case insensitive. +// resourceName - The name of the managed cluster resource. +// parameters - The managed cluster snapshot to create or update. +// options - ManagedClusterSnapshotsClientCreateOrUpdateOptions contains the optional parameters for the ManagedClusterSnapshotsClient.CreateOrUpdate +// method. +func (client *ManagedClusterSnapshotsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterSnapshot, options *ManagedClusterSnapshotsClientCreateOrUpdateOptions) (ManagedClusterSnapshotsClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) + if err != nil { + return ManagedClusterSnapshotsClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedClusterSnapshotsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return ManagedClusterSnapshotsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ManagedClusterSnapshotsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterSnapshot, options *ManagedClusterSnapshotsClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}" + 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 resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, parameters) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *ManagedClusterSnapshotsClient) createOrUpdateHandleResponse(resp *http.Response) (ManagedClusterSnapshotsClientCreateOrUpdateResponse, error) { + result := ManagedClusterSnapshotsClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedClusterSnapshot); err != nil { + return ManagedClusterSnapshotsClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Deletes a managed cluster snapshot. +// If the operation fails it returns an *azcore.ResponseError type. +// resourceGroupName - The name of the resource group. The name is case insensitive. +// resourceName - The name of the managed cluster resource. +// options - ManagedClusterSnapshotsClientDeleteOptions contains the optional parameters for the ManagedClusterSnapshotsClient.Delete +// method. +func (client *ManagedClusterSnapshotsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClusterSnapshotsClientDeleteOptions) (ManagedClusterSnapshotsClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, options) + if err != nil { + return ManagedClusterSnapshotsClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedClusterSnapshotsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return ManagedClusterSnapshotsClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return ManagedClusterSnapshotsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ManagedClusterSnapshotsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClusterSnapshotsClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}" + 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 resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// Get - Gets a managed cluster snapshot. +// If the operation fails it returns an *azcore.ResponseError type. +// resourceGroupName - The name of the resource group. The name is case insensitive. +// resourceName - The name of the managed cluster resource. +// options - ManagedClusterSnapshotsClientGetOptions contains the optional parameters for the ManagedClusterSnapshotsClient.Get +// method. +func (client *ManagedClusterSnapshotsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClusterSnapshotsClientGetOptions) (ManagedClusterSnapshotsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, options) + if err != nil { + return ManagedClusterSnapshotsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedClusterSnapshotsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedClusterSnapshotsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ManagedClusterSnapshotsClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClusterSnapshotsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}" + 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 resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ManagedClusterSnapshotsClient) getHandleResponse(resp *http.Response) (ManagedClusterSnapshotsClientGetResponse, error) { + result := ManagedClusterSnapshotsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedClusterSnapshot); err != nil { + return ManagedClusterSnapshotsClientGetResponse{}, err + } + return result, nil +} + +// List - Gets a list of managed cluster snapshots in the specified subscription. +// If the operation fails it returns an *azcore.ResponseError type. +// options - ManagedClusterSnapshotsClientListOptions contains the optional parameters for the ManagedClusterSnapshotsClient.List +// method. +func (client *ManagedClusterSnapshotsClient) List(options *ManagedClusterSnapshotsClientListOptions) *runtime.Pager[ManagedClusterSnapshotsClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[ManagedClusterSnapshotsClientListResponse]{ + More: func(page ManagedClusterSnapshotsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ManagedClusterSnapshotsClientListResponse) (ManagedClusterSnapshotsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ManagedClusterSnapshotsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedClusterSnapshotsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedClusterSnapshotsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ManagedClusterSnapshotsClient) listCreateRequest(ctx context.Context, options *ManagedClusterSnapshotsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedclustersnapshots" + 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ManagedClusterSnapshotsClient) listHandleResponse(resp *http.Response) (ManagedClusterSnapshotsClientListResponse, error) { + result := ManagedClusterSnapshotsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedClusterSnapshotListResult); err != nil { + return ManagedClusterSnapshotsClientListResponse{}, err + } + return result, nil +} + +// ListByResourceGroup - Lists managed cluster snapshots in the specified subscription and resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// resourceGroupName - The name of the resource group. The name is case insensitive. +// options - ManagedClusterSnapshotsClientListByResourceGroupOptions contains the optional parameters for the ManagedClusterSnapshotsClient.ListByResourceGroup +// method. +func (client *ManagedClusterSnapshotsClient) ListByResourceGroup(resourceGroupName string, options *ManagedClusterSnapshotsClientListByResourceGroupOptions) *runtime.Pager[ManagedClusterSnapshotsClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PageProcessor[ManagedClusterSnapshotsClientListByResourceGroupResponse]{ + More: func(page ManagedClusterSnapshotsClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ManagedClusterSnapshotsClientListByResourceGroupResponse) (ManagedClusterSnapshotsClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ManagedClusterSnapshotsClientListByResourceGroupResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedClusterSnapshotsClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedClusterSnapshotsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *ManagedClusterSnapshotsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ManagedClusterSnapshotsClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots" + 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *ManagedClusterSnapshotsClient) listByResourceGroupHandleResponse(resp *http.Response) (ManagedClusterSnapshotsClientListByResourceGroupResponse, error) { + result := ManagedClusterSnapshotsClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedClusterSnapshotListResult); err != nil { + return ManagedClusterSnapshotsClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// UpdateTags - Updates tags on a managed cluster snapshot. +// If the operation fails it returns an *azcore.ResponseError type. +// resourceGroupName - The name of the resource group. The name is case insensitive. +// resourceName - The name of the managed cluster resource. +// parameters - Parameters supplied to the Update managed cluster snapshot Tags operation. +// options - ManagedClusterSnapshotsClientUpdateTagsOptions contains the optional parameters for the ManagedClusterSnapshotsClient.UpdateTags +// method. +func (client *ManagedClusterSnapshotsClient) UpdateTags(ctx context.Context, resourceGroupName string, resourceName string, parameters TagsObject, options *ManagedClusterSnapshotsClientUpdateTagsOptions) (ManagedClusterSnapshotsClientUpdateTagsResponse, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) + if err != nil { + return ManagedClusterSnapshotsClientUpdateTagsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedClusterSnapshotsClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedClusterSnapshotsClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + } + return client.updateTagsHandleResponse(resp) +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *ManagedClusterSnapshotsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, parameters TagsObject, options *ManagedClusterSnapshotsClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}" + 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 resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, parameters) +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *ManagedClusterSnapshotsClient) updateTagsHandleResponse(resp *http.Response) (ManagedClusterSnapshotsClientUpdateTagsResponse, error) { + result := ManagedClusterSnapshotsClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedClusterSnapshot); err != nil { + return ManagedClusterSnapshotsClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_models.go b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_models.go index 7cdb73debda1..b01637c41ab7 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_models.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_models.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -8,13 +8,7 @@ package armcontainerservice -import ( - "encoding/json" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "reflect" - "time" -) +import "time" // AccessProfile - Profile for enabling a user to access a managed cluster. type AccessProfile struct { @@ -22,33 +16,6 @@ type AccessProfile struct { KubeConfig []byte `json:"kubeConfig,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type AccessProfile. -func (a AccessProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateByteArray(objectMap, "kubeConfig", a.KubeConfig, runtime.Base64StdFormat) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AccessProfile. -func (a *AccessProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "kubeConfig": - err = runtime.DecodeByteArray(string(val), &a.KubeConfig, runtime.Base64StdFormat) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // AgentPool - Agent Pool. type AgentPool struct { // Properties of an agent pool. @@ -85,13 +52,6 @@ type AgentPoolAvailableVersionsProperties struct { AgentPoolVersions []*AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem `json:"agentPoolVersions,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type AgentPoolAvailableVersionsProperties. -func (a AgentPoolAvailableVersionsProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "agentPoolVersions", a.AgentPoolVersions) - return json.Marshal(objectMap) -} - type AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem struct { // Whether this version is the default agent pool version. Default *bool `json:"default,omitempty"` @@ -112,14 +72,6 @@ type AgentPoolListResult struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type AgentPoolListResult. -func (a AgentPoolListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", a.NextLink) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - // AgentPoolUpgradeProfile - The list of available upgrades for an agent pool. type AgentPoolUpgradeProfile struct { // REQUIRED; The properties of the agent pool upgrade profile. @@ -150,16 +102,6 @@ type AgentPoolUpgradeProfileProperties struct { Upgrades []*AgentPoolUpgradeProfilePropertiesUpgradesItem `json:"upgrades,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type AgentPoolUpgradeProfileProperties. -func (a AgentPoolUpgradeProfileProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "kubernetesVersion", a.KubernetesVersion) - populate(objectMap, "latestNodeImageVersion", a.LatestNodeImageVersion) - populate(objectMap, "osType", a.OSType) - populate(objectMap, "upgrades", a.Upgrades) - return json.Marshal(objectMap) -} - type AgentPoolUpgradeProfilePropertiesUpgradesItem struct { // Whether the Kubernetes version is currently in preview. IsPreview *bool `json:"isPreview,omitempty"` @@ -181,18 +123,23 @@ type AgentPoolUpgradeSettings struct { // AgentPoolsClientBeginCreateOrUpdateOptions contains the optional parameters for the AgentPoolsClient.BeginCreateOrUpdate // method. type AgentPoolsClientBeginCreateOrUpdateOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // AgentPoolsClientBeginDeleteOptions contains the optional parameters for the AgentPoolsClient.BeginDelete method. type AgentPoolsClientBeginDeleteOptions struct { - // placeholder for future optional parameters + // ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget + IgnorePodDisruptionBudget *bool + // Resumes the LRO from the provided token. + ResumeToken string } // AgentPoolsClientBeginUpgradeNodeImageVersionOptions contains the optional parameters for the AgentPoolsClient.BeginUpgradeNodeImageVersion // method. type AgentPoolsClientBeginUpgradeNodeImageVersionOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // AgentPoolsClientGetAvailableAgentPoolVersionsOptions contains the optional parameters for the AgentPoolsClient.GetAvailableAgentPoolVersions @@ -216,6 +163,18 @@ type AgentPoolsClientListOptions struct { // placeholder for future optional parameters } +// AzureKeyVaultKms - Azure Key Vault key management service settings for the security profile. +type AzureKeyVaultKms struct { + // Whether to enable Azure Key Vault key management service. The default is false. + Enabled *bool `json:"enabled,omitempty"` + + // Identifier of Azure Key Vault key. See key identifier format [https://docs.microsoft.com/en-us/azure/key-vault/general/about-keys-secrets-certificates#vault-name-and-object-name] + // for more details. + // When Azure Key Vault key management service is enabled, this field is required and must be a valid key identifier. When + // Azure Key Vault key management service is disabled, leave the field empty. + KeyID *string `json:"keyId,omitempty"` +} + // CloudError - An error response from the Container service. type CloudError struct { // Details about the error. @@ -237,16 +196,6 @@ type CloudErrorBody struct { Target *string `json:"target,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type CloudErrorBody. -func (c CloudErrorBody) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "code", c.Code) - populate(objectMap, "details", c.Details) - populate(objectMap, "message", c.Message) - populate(objectMap, "target", c.Target) - return json.Marshal(objectMap) -} - // CommandResultProperties - The results of a run command type CommandResultProperties struct { // READ-ONLY; The exit code of the command @@ -268,53 +217,6 @@ type CommandResultProperties struct { StartedAt *time.Time `json:"startedAt,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type CommandResultProperties. -func (c CommandResultProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "exitCode", c.ExitCode) - populateTimeRFC3339(objectMap, "finishedAt", c.FinishedAt) - populate(objectMap, "logs", c.Logs) - populate(objectMap, "provisioningState", c.ProvisioningState) - populate(objectMap, "reason", c.Reason) - populateTimeRFC3339(objectMap, "startedAt", c.StartedAt) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CommandResultProperties. -func (c *CommandResultProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "exitCode": - err = unpopulate(val, &c.ExitCode) - delete(rawMsg, key) - case "finishedAt": - err = unpopulateTimeRFC3339(val, &c.FinishedAt) - delete(rawMsg, key) - case "logs": - err = unpopulate(val, &c.Logs) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, &c.ProvisioningState) - delete(rawMsg, key) - case "reason": - err = unpopulate(val, &c.Reason) - delete(rawMsg, key) - case "startedAt": - err = unpopulateTimeRFC3339(val, &c.StartedAt) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // CreationData - Data used when creating a target resource from a source resource. type CreationData struct { // This is the ARM ID of the source object to be used to create the target object. @@ -330,50 +232,12 @@ type CredentialResult struct { Value []byte `json:"value,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type CredentialResult. -func (c CredentialResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "name", c.Name) - populateByteArray(objectMap, "value", c.Value, runtime.Base64StdFormat) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CredentialResult. -func (c *CredentialResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, &c.Name) - delete(rawMsg, key) - case "value": - err = runtime.DecodeByteArray(string(val), &c.Value, runtime.Base64StdFormat) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // CredentialResults - The list credential result response. type CredentialResults struct { // READ-ONLY; Base64-encoded Kubernetes configuration file. Kubeconfigs []*CredentialResult `json:"kubeconfigs,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type CredentialResults. -func (c CredentialResults) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "kubeconfigs", c.Kubeconfigs) - return json.Marshal(objectMap) -} - // DiagnosticsProfile - Profile for diagnostics on the container service cluster. type DiagnosticsProfile struct { // REQUIRED; Profile for diagnostics on the container service VMs. @@ -389,14 +253,6 @@ type EndpointDependency struct { EndpointDetails []*EndpointDetail `json:"endpointDetails,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type EndpointDependency. -func (e EndpointDependency) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "domainName", e.DomainName) - populate(objectMap, "endpointDetails", e.EndpointDetails) - return json.Marshal(objectMap) -} - // EndpointDetail - connect information from the AKS agent nodes to a single endpoint. type EndpointDetail struct { // Description of the detail @@ -464,23 +320,6 @@ type KubeletConfig struct { TopologyManagerPolicy *string `json:"topologyManagerPolicy,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type KubeletConfig. -func (k KubeletConfig) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "allowedUnsafeSysctls", k.AllowedUnsafeSysctls) - populate(objectMap, "cpuCfsQuota", k.CPUCfsQuota) - populate(objectMap, "cpuCfsQuotaPeriod", k.CPUCfsQuotaPeriod) - populate(objectMap, "cpuManagerPolicy", k.CPUManagerPolicy) - populate(objectMap, "containerLogMaxFiles", k.ContainerLogMaxFiles) - populate(objectMap, "containerLogMaxSizeMB", k.ContainerLogMaxSizeMB) - populate(objectMap, "failSwapOn", k.FailSwapOn) - populate(objectMap, "imageGcHighThreshold", k.ImageGcHighThreshold) - populate(objectMap, "imageGcLowThreshold", k.ImageGcLowThreshold) - populate(objectMap, "podMaxPids", k.PodMaxPids) - populate(objectMap, "topologyManagerPolicy", k.TopologyManagerPolicy) - return json.Marshal(objectMap) -} - // LinuxOSConfig - See AKS custom node configuration [https://docs.microsoft.com/azure/aks/custom-node-configuration] for // more details. type LinuxOSConfig struct { @@ -537,14 +376,6 @@ type MaintenanceConfigurationListResult struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type MaintenanceConfigurationListResult. -func (m MaintenanceConfigurationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", m.NextLink) - populate(objectMap, "value", m.Value) - return json.Marshal(objectMap) -} - // MaintenanceConfigurationProperties - Properties used to configure planned maintenance for a Managed Cluster. type MaintenanceConfigurationProperties struct { // Time slots on which upgrade is not allowed. @@ -554,14 +385,6 @@ type MaintenanceConfigurationProperties struct { TimeInWeek []*TimeInWeek `json:"timeInWeek,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type MaintenanceConfigurationProperties. -func (m MaintenanceConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "notAllowedTime", m.NotAllowedTime) - populate(objectMap, "timeInWeek", m.TimeInWeek) - return json.Marshal(objectMap) -} - // MaintenanceConfigurationsClientCreateOrUpdateOptions contains the optional parameters for the MaintenanceConfigurationsClient.CreateOrUpdate // method. type MaintenanceConfigurationsClientCreateOrUpdateOptions struct { @@ -606,29 +429,17 @@ type ManagedCluster struct { // Resource tags Tags map[string]*string `json:"tags,omitempty"` - // READ-ONLY; Resource Id + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` - // READ-ONLY; Resource name + // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` -// MarshalJSON implements the json.Marshaller interface for type ManagedCluster. -func (m ManagedCluster) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "extendedLocation", m.ExtendedLocation) - populate(objectMap, "id", m.ID) - populate(objectMap, "identity", m.Identity) - populate(objectMap, "location", m.Location) - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "sku", m.SKU) - populate(objectMap, "tags", m.Tags) - populate(objectMap, "type", m.Type) - return json.Marshal(objectMap) + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` } // ManagedClusterAADProfile - For more details see managed AAD on AKS [https://docs.microsoft.com/azure/aks/managed-aad]. @@ -655,19 +466,6 @@ type ManagedClusterAADProfile struct { TenantID *string `json:"tenantID,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type ManagedClusterAADProfile. -func (m ManagedClusterAADProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "adminGroupObjectIDs", m.AdminGroupObjectIDs) - populate(objectMap, "clientAppID", m.ClientAppID) - populate(objectMap, "enableAzureRBAC", m.EnableAzureRBAC) - populate(objectMap, "managed", m.Managed) - populate(objectMap, "serverAppID", m.ServerAppID) - populate(objectMap, "serverAppSecret", m.ServerAppSecret) - populate(objectMap, "tenantID", m.TenantID) - return json.Marshal(objectMap) -} - // ManagedClusterAPIServerAccessProfile - Access profile for managed cluster API server. type ManagedClusterAPIServerAccessProfile struct { // IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. This feature is not compatible with clusters that use Public @@ -689,17 +487,6 @@ type ManagedClusterAPIServerAccessProfile struct { PrivateDNSZone *string `json:"privateDNSZone,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type ManagedClusterAPIServerAccessProfile. -func (m ManagedClusterAPIServerAccessProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "authorizedIPRanges", m.AuthorizedIPRanges) - populate(objectMap, "disableRunCommand", m.DisableRunCommand) - populate(objectMap, "enablePrivateCluster", m.EnablePrivateCluster) - populate(objectMap, "enablePrivateClusterPublicFQDN", m.EnablePrivateClusterPublicFQDN) - populate(objectMap, "privateDNSZone", m.PrivateDNSZone) - return json.Marshal(objectMap) -} - // ManagedClusterAccessProfile - Managed cluster Access Profile. type ManagedClusterAccessProfile struct { // REQUIRED; Resource location @@ -711,26 +498,17 @@ type ManagedClusterAccessProfile struct { // Resource tags Tags map[string]*string `json:"tags,omitempty"` - // READ-ONLY; Resource Id + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` - // READ-ONLY; Resource name + // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` -// MarshalJSON implements the json.Marshaller interface for type ManagedClusterAccessProfile. -func (m ManagedClusterAccessProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", m.ID) - populate(objectMap, "location", m.Location) - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "tags", m.Tags) - populate(objectMap, "type", m.Type) - return json.Marshal(objectMap) + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` } // ManagedClusterAddonProfile - A Kubernetes add-on profile for a managed cluster. @@ -745,15 +523,6 @@ type ManagedClusterAddonProfile struct { Identity *ManagedClusterAddonProfileIdentity `json:"identity,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type ManagedClusterAddonProfile. -func (m ManagedClusterAddonProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "config", m.Config) - populate(objectMap, "enabled", m.Enabled) - populate(objectMap, "identity", m.Identity) - return json.Marshal(objectMap) -} - // ManagedClusterAddonProfileIdentity - Information of user assigned identity used by this add-on. type ManagedClusterAddonProfileIdentity struct { // The client ID of the user assigned identity. @@ -785,6 +554,10 @@ type ManagedClusterAgentPoolProfile struct { // CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. CreationData *CreationData `json:"creationData,omitempty"` + // If orchestratorVersion was a fully specified version , this field will be exactly equal to it. If orchestratorVersion was + // , this field will contain the full version being used. + CurrentOrchestratorVersion *string `json:"currentOrchestratorVersion,omitempty"` + // Whether to enable auto-scaler EnableAutoScaling *bool `json:"enableAutoScaling,omitempty"` @@ -808,6 +581,11 @@ type ManagedClusterAgentPoolProfile struct { // GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. GpuInstanceProfile *GPUInstanceProfile `json:"gpuInstanceProfile,omitempty"` + // This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. + // For more information see Azure dedicated hosts + // [https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts]. + HostGroupID *string `json:"hostGroupID,omitempty"` + // The Kubelet configuration on the agent pool nodes. KubeletConfig *KubeletConfig `json:"kubeletConfig,omitempty"` @@ -859,11 +637,13 @@ type ManagedClusterAgentPoolProfile struct { // The operating system type. The default is Linux. OSType *OSType `json:"osType,omitempty"` - // As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version - // must have the same major version as the control plane. The node pool minor - // version must be within two minor versions of the control plane version. The node pool version cannot be greater than the - // control plane version. For more information see upgrading a node pool - // [https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool]. + // Both patch version and are supported. When is specified, the latest supported patch version is chosen automatically. Updating + // the agent pool with the same once it has been created will not trigger an + // upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster + // to the same Kubernetes version. The node pool version must have the same + // major version as the control plane. The node pool minor version must be within two minor versions of the control plane + // version. The node pool version cannot be greater than the control plane version. + // For more information see upgrading a node pool [https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool]. OrchestratorVersion *string `json:"orchestratorVersion,omitempty"` // If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: @@ -921,54 +701,6 @@ type ManagedClusterAgentPoolProfile struct { ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type ManagedClusterAgentPoolProfile. -func (m ManagedClusterAgentPoolProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "availabilityZones", m.AvailabilityZones) - populate(objectMap, "capacityReservationGroupID", m.CapacityReservationGroupID) - populate(objectMap, "count", m.Count) - populate(objectMap, "creationData", m.CreationData) - populate(objectMap, "enableAutoScaling", m.EnableAutoScaling) - populate(objectMap, "enableEncryptionAtHost", m.EnableEncryptionAtHost) - populate(objectMap, "enableFIPS", m.EnableFIPS) - populate(objectMap, "enableNodePublicIP", m.EnableNodePublicIP) - populate(objectMap, "enableUltraSSD", m.EnableUltraSSD) - populate(objectMap, "gpuInstanceProfile", m.GpuInstanceProfile) - populate(objectMap, "kubeletConfig", m.KubeletConfig) - populate(objectMap, "kubeletDiskType", m.KubeletDiskType) - populate(objectMap, "linuxOSConfig", m.LinuxOSConfig) - populate(objectMap, "maxCount", m.MaxCount) - populate(objectMap, "maxPods", m.MaxPods) - populate(objectMap, "messageOfTheDay", m.MessageOfTheDay) - populate(objectMap, "minCount", m.MinCount) - populate(objectMap, "mode", m.Mode) - populate(objectMap, "name", m.Name) - populate(objectMap, "nodeImageVersion", m.NodeImageVersion) - populate(objectMap, "nodeLabels", m.NodeLabels) - populate(objectMap, "nodePublicIPPrefixID", m.NodePublicIPPrefixID) - populate(objectMap, "nodeTaints", m.NodeTaints) - populate(objectMap, "osDiskSizeGB", m.OSDiskSizeGB) - populate(objectMap, "osDiskType", m.OSDiskType) - populate(objectMap, "osSKU", m.OSSKU) - populate(objectMap, "osType", m.OSType) - populate(objectMap, "orchestratorVersion", m.OrchestratorVersion) - populate(objectMap, "podSubnetID", m.PodSubnetID) - populate(objectMap, "powerState", m.PowerState) - populate(objectMap, "provisioningState", m.ProvisioningState) - populate(objectMap, "proximityPlacementGroupID", m.ProximityPlacementGroupID) - populate(objectMap, "scaleDownMode", m.ScaleDownMode) - populate(objectMap, "scaleSetEvictionPolicy", m.ScaleSetEvictionPolicy) - populate(objectMap, "scaleSetPriority", m.ScaleSetPriority) - populate(objectMap, "spotMaxPrice", m.SpotMaxPrice) - populate(objectMap, "tags", m.Tags) - populate(objectMap, "type", m.Type) - populate(objectMap, "upgradeSettings", m.UpgradeSettings) - populate(objectMap, "vmSize", m.VMSize) - populate(objectMap, "vnetSubnetID", m.VnetSubnetID) - populate(objectMap, "workloadRuntime", m.WorkloadRuntime) - return json.Marshal(objectMap) -} - // ManagedClusterAgentPoolProfileProperties - Properties for the container service agent pool profile. type ManagedClusterAgentPoolProfileProperties struct { // The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. @@ -985,6 +717,10 @@ type ManagedClusterAgentPoolProfileProperties struct { // CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. CreationData *CreationData `json:"creationData,omitempty"` + // If orchestratorVersion was a fully specified version , this field will be exactly equal to it. If orchestratorVersion was + // , this field will contain the full version being used. + CurrentOrchestratorVersion *string `json:"currentOrchestratorVersion,omitempty"` + // Whether to enable auto-scaler EnableAutoScaling *bool `json:"enableAutoScaling,omitempty"` @@ -1008,6 +744,11 @@ type ManagedClusterAgentPoolProfileProperties struct { // GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. GpuInstanceProfile *GPUInstanceProfile `json:"gpuInstanceProfile,omitempty"` + // This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. + // For more information see Azure dedicated hosts + // [https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts]. + HostGroupID *string `json:"hostGroupID,omitempty"` + // The Kubelet configuration on the agent pool nodes. KubeletConfig *KubeletConfig `json:"kubeletConfig,omitempty"` @@ -1059,11 +800,13 @@ type ManagedClusterAgentPoolProfileProperties struct { // The operating system type. The default is Linux. OSType *OSType `json:"osType,omitempty"` - // As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version - // must have the same major version as the control plane. The node pool minor - // version must be within two minor versions of the control plane version. The node pool version cannot be greater than the - // control plane version. For more information see upgrading a node pool - // [https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool]. + // Both patch version and are supported. When is specified, the latest supported patch version is chosen automatically. Updating + // the agent pool with the same once it has been created will not trigger an + // upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster + // to the same Kubernetes version. The node pool version must have the same + // major version as the control plane. The node pool minor version must be within two minor versions of the control plane + // version. The node pool version cannot be greater than the control plane version. + // For more information see upgrading a node pool [https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool]. OrchestratorVersion *string `json:"orchestratorVersion,omitempty"` // If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: @@ -1121,53 +864,6 @@ type ManagedClusterAgentPoolProfileProperties struct { ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type ManagedClusterAgentPoolProfileProperties. -func (m ManagedClusterAgentPoolProfileProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "availabilityZones", m.AvailabilityZones) - populate(objectMap, "capacityReservationGroupID", m.CapacityReservationGroupID) - populate(objectMap, "count", m.Count) - populate(objectMap, "creationData", m.CreationData) - populate(objectMap, "enableAutoScaling", m.EnableAutoScaling) - populate(objectMap, "enableEncryptionAtHost", m.EnableEncryptionAtHost) - populate(objectMap, "enableFIPS", m.EnableFIPS) - populate(objectMap, "enableNodePublicIP", m.EnableNodePublicIP) - populate(objectMap, "enableUltraSSD", m.EnableUltraSSD) - populate(objectMap, "gpuInstanceProfile", m.GpuInstanceProfile) - populate(objectMap, "kubeletConfig", m.KubeletConfig) - populate(objectMap, "kubeletDiskType", m.KubeletDiskType) - populate(objectMap, "linuxOSConfig", m.LinuxOSConfig) - populate(objectMap, "maxCount", m.MaxCount) - populate(objectMap, "maxPods", m.MaxPods) - populate(objectMap, "messageOfTheDay", m.MessageOfTheDay) - populate(objectMap, "minCount", m.MinCount) - populate(objectMap, "mode", m.Mode) - populate(objectMap, "nodeImageVersion", m.NodeImageVersion) - populate(objectMap, "nodeLabels", m.NodeLabels) - populate(objectMap, "nodePublicIPPrefixID", m.NodePublicIPPrefixID) - populate(objectMap, "nodeTaints", m.NodeTaints) - populate(objectMap, "osDiskSizeGB", m.OSDiskSizeGB) - populate(objectMap, "osDiskType", m.OSDiskType) - populate(objectMap, "osSKU", m.OSSKU) - populate(objectMap, "osType", m.OSType) - populate(objectMap, "orchestratorVersion", m.OrchestratorVersion) - populate(objectMap, "podSubnetID", m.PodSubnetID) - populate(objectMap, "powerState", m.PowerState) - populate(objectMap, "provisioningState", m.ProvisioningState) - populate(objectMap, "proximityPlacementGroupID", m.ProximityPlacementGroupID) - populate(objectMap, "scaleDownMode", m.ScaleDownMode) - populate(objectMap, "scaleSetEvictionPolicy", m.ScaleSetEvictionPolicy) - populate(objectMap, "scaleSetPriority", m.ScaleSetPriority) - populate(objectMap, "spotMaxPrice", m.SpotMaxPrice) - populate(objectMap, "tags", m.Tags) - populate(objectMap, "type", m.Type) - populate(objectMap, "upgradeSettings", m.UpgradeSettings) - populate(objectMap, "vmSize", m.VMSize) - populate(objectMap, "vnetSubnetID", m.VnetSubnetID) - populate(objectMap, "workloadRuntime", m.WorkloadRuntime) - return json.Marshal(objectMap) -} - // ManagedClusterAutoUpgradeProfile - Auto upgrade profile for a managed cluster. type ManagedClusterAutoUpgradeProfile struct { // For more information see setting the AKS cluster auto-upgrade channel [https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel]. @@ -1189,16 +885,6 @@ type ManagedClusterHTTPProxyConfig struct { TrustedCa *string `json:"trustedCa,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type ManagedClusterHTTPProxyConfig. -func (m ManagedClusterHTTPProxyConfig) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "httpProxy", m.HTTPProxy) - populate(objectMap, "httpsProxy", m.HTTPSProxy) - populate(objectMap, "noProxy", m.NoProxy) - populate(objectMap, "trustedCa", m.TrustedCa) - return json.Marshal(objectMap) -} - // ManagedClusterIdentity - Identity for the managed cluster. type ManagedClusterIdentity struct { // For more information see use managed identities in AKS [https://docs.microsoft.com/azure/aks/use-managed-identity]. @@ -1214,14 +900,19 @@ type ManagedClusterIdentity struct { TenantID *string `json:"tenantId,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type ManagedClusterIdentity. -func (m ManagedClusterIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "principalId", m.PrincipalID) - populate(objectMap, "tenantId", m.TenantID) - populate(objectMap, "type", m.Type) - populate(objectMap, "userAssignedIdentities", m.UserAssignedIdentities) - return json.Marshal(objectMap) +// ManagedClusterIngressProfile - Ingress profile for the container service cluster. +type ManagedClusterIngressProfile struct { + // Web App Routing settings for the ingress profile. + WebAppRouting *ManagedClusterIngressProfileWebAppRouting `json:"webAppRouting,omitempty"` +} + +// ManagedClusterIngressProfileWebAppRouting - Web App Routing settings for the ingress profile. +type ManagedClusterIngressProfileWebAppRouting struct { + // Resource ID of the DNS Zone to be associated with the web app. Used only when Web App Routing is enabled. + DNSZoneResourceID *string `json:"dnsZoneResourceId,omitempty"` + + // Whether to enable Web App Routing. + Enabled *bool `json:"enabled,omitempty"` } // ManagedClusterListResult - The response from the List Managed Clusters operation. @@ -1233,14 +924,6 @@ type ManagedClusterListResult struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type ManagedClusterListResult. -func (m ManagedClusterListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", m.NextLink) - populate(objectMap, "value", m.Value) - return json.Marshal(objectMap) -} - // ManagedClusterLoadBalancerProfile - Profile of the managed cluster load balancer. type ManagedClusterLoadBalancerProfile struct { // The desired number of allocated SNAT ports per VM. Allowed values are in the range of 0 to 64000 (inclusive). The default @@ -1267,19 +950,6 @@ type ManagedClusterLoadBalancerProfile struct { OutboundIPs *ManagedClusterLoadBalancerProfileOutboundIPs `json:"outboundIPs,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type ManagedClusterLoadBalancerProfile. -func (m ManagedClusterLoadBalancerProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "allocatedOutboundPorts", m.AllocatedOutboundPorts) - populate(objectMap, "effectiveOutboundIPs", m.EffectiveOutboundIPs) - populate(objectMap, "enableMultipleStandardLoadBalancers", m.EnableMultipleStandardLoadBalancers) - populate(objectMap, "idleTimeoutInMinutes", m.IdleTimeoutInMinutes) - populate(objectMap, "managedOutboundIPs", m.ManagedOutboundIPs) - populate(objectMap, "outboundIPPrefixes", m.OutboundIPPrefixes) - populate(objectMap, "outboundIPs", m.OutboundIPs) - return json.Marshal(objectMap) -} - // ManagedClusterLoadBalancerProfileManagedOutboundIPs - Desired managed outbound IPs for the cluster load balancer. type ManagedClusterLoadBalancerProfileManagedOutboundIPs struct { // The desired number of IPv4 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be @@ -1298,26 +968,12 @@ type ManagedClusterLoadBalancerProfileOutboundIPPrefixes struct { PublicIPPrefixes []*ResourceReference `json:"publicIPPrefixes,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type ManagedClusterLoadBalancerProfileOutboundIPPrefixes. -func (m ManagedClusterLoadBalancerProfileOutboundIPPrefixes) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "publicIPPrefixes", m.PublicIPPrefixes) - return json.Marshal(objectMap) -} - // ManagedClusterLoadBalancerProfileOutboundIPs - Desired outbound IP resources for the cluster load balancer. type ManagedClusterLoadBalancerProfileOutboundIPs struct { // A list of public IP resources. PublicIPs []*ResourceReference `json:"publicIPs,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type ManagedClusterLoadBalancerProfileOutboundIPs. -func (m ManagedClusterLoadBalancerProfileOutboundIPs) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "publicIPs", m.PublicIPs) - return json.Marshal(objectMap) -} - // ManagedClusterManagedOutboundIPProfile - Profile of the managed outbound IP resources of the managed cluster. type ManagedClusterManagedOutboundIPProfile struct { // The desired number of outbound IPs created/managed by Azure. Allowed values must be in the range of 1 to 16 (inclusive). @@ -1338,15 +994,6 @@ type ManagedClusterNATGatewayProfile struct { ManagedOutboundIPProfile *ManagedClusterManagedOutboundIPProfile `json:"managedOutboundIPProfile,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type ManagedClusterNATGatewayProfile. -func (m ManagedClusterNATGatewayProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "effectiveOutboundIPs", m.EffectiveOutboundIPs) - populate(objectMap, "idleTimeoutInMinutes", m.IdleTimeoutInMinutes) - populate(objectMap, "managedOutboundIPProfile", m.ManagedOutboundIPProfile) - return json.Marshal(objectMap) -} - // ManagedClusterOIDCIssuerProfile - The OIDC issuer profile of the Managed Cluster. type ManagedClusterOIDCIssuerProfile struct { // Whether the OIDC issuer is enabled. @@ -1390,15 +1037,6 @@ type ManagedClusterPodIdentityException struct { PodLabels map[string]*string `json:"podLabels,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type ManagedClusterPodIdentityException. -func (m ManagedClusterPodIdentityException) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "name", m.Name) - populate(objectMap, "namespace", m.Namespace) - populate(objectMap, "podLabels", m.PodLabels) - return json.Marshal(objectMap) -} - // ManagedClusterPodIdentityProfile - See use AAD pod identity [https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity] // for more details on pod identity integration. type ManagedClusterPodIdentityProfile struct { @@ -1418,16 +1056,6 @@ type ManagedClusterPodIdentityProfile struct { UserAssignedIdentityExceptions []*ManagedClusterPodIdentityException `json:"userAssignedIdentityExceptions,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type ManagedClusterPodIdentityProfile. -func (m ManagedClusterPodIdentityProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "allowNetworkPluginKubenet", m.AllowNetworkPluginKubenet) - populate(objectMap, "enabled", m.Enabled) - populate(objectMap, "userAssignedIdentities", m.UserAssignedIdentities) - populate(objectMap, "userAssignedIdentityExceptions", m.UserAssignedIdentityExceptions) - return json.Marshal(objectMap) -} - // ManagedClusterPodIdentityProvisioningError - An error response from the pod identity provisioning. type ManagedClusterPodIdentityProvisioningError struct { // Details about the error. @@ -1449,16 +1077,6 @@ type ManagedClusterPodIdentityProvisioningErrorBody struct { Target *string `json:"target,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type ManagedClusterPodIdentityProvisioningErrorBody. -func (m ManagedClusterPodIdentityProvisioningErrorBody) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "code", m.Code) - populate(objectMap, "details", m.Details) - populate(objectMap, "message", m.Message) - populate(objectMap, "target", m.Target) - return json.Marshal(objectMap) -} - type ManagedClusterPodIdentityProvisioningInfo struct { // Pod identity assignment error (if any). Error *ManagedClusterPodIdentityProvisioningError `json:"error,omitempty"` @@ -1479,16 +1097,6 @@ type ManagedClusterPoolUpgradeProfile struct { Upgrades []*ManagedClusterPoolUpgradeProfileUpgradesItem `json:"upgrades,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type ManagedClusterPoolUpgradeProfile. -func (m ManagedClusterPoolUpgradeProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "kubernetesVersion", m.KubernetesVersion) - populate(objectMap, "name", m.Name) - populate(objectMap, "osType", m.OSType) - populate(objectMap, "upgrades", m.Upgrades) - return json.Marshal(objectMap) -} - type ManagedClusterPoolUpgradeProfileUpgradesItem struct { // Whether the Kubernetes version is currently in preview. IsPreview *bool `json:"isPreview,omitempty"` @@ -1517,6 +1125,9 @@ type ManagedClusterProperties struct { // The auto upgrade configuration. AutoUpgradeProfile *ManagedClusterAutoUpgradeProfile `json:"autoUpgradeProfile,omitempty"` + // CreationData to be used to specify the source Snapshot ID if the cluster will be created/upgraded using a snapshot. + CreationData *CreationData `json:"creationData,omitempty"` + // This cannot be updated once the Managed Cluster has been created. DNSPrefix *string `json:"dnsPrefix,omitempty"` @@ -1549,6 +1160,9 @@ type ManagedClusterProperties struct { // Identities associated with the cluster. IdentityProfile map[string]*UserAssignedIdentity `json:"identityProfile,omitempty"` + // Ingress profile for the managed cluster. + IngressProfile *ManagedClusterIngressProfile `json:"ingressProfile,omitempty"` + // When you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed sequentially // by major version number. For example, upgrades between 1.14.x -> // 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> 1.16.x is not allowed. See upgrading an AKS cluster [https://docs.microsoft.com/azure/aks/upgrade-cluster] @@ -1610,45 +1224,6 @@ type ManagedClusterProperties struct { ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type ManagedClusterProperties. -func (m ManagedClusterProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "aadProfile", m.AADProfile) - populate(objectMap, "apiServerAccessProfile", m.APIServerAccessProfile) - populate(objectMap, "addonProfiles", m.AddonProfiles) - populate(objectMap, "agentPoolProfiles", m.AgentPoolProfiles) - populate(objectMap, "autoScalerProfile", m.AutoScalerProfile) - populate(objectMap, "autoUpgradeProfile", m.AutoUpgradeProfile) - populate(objectMap, "azurePortalFQDN", m.AzurePortalFQDN) - populate(objectMap, "currentKubernetesVersion", m.CurrentKubernetesVersion) - populate(objectMap, "dnsPrefix", m.DNSPrefix) - populate(objectMap, "disableLocalAccounts", m.DisableLocalAccounts) - populate(objectMap, "diskEncryptionSetID", m.DiskEncryptionSetID) - populate(objectMap, "enableNamespaceResources", m.EnableNamespaceResources) - populate(objectMap, "enablePodSecurityPolicy", m.EnablePodSecurityPolicy) - populate(objectMap, "enableRBAC", m.EnableRBAC) - populate(objectMap, "fqdn", m.Fqdn) - populate(objectMap, "fqdnSubdomain", m.FqdnSubdomain) - populate(objectMap, "httpProxyConfig", m.HTTPProxyConfig) - populate(objectMap, "identityProfile", m.IdentityProfile) - populate(objectMap, "kubernetesVersion", m.KubernetesVersion) - populate(objectMap, "linuxProfile", m.LinuxProfile) - populate(objectMap, "maxAgentPools", m.MaxAgentPools) - populate(objectMap, "networkProfile", m.NetworkProfile) - populate(objectMap, "nodeResourceGroup", m.NodeResourceGroup) - populate(objectMap, "oidcIssuerProfile", m.OidcIssuerProfile) - populate(objectMap, "podIdentityProfile", m.PodIdentityProfile) - populate(objectMap, "powerState", m.PowerState) - populate(objectMap, "privateFQDN", m.PrivateFQDN) - populate(objectMap, "privateLinkResources", m.PrivateLinkResources) - populate(objectMap, "provisioningState", m.ProvisioningState) - populate(objectMap, "publicNetworkAccess", m.PublicNetworkAccess) - populate(objectMap, "securityProfile", m.SecurityProfile) - populate(objectMap, "servicePrincipalProfile", m.ServicePrincipalProfile) - populate(objectMap, "windowsProfile", m.WindowsProfile) - return json.Marshal(objectMap) -} - // ManagedClusterPropertiesAutoScalerProfile - Parameters to be applied to the cluster-autoscaler when enabled type ManagedClusterPropertiesAutoScalerProfile struct { // Valid values are 'true' and 'false' @@ -1708,6 +1283,21 @@ type ManagedClusterPropertiesAutoScalerProfile struct { SkipNodesWithSystemPods *string `json:"skip-nodes-with-system-pods,omitempty"` } +// ManagedClusterPropertiesForSnapshot - managed cluster properties for snapshot, these properties are read only. +type ManagedClusterPropertiesForSnapshot struct { + // Whether the cluster has enabled Kubernetes Role-Based Access Control or not. + EnableRbac *bool `json:"enableRbac,omitempty"` + + // The current kubernetes version. + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + + // The current managed cluster sku. + SKU *ManagedClusterSKU `json:"sku,omitempty"` + + // READ-ONLY; The current network profile. + NetworkProfile *NetworkProfileForSnapshot `json:"networkProfile,omitempty" azure:"ro"` +} + // ManagedClusterSKU - The SKU of a Managed Cluster. type ManagedClusterSKU struct { // The name of a managed cluster SKU. @@ -1721,6 +1311,13 @@ type ManagedClusterSKU struct { type ManagedClusterSecurityProfile struct { // Azure Defender settings for the security profile. AzureDefender *ManagedClusterSecurityProfileAzureDefender `json:"azureDefender,omitempty"` + + // Azure Key Vault key management service [https://kubernetes.io/docs/tasks/administer-cluster/kms-provider/] settings for + // the security profile. + AzureKeyVaultKms *AzureKeyVaultKms `json:"azureKeyVaultKms,omitempty"` + + // Workload Identity [https://azure.github.io/azure-workload-identity/docs/] settings for the security profile. + WorkloadIdentity *ManagedClusterSecurityProfileWorkloadIdentity `json:"workloadIdentity,omitempty"` } // ManagedClusterSecurityProfileAzureDefender - Azure Defender settings for the security profile. @@ -1734,6 +1331,12 @@ type ManagedClusterSecurityProfileAzureDefender struct { LogAnalyticsWorkspaceResourceID *string `json:"logAnalyticsWorkspaceResourceId,omitempty"` } +// ManagedClusterSecurityProfileWorkloadIdentity - Workload Identity settings for the security profile. +type ManagedClusterSecurityProfileWorkloadIdentity struct { + // Whether to enable Workload Identity + Enabled *bool `json:"enabled,omitempty"` +} + // ManagedClusterServicePrincipalProfile - Information about a service principal identity for the cluster to use for manipulating // Azure APIs. type ManagedClusterServicePrincipalProfile struct { @@ -1744,6 +1347,118 @@ type ManagedClusterServicePrincipalProfile struct { Secret *string `json:"secret,omitempty"` } +// ManagedClusterSnapshot - A managed cluster snapshot resource. +type ManagedClusterSnapshot struct { + // REQUIRED; Resource location + Location *string `json:"location,omitempty"` + + // Properties of a managed cluster snapshot. + Properties *ManagedClusterSnapshotProperties `json:"properties,omitempty"` + + // Resource tags + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// ManagedClusterSnapshotListResult - The response from the List Managed Cluster Snapshots operation. +type ManagedClusterSnapshotListResult struct { + // The list of managed cluster snapshots. + Value []*ManagedClusterSnapshot `json:"value,omitempty"` + + // READ-ONLY; The URL to get the next set of managed cluster snapshot results. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// ManagedClusterSnapshotProperties - Properties for a managed cluster snapshot. +type ManagedClusterSnapshotProperties struct { + // CreationData to be used to specify the source resource ID to create this snapshot. + CreationData *CreationData `json:"creationData,omitempty"` + + // The type of a snapshot. The default is NodePool. + SnapshotType *SnapshotType `json:"snapshotType,omitempty"` + + // READ-ONLY; What the properties will be showed when getting managed cluster snapshot. Those properties are read-only. + ManagedClusterPropertiesReadOnly *ManagedClusterPropertiesForSnapshot `json:"managedClusterPropertiesReadOnly,omitempty" azure:"ro"` +} + +// ManagedClusterSnapshotsClientCreateOrUpdateOptions contains the optional parameters for the ManagedClusterSnapshotsClient.CreateOrUpdate +// method. +type ManagedClusterSnapshotsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ManagedClusterSnapshotsClientDeleteOptions contains the optional parameters for the ManagedClusterSnapshotsClient.Delete +// method. +type ManagedClusterSnapshotsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ManagedClusterSnapshotsClientGetOptions contains the optional parameters for the ManagedClusterSnapshotsClient.Get method. +type ManagedClusterSnapshotsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedClusterSnapshotsClientListByResourceGroupOptions contains the optional parameters for the ManagedClusterSnapshotsClient.ListByResourceGroup +// method. +type ManagedClusterSnapshotsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// ManagedClusterSnapshotsClientListOptions contains the optional parameters for the ManagedClusterSnapshotsClient.List method. +type ManagedClusterSnapshotsClientListOptions struct { + // placeholder for future optional parameters +} + +// ManagedClusterSnapshotsClientUpdateTagsOptions contains the optional parameters for the ManagedClusterSnapshotsClient.UpdateTags +// method. +type ManagedClusterSnapshotsClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// ManagedClusterStorageProfile - Storage profile for the container service cluster. +type ManagedClusterStorageProfile struct { + // AzureDisk CSI Driver settings for the storage profile. + DiskCSIDriver *ManagedClusterStorageProfileDiskCSIDriver `json:"diskCSIDriver,omitempty"` + + // AzureFile CSI Driver settings for the storage profile. + FileCSIDriver *ManagedClusterStorageProfileFileCSIDriver `json:"fileCSIDriver,omitempty"` + + // Snapshot Controller settings for the storage profile. + SnapshotController *ManagedClusterStorageProfileSnapshotController `json:"snapshotController,omitempty"` +} + +// ManagedClusterStorageProfileDiskCSIDriver - AzureDisk CSI Driver settings for the storage profile. +type ManagedClusterStorageProfileDiskCSIDriver struct { + // Whether to enable AzureDisk CSI Driver. The default value is true. + Enabled *bool `json:"enabled,omitempty"` + + // The version of AzureDisk CSI Driver. The default value is v1. + Version *string `json:"version,omitempty"` +} + +// ManagedClusterStorageProfileFileCSIDriver - AzureFile CSI Driver settings for the storage profile. +type ManagedClusterStorageProfileFileCSIDriver struct { + // Whether to enable AzureFile CSI Driver. The default value is true. + Enabled *bool `json:"enabled,omitempty"` +} + +// ManagedClusterStorageProfileSnapshotController - Snapshot Controller settings for the storage profile. +type ManagedClusterStorageProfileSnapshotController struct { + // Whether to enable Snapshot Controller. The default value is true. + Enabled *bool `json:"enabled,omitempty"` +} + // ManagedClusterUpgradeProfile - The list of available upgrades for compute pools. type ManagedClusterUpgradeProfile struct { // REQUIRED; The properties of the upgrade profile. @@ -1768,14 +1483,6 @@ type ManagedClusterUpgradeProfileProperties struct { ControlPlaneProfile *ManagedClusterPoolUpgradeProfile `json:"controlPlaneProfile,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type ManagedClusterUpgradeProfileProperties. -func (m ManagedClusterUpgradeProfileProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "agentPoolProfiles", m.AgentPoolProfiles) - populate(objectMap, "controlPlaneProfile", m.ControlPlaneProfile) - return json.Marshal(objectMap) -} - // ManagedClusterWindowsProfile - Profile for Windows VMs in the managed cluster. type ManagedClusterWindowsProfile struct { // REQUIRED; Specifies the name of the administrator account. @@ -1813,52 +1520,70 @@ type ManagedClusterWindowsProfile struct { // ManagedClustersClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedClustersClient.BeginCreateOrUpdate // method. type ManagedClustersClientBeginCreateOrUpdateOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // ManagedClustersClientBeginDeleteOptions contains the optional parameters for the ManagedClustersClient.BeginDelete method. type ManagedClustersClientBeginDeleteOptions struct { - // placeholder for future optional parameters + // ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget + IgnorePodDisruptionBudget *bool + // Resumes the LRO from the provided token. + ResumeToken string } // ManagedClustersClientBeginResetAADProfileOptions contains the optional parameters for the ManagedClustersClient.BeginResetAADProfile // method. type ManagedClustersClientBeginResetAADProfileOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // ManagedClustersClientBeginResetServicePrincipalProfileOptions contains the optional parameters for the ManagedClustersClient.BeginResetServicePrincipalProfile // method. type ManagedClustersClientBeginResetServicePrincipalProfileOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // ManagedClustersClientBeginRotateClusterCertificatesOptions contains the optional parameters for the ManagedClustersClient.BeginRotateClusterCertificates // method. type ManagedClustersClientBeginRotateClusterCertificatesOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedClustersClientBeginRotateServiceAccountSigningKeysOptions contains the optional parameters for the ManagedClustersClient.BeginRotateServiceAccountSigningKeys +// method. +type ManagedClustersClientBeginRotateServiceAccountSigningKeysOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string } // ManagedClustersClientBeginRunCommandOptions contains the optional parameters for the ManagedClustersClient.BeginRunCommand // method. type ManagedClustersClientBeginRunCommandOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // ManagedClustersClientBeginStartOptions contains the optional parameters for the ManagedClustersClient.BeginStart method. type ManagedClustersClientBeginStartOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // ManagedClustersClientBeginStopOptions contains the optional parameters for the ManagedClustersClient.BeginStop method. type ManagedClustersClientBeginStopOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // ManagedClustersClientBeginUpdateTagsOptions contains the optional parameters for the ManagedClustersClient.BeginUpdateTags // method. type ManagedClustersClientBeginUpdateTagsOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // ManagedClustersClientGetAccessProfileOptions contains the optional parameters for the ManagedClustersClient.GetAccessProfile @@ -1913,6 +1638,10 @@ type ManagedClustersClientListClusterMonitoringUserCredentialsOptions struct { // ManagedClustersClientListClusterUserCredentialsOptions contains the optional parameters for the ManagedClustersClient.ListClusterUserCredentials // method. type ManagedClustersClientListClusterUserCredentialsOptions struct { + // Only apply to AAD clusters, specifies the format of returned kubeconfig. Format 'azure' will return azure auth-provider + // kubeconfig; format 'exec' will return exec format kubeconfig, which requires + // kubelogin binary in the path. + Format *Format // server fqdn type for credentials to be returned ServerFqdn *string } @@ -2017,24 +1746,19 @@ type NetworkProfile struct { ServiceCidrs []*string `json:"serviceCidrs,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type NetworkProfile. -func (n NetworkProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dnsServiceIP", n.DNSServiceIP) - populate(objectMap, "dockerBridgeCidr", n.DockerBridgeCidr) - populate(objectMap, "ipFamilies", n.IPFamilies) - populate(objectMap, "loadBalancerProfile", n.LoadBalancerProfile) - populate(objectMap, "loadBalancerSku", n.LoadBalancerSKU) - populate(objectMap, "natGatewayProfile", n.NatGatewayProfile) - populate(objectMap, "networkMode", n.NetworkMode) - populate(objectMap, "networkPlugin", n.NetworkPlugin) - populate(objectMap, "networkPolicy", n.NetworkPolicy) - populate(objectMap, "outboundType", n.OutboundType) - populate(objectMap, "podCidr", n.PodCidr) - populate(objectMap, "podCidrs", n.PodCidrs) - populate(objectMap, "serviceCidr", n.ServiceCidr) - populate(objectMap, "serviceCidrs", n.ServiceCidrs) - return json.Marshal(objectMap) +// NetworkProfileForSnapshot - network profile for managed cluster snapshot, these properties are read only. +type NetworkProfileForSnapshot struct { + // loadBalancerSku for managed cluster snapshot. + LoadBalancerSKU *LoadBalancerSKU `json:"loadBalancerSku,omitempty"` + + // networkMode for managed cluster snapshot. + NetworkMode *NetworkMode `json:"networkMode,omitempty"` + + // networkPlugin for managed cluster snapshot. + NetworkPlugin *NetworkPlugin `json:"networkPlugin,omitempty"` + + // networkPolicy for managed cluster snapshot. + NetworkPolicy *NetworkPolicy `json:"networkPolicy,omitempty"` } // OSOptionProfile - The OS option profile. @@ -2067,26 +1791,12 @@ type OSOptionPropertyList struct { OSOptionPropertyList []*OSOptionProperty `json:"osOptionPropertyList,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type OSOptionPropertyList. -func (o OSOptionPropertyList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "osOptionPropertyList", o.OSOptionPropertyList) - return json.Marshal(objectMap) -} - // OperationListResult - The List Operation response. type OperationListResult struct { // READ-ONLY; The list of operations Value []*OperationValue `json:"value,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type OperationListResult. -func (o OperationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", o.Value) - return json.Marshal(objectMap) -} - // OperationValue - Describes the properties of a Operation value. type OperationValue struct { // Describes the properties of a Operation Value Display. @@ -2128,14 +1838,6 @@ type OutboundEnvironmentEndpoint struct { Endpoints []*EndpointDependency `json:"endpoints,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type OutboundEnvironmentEndpoint. -func (o OutboundEnvironmentEndpoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "category", o.Category) - populate(objectMap, "endpoints", o.Endpoints) - return json.Marshal(objectMap) -} - // OutboundEnvironmentEndpointCollection - Collection of OutboundEnvironmentEndpoint type OutboundEnvironmentEndpointCollection struct { // REQUIRED; Collection of resources. @@ -2145,14 +1847,6 @@ type OutboundEnvironmentEndpointCollection struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type OutboundEnvironmentEndpointCollection. -func (o OutboundEnvironmentEndpointCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", o.NextLink) - populate(objectMap, "value", o.Value) - return json.Marshal(objectMap) -} - // PowerState - Describes the Power State of the cluster type PowerState struct { // Tells whether the cluster is Running or Stopped @@ -2186,13 +1880,6 @@ type PrivateEndpointConnectionListResult struct { Value []*PrivateEndpointConnection `json:"value,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult. -func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", p.Value) - return json.Marshal(objectMap) -} - // PrivateEndpointConnectionProperties - Properties of a private endpoint connection. type PrivateEndpointConnectionProperties struct { // REQUIRED; A collection of information about the state of the connection between service consumer and provider. @@ -2208,7 +1895,8 @@ type PrivateEndpointConnectionProperties struct { // PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete // method. type PrivateEndpointConnectionsClientBeginDeleteOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get @@ -2250,18 +1938,6 @@ type PrivateLinkResource struct { PrivateLinkServiceID *string `json:"privateLinkServiceID,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource. -func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "groupId", p.GroupID) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "privateLinkServiceID", p.PrivateLinkServiceID) - populate(objectMap, "requiredMembers", p.RequiredMembers) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - // PrivateLinkResourcesClientListOptions contains the optional parameters for the PrivateLinkResourcesClient.List method. type PrivateLinkResourcesClientListOptions struct { // placeholder for future optional parameters @@ -2273,13 +1949,6 @@ type PrivateLinkResourcesListResult struct { Value []*PrivateLinkResource `json:"value,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourcesListResult. -func (p PrivateLinkResourcesListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", p.Value) - return json.Marshal(objectMap) -} - // PrivateLinkServiceConnectionState - The state of a private link service connection. type PrivateLinkServiceConnectionState struct { // The private link service connection description. @@ -2295,7 +1964,7 @@ type ResolvePrivateLinkServiceIDClientPOSTOptions struct { // placeholder for future optional parameters } -// Resource - The Resource model definition. +// Resource - Common fields that are returned in the response for all Azure Resource Manager resources type Resource struct { // REQUIRED; Resource location Location *string `json:"location,omitempty"` @@ -2303,25 +1972,17 @@ type Resource struct { // Resource tags Tags map[string]*string `json:"tags,omitempty"` - // READ-ONLY; Resource Id + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` - // READ-ONLY; Resource name + // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` -// MarshalJSON implements the json.Marshaller interface for type Resource. -func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` } // ResourceReference - A reference to an Azure resource. @@ -2357,13 +2018,6 @@ type SSHConfiguration struct { PublicKeys []*SSHPublicKey `json:"publicKeys,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type SSHConfiguration. -func (s SSHConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "publicKeys", s.PublicKeys) - return json.Marshal(objectMap) -} - // SSHPublicKey - Contains information about SSH certificate public key data. type SSHPublicKey struct { // REQUIRED; Certificate public key used to authenticate with VMs through SSH. The certificate must be in PEM format with @@ -2382,32 +2036,19 @@ type Snapshot struct { // Resource tags Tags map[string]*string `json:"tags,omitempty"` - // READ-ONLY; Resource Id + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` - // READ-ONLY; Resource name + // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; The system metadata relating to this snapshot. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` - // READ-ONLY; Resource type + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type Snapshot. -func (s Snapshot) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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) -} - // SnapshotListResult - The response from the List Snapshots operation. type SnapshotListResult struct { // The list of snapshots. @@ -2417,14 +2058,6 @@ type SnapshotListResult struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type SnapshotListResult. -func (s SnapshotListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - // SnapshotProperties - Properties used to configure a node pool snapshot. type SnapshotProperties struct { // CreationData to be used to specify the source agent pool resource ID to create this snapshot. @@ -2584,7 +2217,7 @@ type SysctlConfig struct { // SystemData - Metadata pertaining to creation and last modification of the resource. type SystemData struct { - // The UTC timestamp of resource creation. + // The timestamp of resource creation (UTC). CreatedAt *time.Time `json:"createdAt,omitempty"` // The identity that created the resource. @@ -2593,7 +2226,7 @@ type SystemData struct { // The type of identity that created the resource. CreatedByType *CreatedByType `json:"createdByType,omitempty"` - // The type of identity that last modified the resource. + // The timestamp of resource last modification (UTC) LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"` // The identity that last modified the resource. @@ -2603,66 +2236,12 @@ type SystemData struct { LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type SystemData. -func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) - populate(objectMap, "createdBy", s.CreatedBy) - populate(objectMap, "createdByType", s.CreatedByType) - populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) - populate(objectMap, "lastModifiedBy", s.LastModifiedBy) - populate(objectMap, "lastModifiedByType", s.LastModifiedByType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. -func (s *SystemData) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "createdAt": - err = unpopulateTimeRFC3339(val, &s.CreatedAt) - delete(rawMsg, key) - case "createdBy": - err = unpopulate(val, &s.CreatedBy) - delete(rawMsg, key) - case "createdByType": - err = unpopulate(val, &s.CreatedByType) - delete(rawMsg, key) - case "lastModifiedAt": - err = unpopulateTimeRFC3339(val, &s.LastModifiedAt) - delete(rawMsg, key) - case "lastModifiedBy": - err = unpopulate(val, &s.LastModifiedBy) - delete(rawMsg, key) - case "lastModifiedByType": - err = unpopulate(val, &s.LastModifiedByType) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // TagsObject - Tags object for patch operations. type TagsObject struct { // Resource tags. Tags map[string]*string `json:"tags,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type TagsObject. -func (t TagsObject) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", t.Tags) - return json.Marshal(objectMap) -} - // TimeInWeek - Time in a week. type TimeInWeek struct { // The day of the week. @@ -2674,14 +2253,6 @@ type TimeInWeek struct { HourSlots []*int32 `json:"hourSlots,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type TimeInWeek. -func (t TimeInWeek) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "day", t.Day) - populate(objectMap, "hourSlots", t.HourSlots) - return json.Marshal(objectMap) -} - // TimeSpan - For example, between 2021-05-25T13:00:00Z and 2021-05-25T14:00:00Z. type TimeSpan struct { // The end of a time span @@ -2691,37 +2262,6 @@ type TimeSpan struct { Start *time.Time `json:"start,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type TimeSpan. -func (t TimeSpan) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "end", t.End) - populateTimeRFC3339(objectMap, "start", t.Start) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TimeSpan. -func (t *TimeSpan) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "end": - err = unpopulateTimeRFC3339(val, &t.End) - delete(rawMsg, key) - case "start": - err = unpopulateTimeRFC3339(val, &t.Start) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // UserAssignedIdentity - Details about a user assigned identity. type UserAssignedIdentity struct { // The client ID of the user assigned identity. @@ -2756,30 +2296,3 @@ type WindowsGmsaProfile struct { // Set it to empty if you have configured the DNS server in the vnet which is used to create the managed cluster. RootDomainName *string `json:"rootDomainName,omitempty"` } - -func populate(m map[string]interface{}, k string, v interface{}) { - if v == nil { - return - } else if azcore.IsNullValue(v) { - m[k] = nil - } else if !reflect.ValueOf(v).IsNil() { - m[k] = v - } -} - -func populateByteArray(m map[string]interface{}, k string, b []byte, f runtime.Base64Encoding) { - if azcore.IsNullValue(b) { - m[k] = nil - } else if len(b) == 0 { - return - } else { - m[k] = runtime.EncodeByteArray(b, f) - } -} - -func unpopulate(data json.RawMessage, v interface{}) error { - if data == nil { - return nil - } - return json.Unmarshal(data, v) -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_models_serde.go b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_models_serde.go new file mode 100644 index 000000000000..e90314404183 --- /dev/null +++ b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_models_serde.go @@ -0,0 +1,774 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armcontainerservice + +import ( + "encoding/json" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type AccessProfile. +func (a AccessProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateByteArray(objectMap, "kubeConfig", a.KubeConfig, runtime.Base64StdFormat) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccessProfile. +func (a *AccessProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "kubeConfig": + err = runtime.DecodeByteArray(string(val), &a.KubeConfig, runtime.Base64StdFormat) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AgentPoolAvailableVersionsProperties. +func (a AgentPoolAvailableVersionsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "agentPoolVersions", a.AgentPoolVersions) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type AgentPoolListResult. +func (a AgentPoolListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type AgentPoolUpgradeProfileProperties. +func (a AgentPoolUpgradeProfileProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "kubernetesVersion", a.KubernetesVersion) + populate(objectMap, "latestNodeImageVersion", a.LatestNodeImageVersion) + populate(objectMap, "osType", a.OSType) + populate(objectMap, "upgrades", a.Upgrades) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type CloudErrorBody. +func (c CloudErrorBody) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", c.Code) + populate(objectMap, "details", c.Details) + populate(objectMap, "message", c.Message) + populate(objectMap, "target", c.Target) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type CommandResultProperties. +func (c CommandResultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "exitCode", c.ExitCode) + populateTimeRFC3339(objectMap, "finishedAt", c.FinishedAt) + populate(objectMap, "logs", c.Logs) + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "reason", c.Reason) + populateTimeRFC3339(objectMap, "startedAt", c.StartedAt) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CommandResultProperties. +func (c *CommandResultProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "exitCode": + err = unpopulate(val, &c.ExitCode) + delete(rawMsg, key) + case "finishedAt": + err = unpopulateTimeRFC3339(val, &c.FinishedAt) + delete(rawMsg, key) + case "logs": + err = unpopulate(val, &c.Logs) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, &c.ProvisioningState) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, &c.Reason) + delete(rawMsg, key) + case "startedAt": + err = unpopulateTimeRFC3339(val, &c.StartedAt) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CredentialResult. +func (c CredentialResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", c.Name) + populateByteArray(objectMap, "value", c.Value, runtime.Base64StdFormat) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CredentialResult. +func (c *CredentialResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, &c.Name) + delete(rawMsg, key) + case "value": + err = runtime.DecodeByteArray(string(val), &c.Value, runtime.Base64StdFormat) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CredentialResults. +func (c CredentialResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "kubeconfigs", c.Kubeconfigs) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type EndpointDependency. +func (e EndpointDependency) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "domainName", e.DomainName) + populate(objectMap, "endpointDetails", e.EndpointDetails) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type KubeletConfig. +func (k KubeletConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "allowedUnsafeSysctls", k.AllowedUnsafeSysctls) + populate(objectMap, "cpuCfsQuota", k.CPUCfsQuota) + populate(objectMap, "cpuCfsQuotaPeriod", k.CPUCfsQuotaPeriod) + populate(objectMap, "cpuManagerPolicy", k.CPUManagerPolicy) + populate(objectMap, "containerLogMaxFiles", k.ContainerLogMaxFiles) + populate(objectMap, "containerLogMaxSizeMB", k.ContainerLogMaxSizeMB) + populate(objectMap, "failSwapOn", k.FailSwapOn) + populate(objectMap, "imageGcHighThreshold", k.ImageGcHighThreshold) + populate(objectMap, "imageGcLowThreshold", k.ImageGcLowThreshold) + populate(objectMap, "podMaxPids", k.PodMaxPids) + populate(objectMap, "topologyManagerPolicy", k.TopologyManagerPolicy) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type MaintenanceConfigurationListResult. +func (m MaintenanceConfigurationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type MaintenanceConfigurationProperties. +func (m MaintenanceConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "notAllowedTime", m.NotAllowedTime) + populate(objectMap, "timeInWeek", m.TimeInWeek) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedCluster. +func (m ManagedCluster) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "extendedLocation", m.ExtendedLocation) + populate(objectMap, "id", m.ID) + populate(objectMap, "identity", m.Identity) + populate(objectMap, "location", m.Location) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "sku", m.SKU) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "tags", m.Tags) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterAADProfile. +func (m ManagedClusterAADProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "adminGroupObjectIDs", m.AdminGroupObjectIDs) + populate(objectMap, "clientAppID", m.ClientAppID) + populate(objectMap, "enableAzureRBAC", m.EnableAzureRBAC) + populate(objectMap, "managed", m.Managed) + populate(objectMap, "serverAppID", m.ServerAppID) + populate(objectMap, "serverAppSecret", m.ServerAppSecret) + populate(objectMap, "tenantID", m.TenantID) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterAPIServerAccessProfile. +func (m ManagedClusterAPIServerAccessProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "authorizedIPRanges", m.AuthorizedIPRanges) + populate(objectMap, "disableRunCommand", m.DisableRunCommand) + populate(objectMap, "enablePrivateCluster", m.EnablePrivateCluster) + populate(objectMap, "enablePrivateClusterPublicFQDN", m.EnablePrivateClusterPublicFQDN) + populate(objectMap, "privateDNSZone", m.PrivateDNSZone) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterAccessProfile. +func (m ManagedClusterAccessProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + populate(objectMap, "location", m.Location) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "tags", m.Tags) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterAddonProfile. +func (m ManagedClusterAddonProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "config", m.Config) + populate(objectMap, "enabled", m.Enabled) + populate(objectMap, "identity", m.Identity) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterAgentPoolProfile. +func (m ManagedClusterAgentPoolProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "availabilityZones", m.AvailabilityZones) + populate(objectMap, "capacityReservationGroupID", m.CapacityReservationGroupID) + populate(objectMap, "count", m.Count) + populate(objectMap, "creationData", m.CreationData) + populate(objectMap, "currentOrchestratorVersion", m.CurrentOrchestratorVersion) + populate(objectMap, "enableAutoScaling", m.EnableAutoScaling) + populate(objectMap, "enableEncryptionAtHost", m.EnableEncryptionAtHost) + populate(objectMap, "enableFIPS", m.EnableFIPS) + populate(objectMap, "enableNodePublicIP", m.EnableNodePublicIP) + populate(objectMap, "enableUltraSSD", m.EnableUltraSSD) + populate(objectMap, "gpuInstanceProfile", m.GpuInstanceProfile) + populate(objectMap, "hostGroupID", m.HostGroupID) + populate(objectMap, "kubeletConfig", m.KubeletConfig) + populate(objectMap, "kubeletDiskType", m.KubeletDiskType) + populate(objectMap, "linuxOSConfig", m.LinuxOSConfig) + populate(objectMap, "maxCount", m.MaxCount) + populate(objectMap, "maxPods", m.MaxPods) + populate(objectMap, "messageOfTheDay", m.MessageOfTheDay) + populate(objectMap, "minCount", m.MinCount) + populate(objectMap, "mode", m.Mode) + populate(objectMap, "name", m.Name) + populate(objectMap, "nodeImageVersion", m.NodeImageVersion) + populate(objectMap, "nodeLabels", m.NodeLabels) + populate(objectMap, "nodePublicIPPrefixID", m.NodePublicIPPrefixID) + populate(objectMap, "nodeTaints", m.NodeTaints) + populate(objectMap, "osDiskSizeGB", m.OSDiskSizeGB) + populate(objectMap, "osDiskType", m.OSDiskType) + populate(objectMap, "osSKU", m.OSSKU) + populate(objectMap, "osType", m.OSType) + populate(objectMap, "orchestratorVersion", m.OrchestratorVersion) + populate(objectMap, "podSubnetID", m.PodSubnetID) + populate(objectMap, "powerState", m.PowerState) + populate(objectMap, "provisioningState", m.ProvisioningState) + populate(objectMap, "proximityPlacementGroupID", m.ProximityPlacementGroupID) + populate(objectMap, "scaleDownMode", m.ScaleDownMode) + populate(objectMap, "scaleSetEvictionPolicy", m.ScaleSetEvictionPolicy) + populate(objectMap, "scaleSetPriority", m.ScaleSetPriority) + populate(objectMap, "spotMaxPrice", m.SpotMaxPrice) + populate(objectMap, "tags", m.Tags) + populate(objectMap, "type", m.Type) + populate(objectMap, "upgradeSettings", m.UpgradeSettings) + populate(objectMap, "vmSize", m.VMSize) + populate(objectMap, "vnetSubnetID", m.VnetSubnetID) + populate(objectMap, "workloadRuntime", m.WorkloadRuntime) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterAgentPoolProfileProperties. +func (m ManagedClusterAgentPoolProfileProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "availabilityZones", m.AvailabilityZones) + populate(objectMap, "capacityReservationGroupID", m.CapacityReservationGroupID) + populate(objectMap, "count", m.Count) + populate(objectMap, "creationData", m.CreationData) + populate(objectMap, "currentOrchestratorVersion", m.CurrentOrchestratorVersion) + populate(objectMap, "enableAutoScaling", m.EnableAutoScaling) + populate(objectMap, "enableEncryptionAtHost", m.EnableEncryptionAtHost) + populate(objectMap, "enableFIPS", m.EnableFIPS) + populate(objectMap, "enableNodePublicIP", m.EnableNodePublicIP) + populate(objectMap, "enableUltraSSD", m.EnableUltraSSD) + populate(objectMap, "gpuInstanceProfile", m.GpuInstanceProfile) + populate(objectMap, "hostGroupID", m.HostGroupID) + populate(objectMap, "kubeletConfig", m.KubeletConfig) + populate(objectMap, "kubeletDiskType", m.KubeletDiskType) + populate(objectMap, "linuxOSConfig", m.LinuxOSConfig) + populate(objectMap, "maxCount", m.MaxCount) + populate(objectMap, "maxPods", m.MaxPods) + populate(objectMap, "messageOfTheDay", m.MessageOfTheDay) + populate(objectMap, "minCount", m.MinCount) + populate(objectMap, "mode", m.Mode) + populate(objectMap, "nodeImageVersion", m.NodeImageVersion) + populate(objectMap, "nodeLabels", m.NodeLabels) + populate(objectMap, "nodePublicIPPrefixID", m.NodePublicIPPrefixID) + populate(objectMap, "nodeTaints", m.NodeTaints) + populate(objectMap, "osDiskSizeGB", m.OSDiskSizeGB) + populate(objectMap, "osDiskType", m.OSDiskType) + populate(objectMap, "osSKU", m.OSSKU) + populate(objectMap, "osType", m.OSType) + populate(objectMap, "orchestratorVersion", m.OrchestratorVersion) + populate(objectMap, "podSubnetID", m.PodSubnetID) + populate(objectMap, "powerState", m.PowerState) + populate(objectMap, "provisioningState", m.ProvisioningState) + populate(objectMap, "proximityPlacementGroupID", m.ProximityPlacementGroupID) + populate(objectMap, "scaleDownMode", m.ScaleDownMode) + populate(objectMap, "scaleSetEvictionPolicy", m.ScaleSetEvictionPolicy) + populate(objectMap, "scaleSetPriority", m.ScaleSetPriority) + populate(objectMap, "spotMaxPrice", m.SpotMaxPrice) + populate(objectMap, "tags", m.Tags) + populate(objectMap, "type", m.Type) + populate(objectMap, "upgradeSettings", m.UpgradeSettings) + populate(objectMap, "vmSize", m.VMSize) + populate(objectMap, "vnetSubnetID", m.VnetSubnetID) + populate(objectMap, "workloadRuntime", m.WorkloadRuntime) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterHTTPProxyConfig. +func (m ManagedClusterHTTPProxyConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "httpProxy", m.HTTPProxy) + populate(objectMap, "httpsProxy", m.HTTPSProxy) + populate(objectMap, "noProxy", m.NoProxy) + populate(objectMap, "trustedCa", m.TrustedCa) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterIdentity. +func (m ManagedClusterIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "principalId", m.PrincipalID) + populate(objectMap, "tenantId", m.TenantID) + populate(objectMap, "type", m.Type) + populate(objectMap, "userAssignedIdentities", m.UserAssignedIdentities) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterListResult. +func (m ManagedClusterListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterLoadBalancerProfile. +func (m ManagedClusterLoadBalancerProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "allocatedOutboundPorts", m.AllocatedOutboundPorts) + populate(objectMap, "effectiveOutboundIPs", m.EffectiveOutboundIPs) + populate(objectMap, "enableMultipleStandardLoadBalancers", m.EnableMultipleStandardLoadBalancers) + populate(objectMap, "idleTimeoutInMinutes", m.IdleTimeoutInMinutes) + populate(objectMap, "managedOutboundIPs", m.ManagedOutboundIPs) + populate(objectMap, "outboundIPPrefixes", m.OutboundIPPrefixes) + populate(objectMap, "outboundIPs", m.OutboundIPs) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterLoadBalancerProfileOutboundIPPrefixes. +func (m ManagedClusterLoadBalancerProfileOutboundIPPrefixes) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "publicIPPrefixes", m.PublicIPPrefixes) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterLoadBalancerProfileOutboundIPs. +func (m ManagedClusterLoadBalancerProfileOutboundIPs) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "publicIPs", m.PublicIPs) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterNATGatewayProfile. +func (m ManagedClusterNATGatewayProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "effectiveOutboundIPs", m.EffectiveOutboundIPs) + populate(objectMap, "idleTimeoutInMinutes", m.IdleTimeoutInMinutes) + populate(objectMap, "managedOutboundIPProfile", m.ManagedOutboundIPProfile) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterPodIdentityException. +func (m ManagedClusterPodIdentityException) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", m.Name) + populate(objectMap, "namespace", m.Namespace) + populate(objectMap, "podLabels", m.PodLabels) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterPodIdentityProfile. +func (m ManagedClusterPodIdentityProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "allowNetworkPluginKubenet", m.AllowNetworkPluginKubenet) + populate(objectMap, "enabled", m.Enabled) + populate(objectMap, "userAssignedIdentities", m.UserAssignedIdentities) + populate(objectMap, "userAssignedIdentityExceptions", m.UserAssignedIdentityExceptions) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterPodIdentityProvisioningErrorBody. +func (m ManagedClusterPodIdentityProvisioningErrorBody) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", m.Code) + populate(objectMap, "details", m.Details) + populate(objectMap, "message", m.Message) + populate(objectMap, "target", m.Target) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterPoolUpgradeProfile. +func (m ManagedClusterPoolUpgradeProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "kubernetesVersion", m.KubernetesVersion) + populate(objectMap, "name", m.Name) + populate(objectMap, "osType", m.OSType) + populate(objectMap, "upgrades", m.Upgrades) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterProperties. +func (m ManagedClusterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "aadProfile", m.AADProfile) + populate(objectMap, "apiServerAccessProfile", m.APIServerAccessProfile) + populate(objectMap, "addonProfiles", m.AddonProfiles) + populate(objectMap, "agentPoolProfiles", m.AgentPoolProfiles) + populate(objectMap, "autoScalerProfile", m.AutoScalerProfile) + populate(objectMap, "autoUpgradeProfile", m.AutoUpgradeProfile) + populate(objectMap, "azurePortalFQDN", m.AzurePortalFQDN) + populate(objectMap, "creationData", m.CreationData) + populate(objectMap, "currentKubernetesVersion", m.CurrentKubernetesVersion) + populate(objectMap, "dnsPrefix", m.DNSPrefix) + populate(objectMap, "disableLocalAccounts", m.DisableLocalAccounts) + populate(objectMap, "diskEncryptionSetID", m.DiskEncryptionSetID) + populate(objectMap, "enableNamespaceResources", m.EnableNamespaceResources) + populate(objectMap, "enablePodSecurityPolicy", m.EnablePodSecurityPolicy) + populate(objectMap, "enableRBAC", m.EnableRBAC) + populate(objectMap, "fqdn", m.Fqdn) + populate(objectMap, "fqdnSubdomain", m.FqdnSubdomain) + populate(objectMap, "httpProxyConfig", m.HTTPProxyConfig) + populate(objectMap, "identityProfile", m.IdentityProfile) + populate(objectMap, "ingressProfile", m.IngressProfile) + populate(objectMap, "kubernetesVersion", m.KubernetesVersion) + populate(objectMap, "linuxProfile", m.LinuxProfile) + populate(objectMap, "maxAgentPools", m.MaxAgentPools) + populate(objectMap, "networkProfile", m.NetworkProfile) + populate(objectMap, "nodeResourceGroup", m.NodeResourceGroup) + populate(objectMap, "oidcIssuerProfile", m.OidcIssuerProfile) + populate(objectMap, "podIdentityProfile", m.PodIdentityProfile) + populate(objectMap, "powerState", m.PowerState) + populate(objectMap, "privateFQDN", m.PrivateFQDN) + populate(objectMap, "privateLinkResources", m.PrivateLinkResources) + populate(objectMap, "provisioningState", m.ProvisioningState) + populate(objectMap, "publicNetworkAccess", m.PublicNetworkAccess) + populate(objectMap, "securityProfile", m.SecurityProfile) + populate(objectMap, "servicePrincipalProfile", m.ServicePrincipalProfile) + populate(objectMap, "windowsProfile", m.WindowsProfile) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterSnapshot. +func (m ManagedClusterSnapshot) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + populate(objectMap, "location", m.Location) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "tags", m.Tags) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterSnapshotListResult. +func (m ManagedClusterSnapshotListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterUpgradeProfileProperties. +func (m ManagedClusterUpgradeProfileProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "agentPoolProfiles", m.AgentPoolProfiles) + populate(objectMap, "controlPlaneProfile", m.ControlPlaneProfile) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkProfile. +func (n NetworkProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dnsServiceIP", n.DNSServiceIP) + populate(objectMap, "dockerBridgeCidr", n.DockerBridgeCidr) + populate(objectMap, "ipFamilies", n.IPFamilies) + populate(objectMap, "loadBalancerProfile", n.LoadBalancerProfile) + populate(objectMap, "loadBalancerSku", n.LoadBalancerSKU) + populate(objectMap, "natGatewayProfile", n.NatGatewayProfile) + populate(objectMap, "networkMode", n.NetworkMode) + populate(objectMap, "networkPlugin", n.NetworkPlugin) + populate(objectMap, "networkPolicy", n.NetworkPolicy) + populate(objectMap, "outboundType", n.OutboundType) + populate(objectMap, "podCidr", n.PodCidr) + populate(objectMap, "podCidrs", n.PodCidrs) + populate(objectMap, "serviceCidr", n.ServiceCidr) + populate(objectMap, "serviceCidrs", n.ServiceCidrs) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type OSOptionPropertyList. +func (o OSOptionPropertyList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "osOptionPropertyList", o.OSOptionPropertyList) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type OperationListResult. +func (o OperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type OutboundEnvironmentEndpoint. +func (o OutboundEnvironmentEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "category", o.Category) + populate(objectMap, "endpoints", o.Endpoints) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type OutboundEnvironmentEndpointCollection. +func (o OutboundEnvironmentEndpointCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult. +func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource. +func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "groupId", p.GroupID) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "privateLinkServiceID", p.PrivateLinkServiceID) + populate(objectMap, "requiredMembers", p.RequiredMembers) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourcesListResult. +func (p PrivateLinkResourcesListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "systemData", r.SystemData) + populate(objectMap, "tags", r.Tags) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type SSHConfiguration. +func (s SSHConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "publicKeys", s.PublicKeys) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type Snapshot. +func (s Snapshot) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + 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) +} + +// MarshalJSON implements the json.Marshaller interface for type SnapshotListResult. +func (s SnapshotListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populate(objectMap, "lastModifiedBy", s.LastModifiedBy) + populate(objectMap, "lastModifiedByType", s.LastModifiedByType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. +func (s *SystemData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateTimeRFC3339(val, &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateTimeRFC3339(val, &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TagsObject. +func (t TagsObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", t.Tags) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type TimeInWeek. +func (t TimeInWeek) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "day", t.Day) + populate(objectMap, "hourSlots", t.HourSlots) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type TimeSpan. +func (t TimeSpan) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "end", t.End) + populateTimeRFC3339(objectMap, "start", t.Start) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TimeSpan. +func (t *TimeSpan) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "end": + err = unpopulateTimeRFC3339(val, &t.End) + delete(rawMsg, key) + case "start": + err = unpopulateTimeRFC3339(val, &t.Start) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +func populate(m map[string]interface{}, k string, v interface{}) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else if !reflect.ValueOf(v).IsNil() { + m[k] = v + } +} + +func populateByteArray(m map[string]interface{}, k string, b []byte, f runtime.Base64Encoding) { + if azcore.IsNullValue(b) { + m[k] = nil + } else if len(b) == 0 { + return + } else { + m[k] = runtime.EncodeByteArray(b, f) + } +} + +func unpopulate(data json.RawMessage, v interface{}) error { + if data == nil { + return nil + } + return json.Unmarshal(data, v) +} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_operations_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_operations_client.go index b93eb0f60e39..e515ed6d765e 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_operations_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_operations_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -13,6 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -28,37 +29,48 @@ type OperationsClient struct { // NewOperationsClient creates a new instance of OperationsClient with the specified values. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) *OperationsClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &OperationsClient{ - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // List - Gets a list of operations. // If the operation fails it returns an *azcore.ResponseError type. // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. -func (client *OperationsClient) List(ctx context.Context, options *OperationsClientListOptions) (OperationsClientListResponse, error) { - req, err := client.listCreateRequest(ctx, options) - if err != nil { - return OperationsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return OperationsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return OperationsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) +func (client *OperationsClient) List(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[OperationsClientListResponse]{ + More: func(page OperationsClientListResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *OperationsClientListResponse) (OperationsClientListResponse, error) { + req, err := client.listCreateRequest(ctx, options) + if err != nil { + return OperationsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return OperationsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return OperationsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) } // listCreateRequest creates the List request. @@ -69,7 +81,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -77,7 +89,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * // listHandleResponse handles the List response. func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsClientListResponse, error) { - result := OperationsClientListResponse{RawResponse: resp} + result := OperationsClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.OperationListResult); err != nil { return OperationsClientListResponse{}, err } diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_pagers.go b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_pagers.go deleted file mode 100644 index 5133bffc19ed..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_pagers.go +++ /dev/null @@ -1,395 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcontainerservice - -import ( - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "reflect" -) - -// AgentPoolsClientListPager provides operations for iterating over paged responses. -type AgentPoolsClientListPager struct { - client *AgentPoolsClient - current AgentPoolsClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, AgentPoolsClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *AgentPoolsClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *AgentPoolsClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.AgentPoolListResult.NextLink == nil || len(*p.current.AgentPoolListResult.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current AgentPoolsClientListResponse page. -func (p *AgentPoolsClientListPager) PageResponse() AgentPoolsClientListResponse { - return p.current -} - -// MaintenanceConfigurationsClientListByManagedClusterPager provides operations for iterating over paged responses. -type MaintenanceConfigurationsClientListByManagedClusterPager struct { - client *MaintenanceConfigurationsClient - current MaintenanceConfigurationsClientListByManagedClusterResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, MaintenanceConfigurationsClientListByManagedClusterResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *MaintenanceConfigurationsClientListByManagedClusterPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *MaintenanceConfigurationsClientListByManagedClusterPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.MaintenanceConfigurationListResult.NextLink == nil || len(*p.current.MaintenanceConfigurationListResult.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listByManagedClusterHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current MaintenanceConfigurationsClientListByManagedClusterResponse page. -func (p *MaintenanceConfigurationsClientListByManagedClusterPager) PageResponse() MaintenanceConfigurationsClientListByManagedClusterResponse { - return p.current -} - -// ManagedClustersClientListByResourceGroupPager provides operations for iterating over paged responses. -type ManagedClustersClientListByResourceGroupPager struct { - client *ManagedClustersClient - current ManagedClustersClientListByResourceGroupResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, ManagedClustersClientListByResourceGroupResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *ManagedClustersClientListByResourceGroupPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *ManagedClustersClientListByResourceGroupPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.ManagedClusterListResult.NextLink == nil || len(*p.current.ManagedClusterListResult.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listByResourceGroupHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current ManagedClustersClientListByResourceGroupResponse page. -func (p *ManagedClustersClientListByResourceGroupPager) PageResponse() ManagedClustersClientListByResourceGroupResponse { - return p.current -} - -// ManagedClustersClientListOutboundNetworkDependenciesEndpointsPager provides operations for iterating over paged responses. -type ManagedClustersClientListOutboundNetworkDependenciesEndpointsPager struct { - client *ManagedClustersClient - current ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *ManagedClustersClientListOutboundNetworkDependenciesEndpointsPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *ManagedClustersClientListOutboundNetworkDependenciesEndpointsPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.OutboundEnvironmentEndpointCollection.NextLink == nil || len(*p.current.OutboundEnvironmentEndpointCollection.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listOutboundNetworkDependenciesEndpointsHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse page. -func (p *ManagedClustersClientListOutboundNetworkDependenciesEndpointsPager) PageResponse() ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse { - return p.current -} - -// ManagedClustersClientListPager provides operations for iterating over paged responses. -type ManagedClustersClientListPager struct { - client *ManagedClustersClient - current ManagedClustersClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, ManagedClustersClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *ManagedClustersClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *ManagedClustersClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.ManagedClusterListResult.NextLink == nil || len(*p.current.ManagedClusterListResult.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current ManagedClustersClientListResponse page. -func (p *ManagedClustersClientListPager) PageResponse() ManagedClustersClientListResponse { - return p.current -} - -// SnapshotsClientListByResourceGroupPager provides operations for iterating over paged responses. -type SnapshotsClientListByResourceGroupPager struct { - client *SnapshotsClient - current SnapshotsClientListByResourceGroupResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, SnapshotsClientListByResourceGroupResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *SnapshotsClientListByResourceGroupPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *SnapshotsClientListByResourceGroupPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.SnapshotListResult.NextLink == nil || len(*p.current.SnapshotListResult.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listByResourceGroupHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current SnapshotsClientListByResourceGroupResponse page. -func (p *SnapshotsClientListByResourceGroupPager) PageResponse() SnapshotsClientListByResourceGroupResponse { - return p.current -} - -// SnapshotsClientListPager provides operations for iterating over paged responses. -type SnapshotsClientListPager struct { - client *SnapshotsClient - current SnapshotsClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, SnapshotsClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *SnapshotsClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *SnapshotsClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.SnapshotListResult.NextLink == nil || len(*p.current.SnapshotListResult.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current SnapshotsClientListResponse page. -func (p *SnapshotsClientListPager) PageResponse() SnapshotsClientListResponse { - return p.current -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_pollers.go b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_pollers.go deleted file mode 100644 index a9ef481860bc..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_pollers.go +++ /dev/null @@ -1,574 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcontainerservice - -import ( - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "net/http" -) - -// AgentPoolsClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state. -type AgentPoolsClientCreateOrUpdatePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *AgentPoolsClientCreateOrUpdatePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *AgentPoolsClientCreateOrUpdatePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final AgentPoolsClientCreateOrUpdateResponse will be returned. -func (p *AgentPoolsClientCreateOrUpdatePoller) FinalResponse(ctx context.Context) (AgentPoolsClientCreateOrUpdateResponse, error) { - respType := AgentPoolsClientCreateOrUpdateResponse{} - resp, err := p.pt.FinalResponse(ctx, &respType.AgentPool) - if err != nil { - return AgentPoolsClientCreateOrUpdateResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *AgentPoolsClientCreateOrUpdatePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// AgentPoolsClientDeletePoller provides polling facilities until the operation reaches a terminal state. -type AgentPoolsClientDeletePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *AgentPoolsClientDeletePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *AgentPoolsClientDeletePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final AgentPoolsClientDeleteResponse will be returned. -func (p *AgentPoolsClientDeletePoller) FinalResponse(ctx context.Context) (AgentPoolsClientDeleteResponse, error) { - respType := AgentPoolsClientDeleteResponse{} - resp, err := p.pt.FinalResponse(ctx, nil) - if err != nil { - return AgentPoolsClientDeleteResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *AgentPoolsClientDeletePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// AgentPoolsClientUpgradeNodeImageVersionPoller provides polling facilities until the operation reaches a terminal state. -type AgentPoolsClientUpgradeNodeImageVersionPoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *AgentPoolsClientUpgradeNodeImageVersionPoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *AgentPoolsClientUpgradeNodeImageVersionPoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final AgentPoolsClientUpgradeNodeImageVersionResponse will be returned. -func (p *AgentPoolsClientUpgradeNodeImageVersionPoller) FinalResponse(ctx context.Context) (AgentPoolsClientUpgradeNodeImageVersionResponse, error) { - respType := AgentPoolsClientUpgradeNodeImageVersionResponse{} - resp, err := p.pt.FinalResponse(ctx, &respType.AgentPool) - if err != nil { - return AgentPoolsClientUpgradeNodeImageVersionResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *AgentPoolsClientUpgradeNodeImageVersionPoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// ManagedClustersClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state. -type ManagedClustersClientCreateOrUpdatePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *ManagedClustersClientCreateOrUpdatePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *ManagedClustersClientCreateOrUpdatePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final ManagedClustersClientCreateOrUpdateResponse will be returned. -func (p *ManagedClustersClientCreateOrUpdatePoller) FinalResponse(ctx context.Context) (ManagedClustersClientCreateOrUpdateResponse, error) { - respType := ManagedClustersClientCreateOrUpdateResponse{} - resp, err := p.pt.FinalResponse(ctx, &respType.ManagedCluster) - if err != nil { - return ManagedClustersClientCreateOrUpdateResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *ManagedClustersClientCreateOrUpdatePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// ManagedClustersClientDeletePoller provides polling facilities until the operation reaches a terminal state. -type ManagedClustersClientDeletePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *ManagedClustersClientDeletePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *ManagedClustersClientDeletePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final ManagedClustersClientDeleteResponse will be returned. -func (p *ManagedClustersClientDeletePoller) FinalResponse(ctx context.Context) (ManagedClustersClientDeleteResponse, error) { - respType := ManagedClustersClientDeleteResponse{} - resp, err := p.pt.FinalResponse(ctx, nil) - if err != nil { - return ManagedClustersClientDeleteResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *ManagedClustersClientDeletePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// ManagedClustersClientResetAADProfilePoller provides polling facilities until the operation reaches a terminal state. -type ManagedClustersClientResetAADProfilePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *ManagedClustersClientResetAADProfilePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *ManagedClustersClientResetAADProfilePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final ManagedClustersClientResetAADProfileResponse will be returned. -func (p *ManagedClustersClientResetAADProfilePoller) FinalResponse(ctx context.Context) (ManagedClustersClientResetAADProfileResponse, error) { - respType := ManagedClustersClientResetAADProfileResponse{} - resp, err := p.pt.FinalResponse(ctx, nil) - if err != nil { - return ManagedClustersClientResetAADProfileResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *ManagedClustersClientResetAADProfilePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// ManagedClustersClientResetServicePrincipalProfilePoller provides polling facilities until the operation reaches a terminal state. -type ManagedClustersClientResetServicePrincipalProfilePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *ManagedClustersClientResetServicePrincipalProfilePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *ManagedClustersClientResetServicePrincipalProfilePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final ManagedClustersClientResetServicePrincipalProfileResponse will be returned. -func (p *ManagedClustersClientResetServicePrincipalProfilePoller) FinalResponse(ctx context.Context) (ManagedClustersClientResetServicePrincipalProfileResponse, error) { - respType := ManagedClustersClientResetServicePrincipalProfileResponse{} - resp, err := p.pt.FinalResponse(ctx, nil) - if err != nil { - return ManagedClustersClientResetServicePrincipalProfileResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *ManagedClustersClientResetServicePrincipalProfilePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// ManagedClustersClientRotateClusterCertificatesPoller provides polling facilities until the operation reaches a terminal state. -type ManagedClustersClientRotateClusterCertificatesPoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *ManagedClustersClientRotateClusterCertificatesPoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *ManagedClustersClientRotateClusterCertificatesPoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final ManagedClustersClientRotateClusterCertificatesResponse will be returned. -func (p *ManagedClustersClientRotateClusterCertificatesPoller) FinalResponse(ctx context.Context) (ManagedClustersClientRotateClusterCertificatesResponse, error) { - respType := ManagedClustersClientRotateClusterCertificatesResponse{} - resp, err := p.pt.FinalResponse(ctx, nil) - if err != nil { - return ManagedClustersClientRotateClusterCertificatesResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *ManagedClustersClientRotateClusterCertificatesPoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// ManagedClustersClientRunCommandPoller provides polling facilities until the operation reaches a terminal state. -type ManagedClustersClientRunCommandPoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *ManagedClustersClientRunCommandPoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *ManagedClustersClientRunCommandPoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final ManagedClustersClientRunCommandResponse will be returned. -func (p *ManagedClustersClientRunCommandPoller) FinalResponse(ctx context.Context) (ManagedClustersClientRunCommandResponse, error) { - respType := ManagedClustersClientRunCommandResponse{} - resp, err := p.pt.FinalResponse(ctx, &respType.RunCommandResult) - if err != nil { - return ManagedClustersClientRunCommandResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *ManagedClustersClientRunCommandPoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// ManagedClustersClientStartPoller provides polling facilities until the operation reaches a terminal state. -type ManagedClustersClientStartPoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *ManagedClustersClientStartPoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *ManagedClustersClientStartPoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final ManagedClustersClientStartResponse will be returned. -func (p *ManagedClustersClientStartPoller) FinalResponse(ctx context.Context) (ManagedClustersClientStartResponse, error) { - respType := ManagedClustersClientStartResponse{} - resp, err := p.pt.FinalResponse(ctx, nil) - if err != nil { - return ManagedClustersClientStartResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *ManagedClustersClientStartPoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// ManagedClustersClientStopPoller provides polling facilities until the operation reaches a terminal state. -type ManagedClustersClientStopPoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *ManagedClustersClientStopPoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *ManagedClustersClientStopPoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final ManagedClustersClientStopResponse will be returned. -func (p *ManagedClustersClientStopPoller) FinalResponse(ctx context.Context) (ManagedClustersClientStopResponse, error) { - respType := ManagedClustersClientStopResponse{} - resp, err := p.pt.FinalResponse(ctx, nil) - if err != nil { - return ManagedClustersClientStopResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *ManagedClustersClientStopPoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// ManagedClustersClientUpdateTagsPoller provides polling facilities until the operation reaches a terminal state. -type ManagedClustersClientUpdateTagsPoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *ManagedClustersClientUpdateTagsPoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *ManagedClustersClientUpdateTagsPoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final ManagedClustersClientUpdateTagsResponse will be returned. -func (p *ManagedClustersClientUpdateTagsPoller) FinalResponse(ctx context.Context) (ManagedClustersClientUpdateTagsResponse, error) { - respType := ManagedClustersClientUpdateTagsResponse{} - resp, err := p.pt.FinalResponse(ctx, &respType.ManagedCluster) - if err != nil { - return ManagedClustersClientUpdateTagsResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *ManagedClustersClientUpdateTagsPoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// PrivateEndpointConnectionsClientDeletePoller provides polling facilities until the operation reaches a terminal state. -type PrivateEndpointConnectionsClientDeletePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *PrivateEndpointConnectionsClientDeletePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *PrivateEndpointConnectionsClientDeletePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final PrivateEndpointConnectionsClientDeleteResponse will be returned. -func (p *PrivateEndpointConnectionsClientDeletePoller) FinalResponse(ctx context.Context) (PrivateEndpointConnectionsClientDeleteResponse, error) { - respType := PrivateEndpointConnectionsClientDeleteResponse{} - resp, err := p.pt.FinalResponse(ctx, nil) - if err != nil { - return PrivateEndpointConnectionsClientDeleteResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *PrivateEndpointConnectionsClientDeletePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_privateendpointconnections_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_privateendpointconnections_client.go index b6160ec95e52..d038aada11b5 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_privateendpointconnections_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_privateendpointconnections_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -30,49 +31,46 @@ type PrivateEndpointConnectionsClient struct { } // NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *PrivateEndpointConnectionsClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &PrivateEndpointConnectionsClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // BeginDelete - Deletes a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // privateEndpointConnectionName - The name of the private endpoint connection. // options - PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete // method. -func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (PrivateEndpointConnectionsClientDeletePollerResponse, error) { - resp, err := client.deleteOperation(ctx, resourceGroupName, resourceName, privateEndpointConnectionName, options) - if err != nil { - return PrivateEndpointConnectionsClientDeletePollerResponse{}, err - } - result := PrivateEndpointConnectionsClientDeletePollerResponse{ - RawResponse: resp, +func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*armruntime.Poller[PrivateEndpointConnectionsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, resourceName, privateEndpointConnectionName, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[PrivateEndpointConnectionsClientDeleteResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[PrivateEndpointConnectionsClientDeleteResponse](options.ResumeToken, client.pl, nil) } - pt, err := armruntime.NewPoller("PrivateEndpointConnectionsClient.Delete", "", resp, client.pl) - if err != nil { - return PrivateEndpointConnectionsClientDeletePollerResponse{}, err - } - result.Poller = &PrivateEndpointConnectionsClientDeletePoller{ - pt: pt, - } - return result, nil } // Delete - Deletes a private endpoint connection. @@ -116,7 +114,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -124,7 +122,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. // Get - To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // privateEndpointConnectionName - The name of the private endpoint connection. // options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get @@ -168,7 +166,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -176,7 +174,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con // getHandleResponse handles the Get response. func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientGetResponse, error) { - result := PrivateEndpointConnectionsClientGetResponse{RawResponse: resp} + result := PrivateEndpointConnectionsClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnection); err != nil { return PrivateEndpointConnectionsClientGetResponse{}, err } @@ -185,7 +183,7 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // List - To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.List // method. @@ -224,7 +222,7 @@ func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -232,7 +230,7 @@ func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Co // listHandleResponse handles the List response. func (client *PrivateEndpointConnectionsClient) listHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientListResponse, error) { - result := PrivateEndpointConnectionsClientListResponse{RawResponse: resp} + result := PrivateEndpointConnectionsClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionListResult); err != nil { return PrivateEndpointConnectionsClientListResponse{}, err } @@ -241,7 +239,7 @@ func (client *PrivateEndpointConnectionsClient) listHandleResponse(resp *http.Re // Update - Updates a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // privateEndpointConnectionName - The name of the private endpoint connection. // parameters - The updated private endpoint connection. @@ -286,7 +284,7 @@ func (client *PrivateEndpointConnectionsClient) updateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) @@ -294,7 +292,7 @@ func (client *PrivateEndpointConnectionsClient) updateCreateRequest(ctx context. // updateHandleResponse handles the Update response. func (client *PrivateEndpointConnectionsClient) updateHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientUpdateResponse, error) { - result := PrivateEndpointConnectionsClientUpdateResponse{RawResponse: resp} + result := PrivateEndpointConnectionsClientUpdateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnection); err != nil { return PrivateEndpointConnectionsClientUpdateResponse{}, err } diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_privatelinkresources_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_privatelinkresources_client.go index 38157871c103..853d16ff2053 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_privatelinkresources_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_privatelinkresources_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -30,29 +31,32 @@ type PrivateLinkResourcesClient struct { } // NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *PrivateLinkResourcesClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinkResourcesClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &PrivateLinkResourcesClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // List - To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - PrivateLinkResourcesClientListOptions contains the optional parameters for the PrivateLinkResourcesClient.List // method. @@ -91,7 +95,7 @@ func (client *PrivateLinkResourcesClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -99,7 +103,7 @@ func (client *PrivateLinkResourcesClient) listCreateRequest(ctx context.Context, // listHandleResponse handles the List response. func (client *PrivateLinkResourcesClient) listHandleResponse(resp *http.Response) (PrivateLinkResourcesClientListResponse, error) { - result := PrivateLinkResourcesClientListResponse{RawResponse: resp} + result := PrivateLinkResourcesClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.PrivateLinkResourcesListResult); err != nil { return PrivateLinkResourcesClientListResponse{}, err } diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_resolveprivatelinkserviceid_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_resolveprivatelinkserviceid_client.go index d6f9dbf65a8e..6295fc07ef72 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_resolveprivatelinkserviceid_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_resolveprivatelinkserviceid_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -30,29 +31,32 @@ type ResolvePrivateLinkServiceIDClient struct { } // NewResolvePrivateLinkServiceIDClient creates a new instance of ResolvePrivateLinkServiceIDClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewResolvePrivateLinkServiceIDClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ResolvePrivateLinkServiceIDClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewResolvePrivateLinkServiceIDClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ResolvePrivateLinkServiceIDClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &ResolvePrivateLinkServiceIDClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // POST - Gets the private link service ID for the specified managed cluster. // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // parameters - Parameters required in order to resolve a private link service ID. // options - ResolvePrivateLinkServiceIDClientPOSTOptions contains the optional parameters for the ResolvePrivateLinkServiceIDClient.POST @@ -92,7 +96,7 @@ func (client *ResolvePrivateLinkServiceIDClient) postCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) @@ -100,7 +104,7 @@ func (client *ResolvePrivateLinkServiceIDClient) postCreateRequest(ctx context.C // postHandleResponse handles the POST response. func (client *ResolvePrivateLinkServiceIDClient) postHandleResponse(resp *http.Response) (ResolvePrivateLinkServiceIDClientPOSTResponse, error) { - result := ResolvePrivateLinkServiceIDClientPOSTResponse{RawResponse: resp} + result := ResolvePrivateLinkServiceIDClientPOSTResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.PrivateLinkResource); err != nil { return ResolvePrivateLinkServiceIDClientPOSTResponse{}, err } diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_response_types.go b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_response_types.go index c10d9d5b8a3f..71ad5a7f04de 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_response_types.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_response_types.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -8,998 +8,257 @@ package armcontainerservice -import ( - "context" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "net/http" - "time" -) - -// AgentPoolsClientCreateOrUpdatePollerResponse contains the response from method AgentPoolsClient.CreateOrUpdate. -type AgentPoolsClientCreateOrUpdatePollerResponse struct { - // Poller contains an initialized poller. - Poller *AgentPoolsClientCreateOrUpdatePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l AgentPoolsClientCreateOrUpdatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (AgentPoolsClientCreateOrUpdateResponse, error) { - respType := AgentPoolsClientCreateOrUpdateResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.AgentPool) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a AgentPoolsClientCreateOrUpdatePollerResponse from the provided client and resume token. -func (l *AgentPoolsClientCreateOrUpdatePollerResponse) Resume(ctx context.Context, client *AgentPoolsClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("AgentPoolsClient.CreateOrUpdate", token, client.pl) - if err != nil { - return err - } - poller := &AgentPoolsClientCreateOrUpdatePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // AgentPoolsClientCreateOrUpdateResponse contains the response from method AgentPoolsClient.CreateOrUpdate. type AgentPoolsClientCreateOrUpdateResponse struct { - AgentPoolsClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// AgentPoolsClientCreateOrUpdateResult contains the result from method AgentPoolsClient.CreateOrUpdate. -type AgentPoolsClientCreateOrUpdateResult struct { AgentPool } -// AgentPoolsClientDeletePollerResponse contains the response from method AgentPoolsClient.Delete. -type AgentPoolsClientDeletePollerResponse struct { - // Poller contains an initialized poller. - Poller *AgentPoolsClientDeletePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l AgentPoolsClientDeletePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (AgentPoolsClientDeleteResponse, error) { - respType := AgentPoolsClientDeleteResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a AgentPoolsClientDeletePollerResponse from the provided client and resume token. -func (l *AgentPoolsClientDeletePollerResponse) Resume(ctx context.Context, client *AgentPoolsClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("AgentPoolsClient.Delete", token, client.pl) - if err != nil { - return err - } - poller := &AgentPoolsClientDeletePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // AgentPoolsClientDeleteResponse contains the response from method AgentPoolsClient.Delete. type AgentPoolsClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // AgentPoolsClientGetAvailableAgentPoolVersionsResponse contains the response from method AgentPoolsClient.GetAvailableAgentPoolVersions. type AgentPoolsClientGetAvailableAgentPoolVersionsResponse struct { - AgentPoolsClientGetAvailableAgentPoolVersionsResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// AgentPoolsClientGetAvailableAgentPoolVersionsResult contains the result from method AgentPoolsClient.GetAvailableAgentPoolVersions. -type AgentPoolsClientGetAvailableAgentPoolVersionsResult struct { AgentPoolAvailableVersions } // AgentPoolsClientGetResponse contains the response from method AgentPoolsClient.Get. type AgentPoolsClientGetResponse struct { - AgentPoolsClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// AgentPoolsClientGetResult contains the result from method AgentPoolsClient.Get. -type AgentPoolsClientGetResult struct { AgentPool } // AgentPoolsClientGetUpgradeProfileResponse contains the response from method AgentPoolsClient.GetUpgradeProfile. type AgentPoolsClientGetUpgradeProfileResponse struct { - AgentPoolsClientGetUpgradeProfileResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// AgentPoolsClientGetUpgradeProfileResult contains the result from method AgentPoolsClient.GetUpgradeProfile. -type AgentPoolsClientGetUpgradeProfileResult struct { AgentPoolUpgradeProfile } // AgentPoolsClientListResponse contains the response from method AgentPoolsClient.List. type AgentPoolsClientListResponse struct { - AgentPoolsClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// AgentPoolsClientListResult contains the result from method AgentPoolsClient.List. -type AgentPoolsClientListResult struct { AgentPoolListResult } -// AgentPoolsClientUpgradeNodeImageVersionPollerResponse contains the response from method AgentPoolsClient.UpgradeNodeImageVersion. -type AgentPoolsClientUpgradeNodeImageVersionPollerResponse struct { - // Poller contains an initialized poller. - Poller *AgentPoolsClientUpgradeNodeImageVersionPoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l AgentPoolsClientUpgradeNodeImageVersionPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (AgentPoolsClientUpgradeNodeImageVersionResponse, error) { - respType := AgentPoolsClientUpgradeNodeImageVersionResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.AgentPool) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a AgentPoolsClientUpgradeNodeImageVersionPollerResponse from the provided client and resume token. -func (l *AgentPoolsClientUpgradeNodeImageVersionPollerResponse) Resume(ctx context.Context, client *AgentPoolsClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("AgentPoolsClient.UpgradeNodeImageVersion", token, client.pl) - if err != nil { - return err - } - poller := &AgentPoolsClientUpgradeNodeImageVersionPoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // AgentPoolsClientUpgradeNodeImageVersionResponse contains the response from method AgentPoolsClient.UpgradeNodeImageVersion. type AgentPoolsClientUpgradeNodeImageVersionResponse struct { - AgentPoolsClientUpgradeNodeImageVersionResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// AgentPoolsClientUpgradeNodeImageVersionResult contains the result from method AgentPoolsClient.UpgradeNodeImageVersion. -type AgentPoolsClientUpgradeNodeImageVersionResult struct { AgentPool } // MaintenanceConfigurationsClientCreateOrUpdateResponse contains the response from method MaintenanceConfigurationsClient.CreateOrUpdate. type MaintenanceConfigurationsClientCreateOrUpdateResponse struct { - MaintenanceConfigurationsClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// MaintenanceConfigurationsClientCreateOrUpdateResult contains the result from method MaintenanceConfigurationsClient.CreateOrUpdate. -type MaintenanceConfigurationsClientCreateOrUpdateResult struct { MaintenanceConfiguration } // MaintenanceConfigurationsClientDeleteResponse contains the response from method MaintenanceConfigurationsClient.Delete. type MaintenanceConfigurationsClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // MaintenanceConfigurationsClientGetResponse contains the response from method MaintenanceConfigurationsClient.Get. type MaintenanceConfigurationsClientGetResponse struct { - MaintenanceConfigurationsClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// MaintenanceConfigurationsClientGetResult contains the result from method MaintenanceConfigurationsClient.Get. -type MaintenanceConfigurationsClientGetResult struct { MaintenanceConfiguration } // MaintenanceConfigurationsClientListByManagedClusterResponse contains the response from method MaintenanceConfigurationsClient.ListByManagedCluster. type MaintenanceConfigurationsClientListByManagedClusterResponse struct { - MaintenanceConfigurationsClientListByManagedClusterResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + MaintenanceConfigurationListResult } -// MaintenanceConfigurationsClientListByManagedClusterResult contains the result from method MaintenanceConfigurationsClient.ListByManagedCluster. -type MaintenanceConfigurationsClientListByManagedClusterResult struct { - MaintenanceConfigurationListResult +// ManagedClusterSnapshotsClientCreateOrUpdateResponse contains the response from method ManagedClusterSnapshotsClient.CreateOrUpdate. +type ManagedClusterSnapshotsClientCreateOrUpdateResponse struct { + ManagedClusterSnapshot } -// ManagedClustersClientCreateOrUpdatePollerResponse contains the response from method ManagedClustersClient.CreateOrUpdate. -type ManagedClustersClientCreateOrUpdatePollerResponse struct { - // Poller contains an initialized poller. - Poller *ManagedClustersClientCreateOrUpdatePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l ManagedClustersClientCreateOrUpdatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (ManagedClustersClientCreateOrUpdateResponse, error) { - respType := ManagedClustersClientCreateOrUpdateResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.ManagedCluster) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a ManagedClustersClientCreateOrUpdatePollerResponse from the provided client and resume token. -func (l *ManagedClustersClientCreateOrUpdatePollerResponse) Resume(ctx context.Context, client *ManagedClustersClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("ManagedClustersClient.CreateOrUpdate", token, client.pl) - if err != nil { - return err - } - poller := &ManagedClustersClientCreateOrUpdatePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil +// ManagedClusterSnapshotsClientDeleteResponse contains the response from method ManagedClusterSnapshotsClient.Delete. +type ManagedClusterSnapshotsClientDeleteResponse struct { + // placeholder for future response values } -// ManagedClustersClientCreateOrUpdateResponse contains the response from method ManagedClustersClient.CreateOrUpdate. -type ManagedClustersClientCreateOrUpdateResponse struct { - ManagedClustersClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response +// ManagedClusterSnapshotsClientGetResponse contains the response from method ManagedClusterSnapshotsClient.Get. +type ManagedClusterSnapshotsClientGetResponse struct { + ManagedClusterSnapshot } -// ManagedClustersClientCreateOrUpdateResult contains the result from method ManagedClustersClient.CreateOrUpdate. -type ManagedClustersClientCreateOrUpdateResult struct { - ManagedCluster +// ManagedClusterSnapshotsClientListByResourceGroupResponse contains the response from method ManagedClusterSnapshotsClient.ListByResourceGroup. +type ManagedClusterSnapshotsClientListByResourceGroupResponse struct { + ManagedClusterSnapshotListResult +} + +// ManagedClusterSnapshotsClientListResponse contains the response from method ManagedClusterSnapshotsClient.List. +type ManagedClusterSnapshotsClientListResponse struct { + ManagedClusterSnapshotListResult } -// ManagedClustersClientDeletePollerResponse contains the response from method ManagedClustersClient.Delete. -type ManagedClustersClientDeletePollerResponse struct { - // Poller contains an initialized poller. - Poller *ManagedClustersClientDeletePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l ManagedClustersClientDeletePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (ManagedClustersClientDeleteResponse, error) { - respType := ManagedClustersClientDeleteResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a ManagedClustersClientDeletePollerResponse from the provided client and resume token. -func (l *ManagedClustersClientDeletePollerResponse) Resume(ctx context.Context, client *ManagedClustersClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("ManagedClustersClient.Delete", token, client.pl) - if err != nil { - return err - } - poller := &ManagedClustersClientDeletePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil +// ManagedClusterSnapshotsClientUpdateTagsResponse contains the response from method ManagedClusterSnapshotsClient.UpdateTags. +type ManagedClusterSnapshotsClientUpdateTagsResponse struct { + ManagedClusterSnapshot +} + +// ManagedClustersClientCreateOrUpdateResponse contains the response from method ManagedClustersClient.CreateOrUpdate. +type ManagedClustersClientCreateOrUpdateResponse struct { + ManagedCluster } // ManagedClustersClientDeleteResponse contains the response from method ManagedClustersClient.Delete. type ManagedClustersClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // ManagedClustersClientGetAccessProfileResponse contains the response from method ManagedClustersClient.GetAccessProfile. type ManagedClustersClientGetAccessProfileResponse struct { - ManagedClustersClientGetAccessProfileResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ManagedClustersClientGetAccessProfileResult contains the result from method ManagedClustersClient.GetAccessProfile. -type ManagedClustersClientGetAccessProfileResult struct { ManagedClusterAccessProfile } // ManagedClustersClientGetCommandResultResponse contains the response from method ManagedClustersClient.GetCommandResult. type ManagedClustersClientGetCommandResultResponse struct { - ManagedClustersClientGetCommandResultResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ManagedClustersClientGetCommandResultResult contains the result from method ManagedClustersClient.GetCommandResult. -type ManagedClustersClientGetCommandResultResult struct { RunCommandResult } // ManagedClustersClientGetOSOptionsResponse contains the response from method ManagedClustersClient.GetOSOptions. type ManagedClustersClientGetOSOptionsResponse struct { - ManagedClustersClientGetOSOptionsResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ManagedClustersClientGetOSOptionsResult contains the result from method ManagedClustersClient.GetOSOptions. -type ManagedClustersClientGetOSOptionsResult struct { OSOptionProfile } // ManagedClustersClientGetResponse contains the response from method ManagedClustersClient.Get. type ManagedClustersClientGetResponse struct { - ManagedClustersClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ManagedClustersClientGetResult contains the result from method ManagedClustersClient.Get. -type ManagedClustersClientGetResult struct { ManagedCluster } // ManagedClustersClientGetUpgradeProfileResponse contains the response from method ManagedClustersClient.GetUpgradeProfile. type ManagedClustersClientGetUpgradeProfileResponse struct { - ManagedClustersClientGetUpgradeProfileResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ManagedClustersClientGetUpgradeProfileResult contains the result from method ManagedClustersClient.GetUpgradeProfile. -type ManagedClustersClientGetUpgradeProfileResult struct { ManagedClusterUpgradeProfile } // ManagedClustersClientListByResourceGroupResponse contains the response from method ManagedClustersClient.ListByResourceGroup. type ManagedClustersClientListByResourceGroupResponse struct { - ManagedClustersClientListByResourceGroupResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ManagedClustersClientListByResourceGroupResult contains the result from method ManagedClustersClient.ListByResourceGroup. -type ManagedClustersClientListByResourceGroupResult struct { ManagedClusterListResult } // ManagedClustersClientListClusterAdminCredentialsResponse contains the response from method ManagedClustersClient.ListClusterAdminCredentials. type ManagedClustersClientListClusterAdminCredentialsResponse struct { - ManagedClustersClientListClusterAdminCredentialsResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ManagedClustersClientListClusterAdminCredentialsResult contains the result from method ManagedClustersClient.ListClusterAdminCredentials. -type ManagedClustersClientListClusterAdminCredentialsResult struct { CredentialResults } // ManagedClustersClientListClusterMonitoringUserCredentialsResponse contains the response from method ManagedClustersClient.ListClusterMonitoringUserCredentials. type ManagedClustersClientListClusterMonitoringUserCredentialsResponse struct { - ManagedClustersClientListClusterMonitoringUserCredentialsResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ManagedClustersClientListClusterMonitoringUserCredentialsResult contains the result from method ManagedClustersClient.ListClusterMonitoringUserCredentials. -type ManagedClustersClientListClusterMonitoringUserCredentialsResult struct { CredentialResults } // ManagedClustersClientListClusterUserCredentialsResponse contains the response from method ManagedClustersClient.ListClusterUserCredentials. type ManagedClustersClientListClusterUserCredentialsResponse struct { - ManagedClustersClientListClusterUserCredentialsResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ManagedClustersClientListClusterUserCredentialsResult contains the result from method ManagedClustersClient.ListClusterUserCredentials. -type ManagedClustersClientListClusterUserCredentialsResult struct { CredentialResults } // ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse contains the response from method ManagedClustersClient.ListOutboundNetworkDependenciesEndpoints. type ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse struct { - ManagedClustersClientListOutboundNetworkDependenciesEndpointsResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ManagedClustersClientListOutboundNetworkDependenciesEndpointsResult contains the result from method ManagedClustersClient.ListOutboundNetworkDependenciesEndpoints. -type ManagedClustersClientListOutboundNetworkDependenciesEndpointsResult struct { OutboundEnvironmentEndpointCollection } // ManagedClustersClientListResponse contains the response from method ManagedClustersClient.List. type ManagedClustersClientListResponse struct { - ManagedClustersClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ManagedClustersClientListResult contains the result from method ManagedClustersClient.List. -type ManagedClustersClientListResult struct { ManagedClusterListResult } -// ManagedClustersClientResetAADProfilePollerResponse contains the response from method ManagedClustersClient.ResetAADProfile. -type ManagedClustersClientResetAADProfilePollerResponse struct { - // Poller contains an initialized poller. - Poller *ManagedClustersClientResetAADProfilePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l ManagedClustersClientResetAADProfilePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (ManagedClustersClientResetAADProfileResponse, error) { - respType := ManagedClustersClientResetAADProfileResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a ManagedClustersClientResetAADProfilePollerResponse from the provided client and resume token. -func (l *ManagedClustersClientResetAADProfilePollerResponse) Resume(ctx context.Context, client *ManagedClustersClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("ManagedClustersClient.ResetAADProfile", token, client.pl) - if err != nil { - return err - } - poller := &ManagedClustersClientResetAADProfilePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // ManagedClustersClientResetAADProfileResponse contains the response from method ManagedClustersClient.ResetAADProfile. type ManagedClustersClientResetAADProfileResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ManagedClustersClientResetServicePrincipalProfilePollerResponse contains the response from method ManagedClustersClient.ResetServicePrincipalProfile. -type ManagedClustersClientResetServicePrincipalProfilePollerResponse struct { - // Poller contains an initialized poller. - Poller *ManagedClustersClientResetServicePrincipalProfilePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l ManagedClustersClientResetServicePrincipalProfilePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (ManagedClustersClientResetServicePrincipalProfileResponse, error) { - respType := ManagedClustersClientResetServicePrincipalProfileResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a ManagedClustersClientResetServicePrincipalProfilePollerResponse from the provided client and resume -// token. -func (l *ManagedClustersClientResetServicePrincipalProfilePollerResponse) Resume(ctx context.Context, client *ManagedClustersClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("ManagedClustersClient.ResetServicePrincipalProfile", token, client.pl) - if err != nil { - return err - } - poller := &ManagedClustersClientResetServicePrincipalProfilePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil + // placeholder for future response values } // ManagedClustersClientResetServicePrincipalProfileResponse contains the response from method ManagedClustersClient.ResetServicePrincipalProfile. type ManagedClustersClientResetServicePrincipalProfileResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ManagedClustersClientRotateClusterCertificatesPollerResponse contains the response from method ManagedClustersClient.RotateClusterCertificates. -type ManagedClustersClientRotateClusterCertificatesPollerResponse struct { - // Poller contains an initialized poller. - Poller *ManagedClustersClientRotateClusterCertificatesPoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l ManagedClustersClientRotateClusterCertificatesPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (ManagedClustersClientRotateClusterCertificatesResponse, error) { - respType := ManagedClustersClientRotateClusterCertificatesResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a ManagedClustersClientRotateClusterCertificatesPollerResponse from the provided client and resume token. -func (l *ManagedClustersClientRotateClusterCertificatesPollerResponse) Resume(ctx context.Context, client *ManagedClustersClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("ManagedClustersClient.RotateClusterCertificates", token, client.pl) - if err != nil { - return err - } - poller := &ManagedClustersClientRotateClusterCertificatesPoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil + // placeholder for future response values } // ManagedClustersClientRotateClusterCertificatesResponse contains the response from method ManagedClustersClient.RotateClusterCertificates. type ManagedClustersClientRotateClusterCertificatesResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ManagedClustersClientRunCommandPollerResponse contains the response from method ManagedClustersClient.RunCommand. -type ManagedClustersClientRunCommandPollerResponse struct { - // Poller contains an initialized poller. - Poller *ManagedClustersClientRunCommandPoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l ManagedClustersClientRunCommandPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (ManagedClustersClientRunCommandResponse, error) { - respType := ManagedClustersClientRunCommandResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.RunCommandResult) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a ManagedClustersClientRunCommandPollerResponse from the provided client and resume token. -func (l *ManagedClustersClientRunCommandPollerResponse) Resume(ctx context.Context, client *ManagedClustersClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("ManagedClustersClient.RunCommand", token, client.pl) - if err != nil { - return err - } - poller := &ManagedClustersClientRunCommandPoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil + // placeholder for future response values } -// ManagedClustersClientRunCommandResponse contains the response from method ManagedClustersClient.RunCommand. -type ManagedClustersClientRunCommandResponse struct { - ManagedClustersClientRunCommandResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response +// ManagedClustersClientRotateServiceAccountSigningKeysResponse contains the response from method ManagedClustersClient.RotateServiceAccountSigningKeys. +type ManagedClustersClientRotateServiceAccountSigningKeysResponse struct { + // placeholder for future response values } -// ManagedClustersClientRunCommandResult contains the result from method ManagedClustersClient.RunCommand. -type ManagedClustersClientRunCommandResult struct { +// ManagedClustersClientRunCommandResponse contains the response from method ManagedClustersClient.RunCommand. +type ManagedClustersClientRunCommandResponse struct { RunCommandResult } -// ManagedClustersClientStartPollerResponse contains the response from method ManagedClustersClient.Start. -type ManagedClustersClientStartPollerResponse struct { - // Poller contains an initialized poller. - Poller *ManagedClustersClientStartPoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l ManagedClustersClientStartPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (ManagedClustersClientStartResponse, error) { - respType := ManagedClustersClientStartResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a ManagedClustersClientStartPollerResponse from the provided client and resume token. -func (l *ManagedClustersClientStartPollerResponse) Resume(ctx context.Context, client *ManagedClustersClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("ManagedClustersClient.Start", token, client.pl) - if err != nil { - return err - } - poller := &ManagedClustersClientStartPoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // ManagedClustersClientStartResponse contains the response from method ManagedClustersClient.Start. type ManagedClustersClientStartResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ManagedClustersClientStopPollerResponse contains the response from method ManagedClustersClient.Stop. -type ManagedClustersClientStopPollerResponse struct { - // Poller contains an initialized poller. - Poller *ManagedClustersClientStopPoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l ManagedClustersClientStopPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (ManagedClustersClientStopResponse, error) { - respType := ManagedClustersClientStopResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a ManagedClustersClientStopPollerResponse from the provided client and resume token. -func (l *ManagedClustersClientStopPollerResponse) Resume(ctx context.Context, client *ManagedClustersClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("ManagedClustersClient.Stop", token, client.pl) - if err != nil { - return err - } - poller := &ManagedClustersClientStopPoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil + // placeholder for future response values } // ManagedClustersClientStopResponse contains the response from method ManagedClustersClient.Stop. type ManagedClustersClientStopResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ManagedClustersClientUpdateTagsPollerResponse contains the response from method ManagedClustersClient.UpdateTags. -type ManagedClustersClientUpdateTagsPollerResponse struct { - // Poller contains an initialized poller. - Poller *ManagedClustersClientUpdateTagsPoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l ManagedClustersClientUpdateTagsPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (ManagedClustersClientUpdateTagsResponse, error) { - respType := ManagedClustersClientUpdateTagsResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.ManagedCluster) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a ManagedClustersClientUpdateTagsPollerResponse from the provided client and resume token. -func (l *ManagedClustersClientUpdateTagsPollerResponse) Resume(ctx context.Context, client *ManagedClustersClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("ManagedClustersClient.UpdateTags", token, client.pl) - if err != nil { - return err - } - poller := &ManagedClustersClientUpdateTagsPoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil + // placeholder for future response values } // ManagedClustersClientUpdateTagsResponse contains the response from method ManagedClustersClient.UpdateTags. type ManagedClustersClientUpdateTagsResponse struct { - ManagedClustersClientUpdateTagsResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ManagedClustersClientUpdateTagsResult contains the result from method ManagedClustersClient.UpdateTags. -type ManagedClustersClientUpdateTagsResult struct { ManagedCluster } // OperationsClientListResponse contains the response from method OperationsClient.List. type OperationsClientListResponse struct { - OperationsClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// OperationsClientListResult contains the result from method OperationsClient.List. -type OperationsClientListResult struct { OperationListResult } -// PrivateEndpointConnectionsClientDeletePollerResponse contains the response from method PrivateEndpointConnectionsClient.Delete. -type PrivateEndpointConnectionsClientDeletePollerResponse struct { - // Poller contains an initialized poller. - Poller *PrivateEndpointConnectionsClientDeletePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l PrivateEndpointConnectionsClientDeletePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (PrivateEndpointConnectionsClientDeleteResponse, error) { - respType := PrivateEndpointConnectionsClientDeleteResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a PrivateEndpointConnectionsClientDeletePollerResponse from the provided client and resume token. -func (l *PrivateEndpointConnectionsClientDeletePollerResponse) Resume(ctx context.Context, client *PrivateEndpointConnectionsClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("PrivateEndpointConnectionsClient.Delete", token, client.pl) - if err != nil { - return err - } - poller := &PrivateEndpointConnectionsClientDeletePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // PrivateEndpointConnectionsClientDeleteResponse contains the response from method PrivateEndpointConnectionsClient.Delete. type PrivateEndpointConnectionsClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // PrivateEndpointConnectionsClientGetResponse contains the response from method PrivateEndpointConnectionsClient.Get. type PrivateEndpointConnectionsClientGetResponse struct { - PrivateEndpointConnectionsClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PrivateEndpointConnectionsClientGetResult contains the result from method PrivateEndpointConnectionsClient.Get. -type PrivateEndpointConnectionsClientGetResult struct { PrivateEndpointConnection } // PrivateEndpointConnectionsClientListResponse contains the response from method PrivateEndpointConnectionsClient.List. type PrivateEndpointConnectionsClientListResponse struct { - PrivateEndpointConnectionsClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PrivateEndpointConnectionsClientListResult contains the result from method PrivateEndpointConnectionsClient.List. -type PrivateEndpointConnectionsClientListResult struct { PrivateEndpointConnectionListResult } // PrivateEndpointConnectionsClientUpdateResponse contains the response from method PrivateEndpointConnectionsClient.Update. type PrivateEndpointConnectionsClientUpdateResponse struct { - PrivateEndpointConnectionsClientUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PrivateEndpointConnectionsClientUpdateResult contains the result from method PrivateEndpointConnectionsClient.Update. -type PrivateEndpointConnectionsClientUpdateResult struct { PrivateEndpointConnection } // PrivateLinkResourcesClientListResponse contains the response from method PrivateLinkResourcesClient.List. type PrivateLinkResourcesClientListResponse struct { - PrivateLinkResourcesClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PrivateLinkResourcesClientListResult contains the result from method PrivateLinkResourcesClient.List. -type PrivateLinkResourcesClientListResult struct { PrivateLinkResourcesListResult } // ResolvePrivateLinkServiceIDClientPOSTResponse contains the response from method ResolvePrivateLinkServiceIDClient.POST. type ResolvePrivateLinkServiceIDClientPOSTResponse struct { - ResolvePrivateLinkServiceIDClientPOSTResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ResolvePrivateLinkServiceIDClientPOSTResult contains the result from method ResolvePrivateLinkServiceIDClient.POST. -type ResolvePrivateLinkServiceIDClientPOSTResult struct { PrivateLinkResource } // SnapshotsClientCreateOrUpdateResponse contains the response from method SnapshotsClient.CreateOrUpdate. type SnapshotsClientCreateOrUpdateResponse struct { - SnapshotsClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// SnapshotsClientCreateOrUpdateResult contains the result from method SnapshotsClient.CreateOrUpdate. -type SnapshotsClientCreateOrUpdateResult struct { Snapshot } // SnapshotsClientDeleteResponse contains the response from method SnapshotsClient.Delete. type SnapshotsClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // SnapshotsClientGetResponse contains the response from method SnapshotsClient.Get. type SnapshotsClientGetResponse struct { - SnapshotsClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// SnapshotsClientGetResult contains the result from method SnapshotsClient.Get. -type SnapshotsClientGetResult struct { Snapshot } // SnapshotsClientListByResourceGroupResponse contains the response from method SnapshotsClient.ListByResourceGroup. type SnapshotsClientListByResourceGroupResponse struct { - SnapshotsClientListByResourceGroupResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// SnapshotsClientListByResourceGroupResult contains the result from method SnapshotsClient.ListByResourceGroup. -type SnapshotsClientListByResourceGroupResult struct { SnapshotListResult } // SnapshotsClientListResponse contains the response from method SnapshotsClient.List. type SnapshotsClientListResponse struct { - SnapshotsClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// SnapshotsClientListResult contains the result from method SnapshotsClient.List. -type SnapshotsClientListResult struct { SnapshotListResult } // SnapshotsClientUpdateTagsResponse contains the response from method SnapshotsClient.UpdateTags. type SnapshotsClientUpdateTagsResponse struct { - SnapshotsClientUpdateTagsResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// SnapshotsClientUpdateTagsResult contains the result from method SnapshotsClient.UpdateTags. -type SnapshotsClientUpdateTagsResult struct { Snapshot } diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_snapshots_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_snapshots_client.go index 783742a5582d..a90f026506d2 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_snapshots_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_snapshots_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -30,29 +31,32 @@ type SnapshotsClient struct { } // NewSnapshotsClient creates a new instance of SnapshotsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewSnapshotsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *SnapshotsClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewSnapshotsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SnapshotsClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &SnapshotsClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // CreateOrUpdate - Creates or updates a snapshot. // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // parameters - The snapshot to create or update. // options - SnapshotsClientCreateOrUpdateOptions contains the optional parameters for the SnapshotsClient.CreateOrUpdate @@ -92,7 +96,7 @@ func (client *SnapshotsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) @@ -100,7 +104,7 @@ func (client *SnapshotsClient) createOrUpdateCreateRequest(ctx context.Context, // createOrUpdateHandleResponse handles the CreateOrUpdate response. func (client *SnapshotsClient) createOrUpdateHandleResponse(resp *http.Response) (SnapshotsClientCreateOrUpdateResponse, error) { - result := SnapshotsClientCreateOrUpdateResponse{RawResponse: resp} + result := SnapshotsClientCreateOrUpdateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.Snapshot); err != nil { return SnapshotsClientCreateOrUpdateResponse{}, err } @@ -109,7 +113,7 @@ func (client *SnapshotsClient) createOrUpdateHandleResponse(resp *http.Response) // Delete - Deletes a snapshot. // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - SnapshotsClientDeleteOptions contains the optional parameters for the SnapshotsClient.Delete method. func (client *SnapshotsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, options *SnapshotsClientDeleteOptions) (SnapshotsClientDeleteResponse, error) { @@ -124,7 +128,7 @@ func (client *SnapshotsClient) Delete(ctx context.Context, resourceGroupName str if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return SnapshotsClientDeleteResponse{}, runtime.NewResponseError(resp) } - return SnapshotsClientDeleteResponse{RawResponse: resp}, nil + return SnapshotsClientDeleteResponse{}, nil } // deleteCreateRequest creates the Delete request. @@ -147,7 +151,7 @@ func (client *SnapshotsClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -155,7 +159,7 @@ func (client *SnapshotsClient) deleteCreateRequest(ctx context.Context, resource // Get - Gets a snapshot. // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - SnapshotsClientGetOptions contains the optional parameters for the SnapshotsClient.Get method. func (client *SnapshotsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, options *SnapshotsClientGetOptions) (SnapshotsClientGetResponse, error) { @@ -193,7 +197,7 @@ func (client *SnapshotsClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -201,7 +205,7 @@ func (client *SnapshotsClient) getCreateRequest(ctx context.Context, resourceGro // getHandleResponse handles the Get response. func (client *SnapshotsClient) getHandleResponse(resp *http.Response) (SnapshotsClientGetResponse, error) { - result := SnapshotsClientGetResponse{RawResponse: resp} + result := SnapshotsClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.Snapshot); err != nil { return SnapshotsClientGetResponse{}, err } @@ -211,16 +215,32 @@ func (client *SnapshotsClient) getHandleResponse(resp *http.Response) (Snapshots // List - Gets a list of snapshots in the specified subscription. // If the operation fails it returns an *azcore.ResponseError type. // options - SnapshotsClientListOptions contains the optional parameters for the SnapshotsClient.List method. -func (client *SnapshotsClient) List(options *SnapshotsClientListOptions) *SnapshotsClientListPager { - return &SnapshotsClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, options) +func (client *SnapshotsClient) List(options *SnapshotsClientListOptions) *runtime.Pager[SnapshotsClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[SnapshotsClientListResponse]{ + More: func(page SnapshotsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp SnapshotsClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.SnapshotListResult.NextLink) + Fetcher: func(ctx context.Context, page *SnapshotsClientListResponse) (SnapshotsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return SnapshotsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SnapshotsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SnapshotsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) }, - } + }) } // listCreateRequest creates the List request. @@ -235,7 +255,7 @@ func (client *SnapshotsClient) listCreateRequest(ctx context.Context, options *S return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -243,7 +263,7 @@ func (client *SnapshotsClient) listCreateRequest(ctx context.Context, options *S // listHandleResponse handles the List response. func (client *SnapshotsClient) listHandleResponse(resp *http.Response) (SnapshotsClientListResponse, error) { - result := SnapshotsClientListResponse{RawResponse: resp} + result := SnapshotsClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.SnapshotListResult); err != nil { return SnapshotsClientListResponse{}, err } @@ -252,19 +272,35 @@ func (client *SnapshotsClient) listHandleResponse(resp *http.Response) (Snapshot // ListByResourceGroup - Lists snapshots in the specified subscription and resource group. // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // options - SnapshotsClientListByResourceGroupOptions contains the optional parameters for the SnapshotsClient.ListByResourceGroup // method. -func (client *SnapshotsClient) ListByResourceGroup(resourceGroupName string, options *SnapshotsClientListByResourceGroupOptions) *SnapshotsClientListByResourceGroupPager { - return &SnapshotsClientListByResourceGroupPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) +func (client *SnapshotsClient) ListByResourceGroup(resourceGroupName string, options *SnapshotsClientListByResourceGroupOptions) *runtime.Pager[SnapshotsClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PageProcessor[SnapshotsClientListByResourceGroupResponse]{ + More: func(page SnapshotsClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp SnapshotsClientListByResourceGroupResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.SnapshotListResult.NextLink) + Fetcher: func(ctx context.Context, page *SnapshotsClientListByResourceGroupResponse) (SnapshotsClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return SnapshotsClientListByResourceGroupResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SnapshotsClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SnapshotsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) }, - } + }) } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. @@ -283,7 +319,7 @@ func (client *SnapshotsClient) listByResourceGroupCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -291,7 +327,7 @@ func (client *SnapshotsClient) listByResourceGroupCreateRequest(ctx context.Cont // listByResourceGroupHandleResponse handles the ListByResourceGroup response. func (client *SnapshotsClient) listByResourceGroupHandleResponse(resp *http.Response) (SnapshotsClientListByResourceGroupResponse, error) { - result := SnapshotsClientListByResourceGroupResponse{RawResponse: resp} + result := SnapshotsClientListByResourceGroupResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.SnapshotListResult); err != nil { return SnapshotsClientListByResourceGroupResponse{}, err } @@ -300,7 +336,7 @@ func (client *SnapshotsClient) listByResourceGroupHandleResponse(resp *http.Resp // UpdateTags - Updates tags on a snapshot. // If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. +// resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // parameters - Parameters supplied to the Update snapshot Tags operation. // options - SnapshotsClientUpdateTagsOptions contains the optional parameters for the SnapshotsClient.UpdateTags method. @@ -339,7 +375,7 @@ func (client *SnapshotsClient) updateTagsCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-03-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) @@ -347,7 +383,7 @@ func (client *SnapshotsClient) updateTagsCreateRequest(ctx context.Context, reso // updateTagsHandleResponse handles the UpdateTags response. func (client *SnapshotsClient) updateTagsHandleResponse(resp *http.Response) (SnapshotsClientUpdateTagsResponse, error) { - result := SnapshotsClientUpdateTagsResponse{RawResponse: resp} + result := SnapshotsClientUpdateTagsResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.Snapshot); err != nil { return SnapshotsClientUpdateTagsResponse{}, err } diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_time_rfc3339.go b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_time_rfc3339.go index efe81fe66d23..85bfcfa0dfa1 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_time_rfc3339.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information.