diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/CHANGELOG.md b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/CHANGELOG.md index c26f5a0f9d26c..78f215cef73ab 100644 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/CHANGELOG.md +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.3 (Unreleased) +## 1.0.0-beta.1 (2022-03-09) + +- Azure Resource Manager SourceControlConfiguration client library for Java. This package contains Microsoft Azure SDK for SourceControlConfiguration Management SDK. KubernetesConfiguration Client. Package tag package-preview-2022-04. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/README.md b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/README.md index 0a06d81ba865a..926f7e881fdf5 100644 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/README.md +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/README.md @@ -2,7 +2,7 @@ Azure Resource Manager SourceControlConfiguration client library for Java. -This package contains Microsoft Azure SDK for SourceControlConfiguration Management SDK. KubernetesConfiguration Client. Package tag package-2021-09. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for SourceControlConfiguration Management SDK. KubernetesConfiguration Client. Package tag package-preview-2022-04. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-kubernetesconfiguration - 1.0.0-beta.2 + 1.0.0-beta.3 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/SAMPLE.md b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/SAMPLE.md index 508d0ce485f59..389f62065e328 100644 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/SAMPLE.md +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/SAMPLE.md @@ -1,6 +1,18 @@ # Code snippets and samples +## ClusterExtensionType + +- [Get](#clusterextensiontype_get) + +## ClusterExtensionTypesOperation + +- [List](#clusterextensiontypesoperation_list) + +## ExtensionTypeVersions + +- [List](#extensiontypeversions_list) + ## Extensions - [Create](#extensions_create) @@ -9,6 +21,22 @@ - [List](#extensions_list) - [Update](#extensions_update) +## FluxConfigOperationStatus + +- [Get](#fluxconfigoperationstatus_get) + +## FluxConfigurations + +- [CreateOrUpdate](#fluxconfigurations_createorupdate) +- [Delete](#fluxconfigurations_delete) +- [Get](#fluxconfigurations_get) +- [List](#fluxconfigurations_list) +- [Update](#fluxconfigurations_update) + +## LocationExtensionTypes + +- [List](#locationextensiontypes_list) + ## OperationStatus - [Get](#operationstatus_get) @@ -17,13 +45,127 @@ ## Operations - [List](#operations_list) -### Extensions_Create + +## PrivateEndpointConnections + +- [CreateOrUpdate](#privateendpointconnections_createorupdate) +- [Delete](#privateendpointconnections_delete) +- [Get](#privateendpointconnections_get) +- [ListByPrivateLinkScope](#privateendpointconnections_listbyprivatelinkscope) + +## PrivateLinkResources + +- [Get](#privatelinkresources_get) +- [ListByPrivateLinkScope](#privatelinkresources_listbyprivatelinkscope) + +## PrivateLinkScopes + +- [CreateOrUpdate](#privatelinkscopes_createorupdate) +- [Delete](#privatelinkscopes_delete) +- [GetByResourceGroup](#privatelinkscopes_getbyresourcegroup) +- [GetValidationDetails](#privatelinkscopes_getvalidationdetails) +- [GetValidationDetailsForMachine](#privatelinkscopes_getvalidationdetailsformachine) +- [List](#privatelinkscopes_list) +- [ListByResourceGroup](#privatelinkscopes_listbyresourcegroup) +- [UpdateTags](#privatelinkscopes_updatetags) + +## SourceControlConfigurations + +- [CreateOrUpdate](#sourcecontrolconfigurations_createorupdate) +- [Delete](#sourcecontrolconfigurations_delete) +- [Get](#sourcecontrolconfigurations_get) +- [List](#sourcecontrolconfigurations_list) +### ClusterExtensionType_Get + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterResourceName; +import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterRp; + +/** Samples for ClusterExtensionType Get. */ +public final class ClusterExtensionTypeGetSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-01-01-preview/examples/ClusterExtensionType_Get.json + */ + /** + * Sample code: ClusterExtensionType_Get_MaximumSet_Gen. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void clusterExtensionTypeGetMaximumSetGen( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .clusterExtensionTypes() + .getWithResponse( + "rg1", + ExtensionsClusterRp.MICROSOFT_CONTAINER_SERVICE, + ExtensionsClusterResourceName.MANAGED_CLUSTERS, + "clusterName1", + "microsoft.example", + Context.NONE); + } +} +``` + +### ClusterExtensionTypesOperation_List ```java import com.azure.core.util.Context; -import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.ExtensionInner; import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterResourceName; import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterRp; + +/** Samples for ClusterExtensionTypesOperation List. */ +public final class ClusterExtensionTypesOperationListSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-01-01-preview/examples/ClusterExtensionTypes_List.json + */ + /** + * Sample code: ClusterExtensionTypes_List_MaximumSet_Gen. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void clusterExtensionTypesListMaximumSetGen( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .clusterExtensionTypesOperations() + .list( + "rg1", + ExtensionsClusterRp.MICROSOFT_CONTAINER_SERVICE, + ExtensionsClusterResourceName.MANAGED_CLUSTERS, + "clusterName1", + Context.NONE); + } +} +``` + +### ExtensionTypeVersions_List + +```java +import com.azure.core.util.Context; + +/** Samples for ExtensionTypeVersions List. */ +public final class ExtensionTypeVersionsListSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-01-01-preview/examples/ExtensionTypeVersions_List.json + */ + /** + * Sample code: ExtensionTypeVersions_List_MaximumSet_Gen. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void extensionTypeVersionsListMaximumSetGen( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager.extensionTypeVersions().list("eastus", "microsoft.example", Context.NONE); + } +} +``` + +### Extensions_Create + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.ExtensionInner; +import com.azure.resourcemanager.kubernetesconfiguration.models.Plan; import com.azure.resourcemanager.kubernetesconfiguration.models.Scope; import com.azure.resourcemanager.kubernetesconfiguration.models.ScopeCluster; import java.util.HashMap; @@ -32,7 +174,7 @@ import java.util.Map; /** Samples for Extensions Create. */ public final class ExtensionsCreateSamples { /* - * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2021-09-01/examples/CreateExtension.json + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/CreateExtension.json */ /** * Sample code: Create Extension. @@ -45,8 +187,8 @@ public final class ExtensionsCreateSamples { .extensions() .create( "rg1", - ExtensionsClusterRp.MICROSOFT_KUBERNETES, - ExtensionsClusterResourceName.CONNECTED_CLUSTERS, + "Microsoft.Kubernetes", + "connectedClusters", "clusterName1", "ClusterMonitor", new ExtensionInner() @@ -64,6 +206,36 @@ public final class ExtensionsCreateSamples { Context.NONE); } + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/CreateExtensionWithPlan.json + */ + /** + * Sample code: Create Extension with Plan. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void createExtensionWithPlan( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .extensions() + .create( + "rg1", + "Microsoft.Kubernetes", + "connectedClusters", + "clusterName1", + "azureVote", + new ExtensionInner() + .withPlan( + new Plan() + .withName("azure-vote-standard") + .withPublisher("Microsoft") + .withProduct("azure-vote-standard-offer-id")) + .withExtensionType("azure-vote") + .withAutoUpgradeMinorVersion(true) + .withReleaseTrain("Preview"), + Context.NONE); + } + @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -81,13 +253,11 @@ public final class ExtensionsCreateSamples { ```java import com.azure.core.util.Context; -import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterResourceName; -import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterRp; /** Samples for Extensions Delete. */ public final class ExtensionsDeleteSamples { /* - * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2021-09-01/examples/DeleteExtension.json + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/DeleteExtension.json */ /** * Sample code: Delete Extension. @@ -100,8 +270,8 @@ public final class ExtensionsDeleteSamples { .extensions() .delete( "rg1", - ExtensionsClusterRp.MICROSOFT_KUBERNETES, - ExtensionsClusterResourceName.CONNECTED_CLUSTERS, + "Microsoft.Kubernetes", + "connectedClusters", "clusterName1", "ClusterMonitor", null, @@ -114,13 +284,11 @@ public final class ExtensionsDeleteSamples { ```java import com.azure.core.util.Context; -import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterResourceName; -import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterRp; /** Samples for Extensions Get. */ public final class ExtensionsGetSamples { /* - * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2021-09-01/examples/GetExtension.json + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/GetExtension.json */ /** * Sample code: Get Extension. @@ -132,12 +300,7 @@ public final class ExtensionsGetSamples { manager .extensions() .getWithResponse( - "rg1", - ExtensionsClusterRp.MICROSOFT_KUBERNETES, - ExtensionsClusterResourceName.CONNECTED_CLUSTERS, - "clusterName1", - "ClusterMonitor", - Context.NONE); + "rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", "ClusterMonitor", Context.NONE); } } ``` @@ -146,13 +309,11 @@ public final class ExtensionsGetSamples { ```java import com.azure.core.util.Context; -import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterResourceName; -import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterRp; /** Samples for Extensions List. */ public final class ExtensionsListSamples { /* - * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2021-09-01/examples/ListExtensions.json + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/ListExtensions.json */ /** * Sample code: List Extensions. @@ -161,14 +322,7 @@ public final class ExtensionsListSamples { */ public static void listExtensions( com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { - manager - .extensions() - .list( - "rg1", - ExtensionsClusterRp.MICROSOFT_KUBERNETES, - ExtensionsClusterResourceName.CONNECTED_CLUSTERS, - "clusterName1", - Context.NONE); + manager.extensions().list("rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", Context.NONE); } } ``` @@ -177,8 +331,6 @@ public final class ExtensionsListSamples { ```java import com.azure.core.util.Context; -import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterResourceName; -import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterRp; import com.azure.resourcemanager.kubernetesconfiguration.models.PatchExtension; import java.util.HashMap; import java.util.Map; @@ -186,7 +338,7 @@ import java.util.Map; /** Samples for Extensions Update. */ public final class ExtensionsUpdateSamples { /* - * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2021-09-01/examples/PatchExtension.json + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/PatchExtension.json */ /** * Sample code: Update Extension. @@ -199,8 +351,8 @@ public final class ExtensionsUpdateSamples { .extensions() .update( "rg1", - ExtensionsClusterRp.MICROSOFT_KUBERNETES, - ExtensionsClusterResourceName.CONNECTED_CLUSTERS, + "Microsoft.Kubernetes", + "connectedClusters", "clusterName1", "ClusterMonitor", new PatchExtension() @@ -229,88 +381,928 @@ public final class ExtensionsUpdateSamples { } ``` -### OperationStatus_Get +### FluxConfigOperationStatus_Get ```java import com.azure.core.util.Context; -import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterResourceName; -import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterRp; -/** Samples for OperationStatus Get. */ -public final class OperationStatusGetSamples { +/** Samples for FluxConfigOperationStatus Get. */ +public final class FluxConfigOperationStatusGetSamples { /* - * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2021-09-01/examples/GetAsyncOperationStatus.json + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/GetFluxConfigurationAsyncOperationStatus.json */ /** - * Sample code: AsyncOperationStatus Get. + * Sample code: FluxConfigurationAsyncOperationStatus Get. * * @param manager Entry point to SourceControlConfigurationManager. */ - public static void asyncOperationStatusGet( + public static void fluxConfigurationAsyncOperationStatusGet( com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { manager - .operationStatus() + .fluxConfigOperationStatus() .getWithResponse( "rg1", - ExtensionsClusterRp.MICROSOFT_KUBERNETES, - ExtensionsClusterResourceName.CONNECTED_CLUSTERS, + "Microsoft.Kubernetes", + "connectedClusters", "clusterName1", - "ClusterMonitor", + "srs-fluxconfig", "99999999-9999-9999-9999-999999999999", Context.NONE); } } ``` -### OperationStatus_List +### FluxConfigurations_CreateOrUpdate ```java import com.azure.core.util.Context; -import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterResourceName; -import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterRp; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.FluxConfigurationInner; +import com.azure.resourcemanager.kubernetesconfiguration.models.BucketDefinition; +import com.azure.resourcemanager.kubernetesconfiguration.models.GitRepositoryDefinition; +import com.azure.resourcemanager.kubernetesconfiguration.models.KustomizationDefinition; +import com.azure.resourcemanager.kubernetesconfiguration.models.RepositoryRefDefinition; +import com.azure.resourcemanager.kubernetesconfiguration.models.ScopeType; +import com.azure.resourcemanager.kubernetesconfiguration.models.SourceKindType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; -/** Samples for OperationStatus List. */ -public final class OperationStatusListSamples { +/** Samples for FluxConfigurations CreateOrUpdate. */ +public final class FluxConfigurationsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2021-09-01/examples/ListAsyncOperationStatus.json + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/CreateFluxConfiguration.json */ /** - * Sample code: AsyncOperationStatus List. + * Sample code: Create Flux Configuration. * * @param manager Entry point to SourceControlConfigurationManager. */ - public static void asyncOperationStatusList( + public static void createFluxConfiguration( com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { manager - .operationStatus() - .list( + .fluxConfigurations() + .createOrUpdate( + "rg1", + "Microsoft.Kubernetes", + "connectedClusters", + "clusterName1", + "srs-fluxconfig", + new FluxConfigurationInner() + .withScope(ScopeType.CLUSTER) + .withNamespace("srs-namespace") + .withSourceKind(SourceKindType.GIT_REPOSITORY) + .withSuspend(false) + .withGitRepository( + new GitRepositoryDefinition() + .withUrl("https://github.com/Azure/arc-k8s-demo") + .withTimeoutInSeconds(600L) + .withSyncIntervalInSeconds(600L) + .withRepositoryRef(new RepositoryRefDefinition().withBranch("master")) + .withHttpsCACert("ZXhhbXBsZWNlcnRpZmljYXRl")) + .withKustomizations( + mapOf( + "srs-kustomization1", + new KustomizationDefinition() + .withPath("./test/path") + .withDependsOn(Arrays.asList()) + .withTimeoutInSeconds(600L) + .withSyncIntervalInSeconds(600L), + "srs-kustomization2", + new KustomizationDefinition() + .withPath("./other/test/path") + .withDependsOn(Arrays.asList("srs-kustomization1")) + .withTimeoutInSeconds(600L) + .withSyncIntervalInSeconds(600L) + .withRetryIntervalInSeconds(600L) + .withPrune(false))), + Context.NONE); + } + + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/CreateFluxConfigurationWithBucket.json + */ + /** + * Sample code: Create Flux Configuration with Bucket Source Kind. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void createFluxConfigurationWithBucketSourceKind( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .fluxConfigurations() + .createOrUpdate( + "rg1", + "Microsoft.Kubernetes", + "connectedClusters", + "clusterName1", + "srs-fluxconfig", + new FluxConfigurationInner() + .withScope(ScopeType.CLUSTER) + .withNamespace("srs-namespace") + .withSourceKind(SourceKindType.BUCKET) + .withSuspend(false) + .withBucket( + new BucketDefinition() + .withUrl("https://fluxminiotest.az.minio.io") + .withBucketName("flux") + .withTimeoutInSeconds(1000L) + .withSyncIntervalInSeconds(1000L) + .withAccessKey("fluxminiotest")) + .withKustomizations( + mapOf( + "srs-kustomization1", + new KustomizationDefinition() + .withPath("./test/path") + .withDependsOn(Arrays.asList()) + .withTimeoutInSeconds(600L) + .withSyncIntervalInSeconds(600L), + "srs-kustomization2", + new KustomizationDefinition() + .withPath("./other/test/path") + .withDependsOn(Arrays.asList("srs-kustomization1")) + .withTimeoutInSeconds(600L) + .withSyncIntervalInSeconds(600L) + .withRetryIntervalInSeconds(600L) + .withPrune(false))), + Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### FluxConfigurations_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for FluxConfigurations Delete. */ +public final class FluxConfigurationsDeleteSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/DeleteFluxConfiguration.json + */ + /** + * Sample code: Delete Flux Configuration. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void deleteFluxConfiguration( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .fluxConfigurations() + .delete( "rg1", - ExtensionsClusterRp.MICROSOFT_KUBERNETES, - ExtensionsClusterResourceName.CONNECTED_CLUSTERS, + "Microsoft.Kubernetes", + "connectedClusters", "clusterName1", + "srs-fluxconfig", + null, Context.NONE); } } ``` -### Operations_List +### FluxConfigurations_Get ```java import com.azure.core.util.Context; -/** Samples for Operations List. */ -public final class OperationsListSamples { +/** Samples for FluxConfigurations Get. */ +public final class FluxConfigurationsGetSamples { /* - * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2021-09-01/examples/OperationsList.json + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/GetFluxConfiguration.json */ /** - * Sample code: BatchAccountDelete. + * Sample code: Get Flux Configuration. * * @param manager Entry point to SourceControlConfigurationManager. */ - public static void batchAccountDelete( + public static void getFluxConfiguration( com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { - manager.operations().list(Context.NONE); + manager + .fluxConfigurations() + .getWithResponse( + "rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", "srs-fluxconfig", Context.NONE); + } +} +``` + +### FluxConfigurations_List + +```java +import com.azure.core.util.Context; + +/** Samples for FluxConfigurations List. */ +public final class FluxConfigurationsListSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/ListFluxConfigurations.json + */ + /** + * Sample code: List Flux Configuration. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void listFluxConfiguration( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .fluxConfigurations() + .list("rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", Context.NONE); + } +} +``` + +### FluxConfigurations_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.kubernetesconfiguration.models.FluxConfigurationPatch; +import com.azure.resourcemanager.kubernetesconfiguration.models.GitRepositoryPatchDefinition; +import com.azure.resourcemanager.kubernetesconfiguration.models.KustomizationPatchDefinition; +import java.util.HashMap; +import java.util.Map; + +/** Samples for FluxConfigurations Update. */ +public final class FluxConfigurationsUpdateSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/PatchFluxConfiguration.json + */ + /** + * Sample code: Patch Flux Configuration. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void patchFluxConfiguration( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .fluxConfigurations() + .update( + "rg1", + "Microsoft.Kubernetes", + "connectedClusters", + "clusterName1", + "srs-fluxconfig", + new FluxConfigurationPatch() + .withSuspend(true) + .withGitRepository( + new GitRepositoryPatchDefinition() + .withUrl("https://github.com/jonathan-innis/flux2-kustomize-helm-example.git")) + .withKustomizations( + mapOf( + "srs-kustomization1", + null, + "srs-kustomization2", + new KustomizationPatchDefinition() + .withPath("./test/alt-path") + .withSyncIntervalInSeconds(300L), + "srs-kustomization3", + new KustomizationPatchDefinition() + .withPath("./test/another-path") + .withSyncIntervalInSeconds(300L))), + Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### LocationExtensionTypes_List + +```java +import com.azure.core.util.Context; + +/** Samples for LocationExtensionTypes List. */ +public final class LocationExtensionTypesListSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-01-01-preview/examples/LocationExtensionTypes_List.json + */ + /** + * Sample code: LocationExtensionTypes_List_MaximumSet_Gen. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void locationExtensionTypesListMaximumSetGen( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager.locationExtensionTypes().list("eastus", Context.NONE); + } +} +``` + +### OperationStatus_Get + +```java +import com.azure.core.util.Context; + +/** Samples for OperationStatus Get. */ +public final class OperationStatusGetSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/GetExtensionAsyncOperationStatus.json + */ + /** + * Sample code: ExtensionAsyncOperationStatus Get. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void extensionAsyncOperationStatusGet( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .operationStatus() + .getWithResponse( + "rg1", + "Microsoft.Kubernetes", + "connectedClusters", + "clusterName1", + "ClusterMonitor", + "99999999-9999-9999-9999-999999999999", + Context.NONE); + } +} +``` + +### OperationStatus_List + +```java +import com.azure.core.util.Context; + +/** Samples for OperationStatus List. */ +public final class OperationStatusListSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/ListAsyncOperationStatus.json + */ + /** + * Sample code: AsyncOperationStatus List. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void asyncOperationStatusList( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .operationStatus() + .list("rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", Context.NONE); + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/OperationsList.json + */ + /** + * Sample code: BatchAccountDelete. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void batchAccountDelete( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + +### PrivateEndpointConnections_CreateOrUpdate + +```java +import com.azure.resourcemanager.kubernetesconfiguration.models.PrivateEndpointConnectionProperties; +import com.azure.resourcemanager.kubernetesconfiguration.models.PrivateLinkServiceConnectionStateProperty; + +/** Samples for PrivateEndpointConnections CreateOrUpdate. */ +public final class PrivateEndpointConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/PrivateEndpointConnectionUpdate.json + */ + /** + * Sample code: Approve or reject a private endpoint connection with a given name. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void approveOrRejectAPrivateEndpointConnectionWithAGivenName( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .privateEndpointConnections() + .define("private-endpoint-connection-name") + .withExistingPrivateLinkScope("myResourceGroup", "myPrivateLinkScope") + .withProperties( + new PrivateEndpointConnectionProperties() + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionStateProperty() + .withStatus("Approved") + .withDescription("Approved by johndoe@contoso.com"))) + .create(); + } +} +``` + +### PrivateEndpointConnections_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/PrivateEndpointConnectionDelete.json + */ + /** + * Sample code: Deletes a private endpoint connection with a given name. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void deletesAPrivateEndpointConnectionWithAGivenName( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .privateEndpointConnections() + .delete("myResourceGroup", "myPrivateLinkScope", "private-endpoint-connection-name", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Get + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/PrivateEndpointConnectionGet.json + */ + /** + * Sample code: Gets private endpoint connection. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void getsPrivateEndpointConnection( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .privateEndpointConnections() + .getWithResponse("myResourceGroup", "myPrivateLinkScope", "private-endpoint-connection-name", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_ListByPrivateLinkScope + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections ListByPrivateLinkScope. */ +public final class PrivateEndpointConnectionsListByPrivateLinkScopeSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/PrivateEndpointConnectionList.json + */ + /** + * Sample code: Gets list of private endpoint connections on a private link scope. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void getsListOfPrivateEndpointConnectionsOnAPrivateLinkScope( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .privateEndpointConnections() + .listByPrivateLinkScope("myResourceGroup", "myPrivateLinkScope", Context.NONE); + } +} +``` + +### PrivateLinkResources_Get + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources Get. */ +public final class PrivateLinkResourcesGetSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/PrivateLinkScopePrivateLinkResourceGet.json + */ + /** + * Sample code: Gets private endpoint connection. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void getsPrivateEndpointConnection( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .privateLinkResources() + .getWithResponse("myResourceGroup", "myPrivateLinkScope", "KubernetesConfiguration", Context.NONE); + } +} +``` + +### PrivateLinkResources_ListByPrivateLinkScope + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources ListByPrivateLinkScope. */ +public final class PrivateLinkResourcesListByPrivateLinkScopeSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/PrivateLinkScopePrivateLinkResourceListGet.json + */ + /** + * Sample code: Gets private endpoint connection. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void getsPrivateEndpointConnection( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager.privateLinkResources().listByPrivateLinkScope("myResourceGroup", "myPrivateLinkScope", Context.NONE); + } +} +``` + +### PrivateLinkScopes_CreateOrUpdate + +```java +import java.util.HashMap; +import java.util.Map; + +/** Samples for PrivateLinkScopes CreateOrUpdate. */ +public final class PrivateLinkScopesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/PrivateLinkScopesCreate.json + */ + /** + * Sample code: PrivateLinkScopeCreate. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void privateLinkScopeCreate( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .privateLinkScopes() + .define("my-privatelinkscope") + .withRegion("westus") + .withExistingResourceGroup("my-resource-group") + .create(); + } + + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/PrivateLinkScopesUpdate.json + */ + /** + * Sample code: PrivateLinkScopeUpdate. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void privateLinkScopeUpdate( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .privateLinkScopes() + .define("my-privatelinkscope") + .withRegion("westus") + .withExistingResourceGroup("my-resource-group") + .withTags(mapOf("Tag1", "Value1")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### PrivateLinkScopes_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkScopes Delete. */ +public final class PrivateLinkScopesDeleteSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/PrivateLinkScopesDelete.json + */ + /** + * Sample code: PrivateLinkScopesDelete. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void privateLinkScopesDelete( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager.privateLinkScopes().delete("my-resource-group", "my-privatelinkscope", Context.NONE); + } +} +``` + +### PrivateLinkScopes_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkScopes GetByResourceGroup. */ +public final class PrivateLinkScopesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/PrivateLinkScopesGet.json + */ + /** + * Sample code: PrivateLinkScopeGet. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void privateLinkScopeGet( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .privateLinkScopes() + .getByResourceGroupWithResponse("my-resource-group", "my-privatelinkscope", Context.NONE); + } +} +``` + +### PrivateLinkScopes_GetValidationDetails + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkScopes GetValidationDetails. */ +public final class PrivateLinkScopesGetValidationDetailsSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/PrivateLinkScopesGetValidation.json + */ + /** + * Sample code: PrivateLinkScopeGet. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void privateLinkScopeGet( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .privateLinkScopes() + .getValidationDetailsWithResponse("wus2", "f5dc51d3-92ed-4d7e-947a-775ea79b4919", Context.NONE); + } +} +``` + +### PrivateLinkScopes_GetValidationDetailsForMachine + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkScopes GetValidationDetailsForMachine. */ +public final class PrivateLinkScopesGetValidationDetailsForMachineSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/PrivateLinkScopesGetValidationForMachine.json + */ + /** + * Sample code: PrivateLinkScopeGet. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void privateLinkScopeGet( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .privateLinkScopes() + .getValidationDetailsForMachineWithResponse("my-resource-group", "machineName", Context.NONE); + } +} +``` + +### PrivateLinkScopes_List + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkScopes List. */ +public final class PrivateLinkScopesListSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/PrivateLinkScopesList.json + */ + /** + * Sample code: PrivateLinkScopesList.json. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void privateLinkScopesListJson( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager.privateLinkScopes().list(Context.NONE); + } +} +``` + +### PrivateLinkScopes_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkScopes ListByResourceGroup. */ +public final class PrivateLinkScopesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/PrivateLinkScopesListByResourceGroup.json + */ + /** + * Sample code: PrivateLinkScopeListByResourceGroup. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void privateLinkScopeListByResourceGroup( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager.privateLinkScopes().listByResourceGroup("my-resource-group", Context.NONE); + } +} +``` + +### PrivateLinkScopes_UpdateTags + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.kubernetesconfiguration.models.KubernetesConfigurationPrivateLinkScope; +import java.util.HashMap; +import java.util.Map; + +/** Samples for PrivateLinkScopes UpdateTags. */ +public final class PrivateLinkScopesUpdateTagsSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/PrivateLinkScopesUpdateTagsOnly.json + */ + /** + * Sample code: PrivateLinkScopeUpdateTagsOnly. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void privateLinkScopeUpdateTagsOnly( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + KubernetesConfigurationPrivateLinkScope resource = + manager + .privateLinkScopes() + .getByResourceGroupWithResponse("my-resource-group", "my-privatelinkscope", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("Tag1", "Value1", "Tag2", "Value2")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### SourceControlConfigurations_CreateOrUpdate + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.SourceControlConfigurationInner; +import com.azure.resourcemanager.kubernetesconfiguration.models.HelmOperatorProperties; +import com.azure.resourcemanager.kubernetesconfiguration.models.OperatorScopeType; +import com.azure.resourcemanager.kubernetesconfiguration.models.OperatorType; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SourceControlConfigurations CreateOrUpdate. */ +public final class SourceControlConfigurationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/CreateSourceControlConfiguration.json + */ + /** + * Sample code: Create Source Control Configuration. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void createSourceControlConfiguration( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .sourceControlConfigurations() + .createOrUpdateWithResponse( + "rg1", + "Microsoft.Kubernetes", + "connectedClusters", + "clusterName1", + "SRS_GitHubConfig", + new SourceControlConfigurationInner() + .withRepositoryUrl("git@github.com:k8sdeveloper425/flux-get-started") + .withOperatorNamespace("SRS_Namespace") + .withOperatorInstanceName("SRSGitHubFluxOp-01") + .withOperatorType(OperatorType.FLUX) + .withOperatorParams("--git-email=xyzgituser@users.srs.github.com") + .withConfigurationProtectedSettings(mapOf("protectedSetting1Key", "protectedSetting1Value")) + .withOperatorScope(OperatorScopeType.NAMESPACE) + .withSshKnownHostsContents( + "c3NoLmRldi5henVyZS5jb20gc3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBREFRQUJBQUFCQVFDN0hyMW9UV3FOcU9sekdKT2ZHSjROYWtWeUl6ZjFyWFlkNGQ3d282akJsa0x2Q0E0b2RCbEwwbURVeVowL1FVZlRUcWV1K3RtMjJnT3N2K1ZyVlRNazZ2d1JVNzVnWS95OXV0NU1iM2JSNUJWNThkS1h5cTlBOVVlQjVDYWtlaG41WmdtNngxbUtvVnlmK0ZGbjI2aVlxWEpSZ3pJWlpjWjVWNmhyRTBRZzM5a1ptNGF6NDhvMEFVYmY2U3A0U0xkdm51TWEyc1ZOd0hCYm9TN0VKa201N1hRUFZVMy9RcHlOTEhiV0Rkend0cmxTK2V6MzBTM0FkWWhMS0VPeEFHOHdlT255cnRMSkFVZW45bVRrb2w4b0lJMWVkZjdtV1diV1ZmMG5CbWx5MjErblpjbUNUSVNRQnRkY3lQYUVubzdmRlFNREQyNi9zMGxmS29iNEt3OEg=") + .withEnableHelmOperator(true) + .withHelmOperatorProperties( + new HelmOperatorProperties() + .withChartVersion("0.3.0") + .withChartValues( + "--set git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system")), + Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### SourceControlConfigurations_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for SourceControlConfigurations Delete. */ +public final class SourceControlConfigurationsDeleteSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/DeleteSourceControlConfiguration.json + */ + /** + * Sample code: Delete Source Control Configuration. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void deleteSourceControlConfiguration( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .sourceControlConfigurations() + .delete( + "rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", "SRS_GitHubConfig", Context.NONE); + } +} +``` + +### SourceControlConfigurations_Get + +```java +import com.azure.core.util.Context; + +/** Samples for SourceControlConfigurations Get. */ +public final class SourceControlConfigurationsGetSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/GetSourceControlConfiguration.json + */ + /** + * Sample code: Get Source Control Configuration. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void getSourceControlConfiguration( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .sourceControlConfigurations() + .getWithResponse( + "rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", "SRS_GitHubConfig", Context.NONE); + } +} +``` + +### SourceControlConfigurations_List + +```java +import com.azure.core.util.Context; + +/** Samples for SourceControlConfigurations List. */ +public final class SourceControlConfigurationsListSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/ListSourceControlConfiguration.json + */ + /** + * Sample code: List Source Control Configuration. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void listSourceControlConfiguration( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .sourceControlConfigurations() + .list("rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", Context.NONE); } } ``` diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/pom.xml b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/pom.xml index 8844cf4b25a5f..2e981d32e3f38 100644 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/pom.xml +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/pom.xml @@ -13,7 +13,7 @@ jar Microsoft Azure SDK for SourceControlConfiguration Management - This package contains Microsoft Azure SDK for SourceControlConfiguration Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. KubernetesConfiguration Client. Package tag package-2021-09. + This package contains Microsoft Azure SDK for SourceControlConfiguration Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. KubernetesConfiguration Client. Package tag package-preview-2022-04. https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/SourceControlConfigurationManager.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/SourceControlConfigurationManager.java index e6f9a4b6b3016..2887a8555bbed 100644 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/SourceControlConfigurationManager.java +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/SourceControlConfigurationManager.java @@ -22,13 +22,33 @@ import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.kubernetesconfiguration.fluent.SourceControlConfigurationClient; +import com.azure.resourcemanager.kubernetesconfiguration.implementation.ClusterExtensionTypesImpl; +import com.azure.resourcemanager.kubernetesconfiguration.implementation.ClusterExtensionTypesOperationsImpl; +import com.azure.resourcemanager.kubernetesconfiguration.implementation.ExtensionTypeVersionsImpl; import com.azure.resourcemanager.kubernetesconfiguration.implementation.ExtensionsImpl; +import com.azure.resourcemanager.kubernetesconfiguration.implementation.FluxConfigOperationStatusImpl; +import com.azure.resourcemanager.kubernetesconfiguration.implementation.FluxConfigurationsImpl; +import com.azure.resourcemanager.kubernetesconfiguration.implementation.LocationExtensionTypesImpl; import com.azure.resourcemanager.kubernetesconfiguration.implementation.OperationStatusImpl; import com.azure.resourcemanager.kubernetesconfiguration.implementation.OperationsImpl; +import com.azure.resourcemanager.kubernetesconfiguration.implementation.PrivateEndpointConnectionsImpl; +import com.azure.resourcemanager.kubernetesconfiguration.implementation.PrivateLinkResourcesImpl; +import com.azure.resourcemanager.kubernetesconfiguration.implementation.PrivateLinkScopesImpl; import com.azure.resourcemanager.kubernetesconfiguration.implementation.SourceControlConfigurationClientBuilder; +import com.azure.resourcemanager.kubernetesconfiguration.implementation.SourceControlConfigurationsImpl; +import com.azure.resourcemanager.kubernetesconfiguration.models.ClusterExtensionTypes; +import com.azure.resourcemanager.kubernetesconfiguration.models.ClusterExtensionTypesOperations; +import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionTypeVersions; import com.azure.resourcemanager.kubernetesconfiguration.models.Extensions; +import com.azure.resourcemanager.kubernetesconfiguration.models.FluxConfigOperationStatus; +import com.azure.resourcemanager.kubernetesconfiguration.models.FluxConfigurations; +import com.azure.resourcemanager.kubernetesconfiguration.models.LocationExtensionTypes; import com.azure.resourcemanager.kubernetesconfiguration.models.OperationStatus; import com.azure.resourcemanager.kubernetesconfiguration.models.Operations; +import com.azure.resourcemanager.kubernetesconfiguration.models.PrivateEndpointConnections; +import com.azure.resourcemanager.kubernetesconfiguration.models.PrivateLinkResources; +import com.azure.resourcemanager.kubernetesconfiguration.models.PrivateLinkScopes; +import com.azure.resourcemanager.kubernetesconfiguration.models.SourceControlConfigurations; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; @@ -38,12 +58,32 @@ /** Entry point to SourceControlConfigurationManager. KubernetesConfiguration Client. */ public final class SourceControlConfigurationManager { + private ClusterExtensionTypes clusterExtensionTypes; + + private ClusterExtensionTypesOperations clusterExtensionTypesOperations; + + private ExtensionTypeVersions extensionTypeVersions; + + private LocationExtensionTypes locationExtensionTypes; + private Extensions extensions; private OperationStatus operationStatus; + private FluxConfigurations fluxConfigurations; + + private FluxConfigOperationStatus fluxConfigOperationStatus; + + private SourceControlConfigurations sourceControlConfigurations; + private Operations operations; + private PrivateLinkScopes privateLinkScopes; + + private PrivateLinkResources privateLinkResources; + + private PrivateEndpointConnections privateEndpointConnections; + private final SourceControlConfigurationClient clientObject; private SourceControlConfigurationManager( @@ -182,7 +222,7 @@ public SourceControlConfigurationManager authenticate(TokenCredential credential .append("-") .append("com.azure.resourcemanager.kubernetesconfiguration") .append("/") - .append("1.0.0-beta.2"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -234,6 +274,40 @@ public SourceControlConfigurationManager authenticate(TokenCredential credential } } + /** @return Resource collection API of ClusterExtensionTypes. */ + public ClusterExtensionTypes clusterExtensionTypes() { + if (this.clusterExtensionTypes == null) { + this.clusterExtensionTypes = new ClusterExtensionTypesImpl(clientObject.getClusterExtensionTypes(), this); + } + return clusterExtensionTypes; + } + + /** @return Resource collection API of ClusterExtensionTypesOperations. */ + public ClusterExtensionTypesOperations clusterExtensionTypesOperations() { + if (this.clusterExtensionTypesOperations == null) { + this.clusterExtensionTypesOperations = + new ClusterExtensionTypesOperationsImpl(clientObject.getClusterExtensionTypesOperations(), this); + } + return clusterExtensionTypesOperations; + } + + /** @return Resource collection API of ExtensionTypeVersions. */ + public ExtensionTypeVersions extensionTypeVersions() { + if (this.extensionTypeVersions == null) { + this.extensionTypeVersions = new ExtensionTypeVersionsImpl(clientObject.getExtensionTypeVersions(), this); + } + return extensionTypeVersions; + } + + /** @return Resource collection API of LocationExtensionTypes. */ + public LocationExtensionTypes locationExtensionTypes() { + if (this.locationExtensionTypes == null) { + this.locationExtensionTypes = + new LocationExtensionTypesImpl(clientObject.getLocationExtensionTypes(), this); + } + return locationExtensionTypes; + } + /** @return Resource collection API of Extensions. */ public Extensions extensions() { if (this.extensions == null) { @@ -250,6 +324,32 @@ public OperationStatus operationStatus() { return operationStatus; } + /** @return Resource collection API of FluxConfigurations. */ + public FluxConfigurations fluxConfigurations() { + if (this.fluxConfigurations == null) { + this.fluxConfigurations = new FluxConfigurationsImpl(clientObject.getFluxConfigurations(), this); + } + return fluxConfigurations; + } + + /** @return Resource collection API of FluxConfigOperationStatus. */ + public FluxConfigOperationStatus fluxConfigOperationStatus() { + if (this.fluxConfigOperationStatus == null) { + this.fluxConfigOperationStatus = + new FluxConfigOperationStatusImpl(clientObject.getFluxConfigOperationStatus(), this); + } + return fluxConfigOperationStatus; + } + + /** @return Resource collection API of SourceControlConfigurations. */ + public SourceControlConfigurations sourceControlConfigurations() { + if (this.sourceControlConfigurations == null) { + this.sourceControlConfigurations = + new SourceControlConfigurationsImpl(clientObject.getSourceControlConfigurations(), this); + } + return sourceControlConfigurations; + } + /** @return Resource collection API of Operations. */ public Operations operations() { if (this.operations == null) { @@ -258,6 +358,31 @@ public Operations operations() { return operations; } + /** @return Resource collection API of PrivateLinkScopes. */ + public PrivateLinkScopes privateLinkScopes() { + if (this.privateLinkScopes == null) { + this.privateLinkScopes = new PrivateLinkScopesImpl(clientObject.getPrivateLinkScopes(), this); + } + return privateLinkScopes; + } + + /** @return Resource collection API of PrivateLinkResources. */ + public PrivateLinkResources privateLinkResources() { + if (this.privateLinkResources == null) { + this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); + } + return privateLinkResources; + } + + /** @return Resource collection API of PrivateEndpointConnections. */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections = + new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + } + return privateEndpointConnections; + } + /** * @return Wrapped service client SourceControlConfigurationClient providing direct access to the underlying * auto-generated API implementation, based on Azure REST API. diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/ClusterExtensionTypesClient.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/ClusterExtensionTypesClient.java new file mode 100644 index 0000000000000..8a5f0385b88c6 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/ClusterExtensionTypesClient.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.ExtensionTypeInner; +import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterResourceName; +import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterRp; + +/** An instance of this class provides access to all the operations defined in ClusterExtensionTypesClient. */ +public interface ClusterExtensionTypesClient { + /** + * Get Extension Type details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or + * Microsoft.Kubernetes (for OnPrem K8S clusters). + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or + * connectedClusters (for OnPrem K8S clusters). + * @param clusterName The name of the kubernetes cluster. + * @param extensionTypeName Extension type name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return extension Type details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExtensionTypeInner get( + String resourceGroupName, + ExtensionsClusterRp clusterRp, + ExtensionsClusterResourceName clusterResourceName, + String clusterName, + String extensionTypeName); + + /** + * Get Extension Type details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or + * Microsoft.Kubernetes (for OnPrem K8S clusters). + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or + * connectedClusters (for OnPrem K8S clusters). + * @param clusterName The name of the kubernetes cluster. + * @param extensionTypeName Extension type name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return extension Type details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + ExtensionsClusterRp clusterRp, + ExtensionsClusterResourceName clusterResourceName, + String clusterName, + String extensionTypeName, + Context context); +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/ClusterExtensionTypesOperationsClient.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/ClusterExtensionTypesOperationsClient.java new file mode 100644 index 0000000000000..cf286b84c7a87 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/ClusterExtensionTypesOperationsClient.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.ExtensionTypeInner; +import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterResourceName; +import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterRp; + +/** An instance of this class provides access to all the operations defined in ClusterExtensionTypesOperationsClient. */ +public interface ClusterExtensionTypesOperationsClient { + /** + * Get Extension Types. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or + * Microsoft.Kubernetes (for OnPrem K8S clusters). + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or + * connectedClusters (for OnPrem K8S clusters). + * @param clusterName The name of the kubernetes cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return extension Types as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, + ExtensionsClusterRp clusterRp, + ExtensionsClusterResourceName clusterResourceName, + String clusterName); + + /** + * Get Extension Types. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or + * Microsoft.Kubernetes (for OnPrem K8S clusters). + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or + * connectedClusters (for OnPrem K8S clusters). + * @param clusterName The name of the kubernetes cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return extension Types as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, + ExtensionsClusterRp clusterRp, + ExtensionsClusterResourceName clusterResourceName, + String clusterName, + Context context); +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/ExtensionTypeVersionsClient.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/ExtensionTypeVersionsClient.java new file mode 100644 index 0000000000000..72d7050bb36c2 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/ExtensionTypeVersionsClient.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionVersionListVersionsItem; + +/** An instance of this class provides access to all the operations defined in ExtensionTypeVersionsClient. */ +public interface ExtensionTypeVersionsClient { + /** + * List available versions for an Extension Type. + * + * @param location extension location. + * @param extensionTypeName Extension type name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list versions for an Extension as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, String extensionTypeName); + + /** + * List available versions for an Extension Type. + * + * @param location extension location. + * @param extensionTypeName Extension type name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list versions for an Extension as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, String extensionTypeName, Context context); +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/ExtensionsClient.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/ExtensionsClient.java index 160afff19a486..0643ae0f6084f 100644 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/ExtensionsClient.java +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/ExtensionsClient.java @@ -12,8 +12,6 @@ import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.ExtensionInner; -import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterResourceName; -import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterRp; import com.azure.resourcemanager.kubernetesconfiguration.models.PatchExtension; /** An instance of this class provides access to all the operations defined in ExtensionsClient. */ @@ -22,23 +20,23 @@ public interface ExtensionsClient { * Create a new Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param extension Properties necessary to Create an Extension. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Extension object. + * @return the {@link SyncPoller} for polling of the Extension object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ExtensionInner> beginCreate( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, ExtensionInner extension); @@ -47,10 +45,10 @@ SyncPoller, ExtensionInner> beginCreate( * Create a new Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param extension Properties necessary to Create an Extension. @@ -58,13 +56,13 @@ SyncPoller, ExtensionInner> beginCreate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Extension object. + * @return the {@link SyncPoller} for polling of the Extension object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ExtensionInner> beginCreate( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, ExtensionInner extension, @@ -74,10 +72,10 @@ SyncPoller, ExtensionInner> beginCreate( * Create a new Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param extension Properties necessary to Create an Extension. @@ -89,8 +87,8 @@ SyncPoller, ExtensionInner> beginCreate( @ServiceMethod(returns = ReturnType.SINGLE) ExtensionInner create( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, ExtensionInner extension); @@ -99,10 +97,10 @@ ExtensionInner create( * Create a new Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param extension Properties necessary to Create an Extension. @@ -115,8 +113,8 @@ ExtensionInner create( @ServiceMethod(returns = ReturnType.SINGLE) ExtensionInner create( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, ExtensionInner extension, @@ -126,10 +124,10 @@ ExtensionInner create( * Gets Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -140,8 +138,8 @@ ExtensionInner create( @ServiceMethod(returns = ReturnType.SINGLE) ExtensionInner get( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName); @@ -149,23 +147,23 @@ ExtensionInner get( * Gets Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return kubernetes Cluster Extension. + * @return kubernetes Cluster Extension along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, Context context); @@ -174,23 +172,23 @@ Response getWithResponse( * Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension from the cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param forceDelete Delete the extension resource in Azure - not the normal asynchronous delete. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, Boolean forceDelete); @@ -199,10 +197,10 @@ SyncPoller, Void> beginDelete( * Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension from the cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param forceDelete Delete the extension resource in Azure - not the normal asynchronous delete. @@ -210,13 +208,13 @@ SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, Boolean forceDelete, @@ -226,10 +224,10 @@ SyncPoller, Void> beginDelete( * Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension from the cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param forceDelete Delete the extension resource in Azure - not the normal asynchronous delete. @@ -240,8 +238,8 @@ SyncPoller, Void> beginDelete( @ServiceMethod(returns = ReturnType.SINGLE) void delete( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, Boolean forceDelete); @@ -250,10 +248,10 @@ void delete( * Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension from the cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -263,8 +261,8 @@ void delete( @ServiceMethod(returns = ReturnType.SINGLE) void delete( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName); @@ -272,10 +270,10 @@ void delete( * Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension from the cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param forceDelete Delete the extension resource in Azure - not the normal asynchronous delete. @@ -287,8 +285,8 @@ void delete( @ServiceMethod(returns = ReturnType.SINGLE) void delete( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, Boolean forceDelete, @@ -298,23 +296,23 @@ void delete( * Patch an existing Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param patchExtension Properties to Patch in an existing Extension. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Extension object. + * @return the {@link SyncPoller} for polling of the Extension object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ExtensionInner> beginUpdate( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, PatchExtension patchExtension); @@ -323,10 +321,10 @@ SyncPoller, ExtensionInner> beginUpdate( * Patch an existing Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param patchExtension Properties to Patch in an existing Extension. @@ -334,13 +332,13 @@ SyncPoller, ExtensionInner> beginUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Extension object. + * @return the {@link SyncPoller} for polling of the Extension object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ExtensionInner> beginUpdate( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, PatchExtension patchExtension, @@ -350,10 +348,10 @@ SyncPoller, ExtensionInner> beginUpdate( * Patch an existing Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param patchExtension Properties to Patch in an existing Extension. @@ -365,8 +363,8 @@ SyncPoller, ExtensionInner> beginUpdate( @ServiceMethod(returns = ReturnType.SINGLE) ExtensionInner update( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, PatchExtension patchExtension); @@ -375,10 +373,10 @@ ExtensionInner update( * Patch an existing Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param patchExtension Properties to Patch in an existing Extension. @@ -391,8 +389,8 @@ ExtensionInner update( @ServiceMethod(returns = ReturnType.SINGLE) ExtensionInner update( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, PatchExtension patchExtension, @@ -402,43 +400,36 @@ ExtensionInner update( * List all Extensions in the cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Extensions. + * @return result of the request to list Extensions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list( - String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, - String clusterName); + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName); /** * List all Extensions in the cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Extensions. + * @return result of the request to list Extensions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list( - String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, - String clusterName, - Context context); + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, Context context); } diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/FluxConfigOperationStatusClient.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/FluxConfigOperationStatusClient.java new file mode 100644 index 0000000000000..813fe4c5623d9 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/FluxConfigOperationStatusClient.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.OperationStatusResultInner; + +/** An instance of this class provides access to all the operations defined in FluxConfigOperationStatusClient. */ +public interface FluxConfigOperationStatusClient { + /** + * Get Async Operation status. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param operationId operation Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return async Operation status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner get( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + String operationId); + + /** + * Get Async Operation status. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param operationId operation Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return async Operation status along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + String operationId, + Context context); +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/FluxConfigurationsClient.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/FluxConfigurationsClient.java new file mode 100644 index 0000000000000..117c7f759de5e --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/FluxConfigurationsClient.java @@ -0,0 +1,440 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.FluxConfigurationInner; +import com.azure.resourcemanager.kubernetesconfiguration.models.FluxConfigurationPatch; + +/** An instance of this class provides access to all the operations defined in FluxConfigurationsClient. */ +public interface FluxConfigurationsClient { + /** + * Gets details of the Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the Flux Configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FluxConfigurationInner get( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName); + + /** + * Gets details of the Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the Flux Configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + Context context); + + /** + * Create a new Kubernetes Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfiguration Properties necessary to Create a FluxConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Flux Configuration object returned in Get & Put response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FluxConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + FluxConfigurationInner fluxConfiguration); + + /** + * Create a new Kubernetes Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfiguration Properties necessary to Create a FluxConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Flux Configuration object returned in Get & Put response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FluxConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + FluxConfigurationInner fluxConfiguration, + Context context); + + /** + * Create a new Kubernetes Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfiguration Properties necessary to Create a FluxConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Flux Configuration object returned in Get & Put response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FluxConfigurationInner createOrUpdate( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + FluxConfigurationInner fluxConfiguration); + + /** + * Create a new Kubernetes Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfiguration Properties necessary to Create a FluxConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Flux Configuration object returned in Get & Put response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FluxConfigurationInner createOrUpdate( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + FluxConfigurationInner fluxConfiguration, + Context context); + + /** + * Update an existing Kubernetes Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfigurationPatch Properties to Patch in an existing Flux Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Flux Configuration object returned in Get & Put response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FluxConfigurationInner> beginUpdate( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + FluxConfigurationPatch fluxConfigurationPatch); + + /** + * Update an existing Kubernetes Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfigurationPatch Properties to Patch in an existing Flux Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Flux Configuration object returned in Get & Put response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FluxConfigurationInner> beginUpdate( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + FluxConfigurationPatch fluxConfigurationPatch, + Context context); + + /** + * Update an existing Kubernetes Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfigurationPatch Properties to Patch in an existing Flux Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Flux Configuration object returned in Get & Put response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FluxConfigurationInner update( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + FluxConfigurationPatch fluxConfigurationPatch); + + /** + * Update an existing Kubernetes Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfigurationPatch Properties to Patch in an existing Flux Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Flux Configuration object returned in Get & Put response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FluxConfigurationInner update( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + FluxConfigurationPatch fluxConfigurationPatch, + Context context); + + /** + * This will delete the YAML file used to set up the Flux Configuration, thus stopping future sync from the source + * repo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param forceDelete Delete the extension resource in Azure - not the normal asynchronous delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + Boolean forceDelete); + + /** + * This will delete the YAML file used to set up the Flux Configuration, thus stopping future sync from the source + * repo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param forceDelete Delete the extension resource in Azure - not the normal asynchronous delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + Boolean forceDelete, + Context context); + + /** + * This will delete the YAML file used to set up the Flux Configuration, thus stopping future sync from the source + * repo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param forceDelete Delete the extension resource in Azure - not the normal asynchronous delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + Boolean forceDelete); + + /** + * This will delete the YAML file used to set up the Flux Configuration, thus stopping future sync from the source + * repo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName); + + /** + * This will delete the YAML file used to set up the Flux Configuration, thus stopping future sync from the source + * repo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param forceDelete Delete the extension resource in Azure - not the normal asynchronous delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + Boolean forceDelete, + Context context); + + /** + * List all Flux Configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Flux Configurations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName); + + /** + * List all Flux Configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Flux Configurations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, Context context); +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/LocationExtensionTypesClient.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/LocationExtensionTypesClient.java new file mode 100644 index 0000000000000..c71f347d6963c --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/LocationExtensionTypesClient.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.ExtensionTypeInner; + +/** An instance of this class provides access to all the operations defined in LocationExtensionTypesClient. */ +public interface LocationExtensionTypesClient { + /** + * List all Extension Types. + * + * @param location extension location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Types as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location); + + /** + * List all Extension Types. + * + * @param location extension location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Types as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, Context context); +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/OperationStatusClient.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/OperationStatusClient.java index 547e3501efaae..70a8eaa3a7ddf 100644 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/OperationStatusClient.java +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/OperationStatusClient.java @@ -10,104 +10,95 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.OperationStatusResultInner; -import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterResourceName; -import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterRp; /** An instance of this class provides access to all the operations defined in OperationStatusClient. */ public interface OperationStatusClient { /** - * List Async Operations, currently in progress, in a cluster. + * Get Async Operation status. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. + * @param extensionName Name of the Extension. + * @param operationId operation Id. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the async operations in progress, in the cluster. + * @return async Operation status. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner get( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, - String clusterName); + String clusterRp, + String clusterResourceName, + String clusterName, + String extensionName, + String operationId); /** - * List Async Operations, currently in progress, in a cluster. + * Get Async Operation status. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. + * @param extensionName Name of the Extension. + * @param operationId operation Id. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the async operations in progress, in the cluster. + * @return async Operation status along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, + String extensionName, + String operationId, Context context); /** - * Get Async Operation status. + * List Async Operations, currently in progress, in a cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. - * @param extensionName Name of the Extension. - * @param operationId operation Id. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return async Operation status. + * @return the async operations in progress, in the cluster as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - OperationStatusResultInner get( - String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, - String clusterName, - String extensionName, - String operationId); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName); /** - * Get Async Operation status. + * List Async Operations, currently in progress, in a cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. - * @param extensionName Name of the Extension. - * @param operationId operation Id. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return async Operation status. + * @return the async operations in progress, in the cluster as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, - String clusterName, - String extensionName, - String operationId, - Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, Context context); } diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/OperationsClient.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/OperationsClient.java index d0a139ee34fe2..eac1c3bcd1936 100644 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/OperationsClient.java +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/OperationsClient.java @@ -13,23 +13,23 @@ /** An instance of this class provides access to all the operations defined in OperationsClient. */ public interface OperationsClient { /** - * List all the available operations the KubernetesConfiguration resource provider supports, in this api-version. + * List all the available operations the KubernetesConfiguration resource provider supports. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list operations. + * @return result of the request to list operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); /** - * List all the available operations the KubernetesConfiguration resource provider supports, in this api-version. + * List all the available operations the KubernetesConfiguration resource provider supports. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list operations. + * @return result of the request to list operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/PrivateEndpointConnectionsClient.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/PrivateEndpointConnectionsClient.java new file mode 100644 index 0000000000000..c820106c185f0 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/PrivateEndpointConnectionsClient.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.PrivateEndpointConnectionInner; + +/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +public interface PrivateEndpointConnectionsClient { + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner get( + String resourceGroupName, String scopeName, String privateEndpointConnectionName); + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context); + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String scopeName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters); + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String scopeName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context); + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner createOrUpdate( + String resourceGroupName, + String scopeName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters); + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner createOrUpdate( + String resourceGroupName, + String scopeName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String scopeName, String privateEndpointConnectionName); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String scopeName, String privateEndpointConnectionName); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context); + + /** + * Gets all private endpoint connections on a private link scope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoint connections on a private link scope as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByPrivateLinkScope(String resourceGroupName, String scopeName); + + /** + * Gets all private endpoint connections on a private link scope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoint connections on a private link scope as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByPrivateLinkScope( + String resourceGroupName, String scopeName, Context context); +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/PrivateLinkResourcesClient.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/PrivateLinkResourcesClient.java new file mode 100644 index 0000000000000..ee4f35b941919 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/PrivateLinkResourcesClient.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.PrivateLinkResourceInner; + +/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ +public interface PrivateLinkResourcesClient { + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByPrivateLinkScope(String resourceGroupName, String scopeName); + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByPrivateLinkScope( + String resourceGroupName, String scopeName, Context context); + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param groupName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkResourceInner get(String resourceGroupName, String scopeName, String groupName); + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param groupName The name of the private link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String scopeName, String groupName, Context context); +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/PrivateLinkScopesClient.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/PrivateLinkScopesClient.java new file mode 100644 index 0000000000000..e903fdb055135 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/PrivateLinkScopesClient.java @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.KubernetesConfigurationPrivateLinkScopeInner; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.PrivateLinkScopeValidationDetailsInner; +import com.azure.resourcemanager.kubernetesconfiguration.models.TagsResource; + +/** An instance of this class provides access to all the operations defined in PrivateLinkScopesClient. */ +public interface PrivateLinkScopesClient { + /** + * Gets a list of all Azure Arc PrivateLinkScopes within a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all Azure Arc PrivateLinkScopes within a subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets a list of all Azure Arc PrivateLinkScopes within a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all Azure Arc PrivateLinkScopes within a subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets a list of Azure Arc PrivateLinkScopes within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Azure Arc PrivateLinkScopes within a resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets a list of Azure Arc PrivateLinkScopes within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Azure Arc PrivateLinkScopes within a resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup( + String resourceGroupName, Context context); + + /** + * Deletes a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String scopeName); + + /** + * Deletes a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String scopeName, Context context); + + /** + * Deletes a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String scopeName); + + /** + * Deletes a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String scopeName, Context context); + + /** + * Returns a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KubernetesConfigurationPrivateLinkScopeInner getByResourceGroup(String resourceGroupName, String scopeName); + + /** + * Returns a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String scopeName, Context context); + + /** + * Creates (or updates) a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for + * InstrumentationKey nor AppId in the Put operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param parameters Properties that need to be specified to create or update a Azure Arc for Servers and Clusters + * PrivateLinkScope. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KubernetesConfigurationPrivateLinkScopeInner createOrUpdate( + String resourceGroupName, String scopeName, KubernetesConfigurationPrivateLinkScopeInner parameters); + + /** + * Creates (or updates) a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for + * InstrumentationKey nor AppId in the Put operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param parameters Properties that need to be specified to create or update a Azure Arc for Servers and Clusters + * PrivateLinkScope. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String scopeName, + KubernetesConfigurationPrivateLinkScopeInner parameters, + Context context); + + /** + * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateLinkScopeTags Updated tag information to set into the PrivateLinkScope instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KubernetesConfigurationPrivateLinkScopeInner updateTags( + String resourceGroupName, String scopeName, TagsResource privateLinkScopeTags); + + /** + * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateLinkScopeTags Updated tag information to set into the PrivateLinkScope instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String scopeName, TagsResource privateLinkScopeTags, Context context); + + /** + * Returns a Azure Arc PrivateLinkScope's validation details. + * + * @param location The location of the target resource. + * @param privateLinkScopeId The id (Guid) of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkScopeValidationDetailsInner getValidationDetails(String location, String privateLinkScopeId); + + /** + * Returns a Azure Arc PrivateLinkScope's validation details. + * + * @param location The location of the target resource. + * @param privateLinkScopeId The id (Guid) of the Azure Arc PrivateLinkScope resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getValidationDetailsWithResponse( + String location, String privateLinkScopeId, Context context); + + /** + * Returns a Azure Arc PrivateLinkScope's validation details for a given machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the target machine to get the private link scope validation details for. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkScopeValidationDetailsInner getValidationDetailsForMachine(String resourceGroupName, String machineName); + + /** + * Returns a Azure Arc PrivateLinkScope's validation details for a given machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the target machine to get the private link scope validation details for. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getValidationDetailsForMachineWithResponse( + String resourceGroupName, String machineName, Context context); +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/SourceControlConfigurationClient.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/SourceControlConfigurationClient.java index 1d6bb99765877..806218215ecec 100644 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/SourceControlConfigurationClient.java +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/SourceControlConfigurationClient.java @@ -23,13 +23,6 @@ public interface SourceControlConfigurationClient { */ String getEndpoint(); - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - String getApiVersion(); - /** * Gets The HTTP pipeline to send requests through. * @@ -44,6 +37,34 @@ public interface SourceControlConfigurationClient { */ Duration getDefaultPollInterval(); + /** + * Gets the ClusterExtensionTypesClient object to access its operations. + * + * @return the ClusterExtensionTypesClient object. + */ + ClusterExtensionTypesClient getClusterExtensionTypes(); + + /** + * Gets the ClusterExtensionTypesOperationsClient object to access its operations. + * + * @return the ClusterExtensionTypesOperationsClient object. + */ + ClusterExtensionTypesOperationsClient getClusterExtensionTypesOperations(); + + /** + * Gets the ExtensionTypeVersionsClient object to access its operations. + * + * @return the ExtensionTypeVersionsClient object. + */ + ExtensionTypeVersionsClient getExtensionTypeVersions(); + + /** + * Gets the LocationExtensionTypesClient object to access its operations. + * + * @return the LocationExtensionTypesClient object. + */ + LocationExtensionTypesClient getLocationExtensionTypes(); + /** * Gets the ExtensionsClient object to access its operations. * @@ -58,10 +79,52 @@ public interface SourceControlConfigurationClient { */ OperationStatusClient getOperationStatus(); + /** + * Gets the FluxConfigurationsClient object to access its operations. + * + * @return the FluxConfigurationsClient object. + */ + FluxConfigurationsClient getFluxConfigurations(); + + /** + * Gets the FluxConfigOperationStatusClient object to access its operations. + * + * @return the FluxConfigOperationStatusClient object. + */ + FluxConfigOperationStatusClient getFluxConfigOperationStatus(); + + /** + * Gets the SourceControlConfigurationsClient object to access its operations. + * + * @return the SourceControlConfigurationsClient object. + */ + SourceControlConfigurationsClient getSourceControlConfigurations(); + /** * Gets the OperationsClient object to access its operations. * * @return the OperationsClient object. */ OperationsClient getOperations(); + + /** + * Gets the PrivateLinkScopesClient object to access its operations. + * + * @return the PrivateLinkScopesClient object. + */ + PrivateLinkScopesClient getPrivateLinkScopes(); + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + PrivateLinkResourcesClient getPrivateLinkResources(); + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + PrivateEndpointConnectionsClient getPrivateEndpointConnections(); } diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/SourceControlConfigurationsClient.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/SourceControlConfigurationsClient.java new file mode 100644 index 0000000000000..64eb81473e4f4 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/SourceControlConfigurationsClient.java @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.SourceControlConfigurationInner; + +/** An instance of this class provides access to all the operations defined in SourceControlConfigurationsClient. */ +public interface SourceControlConfigurationsClient { + /** + * Gets details of the Source Control Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the Source Control Configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SourceControlConfigurationInner get( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName); + + /** + * Gets details of the Source Control Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the Source Control Configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName, + Context context); + + /** + * Create a new Kubernetes Source Control Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @param sourceControlConfiguration Properties necessary to Create KubernetesConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SourceControl Configuration object returned in Get & Put response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SourceControlConfigurationInner createOrUpdate( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName, + SourceControlConfigurationInner sourceControlConfiguration); + + /** + * Create a new Kubernetes Source Control Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @param sourceControlConfiguration Properties necessary to Create KubernetesConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SourceControl Configuration object returned in Get & Put response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName, + SourceControlConfigurationInner sourceControlConfiguration, + Context context); + + /** + * This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from + * the source repo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName); + + /** + * This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from + * the source repo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName, + Context context); + + /** + * This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from + * the source repo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName); + + /** + * This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from + * the source repo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName, + Context context); + + /** + * List all Source Control Configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Source Control Configurations as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName); + + /** + * List all Source Control Configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Source Control Configurations as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, Context context); +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/ClusterScopeSettingsProperties.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/ClusterScopeSettingsProperties.java new file mode 100644 index 0000000000000..05f7deae6e118 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/ClusterScopeSettingsProperties.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Extension scope settings. */ +@Fluent +public final class ClusterScopeSettingsProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterScopeSettingsProperties.class); + + /* + * Describes if multiple instances of the extension are allowed + */ + @JsonProperty(value = "allowMultipleInstances") + private Boolean allowMultipleInstances; + + /* + * Default extension release namespace + */ + @JsonProperty(value = "defaultReleaseNamespace") + private String defaultReleaseNamespace; + + /** + * Get the allowMultipleInstances property: Describes if multiple instances of the extension are allowed. + * + * @return the allowMultipleInstances value. + */ + public Boolean allowMultipleInstances() { + return this.allowMultipleInstances; + } + + /** + * Set the allowMultipleInstances property: Describes if multiple instances of the extension are allowed. + * + * @param allowMultipleInstances the allowMultipleInstances value to set. + * @return the ClusterScopeSettingsProperties object itself. + */ + public ClusterScopeSettingsProperties withAllowMultipleInstances(Boolean allowMultipleInstances) { + this.allowMultipleInstances = allowMultipleInstances; + return this; + } + + /** + * Get the defaultReleaseNamespace property: Default extension release namespace. + * + * @return the defaultReleaseNamespace value. + */ + public String defaultReleaseNamespace() { + return this.defaultReleaseNamespace; + } + + /** + * Set the defaultReleaseNamespace property: Default extension release namespace. + * + * @param defaultReleaseNamespace the defaultReleaseNamespace value to set. + * @return the ClusterScopeSettingsProperties object itself. + */ + public ClusterScopeSettingsProperties withDefaultReleaseNamespace(String defaultReleaseNamespace) { + this.defaultReleaseNamespace = defaultReleaseNamespace; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/ExtensionInner.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/ExtensionInner.java index d369b735364f5..595fa09944b38 100644 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/ExtensionInner.java +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/ExtensionInner.java @@ -12,6 +12,7 @@ import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionPropertiesAksAssignedIdentity; import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionStatus; import com.azure.resourcemanager.kubernetesconfiguration.models.Identity; +import com.azure.resourcemanager.kubernetesconfiguration.models.Plan; import com.azure.resourcemanager.kubernetesconfiguration.models.ProvisioningState; import com.azure.resourcemanager.kubernetesconfiguration.models.Scope; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -43,6 +44,12 @@ public final class ExtensionInner extends ProxyResource { @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * The plan information. + */ + @JsonProperty(value = "plan") + private Plan plan; + /** * Get the innerProperties property: Properties of an Extension resource. * @@ -82,6 +89,26 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the plan property: The plan information. + * + * @return the plan value. + */ + public Plan plan() { + return this.plan; + } + + /** + * Set the plan property: The plan information. + * + * @param plan the plan value to set. + * @return the ExtensionInner object itself. + */ + public ExtensionInner withPlan(Plan plan) { + this.plan = plan; + return this; + } + /** * Get the extensionType property: Type of the Extension, of which this resource is an instance of. It must be one * of the Extension Types registered with Microsoft.KubernetesConfiguration by the Extension publisher. @@ -256,7 +283,7 @@ public ExtensionInner withConfigurationProtectedSettings(Map con } /** - * Get the provisioningState property: The provisioning state of the extension resource. + * Get the provisioningState property: Status of installation of this extension. * * @return the provisioningState value. */ @@ -288,7 +315,7 @@ public ExtensionInner withStatuses(List statuses) { } /** - * Get the errorInfo property: The error detail. + * Get the errorInfo property: Error information from the Agent - e.g. errors during installation. * * @return the errorInfo value. */ @@ -296,20 +323,6 @@ public ManagementError errorInfo() { return this.innerProperties() == null ? null : this.innerProperties().errorInfo(); } - /** - * Set the errorInfo property: The error detail. - * - * @param errorInfo the errorInfo value to set. - * @return the ExtensionInner object itself. - */ - public ExtensionInner withErrorInfo(ManagementError errorInfo) { - if (this.innerProperties() == null) { - this.innerProperties = new ExtensionProperties(); - } - this.innerProperties().withErrorInfo(errorInfo); - return this; - } - /** * Get the customLocationSettings property: Custom Location settings properties. * @@ -363,5 +376,8 @@ public void validate() { if (identity() != null) { identity().validate(); } + if (plan() != null) { + plan().validate(); + } } } diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/ExtensionProperties.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/ExtensionProperties.java index fde287b22390f..379724bbf7e4c 100644 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/ExtensionProperties.java +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/ExtensionProperties.java @@ -74,7 +74,7 @@ public final class ExtensionProperties { private Map configurationProtectedSettings; /* - * The provisioning state of the extension resource. + * Status of installation of this extension. */ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; @@ -86,9 +86,9 @@ public final class ExtensionProperties { private List statuses; /* - * The error detail. + * Error information from the Agent - e.g. errors during installation. */ - @JsonProperty(value = "errorInfo") + @JsonProperty(value = "errorInfo", access = JsonProperty.Access.WRITE_ONLY) private ManagementError errorInfo; /* @@ -263,7 +263,7 @@ public ExtensionProperties withConfigurationProtectedSettings(Map statuses) { } /** - * Get the errorInfo property: The error detail. + * Get the errorInfo property: Error information from the Agent - e.g. errors during installation. * * @return the errorInfo value. */ @@ -300,17 +300,6 @@ public ManagementError errorInfo() { return this.errorInfo; } - /** - * Set the errorInfo property: The error detail. - * - * @param errorInfo the errorInfo value to set. - * @return the ExtensionProperties object itself. - */ - public ExtensionProperties withErrorInfo(ManagementError errorInfo) { - this.errorInfo = errorInfo; - return this; - } - /** * Get the customLocationSettings property: Custom Location settings properties. * diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/ExtensionTypeInner.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/ExtensionTypeInner.java new file mode 100644 index 0000000000000..12e738edcd610 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/ExtensionTypeInner.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfiguration.models.ClusterTypes; +import com.azure.resourcemanager.kubernetesconfiguration.models.SupportedScopes; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Represents an Extension Type. */ +@Fluent +public final class ExtensionTypeInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExtensionTypeInner.class); + + /* + * Describes the Resource Type properties. + */ + @JsonProperty(value = "properties", required = true) + private ExtensionTypeProperties innerProperties = new ExtensionTypeProperties(); + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: Describes the Resource Type properties. + * + * @return the innerProperties value. + */ + private ExtensionTypeProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the releaseTrains property: Extension release train: preview or stable. + * + * @return the releaseTrains value. + */ + public List releaseTrains() { + return this.innerProperties() == null ? null : this.innerProperties().releaseTrains(); + } + + /** + * Get the clusterTypes property: Cluster types. + * + * @return the clusterTypes value. + */ + public ClusterTypes clusterTypes() { + return this.innerProperties() == null ? null : this.innerProperties().clusterTypes(); + } + + /** + * Get the supportedScopes property: Extension scopes. + * + * @return the supportedScopes value. + */ + public SupportedScopes supportedScopes() { + return this.innerProperties() == null ? null : this.innerProperties().supportedScopes(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model ExtensionTypeInner")); + } else { + innerProperties().validate(); + } + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/ExtensionTypeProperties.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/ExtensionTypeProperties.java new file mode 100644 index 0000000000000..2e9bd3257c835 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/ExtensionTypeProperties.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfiguration.models.ClusterTypes; +import com.azure.resourcemanager.kubernetesconfiguration.models.SupportedScopes; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the connected cluster. */ +@Immutable +public final class ExtensionTypeProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExtensionTypeProperties.class); + + /* + * Extension release train: preview or stable + */ + @JsonProperty(value = "releaseTrains", access = JsonProperty.Access.WRITE_ONLY) + private List releaseTrains; + + /* + * Cluster types + */ + @JsonProperty(value = "clusterTypes", access = JsonProperty.Access.WRITE_ONLY) + private ClusterTypes clusterTypes; + + /* + * Extension scopes + */ + @JsonProperty(value = "supportedScopes", access = JsonProperty.Access.WRITE_ONLY) + private SupportedScopes supportedScopes; + + /** + * Get the releaseTrains property: Extension release train: preview or stable. + * + * @return the releaseTrains value. + */ + public List releaseTrains() { + return this.releaseTrains; + } + + /** + * Get the clusterTypes property: Cluster types. + * + * @return the clusterTypes value. + */ + public ClusterTypes clusterTypes() { + return this.clusterTypes; + } + + /** + * Get the supportedScopes property: Extension scopes. + * + * @return the supportedScopes value. + */ + public SupportedScopes supportedScopes() { + return this.supportedScopes; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (supportedScopes() != null) { + supportedScopes().validate(); + } + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/FluxConfigurationInner.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/FluxConfigurationInner.java new file mode 100644 index 0000000000000..4f3365bd689aa --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/FluxConfigurationInner.java @@ -0,0 +1,340 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfiguration.models.BucketDefinition; +import com.azure.resourcemanager.kubernetesconfiguration.models.FluxComplianceState; +import com.azure.resourcemanager.kubernetesconfiguration.models.GitRepositoryDefinition; +import com.azure.resourcemanager.kubernetesconfiguration.models.KustomizationDefinition; +import com.azure.resourcemanager.kubernetesconfiguration.models.ObjectStatusDefinition; +import com.azure.resourcemanager.kubernetesconfiguration.models.ProvisioningState; +import com.azure.resourcemanager.kubernetesconfiguration.models.ScopeType; +import com.azure.resourcemanager.kubernetesconfiguration.models.SourceKindType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** The Flux Configuration object returned in Get & Put response. */ +@Fluent +public final class FluxConfigurationInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FluxConfigurationInner.class); + + /* + * Properties to create a Flux Configuration resource + */ + @JsonProperty(value = "properties") + private FluxConfigurationProperties innerProperties; + + /* + * Top level metadata + * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: Properties to create a Flux Configuration resource. + * + * @return the innerProperties value. + */ + private FluxConfigurationProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Top level metadata + * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the scope property: Scope at which the operator will be installed. + * + * @return the scope value. + */ + public ScopeType scope() { + return this.innerProperties() == null ? null : this.innerProperties().scope(); + } + + /** + * Set the scope property: Scope at which the operator will be installed. + * + * @param scope the scope value to set. + * @return the FluxConfigurationInner object itself. + */ + public FluxConfigurationInner withScope(ScopeType scope) { + if (this.innerProperties() == null) { + this.innerProperties = new FluxConfigurationProperties(); + } + this.innerProperties().withScope(scope); + return this; + } + + /** + * Get the namespace property: The namespace to which this configuration is installed to. Maximum of 253 lower case + * alphanumeric characters, hyphen and period only. + * + * @return the namespace value. + */ + public String namespace() { + return this.innerProperties() == null ? null : this.innerProperties().namespace(); + } + + /** + * Set the namespace property: The namespace to which this configuration is installed to. Maximum of 253 lower case + * alphanumeric characters, hyphen and period only. + * + * @param namespace the namespace value to set. + * @return the FluxConfigurationInner object itself. + */ + public FluxConfigurationInner withNamespace(String namespace) { + if (this.innerProperties() == null) { + this.innerProperties = new FluxConfigurationProperties(); + } + this.innerProperties().withNamespace(namespace); + return this; + } + + /** + * Get the sourceKind property: Source Kind to pull the configuration data from. + * + * @return the sourceKind value. + */ + public SourceKindType sourceKind() { + return this.innerProperties() == null ? null : this.innerProperties().sourceKind(); + } + + /** + * Set the sourceKind property: Source Kind to pull the configuration data from. + * + * @param sourceKind the sourceKind value to set. + * @return the FluxConfigurationInner object itself. + */ + public FluxConfigurationInner withSourceKind(SourceKindType sourceKind) { + if (this.innerProperties() == null) { + this.innerProperties = new FluxConfigurationProperties(); + } + this.innerProperties().withSourceKind(sourceKind); + return this; + } + + /** + * Get the suspend property: Whether this configuration should suspend its reconciliation of its kustomizations and + * sources. + * + * @return the suspend value. + */ + public Boolean suspend() { + return this.innerProperties() == null ? null : this.innerProperties().suspend(); + } + + /** + * Set the suspend property: Whether this configuration should suspend its reconciliation of its kustomizations and + * sources. + * + * @param suspend the suspend value to set. + * @return the FluxConfigurationInner object itself. + */ + public FluxConfigurationInner withSuspend(Boolean suspend) { + if (this.innerProperties() == null) { + this.innerProperties = new FluxConfigurationProperties(); + } + this.innerProperties().withSuspend(suspend); + return this; + } + + /** + * Get the gitRepository property: Parameters to reconcile to the GitRepository source kind type. + * + * @return the gitRepository value. + */ + public GitRepositoryDefinition gitRepository() { + return this.innerProperties() == null ? null : this.innerProperties().gitRepository(); + } + + /** + * Set the gitRepository property: Parameters to reconcile to the GitRepository source kind type. + * + * @param gitRepository the gitRepository value to set. + * @return the FluxConfigurationInner object itself. + */ + public FluxConfigurationInner withGitRepository(GitRepositoryDefinition gitRepository) { + if (this.innerProperties() == null) { + this.innerProperties = new FluxConfigurationProperties(); + } + this.innerProperties().withGitRepository(gitRepository); + return this; + } + + /** + * Get the bucket property: Parameters to reconcile to the Bucket source kind type. + * + * @return the bucket value. + */ + public BucketDefinition bucket() { + return this.innerProperties() == null ? null : this.innerProperties().bucket(); + } + + /** + * Set the bucket property: Parameters to reconcile to the Bucket source kind type. + * + * @param bucket the bucket value to set. + * @return the FluxConfigurationInner object itself. + */ + public FluxConfigurationInner withBucket(BucketDefinition bucket) { + if (this.innerProperties() == null) { + this.innerProperties = new FluxConfigurationProperties(); + } + this.innerProperties().withBucket(bucket); + return this; + } + + /** + * Get the kustomizations property: Array of kustomizations used to reconcile the artifact pulled by the source type + * on the cluster. + * + * @return the kustomizations value. + */ + public Map kustomizations() { + return this.innerProperties() == null ? null : this.innerProperties().kustomizations(); + } + + /** + * Set the kustomizations property: Array of kustomizations used to reconcile the artifact pulled by the source type + * on the cluster. + * + * @param kustomizations the kustomizations value to set. + * @return the FluxConfigurationInner object itself. + */ + public FluxConfigurationInner withKustomizations(Map kustomizations) { + if (this.innerProperties() == null) { + this.innerProperties = new FluxConfigurationProperties(); + } + this.innerProperties().withKustomizations(kustomizations); + return this; + } + + /** + * Get the configurationProtectedSettings property: Key-value pairs of protected configuration settings for the + * configuration. + * + * @return the configurationProtectedSettings value. + */ + public Map configurationProtectedSettings() { + return this.innerProperties() == null ? null : this.innerProperties().configurationProtectedSettings(); + } + + /** + * Set the configurationProtectedSettings property: Key-value pairs of protected configuration settings for the + * configuration. + * + * @param configurationProtectedSettings the configurationProtectedSettings value to set. + * @return the FluxConfigurationInner object itself. + */ + public FluxConfigurationInner withConfigurationProtectedSettings( + Map configurationProtectedSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new FluxConfigurationProperties(); + } + this.innerProperties().withConfigurationProtectedSettings(configurationProtectedSettings); + return this; + } + + /** + * Get the statuses property: Statuses of the Flux Kubernetes resources created by the fluxConfiguration or created + * by the managed objects provisioned by the fluxConfiguration. + * + * @return the statuses value. + */ + public List statuses() { + return this.innerProperties() == null ? null : this.innerProperties().statuses(); + } + + /** + * Get the repositoryPublicKey property: Public Key associated with this fluxConfiguration (either generated within + * the cluster or provided by the user). + * + * @return the repositoryPublicKey value. + */ + public String repositoryPublicKey() { + return this.innerProperties() == null ? null : this.innerProperties().repositoryPublicKey(); + } + + /** + * Get the sourceSyncedCommitId property: Branch and/or SHA of the source commit synced with the cluster. + * + * @return the sourceSyncedCommitId value. + */ + public String sourceSyncedCommitId() { + return this.innerProperties() == null ? null : this.innerProperties().sourceSyncedCommitId(); + } + + /** + * Get the sourceUpdatedAt property: Datetime the fluxConfiguration synced its source on the cluster. + * + * @return the sourceUpdatedAt value. + */ + public OffsetDateTime sourceUpdatedAt() { + return this.innerProperties() == null ? null : this.innerProperties().sourceUpdatedAt(); + } + + /** + * Get the statusUpdatedAt property: Datetime the fluxConfiguration synced its status on the cluster with Azure. + * + * @return the statusUpdatedAt value. + */ + public OffsetDateTime statusUpdatedAt() { + return this.innerProperties() == null ? null : this.innerProperties().statusUpdatedAt(); + } + + /** + * Get the complianceState property: Combined status of the Flux Kubernetes resources created by the + * fluxConfiguration or created by the managed objects. + * + * @return the complianceState value. + */ + public FluxComplianceState complianceState() { + return this.innerProperties() == null ? null : this.innerProperties().complianceState(); + } + + /** + * Get the provisioningState property: Status of the creation of the fluxConfiguration. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the errorMessage property: Error message returned to the user in the case of provisioning failure. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.innerProperties() == null ? null : this.innerProperties().errorMessage(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/FluxConfigurationPatchProperties.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/FluxConfigurationPatchProperties.java new file mode 100644 index 0000000000000..e9a4dcd99e418 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/FluxConfigurationPatchProperties.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfiguration.models.BucketPatchDefinition; +import com.azure.resourcemanager.kubernetesconfiguration.models.GitRepositoryPatchDefinition; +import com.azure.resourcemanager.kubernetesconfiguration.models.KustomizationPatchDefinition; +import com.azure.resourcemanager.kubernetesconfiguration.models.SourceKindType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Updatable properties of an Flux Configuration Patch Request. */ +@Fluent +public final class FluxConfigurationPatchProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FluxConfigurationPatchProperties.class); + + /* + * Source Kind to pull the configuration data from. + */ + @JsonProperty(value = "sourceKind") + private SourceKindType sourceKind; + + /* + * Whether this configuration should suspend its reconciliation of its + * kustomizations and sources. + */ + @JsonProperty(value = "suspend") + private Boolean suspend; + + /* + * Parameters to reconcile to the GitRepository source kind type. + */ + @JsonProperty(value = "gitRepository") + private GitRepositoryPatchDefinition gitRepository; + + /* + * Parameters to reconcile to the Bucket source kind type. + */ + @JsonProperty(value = "bucket") + private BucketPatchDefinition bucket; + + /* + * Array of kustomizations used to reconcile the artifact pulled by the + * source type on the cluster. + */ + @JsonProperty(value = "kustomizations") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map kustomizations; + + /* + * Key-value pairs of protected configuration settings for the + * configuration + */ + @JsonProperty(value = "configurationProtectedSettings") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map configurationProtectedSettings; + + /** + * Get the sourceKind property: Source Kind to pull the configuration data from. + * + * @return the sourceKind value. + */ + public SourceKindType sourceKind() { + return this.sourceKind; + } + + /** + * Set the sourceKind property: Source Kind to pull the configuration data from. + * + * @param sourceKind the sourceKind value to set. + * @return the FluxConfigurationPatchProperties object itself. + */ + public FluxConfigurationPatchProperties withSourceKind(SourceKindType sourceKind) { + this.sourceKind = sourceKind; + return this; + } + + /** + * Get the suspend property: Whether this configuration should suspend its reconciliation of its kustomizations and + * sources. + * + * @return the suspend value. + */ + public Boolean suspend() { + return this.suspend; + } + + /** + * Set the suspend property: Whether this configuration should suspend its reconciliation of its kustomizations and + * sources. + * + * @param suspend the suspend value to set. + * @return the FluxConfigurationPatchProperties object itself. + */ + public FluxConfigurationPatchProperties withSuspend(Boolean suspend) { + this.suspend = suspend; + return this; + } + + /** + * Get the gitRepository property: Parameters to reconcile to the GitRepository source kind type. + * + * @return the gitRepository value. + */ + public GitRepositoryPatchDefinition gitRepository() { + return this.gitRepository; + } + + /** + * Set the gitRepository property: Parameters to reconcile to the GitRepository source kind type. + * + * @param gitRepository the gitRepository value to set. + * @return the FluxConfigurationPatchProperties object itself. + */ + public FluxConfigurationPatchProperties withGitRepository(GitRepositoryPatchDefinition gitRepository) { + this.gitRepository = gitRepository; + return this; + } + + /** + * Get the bucket property: Parameters to reconcile to the Bucket source kind type. + * + * @return the bucket value. + */ + public BucketPatchDefinition bucket() { + return this.bucket; + } + + /** + * Set the bucket property: Parameters to reconcile to the Bucket source kind type. + * + * @param bucket the bucket value to set. + * @return the FluxConfigurationPatchProperties object itself. + */ + public FluxConfigurationPatchProperties withBucket(BucketPatchDefinition bucket) { + this.bucket = bucket; + return this; + } + + /** + * Get the kustomizations property: Array of kustomizations used to reconcile the artifact pulled by the source type + * on the cluster. + * + * @return the kustomizations value. + */ + public Map kustomizations() { + return this.kustomizations; + } + + /** + * Set the kustomizations property: Array of kustomizations used to reconcile the artifact pulled by the source type + * on the cluster. + * + * @param kustomizations the kustomizations value to set. + * @return the FluxConfigurationPatchProperties object itself. + */ + public FluxConfigurationPatchProperties withKustomizations( + Map kustomizations) { + this.kustomizations = kustomizations; + return this; + } + + /** + * Get the configurationProtectedSettings property: Key-value pairs of protected configuration settings for the + * configuration. + * + * @return the configurationProtectedSettings value. + */ + public Map configurationProtectedSettings() { + return this.configurationProtectedSettings; + } + + /** + * Set the configurationProtectedSettings property: Key-value pairs of protected configuration settings for the + * configuration. + * + * @param configurationProtectedSettings the configurationProtectedSettings value to set. + * @return the FluxConfigurationPatchProperties object itself. + */ + public FluxConfigurationPatchProperties withConfigurationProtectedSettings( + Map configurationProtectedSettings) { + this.configurationProtectedSettings = configurationProtectedSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (gitRepository() != null) { + gitRepository().validate(); + } + if (bucket() != null) { + bucket().validate(); + } + if (kustomizations() != null) { + kustomizations() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/FluxConfigurationProperties.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/FluxConfigurationProperties.java new file mode 100644 index 0000000000000..449fca028351f --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/FluxConfigurationProperties.java @@ -0,0 +1,406 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfiguration.models.BucketDefinition; +import com.azure.resourcemanager.kubernetesconfiguration.models.FluxComplianceState; +import com.azure.resourcemanager.kubernetesconfiguration.models.GitRepositoryDefinition; +import com.azure.resourcemanager.kubernetesconfiguration.models.KustomizationDefinition; +import com.azure.resourcemanager.kubernetesconfiguration.models.ObjectStatusDefinition; +import com.azure.resourcemanager.kubernetesconfiguration.models.ProvisioningState; +import com.azure.resourcemanager.kubernetesconfiguration.models.ScopeType; +import com.azure.resourcemanager.kubernetesconfiguration.models.SourceKindType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Properties to create a Flux Configuration resource. */ +@Fluent +public final class FluxConfigurationProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FluxConfigurationProperties.class); + + /* + * Scope at which the operator will be installed. + */ + @JsonProperty(value = "scope") + private ScopeType scope; + + /* + * The namespace to which this configuration is installed to. Maximum of + * 253 lower case alphanumeric characters, hyphen and period only. + */ + @JsonProperty(value = "namespace") + private String namespace; + + /* + * Source Kind to pull the configuration data from. + */ + @JsonProperty(value = "sourceKind") + private SourceKindType sourceKind; + + /* + * Whether this configuration should suspend its reconciliation of its + * kustomizations and sources. + */ + @JsonProperty(value = "suspend") + private Boolean suspend; + + /* + * Parameters to reconcile to the GitRepository source kind type. + */ + @JsonProperty(value = "gitRepository") + private GitRepositoryDefinition gitRepository; + + /* + * Parameters to reconcile to the Bucket source kind type. + */ + @JsonProperty(value = "bucket") + private BucketDefinition bucket; + + /* + * Array of kustomizations used to reconcile the artifact pulled by the + * source type on the cluster. + */ + @JsonProperty(value = "kustomizations") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map kustomizations; + + /* + * Key-value pairs of protected configuration settings for the + * configuration + */ + @JsonProperty(value = "configurationProtectedSettings") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map configurationProtectedSettings; + + /* + * Statuses of the Flux Kubernetes resources created by the + * fluxConfiguration or created by the managed objects provisioned by the + * fluxConfiguration. + */ + @JsonProperty(value = "statuses", access = JsonProperty.Access.WRITE_ONLY) + private List statuses; + + /* + * Public Key associated with this fluxConfiguration (either generated + * within the cluster or provided by the user). + */ + @JsonProperty(value = "repositoryPublicKey", access = JsonProperty.Access.WRITE_ONLY) + private String repositoryPublicKey; + + /* + * Branch and/or SHA of the source commit synced with the cluster. + */ + @JsonProperty(value = "sourceSyncedCommitId", access = JsonProperty.Access.WRITE_ONLY) + private String sourceSyncedCommitId; + + /* + * Datetime the fluxConfiguration synced its source on the cluster. + */ + @JsonProperty(value = "sourceUpdatedAt", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime sourceUpdatedAt; + + /* + * Datetime the fluxConfiguration synced its status on the cluster with + * Azure. + */ + @JsonProperty(value = "statusUpdatedAt", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime statusUpdatedAt; + + /* + * Combined status of the Flux Kubernetes resources created by the + * fluxConfiguration or created by the managed objects. + */ + @JsonProperty(value = "complianceState", access = JsonProperty.Access.WRITE_ONLY) + private FluxComplianceState complianceState; + + /* + * Status of the creation of the fluxConfiguration. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Error message returned to the user in the case of provisioning failure. + */ + @JsonProperty(value = "errorMessage", access = JsonProperty.Access.WRITE_ONLY) + private String errorMessage; + + /** + * Get the scope property: Scope at which the operator will be installed. + * + * @return the scope value. + */ + public ScopeType scope() { + return this.scope; + } + + /** + * Set the scope property: Scope at which the operator will be installed. + * + * @param scope the scope value to set. + * @return the FluxConfigurationProperties object itself. + */ + public FluxConfigurationProperties withScope(ScopeType scope) { + this.scope = scope; + return this; + } + + /** + * Get the namespace property: The namespace to which this configuration is installed to. Maximum of 253 lower case + * alphanumeric characters, hyphen and period only. + * + * @return the namespace value. + */ + public String namespace() { + return this.namespace; + } + + /** + * Set the namespace property: The namespace to which this configuration is installed to. Maximum of 253 lower case + * alphanumeric characters, hyphen and period only. + * + * @param namespace the namespace value to set. + * @return the FluxConfigurationProperties object itself. + */ + public FluxConfigurationProperties withNamespace(String namespace) { + this.namespace = namespace; + return this; + } + + /** + * Get the sourceKind property: Source Kind to pull the configuration data from. + * + * @return the sourceKind value. + */ + public SourceKindType sourceKind() { + return this.sourceKind; + } + + /** + * Set the sourceKind property: Source Kind to pull the configuration data from. + * + * @param sourceKind the sourceKind value to set. + * @return the FluxConfigurationProperties object itself. + */ + public FluxConfigurationProperties withSourceKind(SourceKindType sourceKind) { + this.sourceKind = sourceKind; + return this; + } + + /** + * Get the suspend property: Whether this configuration should suspend its reconciliation of its kustomizations and + * sources. + * + * @return the suspend value. + */ + public Boolean suspend() { + return this.suspend; + } + + /** + * Set the suspend property: Whether this configuration should suspend its reconciliation of its kustomizations and + * sources. + * + * @param suspend the suspend value to set. + * @return the FluxConfigurationProperties object itself. + */ + public FluxConfigurationProperties withSuspend(Boolean suspend) { + this.suspend = suspend; + return this; + } + + /** + * Get the gitRepository property: Parameters to reconcile to the GitRepository source kind type. + * + * @return the gitRepository value. + */ + public GitRepositoryDefinition gitRepository() { + return this.gitRepository; + } + + /** + * Set the gitRepository property: Parameters to reconcile to the GitRepository source kind type. + * + * @param gitRepository the gitRepository value to set. + * @return the FluxConfigurationProperties object itself. + */ + public FluxConfigurationProperties withGitRepository(GitRepositoryDefinition gitRepository) { + this.gitRepository = gitRepository; + return this; + } + + /** + * Get the bucket property: Parameters to reconcile to the Bucket source kind type. + * + * @return the bucket value. + */ + public BucketDefinition bucket() { + return this.bucket; + } + + /** + * Set the bucket property: Parameters to reconcile to the Bucket source kind type. + * + * @param bucket the bucket value to set. + * @return the FluxConfigurationProperties object itself. + */ + public FluxConfigurationProperties withBucket(BucketDefinition bucket) { + this.bucket = bucket; + return this; + } + + /** + * Get the kustomizations property: Array of kustomizations used to reconcile the artifact pulled by the source type + * on the cluster. + * + * @return the kustomizations value. + */ + public Map kustomizations() { + return this.kustomizations; + } + + /** + * Set the kustomizations property: Array of kustomizations used to reconcile the artifact pulled by the source type + * on the cluster. + * + * @param kustomizations the kustomizations value to set. + * @return the FluxConfigurationProperties object itself. + */ + public FluxConfigurationProperties withKustomizations(Map kustomizations) { + this.kustomizations = kustomizations; + return this; + } + + /** + * Get the configurationProtectedSettings property: Key-value pairs of protected configuration settings for the + * configuration. + * + * @return the configurationProtectedSettings value. + */ + public Map configurationProtectedSettings() { + return this.configurationProtectedSettings; + } + + /** + * Set the configurationProtectedSettings property: Key-value pairs of protected configuration settings for the + * configuration. + * + * @param configurationProtectedSettings the configurationProtectedSettings value to set. + * @return the FluxConfigurationProperties object itself. + */ + public FluxConfigurationProperties withConfigurationProtectedSettings( + Map configurationProtectedSettings) { + this.configurationProtectedSettings = configurationProtectedSettings; + return this; + } + + /** + * Get the statuses property: Statuses of the Flux Kubernetes resources created by the fluxConfiguration or created + * by the managed objects provisioned by the fluxConfiguration. + * + * @return the statuses value. + */ + public List statuses() { + return this.statuses; + } + + /** + * Get the repositoryPublicKey property: Public Key associated with this fluxConfiguration (either generated within + * the cluster or provided by the user). + * + * @return the repositoryPublicKey value. + */ + public String repositoryPublicKey() { + return this.repositoryPublicKey; + } + + /** + * Get the sourceSyncedCommitId property: Branch and/or SHA of the source commit synced with the cluster. + * + * @return the sourceSyncedCommitId value. + */ + public String sourceSyncedCommitId() { + return this.sourceSyncedCommitId; + } + + /** + * Get the sourceUpdatedAt property: Datetime the fluxConfiguration synced its source on the cluster. + * + * @return the sourceUpdatedAt value. + */ + public OffsetDateTime sourceUpdatedAt() { + return this.sourceUpdatedAt; + } + + /** + * Get the statusUpdatedAt property: Datetime the fluxConfiguration synced its status on the cluster with Azure. + * + * @return the statusUpdatedAt value. + */ + public OffsetDateTime statusUpdatedAt() { + return this.statusUpdatedAt; + } + + /** + * Get the complianceState property: Combined status of the Flux Kubernetes resources created by the + * fluxConfiguration or created by the managed objects. + * + * @return the complianceState value. + */ + public FluxComplianceState complianceState() { + return this.complianceState; + } + + /** + * Get the provisioningState property: Status of the creation of the fluxConfiguration. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the errorMessage property: Error message returned to the user in the case of provisioning failure. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (gitRepository() != null) { + gitRepository().validate(); + } + if (bucket() != null) { + bucket().validate(); + } + if (kustomizations() != null) { + kustomizations() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + if (statuses() != null) { + statuses().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/KubernetesConfigurationPrivateLinkScopeInner.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/KubernetesConfigurationPrivateLinkScopeInner.java new file mode 100644 index 0000000000000..a46af67c65bc1 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/KubernetesConfigurationPrivateLinkScopeInner.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfiguration.models.KubernetesConfigurationPrivateLinkScopeProperties; +import com.azure.resourcemanager.kubernetesconfiguration.models.PrivateLinkScopesResource; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** An Azure Arc PrivateLinkScope definition. */ +@Fluent +public final class KubernetesConfigurationPrivateLinkScopeInner extends PrivateLinkScopesResource { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(KubernetesConfigurationPrivateLinkScopeInner.class); + + /* + * Properties that define a Azure Arc PrivateLinkScope resource. + */ + @JsonProperty(value = "properties") + private KubernetesConfigurationPrivateLinkScopeProperties properties; + + /* + * The system meta data relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the properties property: Properties that define a Azure Arc PrivateLinkScope resource. + * + * @return the properties value. + */ + public KubernetesConfigurationPrivateLinkScopeProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties that define a Azure Arc PrivateLinkScope resource. + * + * @param properties the properties value to set. + * @return the KubernetesConfigurationPrivateLinkScopeInner object itself. + */ + public KubernetesConfigurationPrivateLinkScopeInner withProperties( + KubernetesConfigurationPrivateLinkScopeProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public KubernetesConfigurationPrivateLinkScopeInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public KubernetesConfigurationPrivateLinkScopeInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/OperationStatusResultInner.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/OperationStatusResultInner.java index 1043a72b8346d..41e272ba6e810 100644 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/OperationStatusResultInner.java +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/OperationStatusResultInner.java @@ -43,9 +43,9 @@ public final class OperationStatusResultInner { private Map properties; /* - * The error detail. + * If present, details of the operation error. */ - @JsonProperty(value = "error") + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) private ManagementError error; /** @@ -129,7 +129,7 @@ public OperationStatusResultInner withProperties(Map properties) } /** - * Get the error property: The error detail. + * Get the error property: If present, details of the operation error. * * @return the error value. */ @@ -137,17 +137,6 @@ public ManagementError error() { return this.error; } - /** - * Set the error property: The error detail. - * - * @param error the error value to set. - * @return the OperationStatusResultInner object itself. - */ - public OperationStatusResultInner withError(ManagementError error) { - this.error = error; - return this; - } - /** * Validates the instance. * diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/PrivateEndpointConnectionInner.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/PrivateEndpointConnectionInner.java new file mode 100644 index 0000000000000..ceaf5db8a543e --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/PrivateEndpointConnectionInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfiguration.models.PrivateEndpointConnectionProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A private endpoint connection. */ +@Fluent +public final class PrivateEndpointConnectionInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionInner.class); + + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private PrivateEndpointConnectionProperties properties; + + /* + * The system meta data relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the properties property: Resource properties. + * + * @return the properties value. + */ + public PrivateEndpointConnectionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Resource properties. + * + * @param properties the properties value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withProperties(PrivateEndpointConnectionProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/PrivateLinkResourceInner.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/PrivateLinkResourceInner.java new file mode 100644 index 0000000000000..96278e2f3bd8f --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/PrivateLinkResourceInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfiguration.models.PrivateLinkResourceProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A private link resource. */ +@Fluent +public final class PrivateLinkResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceInner.class); + + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private PrivateLinkResourceProperties properties; + + /* + * The system meta data relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the properties property: Resource properties. + * + * @return the properties value. + */ + public PrivateLinkResourceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Resource properties. + * + * @param properties the properties value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withProperties(PrivateLinkResourceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/PrivateLinkScopeValidationDetailsInner.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/PrivateLinkScopeValidationDetailsInner.java new file mode 100644 index 0000000000000..d9a84ef9f8419 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/PrivateLinkScopeValidationDetailsInner.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfiguration.models.ConnectionDetail; +import com.azure.resourcemanager.kubernetesconfiguration.models.PublicNetworkAccessType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The PrivateLinkScopeValidationDetails model. */ +@Fluent +public final class PrivateLinkScopeValidationDetailsInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkScopeValidationDetailsInner.class); + + /* + * Azure resource Id + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Indicates whether machines associated with the private link scope can + * also use public Azure Arc service endpoints. + */ + @JsonProperty(value = "publicNetworkAccess") + private PublicNetworkAccessType publicNetworkAccess; + + /* + * List of Private Endpoint Connection details. + */ + @JsonProperty(value = "connectionDetails") + private List connectionDetails; + + /** + * Get the id property: Azure resource Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the publicNetworkAccess property: Indicates whether machines associated with the private link scope can also + * use public Azure Arc service endpoints. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccessType publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Indicates whether machines associated with the private link scope can also + * use public Azure Arc service endpoints. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the PrivateLinkScopeValidationDetailsInner object itself. + */ + public PrivateLinkScopeValidationDetailsInner withPublicNetworkAccess(PublicNetworkAccessType publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the connectionDetails property: List of Private Endpoint Connection details. + * + * @return the connectionDetails value. + */ + public List connectionDetails() { + return this.connectionDetails; + } + + /** + * Set the connectionDetails property: List of Private Endpoint Connection details. + * + * @param connectionDetails the connectionDetails value to set. + * @return the PrivateLinkScopeValidationDetailsInner object itself. + */ + public PrivateLinkScopeValidationDetailsInner withConnectionDetails(List connectionDetails) { + this.connectionDetails = connectionDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (connectionDetails() != null) { + connectionDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/SourceControlConfigurationInner.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/SourceControlConfigurationInner.java new file mode 100644 index 0000000000000..e1e3c1797b944 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/SourceControlConfigurationInner.java @@ -0,0 +1,332 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfiguration.models.ComplianceStatus; +import com.azure.resourcemanager.kubernetesconfiguration.models.HelmOperatorProperties; +import com.azure.resourcemanager.kubernetesconfiguration.models.OperatorScopeType; +import com.azure.resourcemanager.kubernetesconfiguration.models.OperatorType; +import com.azure.resourcemanager.kubernetesconfiguration.models.ProvisioningStateType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The SourceControl Configuration object returned in Get & Put response. */ +@Fluent +public final class SourceControlConfigurationInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SourceControlConfigurationInner.class); + + /* + * Properties to create a Source Control Configuration resource + */ + @JsonProperty(value = "properties") + private SourceControlConfigurationProperties innerProperties; + + /* + * Top level metadata + * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: Properties to create a Source Control Configuration resource. + * + * @return the innerProperties value. + */ + private SourceControlConfigurationProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Top level metadata + * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the repositoryUrl property: Url of the SourceControl Repository. + * + * @return the repositoryUrl value. + */ + public String repositoryUrl() { + return this.innerProperties() == null ? null : this.innerProperties().repositoryUrl(); + } + + /** + * Set the repositoryUrl property: Url of the SourceControl Repository. + * + * @param repositoryUrl the repositoryUrl value to set. + * @return the SourceControlConfigurationInner object itself. + */ + public SourceControlConfigurationInner withRepositoryUrl(String repositoryUrl) { + if (this.innerProperties() == null) { + this.innerProperties = new SourceControlConfigurationProperties(); + } + this.innerProperties().withRepositoryUrl(repositoryUrl); + return this; + } + + /** + * Get the operatorNamespace property: The namespace to which this operator is installed to. Maximum of 253 lower + * case alphanumeric characters, hyphen and period only. + * + * @return the operatorNamespace value. + */ + public String operatorNamespace() { + return this.innerProperties() == null ? null : this.innerProperties().operatorNamespace(); + } + + /** + * Set the operatorNamespace property: The namespace to which this operator is installed to. Maximum of 253 lower + * case alphanumeric characters, hyphen and period only. + * + * @param operatorNamespace the operatorNamespace value to set. + * @return the SourceControlConfigurationInner object itself. + */ + public SourceControlConfigurationInner withOperatorNamespace(String operatorNamespace) { + if (this.innerProperties() == null) { + this.innerProperties = new SourceControlConfigurationProperties(); + } + this.innerProperties().withOperatorNamespace(operatorNamespace); + return this; + } + + /** + * Get the operatorInstanceName property: Instance name of the operator - identifying the specific configuration. + * + * @return the operatorInstanceName value. + */ + public String operatorInstanceName() { + return this.innerProperties() == null ? null : this.innerProperties().operatorInstanceName(); + } + + /** + * Set the operatorInstanceName property: Instance name of the operator - identifying the specific configuration. + * + * @param operatorInstanceName the operatorInstanceName value to set. + * @return the SourceControlConfigurationInner object itself. + */ + public SourceControlConfigurationInner withOperatorInstanceName(String operatorInstanceName) { + if (this.innerProperties() == null) { + this.innerProperties = new SourceControlConfigurationProperties(); + } + this.innerProperties().withOperatorInstanceName(operatorInstanceName); + return this; + } + + /** + * Get the operatorType property: Type of the operator. + * + * @return the operatorType value. + */ + public OperatorType operatorType() { + return this.innerProperties() == null ? null : this.innerProperties().operatorType(); + } + + /** + * Set the operatorType property: Type of the operator. + * + * @param operatorType the operatorType value to set. + * @return the SourceControlConfigurationInner object itself. + */ + public SourceControlConfigurationInner withOperatorType(OperatorType operatorType) { + if (this.innerProperties() == null) { + this.innerProperties = new SourceControlConfigurationProperties(); + } + this.innerProperties().withOperatorType(operatorType); + return this; + } + + /** + * Get the operatorParams property: Any Parameters for the Operator instance in string format. + * + * @return the operatorParams value. + */ + public String operatorParams() { + return this.innerProperties() == null ? null : this.innerProperties().operatorParams(); + } + + /** + * Set the operatorParams property: Any Parameters for the Operator instance in string format. + * + * @param operatorParams the operatorParams value to set. + * @return the SourceControlConfigurationInner object itself. + */ + public SourceControlConfigurationInner withOperatorParams(String operatorParams) { + if (this.innerProperties() == null) { + this.innerProperties = new SourceControlConfigurationProperties(); + } + this.innerProperties().withOperatorParams(operatorParams); + return this; + } + + /** + * Get the configurationProtectedSettings property: Name-value pairs of protected configuration settings for the + * configuration. + * + * @return the configurationProtectedSettings value. + */ + public Map configurationProtectedSettings() { + return this.innerProperties() == null ? null : this.innerProperties().configurationProtectedSettings(); + } + + /** + * Set the configurationProtectedSettings property: Name-value pairs of protected configuration settings for the + * configuration. + * + * @param configurationProtectedSettings the configurationProtectedSettings value to set. + * @return the SourceControlConfigurationInner object itself. + */ + public SourceControlConfigurationInner withConfigurationProtectedSettings( + Map configurationProtectedSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new SourceControlConfigurationProperties(); + } + this.innerProperties().withConfigurationProtectedSettings(configurationProtectedSettings); + return this; + } + + /** + * Get the operatorScope property: Scope at which the operator will be installed. + * + * @return the operatorScope value. + */ + public OperatorScopeType operatorScope() { + return this.innerProperties() == null ? null : this.innerProperties().operatorScope(); + } + + /** + * Set the operatorScope property: Scope at which the operator will be installed. + * + * @param operatorScope the operatorScope value to set. + * @return the SourceControlConfigurationInner object itself. + */ + public SourceControlConfigurationInner withOperatorScope(OperatorScopeType operatorScope) { + if (this.innerProperties() == null) { + this.innerProperties = new SourceControlConfigurationProperties(); + } + this.innerProperties().withOperatorScope(operatorScope); + return this; + } + + /** + * Get the repositoryPublicKey property: Public Key associated with this SourceControl configuration (either + * generated within the cluster or provided by the user). + * + * @return the repositoryPublicKey value. + */ + public String repositoryPublicKey() { + return this.innerProperties() == null ? null : this.innerProperties().repositoryPublicKey(); + } + + /** + * Get the sshKnownHostsContents property: Base64-encoded known_hosts contents containing public SSH keys required + * to access private Git instances. + * + * @return the sshKnownHostsContents value. + */ + public String sshKnownHostsContents() { + return this.innerProperties() == null ? null : this.innerProperties().sshKnownHostsContents(); + } + + /** + * Set the sshKnownHostsContents property: Base64-encoded known_hosts contents containing public SSH keys required + * to access private Git instances. + * + * @param sshKnownHostsContents the sshKnownHostsContents value to set. + * @return the SourceControlConfigurationInner object itself. + */ + public SourceControlConfigurationInner withSshKnownHostsContents(String sshKnownHostsContents) { + if (this.innerProperties() == null) { + this.innerProperties = new SourceControlConfigurationProperties(); + } + this.innerProperties().withSshKnownHostsContents(sshKnownHostsContents); + return this; + } + + /** + * Get the enableHelmOperator property: Option to enable Helm Operator for this git configuration. + * + * @return the enableHelmOperator value. + */ + public Boolean enableHelmOperator() { + return this.innerProperties() == null ? null : this.innerProperties().enableHelmOperator(); + } + + /** + * Set the enableHelmOperator property: Option to enable Helm Operator for this git configuration. + * + * @param enableHelmOperator the enableHelmOperator value to set. + * @return the SourceControlConfigurationInner object itself. + */ + public SourceControlConfigurationInner withEnableHelmOperator(Boolean enableHelmOperator) { + if (this.innerProperties() == null) { + this.innerProperties = new SourceControlConfigurationProperties(); + } + this.innerProperties().withEnableHelmOperator(enableHelmOperator); + return this; + } + + /** + * Get the helmOperatorProperties property: Properties for Helm operator. + * + * @return the helmOperatorProperties value. + */ + public HelmOperatorProperties helmOperatorProperties() { + return this.innerProperties() == null ? null : this.innerProperties().helmOperatorProperties(); + } + + /** + * Set the helmOperatorProperties property: Properties for Helm operator. + * + * @param helmOperatorProperties the helmOperatorProperties value to set. + * @return the SourceControlConfigurationInner object itself. + */ + public SourceControlConfigurationInner withHelmOperatorProperties(HelmOperatorProperties helmOperatorProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new SourceControlConfigurationProperties(); + } + this.innerProperties().withHelmOperatorProperties(helmOperatorProperties); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the resource provider. + * + * @return the provisioningState value. + */ + public ProvisioningStateType provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the complianceStatus property: Compliance Status of the Configuration. + * + * @return the complianceStatus value. + */ + public ComplianceStatus complianceStatus() { + return this.innerProperties() == null ? null : this.innerProperties().complianceStatus(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/SourceControlConfigurationProperties.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/SourceControlConfigurationProperties.java new file mode 100644 index 0000000000000..1e0b81328a00e --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/SourceControlConfigurationProperties.java @@ -0,0 +1,356 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfiguration.models.ComplianceStatus; +import com.azure.resourcemanager.kubernetesconfiguration.models.HelmOperatorProperties; +import com.azure.resourcemanager.kubernetesconfiguration.models.OperatorScopeType; +import com.azure.resourcemanager.kubernetesconfiguration.models.OperatorType; +import com.azure.resourcemanager.kubernetesconfiguration.models.ProvisioningStateType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Properties to create a Source Control Configuration resource. */ +@Fluent +public final class SourceControlConfigurationProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SourceControlConfigurationProperties.class); + + /* + * Url of the SourceControl Repository. + */ + @JsonProperty(value = "repositoryUrl") + private String repositoryUrl; + + /* + * The namespace to which this operator is installed to. Maximum of 253 + * lower case alphanumeric characters, hyphen and period only. + */ + @JsonProperty(value = "operatorNamespace") + private String operatorNamespace; + + /* + * Instance name of the operator - identifying the specific configuration. + */ + @JsonProperty(value = "operatorInstanceName") + private String operatorInstanceName; + + /* + * Type of the operator + */ + @JsonProperty(value = "operatorType") + private OperatorType operatorType; + + /* + * Any Parameters for the Operator instance in string format. + */ + @JsonProperty(value = "operatorParams") + private String operatorParams; + + /* + * Name-value pairs of protected configuration settings for the + * configuration + */ + @JsonProperty(value = "configurationProtectedSettings") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map configurationProtectedSettings; + + /* + * Scope at which the operator will be installed. + */ + @JsonProperty(value = "operatorScope") + private OperatorScopeType operatorScope; + + /* + * Public Key associated with this SourceControl configuration (either + * generated within the cluster or provided by the user). + */ + @JsonProperty(value = "repositoryPublicKey", access = JsonProperty.Access.WRITE_ONLY) + private String repositoryPublicKey; + + /* + * Base64-encoded known_hosts contents containing public SSH keys required + * to access private Git instances + */ + @JsonProperty(value = "sshKnownHostsContents") + private String sshKnownHostsContents; + + /* + * Option to enable Helm Operator for this git configuration. + */ + @JsonProperty(value = "enableHelmOperator") + private Boolean enableHelmOperator; + + /* + * Properties for Helm operator. + */ + @JsonProperty(value = "helmOperatorProperties") + private HelmOperatorProperties helmOperatorProperties; + + /* + * The provisioning state of the resource provider. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningStateType provisioningState; + + /* + * Compliance Status of the Configuration + */ + @JsonProperty(value = "complianceStatus", access = JsonProperty.Access.WRITE_ONLY) + private ComplianceStatus complianceStatus; + + /** + * Get the repositoryUrl property: Url of the SourceControl Repository. + * + * @return the repositoryUrl value. + */ + public String repositoryUrl() { + return this.repositoryUrl; + } + + /** + * Set the repositoryUrl property: Url of the SourceControl Repository. + * + * @param repositoryUrl the repositoryUrl value to set. + * @return the SourceControlConfigurationProperties object itself. + */ + public SourceControlConfigurationProperties withRepositoryUrl(String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + return this; + } + + /** + * Get the operatorNamespace property: The namespace to which this operator is installed to. Maximum of 253 lower + * case alphanumeric characters, hyphen and period only. + * + * @return the operatorNamespace value. + */ + public String operatorNamespace() { + return this.operatorNamespace; + } + + /** + * Set the operatorNamespace property: The namespace to which this operator is installed to. Maximum of 253 lower + * case alphanumeric characters, hyphen and period only. + * + * @param operatorNamespace the operatorNamespace value to set. + * @return the SourceControlConfigurationProperties object itself. + */ + public SourceControlConfigurationProperties withOperatorNamespace(String operatorNamespace) { + this.operatorNamespace = operatorNamespace; + return this; + } + + /** + * Get the operatorInstanceName property: Instance name of the operator - identifying the specific configuration. + * + * @return the operatorInstanceName value. + */ + public String operatorInstanceName() { + return this.operatorInstanceName; + } + + /** + * Set the operatorInstanceName property: Instance name of the operator - identifying the specific configuration. + * + * @param operatorInstanceName the operatorInstanceName value to set. + * @return the SourceControlConfigurationProperties object itself. + */ + public SourceControlConfigurationProperties withOperatorInstanceName(String operatorInstanceName) { + this.operatorInstanceName = operatorInstanceName; + return this; + } + + /** + * Get the operatorType property: Type of the operator. + * + * @return the operatorType value. + */ + public OperatorType operatorType() { + return this.operatorType; + } + + /** + * Set the operatorType property: Type of the operator. + * + * @param operatorType the operatorType value to set. + * @return the SourceControlConfigurationProperties object itself. + */ + public SourceControlConfigurationProperties withOperatorType(OperatorType operatorType) { + this.operatorType = operatorType; + return this; + } + + /** + * Get the operatorParams property: Any Parameters for the Operator instance in string format. + * + * @return the operatorParams value. + */ + public String operatorParams() { + return this.operatorParams; + } + + /** + * Set the operatorParams property: Any Parameters for the Operator instance in string format. + * + * @param operatorParams the operatorParams value to set. + * @return the SourceControlConfigurationProperties object itself. + */ + public SourceControlConfigurationProperties withOperatorParams(String operatorParams) { + this.operatorParams = operatorParams; + return this; + } + + /** + * Get the configurationProtectedSettings property: Name-value pairs of protected configuration settings for the + * configuration. + * + * @return the configurationProtectedSettings value. + */ + public Map configurationProtectedSettings() { + return this.configurationProtectedSettings; + } + + /** + * Set the configurationProtectedSettings property: Name-value pairs of protected configuration settings for the + * configuration. + * + * @param configurationProtectedSettings the configurationProtectedSettings value to set. + * @return the SourceControlConfigurationProperties object itself. + */ + public SourceControlConfigurationProperties withConfigurationProtectedSettings( + Map configurationProtectedSettings) { + this.configurationProtectedSettings = configurationProtectedSettings; + return this; + } + + /** + * Get the operatorScope property: Scope at which the operator will be installed. + * + * @return the operatorScope value. + */ + public OperatorScopeType operatorScope() { + return this.operatorScope; + } + + /** + * Set the operatorScope property: Scope at which the operator will be installed. + * + * @param operatorScope the operatorScope value to set. + * @return the SourceControlConfigurationProperties object itself. + */ + public SourceControlConfigurationProperties withOperatorScope(OperatorScopeType operatorScope) { + this.operatorScope = operatorScope; + return this; + } + + /** + * Get the repositoryPublicKey property: Public Key associated with this SourceControl configuration (either + * generated within the cluster or provided by the user). + * + * @return the repositoryPublicKey value. + */ + public String repositoryPublicKey() { + return this.repositoryPublicKey; + } + + /** + * Get the sshKnownHostsContents property: Base64-encoded known_hosts contents containing public SSH keys required + * to access private Git instances. + * + * @return the sshKnownHostsContents value. + */ + public String sshKnownHostsContents() { + return this.sshKnownHostsContents; + } + + /** + * Set the sshKnownHostsContents property: Base64-encoded known_hosts contents containing public SSH keys required + * to access private Git instances. + * + * @param sshKnownHostsContents the sshKnownHostsContents value to set. + * @return the SourceControlConfigurationProperties object itself. + */ + public SourceControlConfigurationProperties withSshKnownHostsContents(String sshKnownHostsContents) { + this.sshKnownHostsContents = sshKnownHostsContents; + return this; + } + + /** + * Get the enableHelmOperator property: Option to enable Helm Operator for this git configuration. + * + * @return the enableHelmOperator value. + */ + public Boolean enableHelmOperator() { + return this.enableHelmOperator; + } + + /** + * Set the enableHelmOperator property: Option to enable Helm Operator for this git configuration. + * + * @param enableHelmOperator the enableHelmOperator value to set. + * @return the SourceControlConfigurationProperties object itself. + */ + public SourceControlConfigurationProperties withEnableHelmOperator(Boolean enableHelmOperator) { + this.enableHelmOperator = enableHelmOperator; + return this; + } + + /** + * Get the helmOperatorProperties property: Properties for Helm operator. + * + * @return the helmOperatorProperties value. + */ + public HelmOperatorProperties helmOperatorProperties() { + return this.helmOperatorProperties; + } + + /** + * Set the helmOperatorProperties property: Properties for Helm operator. + * + * @param helmOperatorProperties the helmOperatorProperties value to set. + * @return the SourceControlConfigurationProperties object itself. + */ + public SourceControlConfigurationProperties withHelmOperatorProperties( + HelmOperatorProperties helmOperatorProperties) { + this.helmOperatorProperties = helmOperatorProperties; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the resource provider. + * + * @return the provisioningState value. + */ + public ProvisioningStateType provisioningState() { + return this.provisioningState; + } + + /** + * Get the complianceStatus property: Compliance Status of the Configuration. + * + * @return the complianceStatus value. + */ + public ComplianceStatus complianceStatus() { + return this.complianceStatus; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (helmOperatorProperties() != null) { + helmOperatorProperties().validate(); + } + if (complianceStatus() != null) { + complianceStatus().validate(); + } + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/ClusterExtensionTypesClientImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/ClusterExtensionTypesClientImpl.java new file mode 100644 index 0000000000000..892042a41180a --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/ClusterExtensionTypesClientImpl.java @@ -0,0 +1,309 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.ClusterExtensionTypesClient; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.ExtensionTypeInner; +import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterResourceName; +import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterRp; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ClusterExtensionTypesClient. */ +public final class ClusterExtensionTypesClientImpl implements ClusterExtensionTypesClient { + private final ClientLogger logger = new ClientLogger(ClusterExtensionTypesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ClusterExtensionTypesService service; + + /** The service client containing this operation class. */ + private final SourceControlConfigurationClientImpl client; + + /** + * Initializes an instance of ClusterExtensionTypesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ClusterExtensionTypesClientImpl(SourceControlConfigurationClientImpl client) { + this.service = + RestProxy + .create(ClusterExtensionTypesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SourceControlConfigurationClientClusterExtensionTypes to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SourceControlConfigu") + private interface ClusterExtensionTypesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}" + + "/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensionTypes" + + "/{extensionTypeName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterRp") ExtensionsClusterRp clusterRp, + @PathParam("clusterResourceName") ExtensionsClusterResourceName clusterResourceName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @PathParam("extensionTypeName") String extensionTypeName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get Extension Type details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or + * Microsoft.Kubernetes (for OnPrem K8S clusters). + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or + * connectedClusters (for OnPrem K8S clusters). + * @param clusterName The name of the kubernetes cluster. + * @param extensionTypeName Extension type name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return extension Type details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + ExtensionsClusterRp clusterRp, + ExtensionsClusterResourceName clusterResourceName, + String clusterName, + String extensionTypeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (extensionTypeName == null) { + return Mono + .error(new IllegalArgumentException("Parameter extensionTypeName is required and cannot be null.")); + } + final String apiVersion = "2022-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + apiVersion, + extensionTypeName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get Extension Type details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or + * Microsoft.Kubernetes (for OnPrem K8S clusters). + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or + * connectedClusters (for OnPrem K8S clusters). + * @param clusterName The name of the kubernetes cluster. + * @param extensionTypeName Extension type name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return extension Type details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + ExtensionsClusterRp clusterRp, + ExtensionsClusterResourceName clusterResourceName, + String clusterName, + String extensionTypeName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (extensionTypeName == null) { + return Mono + .error(new IllegalArgumentException("Parameter extensionTypeName is required and cannot be null.")); + } + final String apiVersion = "2022-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + apiVersion, + extensionTypeName, + accept, + context); + } + + /** + * Get Extension Type details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or + * Microsoft.Kubernetes (for OnPrem K8S clusters). + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or + * connectedClusters (for OnPrem K8S clusters). + * @param clusterName The name of the kubernetes cluster. + * @param extensionTypeName Extension type name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return extension Type details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, + ExtensionsClusterRp clusterRp, + ExtensionsClusterResourceName clusterResourceName, + String clusterName, + String extensionTypeName) { + return getWithResponseAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionTypeName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get Extension Type details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or + * Microsoft.Kubernetes (for OnPrem K8S clusters). + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or + * connectedClusters (for OnPrem K8S clusters). + * @param clusterName The name of the kubernetes cluster. + * @param extensionTypeName Extension type name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return extension Type details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExtensionTypeInner get( + String resourceGroupName, + ExtensionsClusterRp clusterRp, + ExtensionsClusterResourceName clusterResourceName, + String clusterName, + String extensionTypeName) { + return getAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionTypeName).block(); + } + + /** + * Get Extension Type details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or + * Microsoft.Kubernetes (for OnPrem K8S clusters). + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or + * connectedClusters (for OnPrem K8S clusters). + * @param clusterName The name of the kubernetes cluster. + * @param extensionTypeName Extension type name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return extension Type details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + ExtensionsClusterRp clusterRp, + ExtensionsClusterResourceName clusterResourceName, + String clusterName, + String extensionTypeName, + Context context) { + return getWithResponseAsync( + resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionTypeName, context) + .block(); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/ClusterExtensionTypesImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/ClusterExtensionTypesImpl.java new file mode 100644 index 0000000000000..6a249e894a75b --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/ClusterExtensionTypesImpl.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.ClusterExtensionTypesClient; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.ExtensionTypeInner; +import com.azure.resourcemanager.kubernetesconfiguration.models.ClusterExtensionTypes; +import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionType; +import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterResourceName; +import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterRp; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ClusterExtensionTypesImpl implements ClusterExtensionTypes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterExtensionTypesImpl.class); + + private final ClusterExtensionTypesClient innerClient; + + private final com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager; + + public ClusterExtensionTypesImpl( + ClusterExtensionTypesClient innerClient, + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ExtensionType get( + String resourceGroupName, + ExtensionsClusterRp clusterRp, + ExtensionsClusterResourceName clusterResourceName, + String clusterName, + String extensionTypeName) { + ExtensionTypeInner inner = + this.serviceClient().get(resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionTypeName); + if (inner != null) { + return new ExtensionTypeImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + ExtensionsClusterRp clusterRp, + ExtensionsClusterResourceName clusterResourceName, + String clusterName, + String extensionTypeName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionTypeName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExtensionTypeImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ClusterExtensionTypesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/ClusterExtensionTypesOperationsClientImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/ClusterExtensionTypesOperationsClientImpl.java new file mode 100644 index 0000000000000..bd05d1d5522a6 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/ClusterExtensionTypesOperationsClientImpl.java @@ -0,0 +1,413 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.ClusterExtensionTypesOperationsClient; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.ExtensionTypeInner; +import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionTypeList; +import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterResourceName; +import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterRp; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ClusterExtensionTypesOperationsClient. */ +public final class ClusterExtensionTypesOperationsClientImpl implements ClusterExtensionTypesOperationsClient { + private final ClientLogger logger = new ClientLogger(ClusterExtensionTypesOperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ClusterExtensionTypesOperationsService service; + + /** The service client containing this operation class. */ + private final SourceControlConfigurationClientImpl client; + + /** + * Initializes an instance of ClusterExtensionTypesOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ClusterExtensionTypesOperationsClientImpl(SourceControlConfigurationClientImpl client) { + this.service = + RestProxy + .create( + ClusterExtensionTypesOperationsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SourceControlConfigurationClientClusterExtensionTypesOperations to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SourceControlConfigu") + private interface ClusterExtensionTypesOperationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}" + + "/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensionTypes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterRp") ExtensionsClusterRp clusterRp, + @PathParam("clusterResourceName") ExtensionsClusterResourceName clusterResourceName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get Extension Types. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or + * Microsoft.Kubernetes (for OnPrem K8S clusters). + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or + * connectedClusters (for OnPrem K8S clusters). + * @param clusterName The name of the kubernetes cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return extension Types along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + ExtensionsClusterRp clusterRp, + ExtensionsClusterResourceName clusterResourceName, + String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String apiVersion = "2022-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get Extension Types. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or + * Microsoft.Kubernetes (for OnPrem K8S clusters). + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or + * connectedClusters (for OnPrem K8S clusters). + * @param clusterName The name of the kubernetes cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return extension Types along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + ExtensionsClusterRp clusterRp, + ExtensionsClusterResourceName clusterResourceName, + String clusterName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String apiVersion = "2022-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get Extension Types. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or + * Microsoft.Kubernetes (for OnPrem K8S clusters). + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or + * connectedClusters (for OnPrem K8S clusters). + * @param clusterName The name of the kubernetes cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return extension Types as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + ExtensionsClusterRp clusterRp, + ExtensionsClusterResourceName clusterResourceName, + String clusterName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get Extension Types. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or + * Microsoft.Kubernetes (for OnPrem K8S clusters). + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or + * connectedClusters (for OnPrem K8S clusters). + * @param clusterName The name of the kubernetes cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return extension Types as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + ExtensionsClusterRp clusterRp, + ExtensionsClusterResourceName clusterResourceName, + String clusterName, + Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get Extension Types. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or + * Microsoft.Kubernetes (for OnPrem K8S clusters). + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or + * connectedClusters (for OnPrem K8S clusters). + * @param clusterName The name of the kubernetes cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return extension Types as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, + ExtensionsClusterRp clusterRp, + ExtensionsClusterResourceName clusterResourceName, + String clusterName) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName)); + } + + /** + * Get Extension Types. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or + * Microsoft.Kubernetes (for OnPrem K8S clusters). + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or + * connectedClusters (for OnPrem K8S clusters). + * @param clusterName The name of the kubernetes cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return extension Types as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, + ExtensionsClusterRp clusterRp, + ExtensionsClusterResourceName clusterResourceName, + String clusterName, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Types along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Types along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/ClusterExtensionTypesOperationsImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/ClusterExtensionTypesOperationsImpl.java new file mode 100644 index 0000000000000..1177e36c6f82e --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/ClusterExtensionTypesOperationsImpl.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.ClusterExtensionTypesOperationsClient; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.ExtensionTypeInner; +import com.azure.resourcemanager.kubernetesconfiguration.models.ClusterExtensionTypesOperations; +import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionType; +import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterResourceName; +import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterRp; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ClusterExtensionTypesOperationsImpl implements ClusterExtensionTypesOperations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterExtensionTypesOperationsImpl.class); + + private final ClusterExtensionTypesOperationsClient innerClient; + + private final com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager; + + public ClusterExtensionTypesOperationsImpl( + ClusterExtensionTypesOperationsClient innerClient, + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list( + String resourceGroupName, + ExtensionsClusterRp clusterRp, + ExtensionsClusterResourceName clusterResourceName, + String clusterName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, clusterRp, clusterResourceName, clusterName); + return Utils.mapPage(inner, inner1 -> new ExtensionTypeImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, + ExtensionsClusterRp clusterRp, + ExtensionsClusterResourceName clusterResourceName, + String clusterName, + Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, clusterRp, clusterResourceName, clusterName, context); + return Utils.mapPage(inner, inner1 -> new ExtensionTypeImpl(inner1, this.manager())); + } + + private ClusterExtensionTypesOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/ExtensionImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/ExtensionImpl.java index c5cfa7f5e1079..28fc9597784ee 100644 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/ExtensionImpl.java +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/ExtensionImpl.java @@ -11,6 +11,7 @@ import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionPropertiesAksAssignedIdentity; import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionStatus; import com.azure.resourcemanager.kubernetesconfiguration.models.Identity; +import com.azure.resourcemanager.kubernetesconfiguration.models.Plan; import com.azure.resourcemanager.kubernetesconfiguration.models.ProvisioningState; import com.azure.resourcemanager.kubernetesconfiguration.models.Scope; import java.util.Collections; @@ -49,6 +50,10 @@ public SystemData systemData() { return this.innerModel().systemData(); } + public Plan plan() { + return this.innerModel().plan(); + } + public String extensionType() { return this.innerModel().extensionType(); } diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/ExtensionTypeImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/ExtensionTypeImpl.java new file mode 100644 index 0000000000000..15c20fd1ca748 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/ExtensionTypeImpl.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.ExtensionTypeInner; +import com.azure.resourcemanager.kubernetesconfiguration.models.ClusterTypes; +import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionType; +import com.azure.resourcemanager.kubernetesconfiguration.models.SupportedScopes; +import java.util.Collections; +import java.util.List; + +public final class ExtensionTypeImpl implements ExtensionType { + private ExtensionTypeInner innerObject; + + private final com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager; + + ExtensionTypeImpl( + ExtensionTypeInner innerObject, + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public List releaseTrains() { + List inner = this.innerModel().releaseTrains(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ClusterTypes clusterTypes() { + return this.innerModel().clusterTypes(); + } + + public SupportedScopes supportedScopes() { + return this.innerModel().supportedScopes(); + } + + public ExtensionTypeInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/ExtensionTypeVersionsClientImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/ExtensionTypeVersionsClientImpl.java new file mode 100644 index 0000000000000..8a8fd4f258b4a --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/ExtensionTypeVersionsClientImpl.java @@ -0,0 +1,341 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.ExtensionTypeVersionsClient; +import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionVersionList; +import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionVersionListVersionsItem; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ExtensionTypeVersionsClient. */ +public final class ExtensionTypeVersionsClientImpl implements ExtensionTypeVersionsClient { + private final ClientLogger logger = new ClientLogger(ExtensionTypeVersionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ExtensionTypeVersionsService service; + + /** The service client containing this operation class. */ + private final SourceControlConfigurationClientImpl client; + + /** + * Initializes an instance of ExtensionTypeVersionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExtensionTypeVersionsClientImpl(SourceControlConfigurationClientImpl client) { + this.service = + RestProxy + .create(ExtensionTypeVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SourceControlConfigurationClientExtensionTypeVersions to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SourceControlConfigu") + private interface ExtensionTypeVersionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.KubernetesConfiguration/locations/{location}" + + "/extensionTypes/{extensionTypeName}/versions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @PathParam("extensionTypeName") String extensionTypeName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List available versions for an Extension Type. + * + * @param location extension location. + * @param extensionTypeName Extension type name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list versions for an Extension along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String location, String extensionTypeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (extensionTypeName == null) { + return Mono + .error(new IllegalArgumentException("Parameter extensionTypeName is required and cannot be null.")); + } + final String apiVersion = "2022-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + extensionTypeName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().versions(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List available versions for an Extension Type. + * + * @param location extension location. + * @param extensionTypeName Extension type name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list versions for an Extension along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String location, String extensionTypeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (extensionTypeName == null) { + return Mono + .error(new IllegalArgumentException("Parameter extensionTypeName is required and cannot be null.")); + } + final String apiVersion = "2022-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + extensionTypeName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().versions(), + res.getValue().nextLink(), + null)); + } + + /** + * List available versions for an Extension Type. + * + * @param location extension location. + * @param extensionTypeName Extension type name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list versions for an Extension as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location, String extensionTypeName) { + return new PagedFlux<>( + () -> listSinglePageAsync(location, extensionTypeName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List available versions for an Extension Type. + * + * @param location extension location. + * @param extensionTypeName Extension type name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list versions for an Extension as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String location, String extensionTypeName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(location, extensionTypeName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List available versions for an Extension Type. + * + * @param location extension location. + * @param extensionTypeName Extension type name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list versions for an Extension as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, String extensionTypeName) { + return new PagedIterable<>(listAsync(location, extensionTypeName)); + } + + /** + * List available versions for an Extension Type. + * + * @param location extension location. + * @param extensionTypeName Extension type name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list versions for an Extension as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String location, String extensionTypeName, Context context) { + return new PagedIterable<>(listAsync(location, extensionTypeName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list versions for an Extension along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().versions(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list versions for an Extension along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().versions(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/ExtensionTypeVersionsImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/ExtensionTypeVersionsImpl.java new file mode 100644 index 0000000000000..d8b7f935d23b5 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/ExtensionTypeVersionsImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.ExtensionTypeVersionsClient; +import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionTypeVersions; +import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionVersionListVersionsItem; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ExtensionTypeVersionsImpl implements ExtensionTypeVersions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExtensionTypeVersionsImpl.class); + + private final ExtensionTypeVersionsClient innerClient; + + private final com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager; + + public ExtensionTypeVersionsImpl( + ExtensionTypeVersionsClient innerClient, + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String location, String extensionTypeName) { + return this.serviceClient().list(location, extensionTypeName); + } + + public PagedIterable list( + String location, String extensionTypeName, Context context) { + return this.serviceClient().list(location, extensionTypeName, context); + } + + private ExtensionTypeVersionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/ExtensionsClientImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/ExtensionsClientImpl.java index d4a662b782d54..33739775276c8 100644 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/ExtensionsClientImpl.java +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/ExtensionsClientImpl.java @@ -35,8 +35,6 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.kubernetesconfiguration.fluent.ExtensionsClient; import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.ExtensionInner; -import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterResourceName; -import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterRp; import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsList; import com.azure.resourcemanager.kubernetesconfiguration.models.PatchExtension; import java.nio.ByteBuffer; @@ -82,8 +80,8 @@ Mono>> create( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterRp") ExtensionsClusterRp clusterRp, - @PathParam("clusterResourceName") ExtensionsClusterResourceName clusterResourceName, + @PathParam("clusterRp") String clusterRp, + @PathParam("clusterResourceName") String clusterResourceName, @PathParam("clusterName") String clusterName, @PathParam("extensionName") String extensionName, @QueryParam("api-version") String apiVersion, @@ -102,8 +100,8 @@ Mono> get( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterRp") ExtensionsClusterRp clusterRp, - @PathParam("clusterResourceName") ExtensionsClusterResourceName clusterResourceName, + @PathParam("clusterRp") String clusterRp, + @PathParam("clusterResourceName") String clusterResourceName, @PathParam("clusterName") String clusterName, @PathParam("extensionName") String extensionName, @QueryParam("api-version") String apiVersion, @@ -121,8 +119,8 @@ Mono>> delete( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterRp") ExtensionsClusterRp clusterRp, - @PathParam("clusterResourceName") ExtensionsClusterResourceName clusterResourceName, + @PathParam("clusterRp") String clusterRp, + @PathParam("clusterResourceName") String clusterResourceName, @PathParam("clusterName") String clusterName, @PathParam("extensionName") String extensionName, @QueryParam("api-version") String apiVersion, @@ -141,8 +139,8 @@ Mono>> update( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterRp") ExtensionsClusterRp clusterRp, - @PathParam("clusterResourceName") ExtensionsClusterResourceName clusterResourceName, + @PathParam("clusterRp") String clusterRp, + @PathParam("clusterResourceName") String clusterResourceName, @PathParam("clusterName") String clusterName, @PathParam("extensionName") String extensionName, @QueryParam("api-version") String apiVersion, @@ -160,8 +158,8 @@ Mono> list( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterRp") ExtensionsClusterRp clusterRp, - @PathParam("clusterResourceName") ExtensionsClusterResourceName clusterResourceName, + @PathParam("clusterRp") String clusterRp, + @PathParam("clusterResourceName") String clusterResourceName, @PathParam("clusterName") String clusterName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, @@ -182,23 +180,23 @@ Mono> listNext( * Create a new Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param extension Properties necessary to Create an Extension. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Extension object. + * @return the Extension object along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createWithResponseAsync( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, ExtensionInner extension) { @@ -236,6 +234,7 @@ private Mono>> createWithResponseAsync( } else { extension.validate(); } + final String apiVersion = "2022-04-02-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -249,7 +248,7 @@ private Mono>> createWithResponseAsync( clusterResourceName, clusterName, extensionName, - this.client.getApiVersion(), + apiVersion, extension, accept, context)) @@ -260,10 +259,10 @@ private Mono>> createWithResponseAsync( * Create a new Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param extension Properties necessary to Create an Extension. @@ -271,13 +270,13 @@ private Mono>> createWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Extension object. + * @return the Extension object along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createWithResponseAsync( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, ExtensionInner extension, @@ -316,6 +315,7 @@ private Mono>> createWithResponseAsync( } else { extension.validate(); } + final String apiVersion = "2022-04-02-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -327,7 +327,7 @@ private Mono>> createWithResponseAsync( clusterResourceName, clusterName, extensionName, - this.client.getApiVersion(), + apiVersion, extension, accept, context); @@ -337,23 +337,23 @@ private Mono>> createWithResponseAsync( * Create a new Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param extension Properties necessary to Create an Extension. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Extension object. + * @return the {@link PollerFlux} for polling of the Extension object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ExtensionInner> beginCreateAsync( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, ExtensionInner extension) { @@ -374,10 +374,10 @@ private PollerFlux, ExtensionInner> beginCreateAsync( * Create a new Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param extension Properties necessary to Create an Extension. @@ -385,13 +385,13 @@ private PollerFlux, ExtensionInner> beginCreateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Extension object. + * @return the {@link PollerFlux} for polling of the Extension object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ExtensionInner> beginCreateAsync( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, ExtensionInner extension, @@ -410,23 +410,23 @@ private PollerFlux, ExtensionInner> beginCreateAsync( * Create a new Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param extension Properties necessary to Create an Extension. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Extension object. + * @return the {@link SyncPoller} for polling of the Extension object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ExtensionInner> beginCreate( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, ExtensionInner extension) { @@ -439,10 +439,10 @@ public SyncPoller, ExtensionInner> beginCreate( * Create a new Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param extension Properties necessary to Create an Extension. @@ -450,13 +450,13 @@ public SyncPoller, ExtensionInner> beginCreate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Extension object. + * @return the {@link SyncPoller} for polling of the Extension object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ExtensionInner> beginCreate( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, ExtensionInner extension, @@ -470,23 +470,23 @@ public SyncPoller, ExtensionInner> beginCreate( * Create a new Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param extension Properties necessary to Create an Extension. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Extension object. + * @return the Extension object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, ExtensionInner extension) { @@ -500,10 +500,10 @@ private Mono createAsync( * Create a new Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param extension Properties necessary to Create an Extension. @@ -511,13 +511,13 @@ private Mono createAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Extension object. + * @return the Extension object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, ExtensionInner extension, @@ -532,10 +532,10 @@ private Mono createAsync( * Create a new Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param extension Properties necessary to Create an Extension. @@ -547,8 +547,8 @@ private Mono createAsync( @ServiceMethod(returns = ReturnType.SINGLE) public ExtensionInner create( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, ExtensionInner extension) { @@ -560,10 +560,10 @@ public ExtensionInner create( * Create a new Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param extension Properties necessary to Create an Extension. @@ -576,8 +576,8 @@ public ExtensionInner create( @ServiceMethod(returns = ReturnType.SINGLE) public ExtensionInner create( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, ExtensionInner extension, @@ -591,22 +591,22 @@ public ExtensionInner create( * Gets Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return kubernetes Cluster Extension. + * @return kubernetes Cluster Extension along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName) { if (this.client.getEndpoint() == null) { @@ -638,6 +638,7 @@ private Mono> getWithResponseAsync( if (extensionName == null) { return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); } + final String apiVersion = "2022-04-02-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -651,7 +652,7 @@ private Mono> getWithResponseAsync( clusterResourceName, clusterName, extensionName, - this.client.getApiVersion(), + apiVersion, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -661,23 +662,23 @@ private Mono> getWithResponseAsync( * Gets Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return kubernetes Cluster Extension. + * @return kubernetes Cluster Extension along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, Context context) { @@ -710,6 +711,7 @@ private Mono> getWithResponseAsync( if (extensionName == null) { return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); } + final String apiVersion = "2022-04-02-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -721,7 +723,7 @@ private Mono> getWithResponseAsync( clusterResourceName, clusterName, extensionName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -730,22 +732,22 @@ private Mono> getWithResponseAsync( * Gets Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return kubernetes Cluster Extension. + * @return kubernetes Cluster Extension on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName) { return getWithResponseAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionName) @@ -763,10 +765,10 @@ private Mono getAsync( * Gets Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -777,8 +779,8 @@ private Mono getAsync( @ServiceMethod(returns = ReturnType.SINGLE) public ExtensionInner get( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName) { return getAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionName).block(); @@ -788,23 +790,23 @@ public ExtensionInner get( * Gets Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return kubernetes Cluster Extension. + * @return kubernetes Cluster Extension along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, Context context) { @@ -817,23 +819,23 @@ public Response getWithResponse( * Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension from the cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param forceDelete Delete the extension resource in Azure - not the normal asynchronous delete. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, Boolean forceDelete) { @@ -866,6 +868,7 @@ private Mono>> deleteWithResponseAsync( if (extensionName == null) { return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); } + final String apiVersion = "2022-04-02-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -879,7 +882,7 @@ private Mono>> deleteWithResponseAsync( clusterResourceName, clusterName, extensionName, - this.client.getApiVersion(), + apiVersion, forceDelete, accept, context)) @@ -890,10 +893,10 @@ private Mono>> deleteWithResponseAsync( * Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension from the cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param forceDelete Delete the extension resource in Azure - not the normal asynchronous delete. @@ -901,13 +904,13 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, Boolean forceDelete, @@ -941,6 +944,7 @@ private Mono>> deleteWithResponseAsync( if (extensionName == null) { return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); } + final String apiVersion = "2022-04-02-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -952,7 +956,7 @@ private Mono>> deleteWithResponseAsync( clusterResourceName, clusterName, extensionName, - this.client.getApiVersion(), + apiVersion, forceDelete, accept, context); @@ -962,23 +966,23 @@ private Mono>> deleteWithResponseAsync( * Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension from the cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param forceDelete Delete the extension resource in Azure - not the normal asynchronous delete. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, Boolean forceDelete) { @@ -995,10 +999,10 @@ private PollerFlux, Void> beginDeleteAsync( * Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension from the cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param forceDelete Delete the extension resource in Azure - not the normal asynchronous delete. @@ -1006,13 +1010,13 @@ private PollerFlux, Void> beginDeleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, Boolean forceDelete, @@ -1030,23 +1034,23 @@ private PollerFlux, Void> beginDeleteAsync( * Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension from the cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param forceDelete Delete the extension resource in Azure - not the normal asynchronous delete. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, Boolean forceDelete) { @@ -1059,10 +1063,10 @@ public SyncPoller, Void> beginDelete( * Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension from the cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param forceDelete Delete the extension resource in Azure - not the normal asynchronous delete. @@ -1070,13 +1074,13 @@ public SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, Boolean forceDelete, @@ -1090,23 +1094,23 @@ public SyncPoller, Void> beginDelete( * Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension from the cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param forceDelete Delete the extension resource in Azure - not the normal asynchronous delete. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, Boolean forceDelete) { @@ -1120,22 +1124,22 @@ private Mono deleteAsync( * Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension from the cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName) { final Boolean forceDelete = null; @@ -1149,10 +1153,10 @@ private Mono deleteAsync( * Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension from the cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param forceDelete Delete the extension resource in Azure - not the normal asynchronous delete. @@ -1160,13 +1164,13 @@ private Mono deleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, Boolean forceDelete, @@ -1181,10 +1185,10 @@ private Mono deleteAsync( * Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension from the cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param forceDelete Delete the extension resource in Azure - not the normal asynchronous delete. @@ -1195,8 +1199,8 @@ private Mono deleteAsync( @ServiceMethod(returns = ReturnType.SINGLE) public void delete( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, Boolean forceDelete) { @@ -1207,10 +1211,10 @@ public void delete( * Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension from the cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1220,8 +1224,8 @@ public void delete( @ServiceMethod(returns = ReturnType.SINGLE) public void delete( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName) { final Boolean forceDelete = null; @@ -1232,10 +1236,10 @@ public void delete( * Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension from the cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param forceDelete Delete the extension resource in Azure - not the normal asynchronous delete. @@ -1247,8 +1251,8 @@ public void delete( @ServiceMethod(returns = ReturnType.SINGLE) public void delete( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, Boolean forceDelete, @@ -1261,23 +1265,23 @@ public void delete( * Patch an existing Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param patchExtension Properties to Patch in an existing Extension. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Extension object. + * @return the Extension object along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, PatchExtension patchExtension) { @@ -1315,6 +1319,7 @@ private Mono>> updateWithResponseAsync( } else { patchExtension.validate(); } + final String apiVersion = "2022-04-02-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1328,7 +1333,7 @@ private Mono>> updateWithResponseAsync( clusterResourceName, clusterName, extensionName, - this.client.getApiVersion(), + apiVersion, patchExtension, accept, context)) @@ -1339,10 +1344,10 @@ private Mono>> updateWithResponseAsync( * Patch an existing Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param patchExtension Properties to Patch in an existing Extension. @@ -1350,13 +1355,13 @@ private Mono>> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Extension object. + * @return the Extension object along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, PatchExtension patchExtension, @@ -1395,6 +1400,7 @@ private Mono>> updateWithResponseAsync( } else { patchExtension.validate(); } + final String apiVersion = "2022-04-02-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1406,7 +1412,7 @@ private Mono>> updateWithResponseAsync( clusterResourceName, clusterName, extensionName, - this.client.getApiVersion(), + apiVersion, patchExtension, accept, context); @@ -1416,23 +1422,23 @@ private Mono>> updateWithResponseAsync( * Patch an existing Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param patchExtension Properties to Patch in an existing Extension. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Extension object. + * @return the {@link PollerFlux} for polling of the Extension object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ExtensionInner> beginUpdateAsync( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, PatchExtension patchExtension) { @@ -1453,10 +1459,10 @@ private PollerFlux, ExtensionInner> beginUpdateAsync( * Patch an existing Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param patchExtension Properties to Patch in an existing Extension. @@ -1464,13 +1470,13 @@ private PollerFlux, ExtensionInner> beginUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Extension object. + * @return the {@link PollerFlux} for polling of the Extension object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ExtensionInner> beginUpdateAsync( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, PatchExtension patchExtension, @@ -1489,23 +1495,23 @@ private PollerFlux, ExtensionInner> beginUpdateAsync( * Patch an existing Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param patchExtension Properties to Patch in an existing Extension. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Extension object. + * @return the {@link SyncPoller} for polling of the Extension object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ExtensionInner> beginUpdate( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, PatchExtension patchExtension) { @@ -1518,10 +1524,10 @@ public SyncPoller, ExtensionInner> beginUpdate( * Patch an existing Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param patchExtension Properties to Patch in an existing Extension. @@ -1529,13 +1535,13 @@ public SyncPoller, ExtensionInner> beginUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Extension object. + * @return the {@link SyncPoller} for polling of the Extension object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ExtensionInner> beginUpdate( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, PatchExtension patchExtension, @@ -1549,23 +1555,23 @@ public SyncPoller, ExtensionInner> beginUpdate( * Patch an existing Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param patchExtension Properties to Patch in an existing Extension. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Extension object. + * @return the Extension object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, PatchExtension patchExtension) { @@ -1579,10 +1585,10 @@ private Mono updateAsync( * Patch an existing Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param patchExtension Properties to Patch in an existing Extension. @@ -1590,13 +1596,13 @@ private Mono updateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Extension object. + * @return the Extension object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, PatchExtension patchExtension, @@ -1611,10 +1617,10 @@ private Mono updateAsync( * Patch an existing Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param patchExtension Properties to Patch in an existing Extension. @@ -1626,8 +1632,8 @@ private Mono updateAsync( @ServiceMethod(returns = ReturnType.SINGLE) public ExtensionInner update( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, PatchExtension patchExtension) { @@ -1640,10 +1646,10 @@ public ExtensionInner update( * Patch an existing Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param patchExtension Properties to Patch in an existing Extension. @@ -1656,8 +1662,8 @@ public ExtensionInner update( @ServiceMethod(returns = ReturnType.SINGLE) public ExtensionInner update( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, PatchExtension patchExtension, @@ -1671,22 +1677,20 @@ public ExtensionInner update( * List all Extensions in the cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Extensions. + * @return result of the request to list Extensions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( - String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, - String clusterName) { + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1713,6 +1717,7 @@ private Mono> listSinglePageAsync( if (clusterName == null) { return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } + final String apiVersion = "2022-04-02-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1725,7 +1730,7 @@ private Mono> listSinglePageAsync( clusterRp, clusterResourceName, clusterName, - this.client.getApiVersion(), + apiVersion, accept, context)) .>map( @@ -1744,24 +1749,21 @@ private Mono> listSinglePageAsync( * List all Extensions in the cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Extensions. + * @return result of the request to list Extensions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( - String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, - String clusterName, - Context context) { + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1788,6 +1790,7 @@ private Mono> listSinglePageAsync( if (clusterName == null) { return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } + final String apiVersion = "2022-04-02-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1798,7 +1801,7 @@ private Mono> listSinglePageAsync( clusterRp, clusterResourceName, clusterName, - this.client.getApiVersion(), + apiVersion, accept, context) .map( @@ -1816,22 +1819,19 @@ private Mono> listSinglePageAsync( * List all Extensions in the cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Extensions. + * @return result of the request to list Extensions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( - String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, - String clusterName) { + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName) { return new PagedFlux<>( () -> listSinglePageAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName), nextLink -> listNextSinglePageAsync(nextLink)); @@ -1841,24 +1841,20 @@ private PagedFlux listAsync( * List all Extensions in the cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Extensions. + * @return result of the request to list Extensions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( - String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, - String clusterName, - Context context) { + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, Context context) { return new PagedFlux<>( () -> listSinglePageAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, context), nextLink -> listNextSinglePageAsync(nextLink, context)); @@ -1868,22 +1864,19 @@ private PagedFlux listAsync( * List all Extensions in the cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Extensions. + * @return result of the request to list Extensions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( - String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, - String clusterName) { + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName) { return new PagedIterable<>(listAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName)); } @@ -1891,24 +1884,20 @@ public PagedIterable list( * List all Extensions in the cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Extensions. + * @return result of the request to list Extensions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( - String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, - String clusterName, - Context context) { + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, Context context) { return new PagedIterable<>(listAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, context)); } @@ -1919,7 +1908,8 @@ public PagedIterable list( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Extensions. + * @return result of the request to list Extensions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1955,7 +1945,8 @@ private Mono> listNextSinglePageAsync(String nextL * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Extensions. + * @return result of the request to list Extensions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/ExtensionsImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/ExtensionsImpl.java index 6fbe62e70f161..9a4fa9d864274 100644 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/ExtensionsImpl.java +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/ExtensionsImpl.java @@ -13,8 +13,6 @@ import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.ExtensionInner; import com.azure.resourcemanager.kubernetesconfiguration.models.Extension; import com.azure.resourcemanager.kubernetesconfiguration.models.Extensions; -import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterResourceName; -import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterRp; import com.azure.resourcemanager.kubernetesconfiguration.models.PatchExtension; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -34,8 +32,8 @@ public ExtensionsImpl( public Extension create( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, ExtensionInner extension) { @@ -52,8 +50,8 @@ public Extension create( public Extension create( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, ExtensionInner extension, @@ -72,8 +70,8 @@ public Extension create( public Extension get( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName) { ExtensionInner inner = @@ -87,8 +85,8 @@ public Extension get( public Response getWithResponse( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, Context context) { @@ -110,8 +108,8 @@ public Response getWithResponse( public void delete( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, Boolean forceDelete) { @@ -122,8 +120,8 @@ public void delete( public void delete( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName) { this.serviceClient().delete(resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionName); @@ -131,8 +129,8 @@ public void delete( public void delete( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, Boolean forceDelete, @@ -145,8 +143,8 @@ public void delete( public Extension update( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, PatchExtension patchExtension) { @@ -163,8 +161,8 @@ public Extension update( public Extension update( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, PatchExtension patchExtension, @@ -188,21 +186,14 @@ public Extension update( } public PagedIterable list( - String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, - String clusterName) { + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, clusterRp, clusterResourceName, clusterName); return Utils.mapPage(inner, inner1 -> new ExtensionImpl(inner1, this.manager())); } public PagedIterable list( - String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, - String clusterName, - Context context) { + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, Context context) { PagedIterable inner = this.serviceClient().list(resourceGroupName, clusterRp, clusterResourceName, clusterName, context); return Utils.mapPage(inner, inner1 -> new ExtensionImpl(inner1, this.manager())); diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/FluxConfigOperationStatusClientImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/FluxConfigOperationStatusClientImpl.java new file mode 100644 index 0000000000000..95ade93c4f749 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/FluxConfigOperationStatusClientImpl.java @@ -0,0 +1,336 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.FluxConfigOperationStatusClient; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.OperationStatusResultInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in FluxConfigOperationStatusClient. */ +public final class FluxConfigOperationStatusClientImpl implements FluxConfigOperationStatusClient { + private final ClientLogger logger = new ClientLogger(FluxConfigOperationStatusClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final FluxConfigOperationStatusService service; + + /** The service client containing this operation class. */ + private final SourceControlConfigurationClientImpl client; + + /** + * Initializes an instance of FluxConfigOperationStatusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FluxConfigOperationStatusClientImpl(SourceControlConfigurationClientImpl client) { + this.service = + RestProxy + .create( + FluxConfigOperationStatusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SourceControlConfigurationClientFluxConfigOperationStatus to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SourceControlConfigu") + private interface FluxConfigOperationStatusService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}" + + "/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations" + + "/{fluxConfigurationName}/operations/{operationId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterRp") String clusterRp, + @PathParam("clusterResourceName") String clusterResourceName, + @PathParam("clusterName") String clusterName, + @PathParam("fluxConfigurationName") String fluxConfigurationName, + @QueryParam("api-version") String apiVersion, + @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get Async Operation status. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param operationId operation Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return async Operation status along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + String operationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (fluxConfigurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fluxConfigurationName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2022-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + apiVersion, + operationId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get Async Operation status. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param operationId operation Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return async Operation status along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + String operationId, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (fluxConfigurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fluxConfigurationName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2022-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + apiVersion, + operationId, + accept, + context); + } + + /** + * Get Async Operation status. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param operationId operation Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return async Operation status on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + String operationId) { + return getWithResponseAsync( + resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, operationId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get Async Operation status. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param operationId operation Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return async Operation status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner get( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + String operationId) { + return getAsync( + resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, operationId) + .block(); + } + + /** + * Get Async Operation status. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param operationId operation Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return async Operation status along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + String operationId, + Context context) { + return getWithResponseAsync( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + operationId, + context) + .block(); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/FluxConfigOperationStatusImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/FluxConfigOperationStatusImpl.java new file mode 100644 index 0000000000000..231bbb57aef3a --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/FluxConfigOperationStatusImpl.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.FluxConfigOperationStatusClient; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.kubernetesconfiguration.models.FluxConfigOperationStatus; +import com.azure.resourcemanager.kubernetesconfiguration.models.OperationStatusResult; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class FluxConfigOperationStatusImpl implements FluxConfigOperationStatus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FluxConfigOperationStatusImpl.class); + + private final FluxConfigOperationStatusClient innerClient; + + private final com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager; + + public FluxConfigOperationStatusImpl( + FluxConfigOperationStatusClient innerClient, + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public OperationStatusResult get( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + String operationId) { + OperationStatusResultInner inner = + this + .serviceClient() + .get( + resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, operationId); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + String operationId, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + operationId, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OperationStatusResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private FluxConfigOperationStatusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/FluxConfigurationImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/FluxConfigurationImpl.java new file mode 100644 index 0000000000000..3a489ff316689 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/FluxConfigurationImpl.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.FluxConfigurationInner; +import com.azure.resourcemanager.kubernetesconfiguration.models.BucketDefinition; +import com.azure.resourcemanager.kubernetesconfiguration.models.FluxComplianceState; +import com.azure.resourcemanager.kubernetesconfiguration.models.FluxConfiguration; +import com.azure.resourcemanager.kubernetesconfiguration.models.GitRepositoryDefinition; +import com.azure.resourcemanager.kubernetesconfiguration.models.KustomizationDefinition; +import com.azure.resourcemanager.kubernetesconfiguration.models.ObjectStatusDefinition; +import com.azure.resourcemanager.kubernetesconfiguration.models.ProvisioningState; +import com.azure.resourcemanager.kubernetesconfiguration.models.ScopeType; +import com.azure.resourcemanager.kubernetesconfiguration.models.SourceKindType; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class FluxConfigurationImpl implements FluxConfiguration { + private FluxConfigurationInner innerObject; + + private final com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager; + + FluxConfigurationImpl( + FluxConfigurationInner innerObject, + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ScopeType scope() { + return this.innerModel().scope(); + } + + public String namespace() { + return this.innerModel().namespace(); + } + + public SourceKindType sourceKind() { + return this.innerModel().sourceKind(); + } + + public Boolean suspend() { + return this.innerModel().suspend(); + } + + public GitRepositoryDefinition gitRepository() { + return this.innerModel().gitRepository(); + } + + public BucketDefinition bucket() { + return this.innerModel().bucket(); + } + + public Map kustomizations() { + Map inner = this.innerModel().kustomizations(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Map configurationProtectedSettings() { + Map inner = this.innerModel().configurationProtectedSettings(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public List statuses() { + List inner = this.innerModel().statuses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String repositoryPublicKey() { + return this.innerModel().repositoryPublicKey(); + } + + public String sourceSyncedCommitId() { + return this.innerModel().sourceSyncedCommitId(); + } + + public OffsetDateTime sourceUpdatedAt() { + return this.innerModel().sourceUpdatedAt(); + } + + public OffsetDateTime statusUpdatedAt() { + return this.innerModel().statusUpdatedAt(); + } + + public FluxComplianceState complianceState() { + return this.innerModel().complianceState(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String errorMessage() { + return this.innerModel().errorMessage(); + } + + public FluxConfigurationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/FluxConfigurationsClientImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/FluxConfigurationsClientImpl.java new file mode 100644 index 0000000000000..766544edde122 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/FluxConfigurationsClientImpl.java @@ -0,0 +1,2135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.FluxConfigurationsClient; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.FluxConfigurationInner; +import com.azure.resourcemanager.kubernetesconfiguration.models.FluxConfigurationPatch; +import com.azure.resourcemanager.kubernetesconfiguration.models.FluxConfigurationsList; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in FluxConfigurationsClient. */ +public final class FluxConfigurationsClientImpl implements FluxConfigurationsClient { + private final ClientLogger logger = new ClientLogger(FluxConfigurationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final FluxConfigurationsService service; + + /** The service client containing this operation class. */ + private final SourceControlConfigurationClientImpl client; + + /** + * Initializes an instance of FluxConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FluxConfigurationsClientImpl(SourceControlConfigurationClientImpl client) { + this.service = + RestProxy.create(FluxConfigurationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SourceControlConfigurationClientFluxConfigurations to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SourceControlConfigu") + private interface FluxConfigurationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}" + + "/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations" + + "/{fluxConfigurationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterRp") String clusterRp, + @PathParam("clusterResourceName") String clusterResourceName, + @PathParam("clusterName") String clusterName, + @PathParam("fluxConfigurationName") String fluxConfigurationName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}" + + "/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations" + + "/{fluxConfigurationName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterRp") String clusterRp, + @PathParam("clusterResourceName") String clusterResourceName, + @PathParam("clusterName") String clusterName, + @PathParam("fluxConfigurationName") String fluxConfigurationName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") FluxConfigurationInner fluxConfiguration, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}" + + "/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations" + + "/{fluxConfigurationName}") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterRp") String clusterRp, + @PathParam("clusterResourceName") String clusterResourceName, + @PathParam("clusterName") String clusterName, + @PathParam("fluxConfigurationName") String fluxConfigurationName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") FluxConfigurationPatch fluxConfigurationPatch, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}" + + "/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations" + + "/{fluxConfigurationName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterRp") String clusterRp, + @PathParam("clusterResourceName") String clusterResourceName, + @PathParam("clusterName") String clusterName, + @PathParam("fluxConfigurationName") String fluxConfigurationName, + @QueryParam("api-version") String apiVersion, + @QueryParam("forceDelete") Boolean forceDelete, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}" + + "/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterRp") String clusterRp, + @PathParam("clusterResourceName") String clusterResourceName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets details of the Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the Flux Configuration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (fluxConfigurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fluxConfigurationName is required and cannot be null.")); + } + final String apiVersion = "2022-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets details of the Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the Flux Configuration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (fluxConfigurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fluxConfigurationName is required and cannot be null.")); + } + final String apiVersion = "2022-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + apiVersion, + accept, + context); + } + + /** + * Gets details of the Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the Flux Configuration on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName) { + return getWithResponseAsync( + resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets details of the Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the Flux Configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FluxConfigurationInner get( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName) { + return getAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName).block(); + } + + /** + * Gets details of the Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the Flux Configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + Context context) { + return getWithResponseAsync( + resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, context) + .block(); + } + + /** + * Create a new Kubernetes Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfiguration Properties necessary to Create a FluxConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Flux Configuration object returned in Get & Put response along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + FluxConfigurationInner fluxConfiguration) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (fluxConfigurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fluxConfigurationName is required and cannot be null.")); + } + if (fluxConfiguration == null) { + return Mono + .error(new IllegalArgumentException("Parameter fluxConfiguration is required and cannot be null.")); + } else { + fluxConfiguration.validate(); + } + final String apiVersion = "2022-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + apiVersion, + fluxConfiguration, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a new Kubernetes Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfiguration Properties necessary to Create a FluxConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Flux Configuration object returned in Get & Put response along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + FluxConfigurationInner fluxConfiguration, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (fluxConfigurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fluxConfigurationName is required and cannot be null.")); + } + if (fluxConfiguration == null) { + return Mono + .error(new IllegalArgumentException("Parameter fluxConfiguration is required and cannot be null.")); + } else { + fluxConfiguration.validate(); + } + final String apiVersion = "2022-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + apiVersion, + fluxConfiguration, + accept, + context); + } + + /** + * Create a new Kubernetes Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfiguration Properties necessary to Create a FluxConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the Flux Configuration object returned in Get & Put response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FluxConfigurationInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + FluxConfigurationInner fluxConfiguration) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + fluxConfiguration); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + FluxConfigurationInner.class, + FluxConfigurationInner.class, + this.client.getContext()); + } + + /** + * Create a new Kubernetes Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfiguration Properties necessary to Create a FluxConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the Flux Configuration object returned in Get & Put response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FluxConfigurationInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + FluxConfigurationInner fluxConfiguration, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + fluxConfiguration, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + FluxConfigurationInner.class, + FluxConfigurationInner.class, + context); + } + + /** + * Create a new Kubernetes Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfiguration Properties necessary to Create a FluxConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Flux Configuration object returned in Get & Put response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FluxConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + FluxConfigurationInner fluxConfiguration) { + return beginCreateOrUpdateAsync( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + fluxConfiguration) + .getSyncPoller(); + } + + /** + * Create a new Kubernetes Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfiguration Properties necessary to Create a FluxConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Flux Configuration object returned in Get & Put response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FluxConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + FluxConfigurationInner fluxConfiguration, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + fluxConfiguration, + context) + .getSyncPoller(); + } + + /** + * Create a new Kubernetes Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfiguration Properties necessary to Create a FluxConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Flux Configuration object returned in Get & Put response on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + FluxConfigurationInner fluxConfiguration) { + return beginCreateOrUpdateAsync( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + fluxConfiguration) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new Kubernetes Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfiguration Properties necessary to Create a FluxConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Flux Configuration object returned in Get & Put response on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + FluxConfigurationInner fluxConfiguration, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + fluxConfiguration, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new Kubernetes Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfiguration Properties necessary to Create a FluxConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Flux Configuration object returned in Get & Put response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FluxConfigurationInner createOrUpdate( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + FluxConfigurationInner fluxConfiguration) { + return createOrUpdateAsync( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + fluxConfiguration) + .block(); + } + + /** + * Create a new Kubernetes Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfiguration Properties necessary to Create a FluxConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Flux Configuration object returned in Get & Put response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FluxConfigurationInner createOrUpdate( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + FluxConfigurationInner fluxConfiguration, + Context context) { + return createOrUpdateAsync( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + fluxConfiguration, + context) + .block(); + } + + /** + * Update an existing Kubernetes Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfigurationPatch Properties to Patch in an existing Flux Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Flux Configuration object returned in Get & Put response along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + FluxConfigurationPatch fluxConfigurationPatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (fluxConfigurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fluxConfigurationName is required and cannot be null.")); + } + if (fluxConfigurationPatch == null) { + return Mono + .error( + new IllegalArgumentException("Parameter fluxConfigurationPatch is required and cannot be null.")); + } else { + fluxConfigurationPatch.validate(); + } + final String apiVersion = "2022-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + apiVersion, + fluxConfigurationPatch, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update an existing Kubernetes Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfigurationPatch Properties to Patch in an existing Flux Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Flux Configuration object returned in Get & Put response along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + FluxConfigurationPatch fluxConfigurationPatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (fluxConfigurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fluxConfigurationName is required and cannot be null.")); + } + if (fluxConfigurationPatch == null) { + return Mono + .error( + new IllegalArgumentException("Parameter fluxConfigurationPatch is required and cannot be null.")); + } else { + fluxConfigurationPatch.validate(); + } + final String apiVersion = "2022-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + apiVersion, + fluxConfigurationPatch, + accept, + context); + } + + /** + * Update an existing Kubernetes Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfigurationPatch Properties to Patch in an existing Flux Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the Flux Configuration object returned in Get & Put response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FluxConfigurationInner> beginUpdateAsync( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + FluxConfigurationPatch fluxConfigurationPatch) { + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + fluxConfigurationPatch); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + FluxConfigurationInner.class, + FluxConfigurationInner.class, + this.client.getContext()); + } + + /** + * Update an existing Kubernetes Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfigurationPatch Properties to Patch in an existing Flux Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the Flux Configuration object returned in Get & Put response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FluxConfigurationInner> beginUpdateAsync( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + FluxConfigurationPatch fluxConfigurationPatch, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + fluxConfigurationPatch, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + FluxConfigurationInner.class, + FluxConfigurationInner.class, + context); + } + + /** + * Update an existing Kubernetes Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfigurationPatch Properties to Patch in an existing Flux Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Flux Configuration object returned in Get & Put response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FluxConfigurationInner> beginUpdate( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + FluxConfigurationPatch fluxConfigurationPatch) { + return beginUpdateAsync( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + fluxConfigurationPatch) + .getSyncPoller(); + } + + /** + * Update an existing Kubernetes Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfigurationPatch Properties to Patch in an existing Flux Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Flux Configuration object returned in Get & Put response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FluxConfigurationInner> beginUpdate( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + FluxConfigurationPatch fluxConfigurationPatch, + Context context) { + return beginUpdateAsync( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + fluxConfigurationPatch, + context) + .getSyncPoller(); + } + + /** + * Update an existing Kubernetes Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfigurationPatch Properties to Patch in an existing Flux Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Flux Configuration object returned in Get & Put response on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + FluxConfigurationPatch fluxConfigurationPatch) { + return beginUpdateAsync( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + fluxConfigurationPatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update an existing Kubernetes Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfigurationPatch Properties to Patch in an existing Flux Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Flux Configuration object returned in Get & Put response on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + FluxConfigurationPatch fluxConfigurationPatch, + Context context) { + return beginUpdateAsync( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + fluxConfigurationPatch, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update an existing Kubernetes Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfigurationPatch Properties to Patch in an existing Flux Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Flux Configuration object returned in Get & Put response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FluxConfigurationInner update( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + FluxConfigurationPatch fluxConfigurationPatch) { + return updateAsync( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + fluxConfigurationPatch) + .block(); + } + + /** + * Update an existing Kubernetes Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfigurationPatch Properties to Patch in an existing Flux Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Flux Configuration object returned in Get & Put response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FluxConfigurationInner update( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + FluxConfigurationPatch fluxConfigurationPatch, + Context context) { + return updateAsync( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + fluxConfigurationPatch, + context) + .block(); + } + + /** + * This will delete the YAML file used to set up the Flux Configuration, thus stopping future sync from the source + * repo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param forceDelete Delete the extension resource in Azure - not the normal asynchronous delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + Boolean forceDelete) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (fluxConfigurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fluxConfigurationName is required and cannot be null.")); + } + final String apiVersion = "2022-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + apiVersion, + forceDelete, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This will delete the YAML file used to set up the Flux Configuration, thus stopping future sync from the source + * repo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param forceDelete Delete the extension resource in Azure - not the normal asynchronous delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + Boolean forceDelete, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (fluxConfigurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fluxConfigurationName is required and cannot be null.")); + } + final String apiVersion = "2022-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + apiVersion, + forceDelete, + accept, + context); + } + + /** + * This will delete the YAML file used to set up the Flux Configuration, thus stopping future sync from the source + * repo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param forceDelete Delete the extension resource in Azure - not the normal asynchronous delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + Boolean forceDelete) { + Mono>> mono = + deleteWithResponseAsync( + resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, forceDelete); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * This will delete the YAML file used to set up the Flux Configuration, thus stopping future sync from the source + * repo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param forceDelete Delete the extension resource in Azure - not the normal asynchronous delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + Boolean forceDelete, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + forceDelete, + context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * This will delete the YAML file used to set up the Flux Configuration, thus stopping future sync from the source + * repo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param forceDelete Delete the extension resource in Azure - not the normal asynchronous delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + Boolean forceDelete) { + return beginDeleteAsync( + resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, forceDelete) + .getSyncPoller(); + } + + /** + * This will delete the YAML file used to set up the Flux Configuration, thus stopping future sync from the source + * repo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param forceDelete Delete the extension resource in Azure - not the normal asynchronous delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + Boolean forceDelete, + Context context) { + return beginDeleteAsync( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + forceDelete, + context) + .getSyncPoller(); + } + + /** + * This will delete the YAML file used to set up the Flux Configuration, thus stopping future sync from the source + * repo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param forceDelete Delete the extension resource in Azure - not the normal asynchronous delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + Boolean forceDelete) { + return beginDeleteAsync( + resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, forceDelete) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This will delete the YAML file used to set up the Flux Configuration, thus stopping future sync from the source + * repo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName) { + final Boolean forceDelete = null; + return beginDeleteAsync( + resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, forceDelete) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This will delete the YAML file used to set up the Flux Configuration, thus stopping future sync from the source + * repo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param forceDelete Delete the extension resource in Azure - not the normal asynchronous delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + Boolean forceDelete, + Context context) { + return beginDeleteAsync( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + forceDelete, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This will delete the YAML file used to set up the Flux Configuration, thus stopping future sync from the source + * repo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param forceDelete Delete the extension resource in Azure - not the normal asynchronous delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + Boolean forceDelete) { + deleteAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, forceDelete) + .block(); + } + + /** + * This will delete the YAML file used to set up the Flux Configuration, thus stopping future sync from the source + * repo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName) { + final Boolean forceDelete = null; + deleteAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, forceDelete) + .block(); + } + + /** + * This will delete the YAML file used to set up the Flux Configuration, thus stopping future sync from the source + * repo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param forceDelete Delete the extension resource in Azure - not the normal asynchronous delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + Boolean forceDelete, + Context context) { + deleteAsync( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + forceDelete, + context) + .block(); + } + + /** + * List all Flux Configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Flux Configurations along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String apiVersion = "2022-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all Flux Configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Flux Configurations along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String apiVersion = "2022-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all Flux Configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Flux Configurations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all Flux Configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Flux Configurations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List all Flux Configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Flux Configurations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName)); + } + + /** + * List all Flux Configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Flux Configurations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Flux Configurations along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Flux Configurations along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/FluxConfigurationsImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/FluxConfigurationsImpl.java new file mode 100644 index 0000000000000..125a6769a9d64 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/FluxConfigurationsImpl.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.FluxConfigurationsClient; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.FluxConfigurationInner; +import com.azure.resourcemanager.kubernetesconfiguration.models.FluxConfiguration; +import com.azure.resourcemanager.kubernetesconfiguration.models.FluxConfigurationPatch; +import com.azure.resourcemanager.kubernetesconfiguration.models.FluxConfigurations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class FluxConfigurationsImpl implements FluxConfigurations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FluxConfigurationsImpl.class); + + private final FluxConfigurationsClient innerClient; + + private final com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager; + + public FluxConfigurationsImpl( + FluxConfigurationsClient innerClient, + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public FluxConfiguration get( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName) { + FluxConfigurationInner inner = + this + .serviceClient() + .get(resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName); + if (inner != null) { + return new FluxConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new FluxConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public FluxConfiguration createOrUpdate( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + FluxConfigurationInner fluxConfiguration) { + FluxConfigurationInner inner = + this + .serviceClient() + .createOrUpdate( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + fluxConfiguration); + if (inner != null) { + return new FluxConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public FluxConfiguration createOrUpdate( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + FluxConfigurationInner fluxConfiguration, + Context context) { + FluxConfigurationInner inner = + this + .serviceClient() + .createOrUpdate( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + fluxConfiguration, + context); + if (inner != null) { + return new FluxConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public FluxConfiguration update( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + FluxConfigurationPatch fluxConfigurationPatch) { + FluxConfigurationInner inner = + this + .serviceClient() + .update( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + fluxConfigurationPatch); + if (inner != null) { + return new FluxConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public FluxConfiguration update( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + FluxConfigurationPatch fluxConfigurationPatch, + Context context) { + FluxConfigurationInner inner = + this + .serviceClient() + .update( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + fluxConfigurationPatch, + context); + if (inner != null) { + return new FluxConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + Boolean forceDelete) { + this + .serviceClient() + .delete(resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, forceDelete); + } + + public void delete( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName) { + this + .serviceClient() + .delete(resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName); + } + + public void delete( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + Boolean forceDelete, + Context context) { + this + .serviceClient() + .delete( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + forceDelete, + context); + } + + public PagedIterable list( + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, clusterRp, clusterResourceName, clusterName); + return Utils.mapPage(inner, inner1 -> new FluxConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, clusterRp, clusterResourceName, clusterName, context); + return Utils.mapPage(inner, inner1 -> new FluxConfigurationImpl(inner1, this.manager())); + } + + private FluxConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/KubernetesConfigurationPrivateLinkScopeImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/KubernetesConfigurationPrivateLinkScopeImpl.java new file mode 100644 index 0000000000000..595e971164ab9 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/KubernetesConfigurationPrivateLinkScopeImpl.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.KubernetesConfigurationPrivateLinkScopeInner; +import com.azure.resourcemanager.kubernetesconfiguration.models.KubernetesConfigurationPrivateLinkScope; +import com.azure.resourcemanager.kubernetesconfiguration.models.KubernetesConfigurationPrivateLinkScopeProperties; +import com.azure.resourcemanager.kubernetesconfiguration.models.TagsResource; +import java.util.Collections; +import java.util.Map; + +public final class KubernetesConfigurationPrivateLinkScopeImpl + implements KubernetesConfigurationPrivateLinkScope, + KubernetesConfigurationPrivateLinkScope.Definition, + KubernetesConfigurationPrivateLinkScope.Update { + private KubernetesConfigurationPrivateLinkScopeInner innerObject; + + private final com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public KubernetesConfigurationPrivateLinkScopeProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public KubernetesConfigurationPrivateLinkScopeInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String scopeName; + + private TagsResource updatePrivateLinkScopeTags; + + public KubernetesConfigurationPrivateLinkScopeImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public KubernetesConfigurationPrivateLinkScope create() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateLinkScopes() + .createOrUpdateWithResponse(resourceGroupName, scopeName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public KubernetesConfigurationPrivateLinkScope create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateLinkScopes() + .createOrUpdateWithResponse(resourceGroupName, scopeName, this.innerModel(), context) + .getValue(); + return this; + } + + KubernetesConfigurationPrivateLinkScopeImpl( + String name, + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager) { + this.innerObject = new KubernetesConfigurationPrivateLinkScopeInner(); + this.serviceManager = serviceManager; + this.scopeName = name; + } + + public KubernetesConfigurationPrivateLinkScopeImpl update() { + this.updatePrivateLinkScopeTags = new TagsResource(); + return this; + } + + public KubernetesConfigurationPrivateLinkScope apply() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateLinkScopes() + .updateTagsWithResponse(resourceGroupName, scopeName, updatePrivateLinkScopeTags, Context.NONE) + .getValue(); + return this; + } + + public KubernetesConfigurationPrivateLinkScope apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateLinkScopes() + .updateTagsWithResponse(resourceGroupName, scopeName, updatePrivateLinkScopeTags, context) + .getValue(); + return this; + } + + KubernetesConfigurationPrivateLinkScopeImpl( + KubernetesConfigurationPrivateLinkScopeInner innerObject, + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.scopeName = Utils.getValueFromIdByName(innerObject.id(), "privateLinkScopes"); + } + + public KubernetesConfigurationPrivateLinkScope refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateLinkScopes() + .getByResourceGroupWithResponse(resourceGroupName, scopeName, Context.NONE) + .getValue(); + return this; + } + + public KubernetesConfigurationPrivateLinkScope refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateLinkScopes() + .getByResourceGroupWithResponse(resourceGroupName, scopeName, context) + .getValue(); + return this; + } + + public KubernetesConfigurationPrivateLinkScopeImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public KubernetesConfigurationPrivateLinkScopeImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public KubernetesConfigurationPrivateLinkScopeImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updatePrivateLinkScopeTags.withTags(tags); + return this; + } + } + + public KubernetesConfigurationPrivateLinkScopeImpl withProperties( + KubernetesConfigurationPrivateLinkScopeProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/LocationExtensionTypesClientImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/LocationExtensionTypesClientImpl.java new file mode 100644 index 0000000000000..7b4ee19b51a10 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/LocationExtensionTypesClientImpl.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.LocationExtensionTypesClient; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.ExtensionTypeInner; +import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionTypeList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LocationExtensionTypesClient. */ +public final class LocationExtensionTypesClientImpl implements LocationExtensionTypesClient { + private final ClientLogger logger = new ClientLogger(LocationExtensionTypesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final LocationExtensionTypesService service; + + /** The service client containing this operation class. */ + private final SourceControlConfigurationClientImpl client; + + /** + * Initializes an instance of LocationExtensionTypesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LocationExtensionTypesClientImpl(SourceControlConfigurationClientImpl client) { + this.service = + RestProxy + .create(LocationExtensionTypesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SourceControlConfigurationClientLocationExtensionTypes to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SourceControlConfigu") + private interface LocationExtensionTypesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.KubernetesConfiguration/locations/{location}" + + "/extensionTypes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List all Extension Types. + * + * @param location extension location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Types along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String location) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String apiVersion = "2022-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all Extension Types. + * + * @param location extension location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Types along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String location, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String apiVersion = "2022-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), location, apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all Extension Types. + * + * @param location extension location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Types as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location) { + return new PagedFlux<>(() -> listSinglePageAsync(location), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all Extension Types. + * + * @param location extension location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Types as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(location, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List all Extension Types. + * + * @param location extension location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Types as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location) { + return new PagedIterable<>(listAsync(location)); + } + + /** + * List all Extension Types. + * + * @param location extension location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Types as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, Context context) { + return new PagedIterable<>(listAsync(location, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Types along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Types along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/LocationExtensionTypesImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/LocationExtensionTypesImpl.java new file mode 100644 index 0000000000000..512cf54a38e85 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/LocationExtensionTypesImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.LocationExtensionTypesClient; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.ExtensionTypeInner; +import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionType; +import com.azure.resourcemanager.kubernetesconfiguration.models.LocationExtensionTypes; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class LocationExtensionTypesImpl implements LocationExtensionTypes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LocationExtensionTypesImpl.class); + + private final LocationExtensionTypesClient innerClient; + + private final com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager; + + public LocationExtensionTypesImpl( + LocationExtensionTypesClient innerClient, + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String location) { + PagedIterable inner = this.serviceClient().list(location); + return Utils.mapPage(inner, inner1 -> new ExtensionTypeImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, Context context) { + PagedIterable inner = this.serviceClient().list(location, context); + return Utils.mapPage(inner, inner1 -> new ExtensionTypeImpl(inner1, this.manager())); + } + + private LocationExtensionTypesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/OperationStatusClientImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/OperationStatusClientImpl.java index 977596e05e518..95a768c402b25 100644 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/OperationStatusClientImpl.java +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/OperationStatusClientImpl.java @@ -28,8 +28,6 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.kubernetesconfiguration.fluent.OperationStatusClient; import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.OperationStatusResultInner; -import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterResourceName; -import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterRp; import com.azure.resourcemanager.kubernetesconfiguration.models.OperationStatusList; import reactor.core.publisher.Mono; @@ -64,37 +62,37 @@ private interface OperationStatusService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}" - + "/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/operations") + + "/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions" + + "/{extensionName}/operations/{operationId}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( + Mono> get( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterRp") ExtensionsClusterRp clusterRp, - @PathParam("clusterResourceName") ExtensionsClusterResourceName clusterResourceName, + @PathParam("clusterRp") String clusterRp, + @PathParam("clusterResourceName") String clusterResourceName, @PathParam("clusterName") String clusterName, + @PathParam("extensionName") String extensionName, @QueryParam("api-version") String apiVersion, + @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}" - + "/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions" - + "/{extensionName}/operations/{operationId}") + + "/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/operations") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( + Mono> list( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterRp") ExtensionsClusterRp clusterRp, - @PathParam("clusterResourceName") ExtensionsClusterResourceName clusterResourceName, + @PathParam("clusterRp") String clusterRp, + @PathParam("clusterResourceName") String clusterResourceName, @PathParam("clusterName") String clusterName, - @PathParam("extensionName") String extensionName, @QueryParam("api-version") String apiVersion, - @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); @@ -110,25 +108,29 @@ Mono> listNext( } /** - * List Async Operations, currently in progress, in a cluster. + * Get Async Operation status. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. + * @param extensionName Name of the Extension. + * @param operationId operation Id. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the async operations in progress, in the cluster. + * @return async Operation status along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( + private Mono> getWithResponseAsync( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, - String clusterName) { + String clusterRp, + String clusterResourceName, + String clusterName, + String extensionName, + String operationId) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -155,54 +157,58 @@ private Mono> listSinglePageAsync( if (clusterName == null) { return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } + if (extensionName == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2022-04-02-preview"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .list( + .get( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterRp, clusterResourceName, clusterName, - this.client.getApiVersion(), + extensionName, + apiVersion, + operationId, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List Async Operations, currently in progress, in a cluster. + * Get Async Operation status. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. + * @param extensionName Name of the Extension. + * @param operationId operation Id. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the async operations in progress, in the cluster. + * @return async Operation status along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( + private Mono> getWithResponseAsync( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, + String extensionName, + String operationId, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -230,154 +236,143 @@ private Mono> listSinglePageAsync( if (clusterName == null) { return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } + if (extensionName == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2022-04-02-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( + .get( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterRp, clusterResourceName, clusterName, - this.client.getApiVersion(), + extensionName, + apiVersion, + operationId, accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List Async Operations, currently in progress, in a cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the async operations in progress, in the cluster. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, - String clusterName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName), - nextLink -> listNextSinglePageAsync(nextLink)); + context); } /** - * List Async Operations, currently in progress, in a cluster. + * Get Async Operation status. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. - * @param context The context to associate with this operation. + * @param extensionName Name of the Extension. + * @param operationId operation Id. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the async operations in progress, in the cluster. + * @return async Operation status on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, - Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + String extensionName, + String operationId) { + return getWithResponseAsync( + resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionName, operationId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** - * List Async Operations, currently in progress, in a cluster. + * Get Async Operation status. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. + * @param extensionName Name of the Extension. + * @param operationId operation Id. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the async operations in progress, in the cluster. + * @return async Operation status. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner get( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, - String clusterName) { - return new PagedIterable<>(listAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName)); + String clusterRp, + String clusterResourceName, + String clusterName, + String extensionName, + String operationId) { + return getAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionName, operationId) + .block(); } /** - * List Async Operations, currently in progress, in a cluster. + * Get Async Operation status. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. + * @param extensionName Name of the Extension. + * @param operationId operation Id. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the async operations in progress, in the cluster. + * @return async Operation status along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, + String extensionName, + String operationId, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, context)); + return getWithResponseAsync( + resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionName, operationId, context) + .block(); } /** - * Get Async Operation status. + * List Async Operations, currently in progress, in a cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. - * @param extensionName Name of the Extension. - * @param operationId operation Id. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return async Operation status. + * @return the async operations in progress, in the cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, - String clusterName, - String extensionName, - String operationId) { + private Mono> listSinglePageAsync( + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -404,58 +399,53 @@ private Mono> getWithResponseAsync( if (clusterName == null) { return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } - if (extensionName == null) { - return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } + final String apiVersion = "2022-03-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .get( + .list( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterRp, clusterResourceName, clusterName, - extensionName, - this.client.getApiVersion(), - operationId, + apiVersion, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get Async Operation status. + * List Async Operations, currently in progress, in a cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. - * @param extensionName Name of the Extension. - * @param operationId operation Id. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return async Operation status. + * @return the async operations in progress, in the cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, - String clusterName, - String extensionName, - String operationId, - Context context) { + private Mono> listSinglePageAsync( + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -482,122 +472,115 @@ private Mono> getWithResponseAsync( if (clusterName == null) { return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } - if (extensionName == null) { - return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } + final String apiVersion = "2022-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .get( + .list( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterRp, clusterResourceName, clusterName, - extensionName, - this.client.getApiVersion(), - operationId, + apiVersion, accept, - context); + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); } /** - * Get Async Operation status. + * List Async Operations, currently in progress, in a cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. - * @param extensionName Name of the Extension. - * @param operationId operation Id. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return async Operation status. + * @return the async operations in progress, in the cluster as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, - String clusterName, - String extensionName, - String operationId) { - return getWithResponseAsync( - resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionName, operationId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Get Async Operation status. + * List Async Operations, currently in progress, in a cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. - * @param extensionName Name of the Extension. - * @param operationId operation Id. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return async Operation status. + * @return the async operations in progress, in the cluster as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OperationStatusResultInner get( - String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, - String clusterName, - String extensionName, - String operationId) { - return getAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionName, operationId) - .block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** - * Get Async Operation status. + * List Async Operations, currently in progress, in a cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the async operations in progress, in the cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName)); + } + + /** + * List Async Operations, currently in progress, in a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. - * @param extensionName Name of the Extension. - * @param operationId operation Id. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return async Operation status. + * @return the async operations in progress, in the cluster as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, - String clusterName, - String extensionName, - String operationId, - Context context) { - return getWithResponseAsync( - resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionName, operationId, context) - .block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, context)); } /** @@ -607,7 +590,8 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the async operations in progress, in the cluster. + * @return the async operations in progress, in the cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -643,7 +627,8 @@ private Mono> listNextSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the async operations in progress, in the cluster. + * @return the async operations in progress, in the cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/OperationStatusImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/OperationStatusImpl.java index 37f7c91c079c8..66b2ab1d161eb 100644 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/OperationStatusImpl.java +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/OperationStatusImpl.java @@ -11,8 +11,6 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.kubernetesconfiguration.fluent.OperationStatusClient; import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.OperationStatusResultInner; -import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterResourceName; -import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterRp; import com.azure.resourcemanager.kubernetesconfiguration.models.OperationStatus; import com.azure.resourcemanager.kubernetesconfiguration.models.OperationStatusResult; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -31,31 +29,10 @@ public OperationStatusImpl( this.serviceManager = serviceManager; } - public PagedIterable list( - String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, - String clusterName) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, clusterRp, clusterResourceName, clusterName); - return Utils.mapPage(inner, inner1 -> new OperationStatusResultImpl(inner1, this.manager())); - } - - public PagedIterable list( - String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, - String clusterName, - Context context) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, clusterRp, clusterResourceName, clusterName, context); - return Utils.mapPage(inner, inner1 -> new OperationStatusResultImpl(inner1, this.manager())); - } - public OperationStatusResult get( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, String operationId) { @@ -72,8 +49,8 @@ public OperationStatusResult get( public Response getWithResponse( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, String operationId, @@ -100,6 +77,20 @@ public Response getWithResponse( } } + public PagedIterable list( + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, clusterRp, clusterResourceName, clusterName); + return Utils.mapPage(inner, inner1 -> new OperationStatusResultImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, clusterRp, clusterResourceName, clusterName, context); + return Utils.mapPage(inner, inner1 -> new OperationStatusResultImpl(inner1, this.manager())); + } + private OperationStatusClient serviceClient() { return this.innerClient; } diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/OperationsClientImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/OperationsClientImpl.java index 4fbd9330e50ab..a4e2914044a9a 100644 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/OperationsClientImpl.java +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/OperationsClientImpl.java @@ -81,11 +81,12 @@ Mono> listNext( } /** - * List all the available operations the KubernetesConfiguration resource provider supports, in this api-version. + * List all the available operations the KubernetesConfiguration resource provider supports. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list operations. + * @return result of the request to list operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -95,10 +96,10 @@ private Mono> listSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + final String apiVersion = "2022-03-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) .>map( res -> new PagedResponseBase<>( @@ -112,13 +113,14 @@ private Mono> listSinglePageAsync( } /** - * List all the available operations the KubernetesConfiguration resource provider supports, in this api-version. + * List all the available operations the KubernetesConfiguration resource provider supports. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list operations. + * @return result of the request to list operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -128,10 +130,11 @@ private Mono> listSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + final String apiVersion = "2022-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .list(this.client.getEndpoint(), apiVersion, accept, context) .map( res -> new PagedResponseBase<>( @@ -144,11 +147,11 @@ private Mono> listSinglePageAsync( } /** - * List all the available operations the KubernetesConfiguration resource provider supports, in this api-version. + * List all the available operations the KubernetesConfiguration resource provider supports. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list operations. + * @return result of the request to list operations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -156,13 +159,13 @@ private PagedFlux listAsync() { } /** - * List all the available operations the KubernetesConfiguration resource provider supports, in this api-version. + * List all the available operations the KubernetesConfiguration resource provider supports. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list operations. + * @return result of the request to list operations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -171,11 +174,11 @@ private PagedFlux listAsync(Context context) { } /** - * List all the available operations the KubernetesConfiguration resource provider supports, in this api-version. + * List all the available operations the KubernetesConfiguration resource provider supports. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list operations. + * @return result of the request to list operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -183,13 +186,13 @@ public PagedIterable list() { } /** - * List all the available operations the KubernetesConfiguration resource provider supports, in this api-version. + * List all the available operations the KubernetesConfiguration resource provider supports. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list operations. + * @return result of the request to list operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -203,7 +206,8 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list operations. + * @return result of the request to list operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -239,7 +243,8 @@ private Mono> listNextSinglePageAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list operations. + * @return result of the request to list operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync( diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/PrivateEndpointConnectionImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 0000000000000..ddfed5cdae440 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.kubernetesconfiguration.models.PrivateEndpointConnection; +import com.azure.resourcemanager.kubernetesconfiguration.models.PrivateEndpointConnectionProperties; + +public final class PrivateEndpointConnectionImpl + implements PrivateEndpointConnection, PrivateEndpointConnection.Definition, PrivateEndpointConnection.Update { + private PrivateEndpointConnectionInner innerObject; + + private final com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public PrivateEndpointConnectionProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public PrivateEndpointConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String scopeName; + + private String privateEndpointConnectionName; + + public PrivateEndpointConnectionImpl withExistingPrivateLinkScope(String resourceGroupName, String scopeName) { + this.resourceGroupName = resourceGroupName; + this.scopeName = scopeName; + return this; + } + + public PrivateEndpointConnection create() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .createOrUpdate( + resourceGroupName, scopeName, privateEndpointConnectionName, this.innerModel(), Context.NONE); + return this; + } + + public PrivateEndpointConnection create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .createOrUpdate( + resourceGroupName, scopeName, privateEndpointConnectionName, this.innerModel(), context); + return this; + } + + PrivateEndpointConnectionImpl( + String name, + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager) { + this.innerObject = new PrivateEndpointConnectionInner(); + this.serviceManager = serviceManager; + this.privateEndpointConnectionName = name; + } + + public PrivateEndpointConnectionImpl update() { + return this; + } + + public PrivateEndpointConnection apply() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .createOrUpdate( + resourceGroupName, scopeName, privateEndpointConnectionName, this.innerModel(), Context.NONE); + return this; + } + + public PrivateEndpointConnection apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .createOrUpdate( + resourceGroupName, scopeName, privateEndpointConnectionName, this.innerModel(), context); + return this; + } + + PrivateEndpointConnectionImpl( + PrivateEndpointConnectionInner innerObject, + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.scopeName = Utils.getValueFromIdByName(innerObject.id(), "privateLinkScopes"); + this.privateEndpointConnectionName = Utils.getValueFromIdByName(innerObject.id(), "privateEndpointConnections"); + } + + public PrivateEndpointConnection refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, scopeName, privateEndpointConnectionName, Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, scopeName, privateEndpointConnectionName, context) + .getValue(); + return this; + } + + public PrivateEndpointConnectionImpl withProperties(PrivateEndpointConnectionProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/PrivateEndpointConnectionsClientImpl.java new file mode 100644 index 0000000000000..fe99a0a5c3d77 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/PrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,1187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.kubernetesconfiguration.models.PrivateEndpointConnectionListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { + private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateEndpointConnectionsService service; + + /** The service client containing this operation class. */ + private final SourceControlConfigurationClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateEndpointConnectionsClientImpl(SourceControlConfigurationClientImpl client) { + this.service = + RestProxy + .create( + PrivateEndpointConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SourceControlConfigurationClientPrivateEndpointConnections to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SourceControlConfigu") + private interface PrivateEndpointConnectionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" + + "/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateEndpointConnections" + + "/{privateEndpointConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("scopeName") String scopeName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" + + "/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateEndpointConnections" + + "/{privateEndpointConnectionName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("scopeName") String scopeName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @BodyParam("application/json") PrivateEndpointConnectionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" + + "/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateEndpointConnections" + + "/{privateEndpointConnectionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("scopeName") String scopeName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" + + "/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateEndpointConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByPrivateLinkScope( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("scopeName") String scopeName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByPrivateLinkScopeNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String scopeName, String privateEndpointConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String apiVersion = "2022-04-02-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + scopeName, + privateEndpointConnectionName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String apiVersion = "2022-04-02-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + scopeName, + privateEndpointConnectionName, + accept, + context); + } + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String scopeName, String privateEndpointConnectionName) { + return getWithResponseAsync(resourceGroupName, scopeName, privateEndpointConnectionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner get( + String resourceGroupName, String scopeName, String privateEndpointConnectionName) { + return getAsync(resourceGroupName, scopeName, privateEndpointConnectionName).block(); + } + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, scopeName, privateEndpointConnectionName, context).block(); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String scopeName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2022-04-02-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + scopeName, + privateEndpointConnectionName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String scopeName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2022-04-02-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + scopeName, + privateEndpointConnectionName, + parameters, + accept, + context); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PrivateEndpointConnectionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String scopeName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, scopeName, privateEndpointConnectionName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateEndpointConnectionInner.class, + PrivateEndpointConnectionInner.class, + this.client.getContext()); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PrivateEndpointConnectionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String scopeName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, scopeName, privateEndpointConnectionName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateEndpointConnectionInner.class, + PrivateEndpointConnectionInner.class, + context); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String scopeName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, scopeName, privateEndpointConnectionName, parameters) + .getSyncPoller(); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String scopeName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, scopeName, privateEndpointConnectionName, parameters, context) + .getSyncPoller(); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String scopeName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, scopeName, privateEndpointConnectionName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String scopeName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, scopeName, privateEndpointConnectionName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner createOrUpdate( + String resourceGroupName, + String scopeName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { + return createOrUpdateAsync(resourceGroupName, scopeName, privateEndpointConnectionName, parameters).block(); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner createOrUpdate( + String resourceGroupName, + String scopeName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, scopeName, privateEndpointConnectionName, parameters, context) + .block(); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String scopeName, String privateEndpointConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String apiVersion = "2022-04-02-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + scopeName, + privateEndpointConnectionName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String apiVersion = "2022-04-02-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + scopeName, + privateEndpointConnectionName, + accept, + context); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String scopeName, String privateEndpointConnectionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, scopeName, privateEndpointConnectionName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, scopeName, privateEndpointConnectionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String scopeName, String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, scopeName, privateEndpointConnectionName).getSyncPoller(); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, scopeName, privateEndpointConnectionName, context).getSyncPoller(); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String scopeName, String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, scopeName, privateEndpointConnectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, scopeName, privateEndpointConnectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String scopeName, String privateEndpointConnectionName) { + deleteAsync(resourceGroupName, scopeName, privateEndpointConnectionName).block(); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context) { + deleteAsync(resourceGroupName, scopeName, privateEndpointConnectionName, context).block(); + } + + /** + * Gets all private endpoint connections on a private link scope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoint connections on a private link scope along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPrivateLinkScopeSinglePageAsync( + String resourceGroupName, String scopeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + final String apiVersion = "2022-04-02-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByPrivateLinkScope( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + scopeName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all private endpoint connections on a private link scope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoint connections on a private link scope along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPrivateLinkScopeSinglePageAsync( + String resourceGroupName, String scopeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + final String apiVersion = "2022-04-02-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByPrivateLinkScope( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + scopeName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all private endpoint connections on a private link scope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoint connections on a private link scope as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByPrivateLinkScopeAsync( + String resourceGroupName, String scopeName) { + return new PagedFlux<>( + () -> listByPrivateLinkScopeSinglePageAsync(resourceGroupName, scopeName), + nextLink -> listByPrivateLinkScopeNextSinglePageAsync(nextLink)); + } + + /** + * Gets all private endpoint connections on a private link scope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoint connections on a private link scope as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByPrivateLinkScopeAsync( + String resourceGroupName, String scopeName, Context context) { + return new PagedFlux<>( + () -> listByPrivateLinkScopeSinglePageAsync(resourceGroupName, scopeName, context), + nextLink -> listByPrivateLinkScopeNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all private endpoint connections on a private link scope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoint connections on a private link scope as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByPrivateLinkScope( + String resourceGroupName, String scopeName) { + return new PagedIterable<>(listByPrivateLinkScopeAsync(resourceGroupName, scopeName)); + } + + /** + * Gets all private endpoint connections on a private link scope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoint connections on a private link scope as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByPrivateLinkScope( + String resourceGroupName, String scopeName, Context context) { + return new PagedIterable<>(listByPrivateLinkScopeAsync(resourceGroupName, scopeName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPrivateLinkScopeNextSinglePageAsync( + String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByPrivateLinkScopeNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPrivateLinkScopeNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByPrivateLinkScopeNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/PrivateEndpointConnectionsImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 0000000000000..4f9dd90dbfb8e --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.kubernetesconfiguration.models.PrivateEndpointConnection; +import com.azure.resourcemanager.kubernetesconfiguration.models.PrivateEndpointConnections; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsImpl.class); + + private final PrivateEndpointConnectionsClient innerClient; + + private final com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager; + + public PrivateEndpointConnectionsImpl( + PrivateEndpointConnectionsClient innerClient, + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PrivateEndpointConnection get( + String resourceGroupName, String scopeName, String privateEndpointConnectionName) { + PrivateEndpointConnectionInner inner = + this.serviceClient().get(resourceGroupName, scopeName, privateEndpointConnectionName); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, scopeName, privateEndpointConnectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String scopeName, String privateEndpointConnectionName) { + this.serviceClient().delete(resourceGroupName, scopeName, privateEndpointConnectionName); + } + + public void delete( + String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context) { + this.serviceClient().delete(resourceGroupName, scopeName, privateEndpointConnectionName, context); + } + + public PagedIterable listByPrivateLinkScope(String resourceGroupName, String scopeName) { + PagedIterable inner = + this.serviceClient().listByPrivateLinkScope(resourceGroupName, scopeName); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listByPrivateLinkScope( + String resourceGroupName, String scopeName, Context context) { + PagedIterable inner = + this.serviceClient().listByPrivateLinkScope(resourceGroupName, scopeName, context); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PrivateEndpointConnection getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String scopeName = Utils.getValueFromIdByName(id, "privateLinkScopes"); + if (scopeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateLinkScopes'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this + .getWithResponse(resourceGroupName, scopeName, privateEndpointConnectionName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String scopeName = Utils.getValueFromIdByName(id, "privateLinkScopes"); + if (scopeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateLinkScopes'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this.getWithResponse(resourceGroupName, scopeName, privateEndpointConnectionName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String scopeName = Utils.getValueFromIdByName(id, "privateLinkScopes"); + if (scopeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateLinkScopes'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + this.delete(resourceGroupName, scopeName, privateEndpointConnectionName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String scopeName = Utils.getValueFromIdByName(id, "privateLinkScopes"); + if (scopeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateLinkScopes'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + this.delete(resourceGroupName, scopeName, privateEndpointConnectionName, context); + } + + private PrivateEndpointConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager() { + return this.serviceManager; + } + + public PrivateEndpointConnectionImpl define(String name) { + return new PrivateEndpointConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/PrivateLinkResourceImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/PrivateLinkResourceImpl.java new file mode 100644 index 0000000000000..d150c068ef89c --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/PrivateLinkResourceImpl.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.kubernetesconfiguration.models.PrivateLinkResource; +import com.azure.resourcemanager.kubernetesconfiguration.models.PrivateLinkResourceProperties; + +public final class PrivateLinkResourceImpl implements PrivateLinkResource { + private PrivateLinkResourceInner innerObject; + + private final com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager; + + PrivateLinkResourceImpl( + PrivateLinkResourceInner innerObject, + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public PrivateLinkResourceProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public PrivateLinkResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/PrivateLinkResourcesClientImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/PrivateLinkResourcesClientImpl.java new file mode 100644 index 0000000000000..e28708d58afcc --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/PrivateLinkResourcesClientImpl.java @@ -0,0 +1,536 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.kubernetesconfiguration.models.PrivateLinkResourceListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ +public final class PrivateLinkResourcesClientImpl implements PrivateLinkResourcesClient { + private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateLinkResourcesService service; + + /** The service client containing this operation class. */ + private final SourceControlConfigurationClientImpl client; + + /** + * Initializes an instance of PrivateLinkResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateLinkResourcesClientImpl(SourceControlConfigurationClientImpl client) { + this.service = + RestProxy + .create(PrivateLinkResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SourceControlConfigurationClientPrivateLinkResources to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SourceControlConfigu") + private interface PrivateLinkResourcesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" + + "/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateLinkResources") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByPrivateLinkScope( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("scopeName") String scopeName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" + + "/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateLinkResources/{groupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("scopeName") String scopeName, + @PathParam("groupName") String groupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByPrivateLinkScopeNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPrivateLinkScopeSinglePageAsync( + String resourceGroupName, String scopeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + final String apiVersion = "2022-04-02-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByPrivateLinkScope( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + scopeName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPrivateLinkScopeSinglePageAsync( + String resourceGroupName, String scopeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + final String apiVersion = "2022-04-02-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByPrivateLinkScope( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + scopeName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByPrivateLinkScopeAsync( + String resourceGroupName, String scopeName) { + return new PagedFlux<>( + () -> listByPrivateLinkScopeSinglePageAsync(resourceGroupName, scopeName), + nextLink -> listByPrivateLinkScopeNextSinglePageAsync(nextLink)); + } + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByPrivateLinkScopeAsync( + String resourceGroupName, String scopeName, Context context) { + return new PagedFlux<>( + () -> listByPrivateLinkScopeSinglePageAsync(resourceGroupName, scopeName, context), + nextLink -> listByPrivateLinkScopeNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByPrivateLinkScope(String resourceGroupName, String scopeName) { + return new PagedIterable<>(listByPrivateLinkScopeAsync(resourceGroupName, scopeName)); + } + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByPrivateLinkScope( + String resourceGroupName, String scopeName, Context context) { + return new PagedIterable<>(listByPrivateLinkScopeAsync(resourceGroupName, scopeName, context)); + } + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param groupName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String scopeName, String groupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + final String apiVersion = "2022-04-02-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + scopeName, + groupName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param groupName The name of the private link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String scopeName, String groupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + final String apiVersion = "2022-04-02-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + scopeName, + groupName, + accept, + context); + } + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param groupName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String scopeName, String groupName) { + return getWithResponseAsync(resourceGroupName, scopeName, groupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param groupName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkResourceInner get(String resourceGroupName, String scopeName, String groupName) { + return getAsync(resourceGroupName, scopeName, groupName).block(); + } + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param groupName The name of the private link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String scopeName, String groupName, Context context) { + return getWithResponseAsync(resourceGroupName, scopeName, groupName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPrivateLinkScopeNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByPrivateLinkScopeNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPrivateLinkScopeNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByPrivateLinkScopeNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/PrivateLinkResourcesImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/PrivateLinkResourcesImpl.java new file mode 100644 index 0000000000000..4a3693f45e2da --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/PrivateLinkResourcesImpl.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.kubernetesconfiguration.models.PrivateLinkResource; +import com.azure.resourcemanager.kubernetesconfiguration.models.PrivateLinkResources; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PrivateLinkResourcesImpl implements PrivateLinkResources { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesImpl.class); + + private final PrivateLinkResourcesClient innerClient; + + private final com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager; + + public PrivateLinkResourcesImpl( + PrivateLinkResourcesClient innerClient, + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByPrivateLinkScope(String resourceGroupName, String scopeName) { + PagedIterable inner = + this.serviceClient().listByPrivateLinkScope(resourceGroupName, scopeName); + return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByPrivateLinkScope( + String resourceGroupName, String scopeName, Context context) { + PagedIterable inner = + this.serviceClient().listByPrivateLinkScope(resourceGroupName, scopeName, context); + return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + } + + public PrivateLinkResource get(String resourceGroupName, String scopeName, String groupName) { + PrivateLinkResourceInner inner = this.serviceClient().get(resourceGroupName, scopeName, groupName); + if (inner != null) { + return new PrivateLinkResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String scopeName, String groupName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, scopeName, groupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateLinkResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private PrivateLinkResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/PrivateLinkScopeValidationDetailsImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/PrivateLinkScopeValidationDetailsImpl.java new file mode 100644 index 0000000000000..b39b8a783076c --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/PrivateLinkScopeValidationDetailsImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.implementation; + +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.PrivateLinkScopeValidationDetailsInner; +import com.azure.resourcemanager.kubernetesconfiguration.models.ConnectionDetail; +import com.azure.resourcemanager.kubernetesconfiguration.models.PrivateLinkScopeValidationDetails; +import com.azure.resourcemanager.kubernetesconfiguration.models.PublicNetworkAccessType; +import java.util.Collections; +import java.util.List; + +public final class PrivateLinkScopeValidationDetailsImpl implements PrivateLinkScopeValidationDetails { + private PrivateLinkScopeValidationDetailsInner innerObject; + + private final com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager; + + PrivateLinkScopeValidationDetailsImpl( + PrivateLinkScopeValidationDetailsInner innerObject, + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public PublicNetworkAccessType publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + + public List connectionDetails() { + List inner = this.innerModel().connectionDetails(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PrivateLinkScopeValidationDetailsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/PrivateLinkScopesClientImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/PrivateLinkScopesClientImpl.java new file mode 100644 index 0000000000000..98e55cf7de8bf --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/PrivateLinkScopesClientImpl.java @@ -0,0 +1,1721 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.PrivateLinkScopesClient; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.KubernetesConfigurationPrivateLinkScopeInner; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.PrivateLinkScopeValidationDetailsInner; +import com.azure.resourcemanager.kubernetesconfiguration.models.KubernetesConfigurationPrivateLinkScopeListResult; +import com.azure.resourcemanager.kubernetesconfiguration.models.TagsResource; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateLinkScopesClient. */ +public final class PrivateLinkScopesClientImpl implements PrivateLinkScopesClient { + private final ClientLogger logger = new ClientLogger(PrivateLinkScopesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateLinkScopesService service; + + /** The service client containing this operation class. */ + private final SourceControlConfigurationClientImpl client; + + /** + * Initializes an instance of PrivateLinkScopesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateLinkScopesClientImpl(SourceControlConfigurationClientImpl client) { + this.service = + RestProxy.create(PrivateLinkScopesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SourceControlConfigurationClientPrivateLinkScopes to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SourceControlConfigu") + private interface PrivateLinkScopesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" + + "/Microsoft.KubernetesConfiguration/privateLinkScopes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" + + "/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("scopeName") String scopeName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" + + "/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("scopeName") String scopeName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" + + "/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("scopeName") String scopeName, + @BodyParam("application/json") KubernetesConfigurationPrivateLinkScopeInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" + + "/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("scopeName") String scopeName, + @BodyParam("application/json") TagsResource privateLinkScopeTags, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.KubernetesConfiguration/locations/{location}" + + "/privateLinkScopes/{privateLinkScopeId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getValidationDetails( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("privateLinkScopeId") String privateLinkScopeId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" + + "/Microsoft.KubernetesConfiguration/machines/{machineName}/privateLinkScopes/current") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getValidationDetailsForMachine( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("machineName") String machineName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a list of all Azure Arc PrivateLinkScopes within a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all Azure Arc PrivateLinkScopes within a subscription along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-04-02-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of all Azure Arc PrivateLinkScopes within a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all Azure Arc PrivateLinkScopes within a subscription along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-04-02-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of all Azure Arc PrivateLinkScopes within a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all Azure Arc PrivateLinkScopes within a subscription as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of all Azure Arc PrivateLinkScopes within a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all Azure Arc PrivateLinkScopes within a subscription as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of all Azure Arc PrivateLinkScopes within a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all Azure Arc PrivateLinkScopes within a subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets a list of all Azure Arc PrivateLinkScopes within a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all Azure Arc PrivateLinkScopes within a subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets a list of Azure Arc PrivateLinkScopes within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Azure Arc PrivateLinkScopes within a resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-04-02-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of Azure Arc PrivateLinkScopes within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Azure Arc PrivateLinkScopes within a resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-04-02-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of Azure Arc PrivateLinkScopes within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Azure Arc PrivateLinkScopes within a resource group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of Azure Arc PrivateLinkScopes within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Azure Arc PrivateLinkScopes within a resource group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of Azure Arc PrivateLinkScopes within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Azure Arc PrivateLinkScopes within a resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets a list of Azure Arc PrivateLinkScopes within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Azure Arc PrivateLinkScopes within a resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Deletes a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String scopeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + final String apiVersion = "2022-04-02-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + scopeName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String scopeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + final String apiVersion = "2022-04-02-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + scopeName, + accept, + context); + } + + /** + * Deletes a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String scopeName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, scopeName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String scopeName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, scopeName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String scopeName) { + return beginDeleteAsync(resourceGroupName, scopeName).getSyncPoller(); + } + + /** + * Deletes a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String scopeName, Context context) { + return beginDeleteAsync(resourceGroupName, scopeName, context).getSyncPoller(); + } + + /** + * Deletes a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String scopeName) { + return beginDeleteAsync(resourceGroupName, scopeName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String scopeName, Context context) { + return beginDeleteAsync(resourceGroupName, scopeName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String scopeName) { + deleteAsync(resourceGroupName, scopeName).block(); + } + + /** + * Deletes a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String scopeName, Context context) { + deleteAsync(resourceGroupName, scopeName, context).block(); + } + + /** + * Returns a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String scopeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + final String apiVersion = "2022-04-02-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + scopeName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String scopeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + final String apiVersion = "2022-04-02-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + scopeName, + accept, + context); + } + + /** + * Returns a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String scopeName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, scopeName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KubernetesConfigurationPrivateLinkScopeInner getByResourceGroup(String resourceGroupName, String scopeName) { + return getByResourceGroupAsync(resourceGroupName, scopeName).block(); + } + + /** + * Returns a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String scopeName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, scopeName, context).block(); + } + + /** + * Creates (or updates) a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for + * InstrumentationKey nor AppId in the Put operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param parameters Properties that need to be specified to create or update a Azure Arc for Servers and Clusters + * PrivateLinkScope. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String scopeName, KubernetesConfigurationPrivateLinkScopeInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2022-04-02-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + scopeName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates (or updates) a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for + * InstrumentationKey nor AppId in the Put operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param parameters Properties that need to be specified to create or update a Azure Arc for Servers and Clusters + * PrivateLinkScope. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String scopeName, + KubernetesConfigurationPrivateLinkScopeInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2022-04-02-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + scopeName, + parameters, + accept, + context); + } + + /** + * Creates (or updates) a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for + * InstrumentationKey nor AppId in the Put operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param parameters Properties that need to be specified to create or update a Azure Arc for Servers and Clusters + * PrivateLinkScope. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String scopeName, KubernetesConfigurationPrivateLinkScopeInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, scopeName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates (or updates) a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for + * InstrumentationKey nor AppId in the Put operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param parameters Properties that need to be specified to create or update a Azure Arc for Servers and Clusters + * PrivateLinkScope. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KubernetesConfigurationPrivateLinkScopeInner createOrUpdate( + String resourceGroupName, String scopeName, KubernetesConfigurationPrivateLinkScopeInner parameters) { + return createOrUpdateAsync(resourceGroupName, scopeName, parameters).block(); + } + + /** + * Creates (or updates) a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for + * InstrumentationKey nor AppId in the Put operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param parameters Properties that need to be specified to create or update a Azure Arc for Servers and Clusters + * PrivateLinkScope. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String scopeName, + KubernetesConfigurationPrivateLinkScopeInner parameters, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, scopeName, parameters, context).block(); + } + + /** + * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateLinkScopeTags Updated tag information to set into the PrivateLinkScope instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String scopeName, TagsResource privateLinkScopeTags) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (privateLinkScopeTags == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateLinkScopeTags is required and cannot be null.")); + } else { + privateLinkScopeTags.validate(); + } + final String apiVersion = "2022-04-02-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + scopeName, + privateLinkScopeTags, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateLinkScopeTags Updated tag information to set into the PrivateLinkScope instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String scopeName, TagsResource privateLinkScopeTags, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (privateLinkScopeTags == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateLinkScopeTags is required and cannot be null.")); + } else { + privateLinkScopeTags.validate(); + } + final String apiVersion = "2022-04-02-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + scopeName, + privateLinkScopeTags, + accept, + context); + } + + /** + * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateLinkScopeTags Updated tag information to set into the PrivateLinkScope instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String scopeName, TagsResource privateLinkScopeTags) { + return updateTagsWithResponseAsync(resourceGroupName, scopeName, privateLinkScopeTags) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateLinkScopeTags Updated tag information to set into the PrivateLinkScope instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KubernetesConfigurationPrivateLinkScopeInner updateTags( + String resourceGroupName, String scopeName, TagsResource privateLinkScopeTags) { + return updateTagsAsync(resourceGroupName, scopeName, privateLinkScopeTags).block(); + } + + /** + * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateLinkScopeTags Updated tag information to set into the PrivateLinkScope instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String scopeName, TagsResource privateLinkScopeTags, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, scopeName, privateLinkScopeTags, context).block(); + } + + /** + * Returns a Azure Arc PrivateLinkScope's validation details. + * + * @param location The location of the target resource. + * @param privateLinkScopeId The id (Guid) of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getValidationDetailsWithResponseAsync( + String location, String privateLinkScopeId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (privateLinkScopeId == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateLinkScopeId is required and cannot be null.")); + } + final String apiVersion = "2022-04-02-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getValidationDetails( + this.client.getEndpoint(), + location, + apiVersion, + this.client.getSubscriptionId(), + privateLinkScopeId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns a Azure Arc PrivateLinkScope's validation details. + * + * @param location The location of the target resource. + * @param privateLinkScopeId The id (Guid) of the Azure Arc PrivateLinkScope resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getValidationDetailsWithResponseAsync( + String location, String privateLinkScopeId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (privateLinkScopeId == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateLinkScopeId is required and cannot be null.")); + } + final String apiVersion = "2022-04-02-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getValidationDetails( + this.client.getEndpoint(), + location, + apiVersion, + this.client.getSubscriptionId(), + privateLinkScopeId, + accept, + context); + } + + /** + * Returns a Azure Arc PrivateLinkScope's validation details. + * + * @param location The location of the target resource. + * @param privateLinkScopeId The id (Guid) of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getValidationDetailsAsync( + String location, String privateLinkScopeId) { + return getValidationDetailsWithResponseAsync(location, privateLinkScopeId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns a Azure Arc PrivateLinkScope's validation details. + * + * @param location The location of the target resource. + * @param privateLinkScopeId The id (Guid) of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkScopeValidationDetailsInner getValidationDetails(String location, String privateLinkScopeId) { + return getValidationDetailsAsync(location, privateLinkScopeId).block(); + } + + /** + * Returns a Azure Arc PrivateLinkScope's validation details. + * + * @param location The location of the target resource. + * @param privateLinkScopeId The id (Guid) of the Azure Arc PrivateLinkScope resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getValidationDetailsWithResponse( + String location, String privateLinkScopeId, Context context) { + return getValidationDetailsWithResponseAsync(location, privateLinkScopeId, context).block(); + } + + /** + * Returns a Azure Arc PrivateLinkScope's validation details for a given machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the target machine to get the private link scope validation details for. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getValidationDetailsForMachineWithResponseAsync( + String resourceGroupName, String machineName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (machineName == null) { + return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null.")); + } + final String apiVersion = "2022-04-02-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getValidationDetailsForMachine( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + machineName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns a Azure Arc PrivateLinkScope's validation details for a given machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the target machine to get the private link scope validation details for. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getValidationDetailsForMachineWithResponseAsync( + String resourceGroupName, String machineName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (machineName == null) { + return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null.")); + } + final String apiVersion = "2022-04-02-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getValidationDetailsForMachine( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + machineName, + accept, + context); + } + + /** + * Returns a Azure Arc PrivateLinkScope's validation details for a given machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the target machine to get the private link scope validation details for. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getValidationDetailsForMachineAsync( + String resourceGroupName, String machineName) { + return getValidationDetailsForMachineWithResponseAsync(resourceGroupName, machineName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns a Azure Arc PrivateLinkScope's validation details for a given machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the target machine to get the private link scope validation details for. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkScopeValidationDetailsInner getValidationDetailsForMachine( + String resourceGroupName, String machineName) { + return getValidationDetailsForMachineAsync(resourceGroupName, machineName).block(); + } + + /** + * Returns a Azure Arc PrivateLinkScope's validation details for a given machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the target machine to get the private link scope validation details for. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getValidationDetailsForMachineWithResponse( + String resourceGroupName, String machineName, Context context) { + return getValidationDetailsForMachineWithResponseAsync(resourceGroupName, machineName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the list of Azure Arc PrivateLinkScope resources along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the list of Azure Arc PrivateLinkScope resources along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the list of Azure Arc PrivateLinkScope resources along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the list of Azure Arc PrivateLinkScope resources along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/PrivateLinkScopesImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/PrivateLinkScopesImpl.java new file mode 100644 index 0000000000000..0f2ab858b7e75 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/PrivateLinkScopesImpl.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.PrivateLinkScopesClient; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.KubernetesConfigurationPrivateLinkScopeInner; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.PrivateLinkScopeValidationDetailsInner; +import com.azure.resourcemanager.kubernetesconfiguration.models.KubernetesConfigurationPrivateLinkScope; +import com.azure.resourcemanager.kubernetesconfiguration.models.PrivateLinkScopeValidationDetails; +import com.azure.resourcemanager.kubernetesconfiguration.models.PrivateLinkScopes; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PrivateLinkScopesImpl implements PrivateLinkScopes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkScopesImpl.class); + + private final PrivateLinkScopesClient innerClient; + + private final com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager; + + public PrivateLinkScopesImpl( + PrivateLinkScopesClient innerClient, + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new KubernetesConfigurationPrivateLinkScopeImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new KubernetesConfigurationPrivateLinkScopeImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new KubernetesConfigurationPrivateLinkScopeImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup( + String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new KubernetesConfigurationPrivateLinkScopeImpl(inner1, this.manager())); + } + + public void deleteByResourceGroup(String resourceGroupName, String scopeName) { + this.serviceClient().delete(resourceGroupName, scopeName); + } + + public void delete(String resourceGroupName, String scopeName, Context context) { + this.serviceClient().delete(resourceGroupName, scopeName, context); + } + + public KubernetesConfigurationPrivateLinkScope getByResourceGroup(String resourceGroupName, String scopeName) { + KubernetesConfigurationPrivateLinkScopeInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, scopeName); + if (inner != null) { + return new KubernetesConfigurationPrivateLinkScopeImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String scopeName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, scopeName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new KubernetesConfigurationPrivateLinkScopeImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PrivateLinkScopeValidationDetails getValidationDetails(String location, String privateLinkScopeId) { + PrivateLinkScopeValidationDetailsInner inner = + this.serviceClient().getValidationDetails(location, privateLinkScopeId); + if (inner != null) { + return new PrivateLinkScopeValidationDetailsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getValidationDetailsWithResponse( + String location, String privateLinkScopeId, Context context) { + Response inner = + this.serviceClient().getValidationDetailsWithResponse(location, privateLinkScopeId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateLinkScopeValidationDetailsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PrivateLinkScopeValidationDetails getValidationDetailsForMachine( + String resourceGroupName, String machineName) { + PrivateLinkScopeValidationDetailsInner inner = + this.serviceClient().getValidationDetailsForMachine(resourceGroupName, machineName); + if (inner != null) { + return new PrivateLinkScopeValidationDetailsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getValidationDetailsForMachineWithResponse( + String resourceGroupName, String machineName, Context context) { + Response inner = + this.serviceClient().getValidationDetailsForMachineWithResponse(resourceGroupName, machineName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateLinkScopeValidationDetailsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public KubernetesConfigurationPrivateLinkScope getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String scopeName = Utils.getValueFromIdByName(id, "privateLinkScopes"); + if (scopeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateLinkScopes'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, scopeName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String scopeName = Utils.getValueFromIdByName(id, "privateLinkScopes"); + if (scopeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateLinkScopes'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, scopeName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String scopeName = Utils.getValueFromIdByName(id, "privateLinkScopes"); + if (scopeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateLinkScopes'.", id))); + } + this.delete(resourceGroupName, scopeName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String scopeName = Utils.getValueFromIdByName(id, "privateLinkScopes"); + if (scopeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateLinkScopes'.", id))); + } + this.delete(resourceGroupName, scopeName, context); + } + + private PrivateLinkScopesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager() { + return this.serviceManager; + } + + public KubernetesConfigurationPrivateLinkScopeImpl define(String name) { + return new KubernetesConfigurationPrivateLinkScopeImpl(name, this.manager()); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/SourceControlConfigurationClientImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/SourceControlConfigurationClientImpl.java index f6e2a9e116697..9a0eac6b5c98a 100644 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/SourceControlConfigurationClientImpl.java +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/SourceControlConfigurationClientImpl.java @@ -21,10 +21,20 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.ClusterExtensionTypesClient; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.ClusterExtensionTypesOperationsClient; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.ExtensionTypeVersionsClient; import com.azure.resourcemanager.kubernetesconfiguration.fluent.ExtensionsClient; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.FluxConfigOperationStatusClient; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.FluxConfigurationsClient; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.LocationExtensionTypesClient; import com.azure.resourcemanager.kubernetesconfiguration.fluent.OperationStatusClient; import com.azure.resourcemanager.kubernetesconfiguration.fluent.OperationsClient; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.PrivateLinkScopesClient; import com.azure.resourcemanager.kubernetesconfiguration.fluent.SourceControlConfigurationClient; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.SourceControlConfigurationsClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -64,18 +74,6 @@ public String getEndpoint() { return this.endpoint; } - /** Api Version. */ - private final String apiVersion; - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - public String getApiVersion() { - return this.apiVersion; - } - /** The HTTP pipeline to send requests through. */ private final HttpPipeline httpPipeline; @@ -112,6 +110,54 @@ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } + /** The ClusterExtensionTypesClient object to access its operations. */ + private final ClusterExtensionTypesClient clusterExtensionTypes; + + /** + * Gets the ClusterExtensionTypesClient object to access its operations. + * + * @return the ClusterExtensionTypesClient object. + */ + public ClusterExtensionTypesClient getClusterExtensionTypes() { + return this.clusterExtensionTypes; + } + + /** The ClusterExtensionTypesOperationsClient object to access its operations. */ + private final ClusterExtensionTypesOperationsClient clusterExtensionTypesOperations; + + /** + * Gets the ClusterExtensionTypesOperationsClient object to access its operations. + * + * @return the ClusterExtensionTypesOperationsClient object. + */ + public ClusterExtensionTypesOperationsClient getClusterExtensionTypesOperations() { + return this.clusterExtensionTypesOperations; + } + + /** The ExtensionTypeVersionsClient object to access its operations. */ + private final ExtensionTypeVersionsClient extensionTypeVersions; + + /** + * Gets the ExtensionTypeVersionsClient object to access its operations. + * + * @return the ExtensionTypeVersionsClient object. + */ + public ExtensionTypeVersionsClient getExtensionTypeVersions() { + return this.extensionTypeVersions; + } + + /** The LocationExtensionTypesClient object to access its operations. */ + private final LocationExtensionTypesClient locationExtensionTypes; + + /** + * Gets the LocationExtensionTypesClient object to access its operations. + * + * @return the LocationExtensionTypesClient object. + */ + public LocationExtensionTypesClient getLocationExtensionTypes() { + return this.locationExtensionTypes; + } + /** The ExtensionsClient object to access its operations. */ private final ExtensionsClient extensions; @@ -136,6 +182,42 @@ public OperationStatusClient getOperationStatus() { return this.operationStatus; } + /** The FluxConfigurationsClient object to access its operations. */ + private final FluxConfigurationsClient fluxConfigurations; + + /** + * Gets the FluxConfigurationsClient object to access its operations. + * + * @return the FluxConfigurationsClient object. + */ + public FluxConfigurationsClient getFluxConfigurations() { + return this.fluxConfigurations; + } + + /** The FluxConfigOperationStatusClient object to access its operations. */ + private final FluxConfigOperationStatusClient fluxConfigOperationStatus; + + /** + * Gets the FluxConfigOperationStatusClient object to access its operations. + * + * @return the FluxConfigOperationStatusClient object. + */ + public FluxConfigOperationStatusClient getFluxConfigOperationStatus() { + return this.fluxConfigOperationStatus; + } + + /** The SourceControlConfigurationsClient object to access its operations. */ + private final SourceControlConfigurationsClient sourceControlConfigurations; + + /** + * Gets the SourceControlConfigurationsClient object to access its operations. + * + * @return the SourceControlConfigurationsClient object. + */ + public SourceControlConfigurationsClient getSourceControlConfigurations() { + return this.sourceControlConfigurations; + } + /** The OperationsClient object to access its operations. */ private final OperationsClient operations; @@ -148,6 +230,42 @@ public OperationsClient getOperations() { return this.operations; } + /** The PrivateLinkScopesClient object to access its operations. */ + private final PrivateLinkScopesClient privateLinkScopes; + + /** + * Gets the PrivateLinkScopesClient object to access its operations. + * + * @return the PrivateLinkScopesClient object. + */ + public PrivateLinkScopesClient getPrivateLinkScopes() { + return this.privateLinkScopes; + } + + /** The PrivateLinkResourcesClient object to access its operations. */ + private final PrivateLinkResourcesClient privateLinkResources; + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + public PrivateLinkResourcesClient getPrivateLinkResources() { + return this.privateLinkResources; + } + + /** The PrivateEndpointConnectionsClient object to access its operations. */ + private final PrivateEndpointConnectionsClient privateEndpointConnections; + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { + return this.privateEndpointConnections; + } + /** * Initializes an instance of SourceControlConfigurationClient client. * @@ -170,10 +288,19 @@ public OperationsClient getOperations() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-09-01"; + this.clusterExtensionTypes = new ClusterExtensionTypesClientImpl(this); + this.clusterExtensionTypesOperations = new ClusterExtensionTypesOperationsClientImpl(this); + this.extensionTypeVersions = new ExtensionTypeVersionsClientImpl(this); + this.locationExtensionTypes = new LocationExtensionTypesClientImpl(this); this.extensions = new ExtensionsClientImpl(this); this.operationStatus = new OperationStatusClientImpl(this); + this.fluxConfigurations = new FluxConfigurationsClientImpl(this); + this.fluxConfigOperationStatus = new FluxConfigOperationStatusClientImpl(this); + this.sourceControlConfigurations = new SourceControlConfigurationsClientImpl(this); this.operations = new OperationsClientImpl(this); + this.privateLinkScopes = new PrivateLinkScopesClientImpl(this); + this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); } /** diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/SourceControlConfigurationImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/SourceControlConfigurationImpl.java new file mode 100644 index 0000000000000..ac0dec7a30d91 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/SourceControlConfigurationImpl.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.SourceControlConfigurationInner; +import com.azure.resourcemanager.kubernetesconfiguration.models.ComplianceStatus; +import com.azure.resourcemanager.kubernetesconfiguration.models.HelmOperatorProperties; +import com.azure.resourcemanager.kubernetesconfiguration.models.OperatorScopeType; +import com.azure.resourcemanager.kubernetesconfiguration.models.OperatorType; +import com.azure.resourcemanager.kubernetesconfiguration.models.ProvisioningStateType; +import com.azure.resourcemanager.kubernetesconfiguration.models.SourceControlConfiguration; +import java.util.Collections; +import java.util.Map; + +public final class SourceControlConfigurationImpl implements SourceControlConfiguration { + private SourceControlConfigurationInner innerObject; + + private final com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager; + + SourceControlConfigurationImpl( + SourceControlConfigurationInner innerObject, + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String repositoryUrl() { + return this.innerModel().repositoryUrl(); + } + + public String operatorNamespace() { + return this.innerModel().operatorNamespace(); + } + + public String operatorInstanceName() { + return this.innerModel().operatorInstanceName(); + } + + public OperatorType operatorType() { + return this.innerModel().operatorType(); + } + + public String operatorParams() { + return this.innerModel().operatorParams(); + } + + public Map configurationProtectedSettings() { + Map inner = this.innerModel().configurationProtectedSettings(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public OperatorScopeType operatorScope() { + return this.innerModel().operatorScope(); + } + + public String repositoryPublicKey() { + return this.innerModel().repositoryPublicKey(); + } + + public String sshKnownHostsContents() { + return this.innerModel().sshKnownHostsContents(); + } + + public Boolean enableHelmOperator() { + return this.innerModel().enableHelmOperator(); + } + + public HelmOperatorProperties helmOperatorProperties() { + return this.innerModel().helmOperatorProperties(); + } + + public ProvisioningStateType provisioningState() { + return this.innerModel().provisioningState(); + } + + public ComplianceStatus complianceStatus() { + return this.innerModel().complianceStatus(); + } + + public SourceControlConfigurationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/SourceControlConfigurationsClientImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/SourceControlConfigurationsClientImpl.java new file mode 100644 index 0000000000000..ede36b60a5b19 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/SourceControlConfigurationsClientImpl.java @@ -0,0 +1,1377 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.SourceControlConfigurationsClient; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.SourceControlConfigurationInner; +import com.azure.resourcemanager.kubernetesconfiguration.models.SourceControlConfigurationList; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SourceControlConfigurationsClient. */ +public final class SourceControlConfigurationsClientImpl implements SourceControlConfigurationsClient { + private final ClientLogger logger = new ClientLogger(SourceControlConfigurationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SourceControlConfigurationsService service; + + /** The service client containing this operation class. */ + private final SourceControlConfigurationClientImpl client; + + /** + * Initializes an instance of SourceControlConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SourceControlConfigurationsClientImpl(SourceControlConfigurationClientImpl client) { + this.service = + RestProxy + .create( + SourceControlConfigurationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SourceControlConfigurationClientSourceControlConfigurations to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SourceControlConfigu") + private interface SourceControlConfigurationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}" + + "/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration" + + "/sourceControlConfigurations/{sourceControlConfigurationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterRp") String clusterRp, + @PathParam("clusterResourceName") String clusterResourceName, + @PathParam("clusterName") String clusterName, + @PathParam("sourceControlConfigurationName") String sourceControlConfigurationName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}" + + "/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration" + + "/sourceControlConfigurations/{sourceControlConfigurationName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterRp") String clusterRp, + @PathParam("clusterResourceName") String clusterResourceName, + @PathParam("clusterName") String clusterName, + @PathParam("sourceControlConfigurationName") String sourceControlConfigurationName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SourceControlConfigurationInner sourceControlConfiguration, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}" + + "/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration" + + "/sourceControlConfigurations/{sourceControlConfigurationName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterRp") String clusterRp, + @PathParam("clusterResourceName") String clusterResourceName, + @PathParam("clusterName") String clusterName, + @PathParam("sourceControlConfigurationName") String sourceControlConfigurationName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}" + + "/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration" + + "/sourceControlConfigurations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterRp") String clusterRp, + @PathParam("clusterResourceName") String clusterResourceName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets details of the Source Control Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the Source Control Configuration along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (sourceControlConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter sourceControlConfigurationName is required and cannot be null.")); + } + final String apiVersion = "2022-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + sourceControlConfigurationName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets details of the Source Control Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the Source Control Configuration along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (sourceControlConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter sourceControlConfigurationName is required and cannot be null.")); + } + final String apiVersion = "2022-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + sourceControlConfigurationName, + apiVersion, + accept, + context); + } + + /** + * Gets details of the Source Control Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the Source Control Configuration on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName) { + return getWithResponseAsync( + resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets details of the Source Control Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the Source Control Configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SourceControlConfigurationInner get( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName) { + return getAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName) + .block(); + } + + /** + * Gets details of the Source Control Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the Source Control Configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName, + Context context) { + return getWithResponseAsync( + resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName, context) + .block(); + } + + /** + * Create a new Kubernetes Source Control Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @param sourceControlConfiguration Properties necessary to Create KubernetesConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SourceControl Configuration object returned in Get & Put response along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName, + SourceControlConfigurationInner sourceControlConfiguration) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (sourceControlConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter sourceControlConfigurationName is required and cannot be null.")); + } + if (sourceControlConfiguration == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter sourceControlConfiguration is required and cannot be null.")); + } else { + sourceControlConfiguration.validate(); + } + final String apiVersion = "2022-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + sourceControlConfigurationName, + apiVersion, + sourceControlConfiguration, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a new Kubernetes Source Control Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @param sourceControlConfiguration Properties necessary to Create KubernetesConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SourceControl Configuration object returned in Get & Put response along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName, + SourceControlConfigurationInner sourceControlConfiguration, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (sourceControlConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter sourceControlConfigurationName is required and cannot be null.")); + } + if (sourceControlConfiguration == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter sourceControlConfiguration is required and cannot be null.")); + } else { + sourceControlConfiguration.validate(); + } + final String apiVersion = "2022-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + sourceControlConfigurationName, + apiVersion, + sourceControlConfiguration, + accept, + context); + } + + /** + * Create a new Kubernetes Source Control Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @param sourceControlConfiguration Properties necessary to Create KubernetesConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SourceControl Configuration object returned in Get & Put response on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName, + SourceControlConfigurationInner sourceControlConfiguration) { + return createOrUpdateWithResponseAsync( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + sourceControlConfigurationName, + sourceControlConfiguration) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create a new Kubernetes Source Control Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @param sourceControlConfiguration Properties necessary to Create KubernetesConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SourceControl Configuration object returned in Get & Put response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SourceControlConfigurationInner createOrUpdate( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName, + SourceControlConfigurationInner sourceControlConfiguration) { + return createOrUpdateAsync( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + sourceControlConfigurationName, + sourceControlConfiguration) + .block(); + } + + /** + * Create a new Kubernetes Source Control Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @param sourceControlConfiguration Properties necessary to Create KubernetesConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SourceControl Configuration object returned in Get & Put response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName, + SourceControlConfigurationInner sourceControlConfiguration, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + sourceControlConfigurationName, + sourceControlConfiguration, + context) + .block(); + } + + /** + * This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from + * the source repo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (sourceControlConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter sourceControlConfigurationName is required and cannot be null.")); + } + final String apiVersion = "2022-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + sourceControlConfigurationName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from + * the source repo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (sourceControlConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter sourceControlConfigurationName is required and cannot be null.")); + } + final String apiVersion = "2022-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + sourceControlConfigurationName, + apiVersion, + accept, + context); + } + + /** + * This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from + * the source repo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName) { + Mono>> mono = + deleteWithResponseAsync( + resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from + * the source repo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + sourceControlConfigurationName, + context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from + * the source repo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName) { + return beginDeleteAsync( + resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName) + .getSyncPoller(); + } + + /** + * This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from + * the source repo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName, + Context context) { + return beginDeleteAsync( + resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName, context) + .getSyncPoller(); + } + + /** + * This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from + * the source repo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName) { + return beginDeleteAsync( + resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from + * the source repo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName, + Context context) { + return beginDeleteAsync( + resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from + * the source repo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName) { + deleteAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName) + .block(); + } + + /** + * This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from + * the source repo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName, + Context context) { + deleteAsync( + resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName, context) + .block(); + } + + /** + * List all Source Control Configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Source Control Configurations along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String apiVersion = "2022-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all Source Control Configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Source Control Configurations along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String apiVersion = "2022-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all Source Control Configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Source Control Configurations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all Source Control Configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Source Control Configurations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List all Source Control Configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Source Control Configurations as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName)); + } + + /** + * List all Source Control Configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Source Control Configurations as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Source Control Configurations along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Source Control Configurations along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/SourceControlConfigurationsImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/SourceControlConfigurationsImpl.java new file mode 100644 index 0000000000000..00620845ade91 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/SourceControlConfigurationsImpl.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.SourceControlConfigurationsClient; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.SourceControlConfigurationInner; +import com.azure.resourcemanager.kubernetesconfiguration.models.SourceControlConfiguration; +import com.azure.resourcemanager.kubernetesconfiguration.models.SourceControlConfigurations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SourceControlConfigurationsImpl implements SourceControlConfigurations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SourceControlConfigurationsImpl.class); + + private final SourceControlConfigurationsClient innerClient; + + private final com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager; + + public SourceControlConfigurationsImpl( + SourceControlConfigurationsClient innerClient, + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public SourceControlConfiguration get( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName) { + SourceControlConfigurationInner inner = + this + .serviceClient() + .get(resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName); + if (inner != null) { + return new SourceControlConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + sourceControlConfigurationName, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SourceControlConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SourceControlConfiguration createOrUpdate( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName, + SourceControlConfigurationInner sourceControlConfiguration) { + SourceControlConfigurationInner inner = + this + .serviceClient() + .createOrUpdate( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + sourceControlConfigurationName, + sourceControlConfiguration); + if (inner != null) { + return new SourceControlConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName, + SourceControlConfigurationInner sourceControlConfiguration, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateWithResponse( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + sourceControlConfigurationName, + sourceControlConfiguration, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SourceControlConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName) { + this + .serviceClient() + .delete(resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName); + } + + public void delete( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName, + Context context) { + this + .serviceClient() + .delete( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + sourceControlConfigurationName, + context); + } + + public PagedIterable list( + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, clusterRp, clusterResourceName, clusterName); + return Utils.mapPage(inner, inner1 -> new SourceControlConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, clusterRp, clusterResourceName, clusterName, context); + return Utils.mapPage(inner, inner1 -> new SourceControlConfigurationImpl(inner1, this.manager())); + } + + private SourceControlConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/AksIdentityType.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/AksIdentityType.java new file mode 100644 index 0000000000000..7d320a479ad90 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/AksIdentityType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for AksIdentityType. */ +public enum AksIdentityType { + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"), + + /** Enum value UserAssigned. */ + USER_ASSIGNED("UserAssigned"); + + /** The actual serialized value for a AksIdentityType instance. */ + private final String value; + + AksIdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AksIdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed AksIdentityType object, or null if unable to parse. + */ + @JsonCreator + public static AksIdentityType fromString(String value) { + AksIdentityType[] items = AksIdentityType.values(); + for (AksIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/BucketDefinition.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/BucketDefinition.java new file mode 100644 index 0000000000000..f6126b0dabd9e --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/BucketDefinition.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters to reconcile to the GitRepository source kind type. */ +@Fluent +public final class BucketDefinition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BucketDefinition.class); + + /* + * The URL to sync for the flux configuration S3 bucket. + */ + @JsonProperty(value = "url") + private String url; + + /* + * The bucket name to sync from the url endpoint for the flux + * configuration. + */ + @JsonProperty(value = "bucketName") + private String bucketName; + + /* + * Specify whether to use insecure communication when puling data from the + * S3 bucket. + */ + @JsonProperty(value = "insecure") + private Boolean insecure; + + /* + * The maximum time to attempt to reconcile the cluster git repository + * source with the remote. + */ + @JsonProperty(value = "timeoutInSeconds") + private Long timeoutInSeconds; + + /* + * The interval at which to re-reconcile the cluster git repository source + * with the remote. + */ + @JsonProperty(value = "syncIntervalInSeconds") + private Long syncIntervalInSeconds; + + /* + * Plaintext access key used to securely access the S3 bucket + */ + @JsonProperty(value = "accessKey") + private String accessKey; + + /* + * Name of a local secret on the Kubernetes cluster to use as the + * authentication secret rather than the managed or user-provided + * configuration secrets. + */ + @JsonProperty(value = "localAuthRef") + private String localAuthRef; + + /** + * Get the url property: The URL to sync for the flux configuration S3 bucket. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: The URL to sync for the flux configuration S3 bucket. + * + * @param url the url value to set. + * @return the BucketDefinition object itself. + */ + public BucketDefinition withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the bucketName property: The bucket name to sync from the url endpoint for the flux configuration. + * + * @return the bucketName value. + */ + public String bucketName() { + return this.bucketName; + } + + /** + * Set the bucketName property: The bucket name to sync from the url endpoint for the flux configuration. + * + * @param bucketName the bucketName value to set. + * @return the BucketDefinition object itself. + */ + public BucketDefinition withBucketName(String bucketName) { + this.bucketName = bucketName; + return this; + } + + /** + * Get the insecure property: Specify whether to use insecure communication when puling data from the S3 bucket. + * + * @return the insecure value. + */ + public Boolean insecure() { + return this.insecure; + } + + /** + * Set the insecure property: Specify whether to use insecure communication when puling data from the S3 bucket. + * + * @param insecure the insecure value to set. + * @return the BucketDefinition object itself. + */ + public BucketDefinition withInsecure(Boolean insecure) { + this.insecure = insecure; + return this; + } + + /** + * Get the timeoutInSeconds property: The maximum time to attempt to reconcile the cluster git repository source + * with the remote. + * + * @return the timeoutInSeconds value. + */ + public Long timeoutInSeconds() { + return this.timeoutInSeconds; + } + + /** + * Set the timeoutInSeconds property: The maximum time to attempt to reconcile the cluster git repository source + * with the remote. + * + * @param timeoutInSeconds the timeoutInSeconds value to set. + * @return the BucketDefinition object itself. + */ + public BucketDefinition withTimeoutInSeconds(Long timeoutInSeconds) { + this.timeoutInSeconds = timeoutInSeconds; + return this; + } + + /** + * Get the syncIntervalInSeconds property: The interval at which to re-reconcile the cluster git repository source + * with the remote. + * + * @return the syncIntervalInSeconds value. + */ + public Long syncIntervalInSeconds() { + return this.syncIntervalInSeconds; + } + + /** + * Set the syncIntervalInSeconds property: The interval at which to re-reconcile the cluster git repository source + * with the remote. + * + * @param syncIntervalInSeconds the syncIntervalInSeconds value to set. + * @return the BucketDefinition object itself. + */ + public BucketDefinition withSyncIntervalInSeconds(Long syncIntervalInSeconds) { + this.syncIntervalInSeconds = syncIntervalInSeconds; + return this; + } + + /** + * Get the accessKey property: Plaintext access key used to securely access the S3 bucket. + * + * @return the accessKey value. + */ + public String accessKey() { + return this.accessKey; + } + + /** + * Set the accessKey property: Plaintext access key used to securely access the S3 bucket. + * + * @param accessKey the accessKey value to set. + * @return the BucketDefinition object itself. + */ + public BucketDefinition withAccessKey(String accessKey) { + this.accessKey = accessKey; + return this; + } + + /** + * Get the localAuthRef property: Name of a local secret on the Kubernetes cluster to use as the authentication + * secret rather than the managed or user-provided configuration secrets. + * + * @return the localAuthRef value. + */ + public String localAuthRef() { + return this.localAuthRef; + } + + /** + * Set the localAuthRef property: Name of a local secret on the Kubernetes cluster to use as the authentication + * secret rather than the managed or user-provided configuration secrets. + * + * @param localAuthRef the localAuthRef value to set. + * @return the BucketDefinition object itself. + */ + public BucketDefinition withLocalAuthRef(String localAuthRef) { + this.localAuthRef = localAuthRef; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/BucketPatchDefinition.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/BucketPatchDefinition.java new file mode 100644 index 0000000000000..a727a74b2c9ca --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/BucketPatchDefinition.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters to reconcile to the GitRepository source kind type. */ +@Fluent +public final class BucketPatchDefinition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BucketPatchDefinition.class); + + /* + * The URL to sync for the flux configuration S3 bucket. + */ + @JsonProperty(value = "url") + private String url; + + /* + * The bucket name to sync from the url endpoint for the flux + * configuration. + */ + @JsonProperty(value = "bucketName") + private String bucketName; + + /* + * Specify whether to use insecure communication when puling data from the + * S3 bucket. + */ + @JsonProperty(value = "insecure") + private Boolean insecure; + + /* + * The maximum time to attempt to reconcile the cluster git repository + * source with the remote. + */ + @JsonProperty(value = "timeoutInSeconds") + private Long timeoutInSeconds; + + /* + * The interval at which to re-reconcile the cluster git repository source + * with the remote. + */ + @JsonProperty(value = "syncIntervalInSeconds") + private Long syncIntervalInSeconds; + + /* + * Plaintext access key used to securely access the S3 bucket + */ + @JsonProperty(value = "accessKey") + private String accessKey; + + /* + * Name of a local secret on the Kubernetes cluster to use as the + * authentication secret rather than the managed or user-provided + * configuration secrets. + */ + @JsonProperty(value = "localAuthRef") + private String localAuthRef; + + /** + * Get the url property: The URL to sync for the flux configuration S3 bucket. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: The URL to sync for the flux configuration S3 bucket. + * + * @param url the url value to set. + * @return the BucketPatchDefinition object itself. + */ + public BucketPatchDefinition withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the bucketName property: The bucket name to sync from the url endpoint for the flux configuration. + * + * @return the bucketName value. + */ + public String bucketName() { + return this.bucketName; + } + + /** + * Set the bucketName property: The bucket name to sync from the url endpoint for the flux configuration. + * + * @param bucketName the bucketName value to set. + * @return the BucketPatchDefinition object itself. + */ + public BucketPatchDefinition withBucketName(String bucketName) { + this.bucketName = bucketName; + return this; + } + + /** + * Get the insecure property: Specify whether to use insecure communication when puling data from the S3 bucket. + * + * @return the insecure value. + */ + public Boolean insecure() { + return this.insecure; + } + + /** + * Set the insecure property: Specify whether to use insecure communication when puling data from the S3 bucket. + * + * @param insecure the insecure value to set. + * @return the BucketPatchDefinition object itself. + */ + public BucketPatchDefinition withInsecure(Boolean insecure) { + this.insecure = insecure; + return this; + } + + /** + * Get the timeoutInSeconds property: The maximum time to attempt to reconcile the cluster git repository source + * with the remote. + * + * @return the timeoutInSeconds value. + */ + public Long timeoutInSeconds() { + return this.timeoutInSeconds; + } + + /** + * Set the timeoutInSeconds property: The maximum time to attempt to reconcile the cluster git repository source + * with the remote. + * + * @param timeoutInSeconds the timeoutInSeconds value to set. + * @return the BucketPatchDefinition object itself. + */ + public BucketPatchDefinition withTimeoutInSeconds(Long timeoutInSeconds) { + this.timeoutInSeconds = timeoutInSeconds; + return this; + } + + /** + * Get the syncIntervalInSeconds property: The interval at which to re-reconcile the cluster git repository source + * with the remote. + * + * @return the syncIntervalInSeconds value. + */ + public Long syncIntervalInSeconds() { + return this.syncIntervalInSeconds; + } + + /** + * Set the syncIntervalInSeconds property: The interval at which to re-reconcile the cluster git repository source + * with the remote. + * + * @param syncIntervalInSeconds the syncIntervalInSeconds value to set. + * @return the BucketPatchDefinition object itself. + */ + public BucketPatchDefinition withSyncIntervalInSeconds(Long syncIntervalInSeconds) { + this.syncIntervalInSeconds = syncIntervalInSeconds; + return this; + } + + /** + * Get the accessKey property: Plaintext access key used to securely access the S3 bucket. + * + * @return the accessKey value. + */ + public String accessKey() { + return this.accessKey; + } + + /** + * Set the accessKey property: Plaintext access key used to securely access the S3 bucket. + * + * @param accessKey the accessKey value to set. + * @return the BucketPatchDefinition object itself. + */ + public BucketPatchDefinition withAccessKey(String accessKey) { + this.accessKey = accessKey; + return this; + } + + /** + * Get the localAuthRef property: Name of a local secret on the Kubernetes cluster to use as the authentication + * secret rather than the managed or user-provided configuration secrets. + * + * @return the localAuthRef value. + */ + public String localAuthRef() { + return this.localAuthRef; + } + + /** + * Set the localAuthRef property: Name of a local secret on the Kubernetes cluster to use as the authentication + * secret rather than the managed or user-provided configuration secrets. + * + * @param localAuthRef the localAuthRef value to set. + * @return the BucketPatchDefinition object itself. + */ + public BucketPatchDefinition withLocalAuthRef(String localAuthRef) { + this.localAuthRef = localAuthRef; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ClusterExtensionTypes.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ClusterExtensionTypes.java new file mode 100644 index 0000000000000..6e784424b53d7 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ClusterExtensionTypes.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ClusterExtensionTypes. */ +public interface ClusterExtensionTypes { + /** + * Get Extension Type details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or + * Microsoft.Kubernetes (for OnPrem K8S clusters). + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or + * connectedClusters (for OnPrem K8S clusters). + * @param clusterName The name of the kubernetes cluster. + * @param extensionTypeName Extension type name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return extension Type details. + */ + ExtensionType get( + String resourceGroupName, + ExtensionsClusterRp clusterRp, + ExtensionsClusterResourceName clusterResourceName, + String clusterName, + String extensionTypeName); + + /** + * Get Extension Type details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or + * Microsoft.Kubernetes (for OnPrem K8S clusters). + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or + * connectedClusters (for OnPrem K8S clusters). + * @param clusterName The name of the kubernetes cluster. + * @param extensionTypeName Extension type name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return extension Type details along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + ExtensionsClusterRp clusterRp, + ExtensionsClusterResourceName clusterResourceName, + String clusterName, + String extensionTypeName, + Context context); +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ClusterExtensionTypesOperations.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ClusterExtensionTypesOperations.java new file mode 100644 index 0000000000000..c75cb9304ccc1 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ClusterExtensionTypesOperations.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of ClusterExtensionTypesOperations. */ +public interface ClusterExtensionTypesOperations { + /** + * Get Extension Types. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or + * Microsoft.Kubernetes (for OnPrem K8S clusters). + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or + * connectedClusters (for OnPrem K8S clusters). + * @param clusterName The name of the kubernetes cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return extension Types as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, + ExtensionsClusterRp clusterRp, + ExtensionsClusterResourceName clusterResourceName, + String clusterName); + + /** + * Get Extension Types. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or + * Microsoft.Kubernetes (for OnPrem K8S clusters). + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or + * connectedClusters (for OnPrem K8S clusters). + * @param clusterName The name of the kubernetes cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return extension Types as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, + ExtensionsClusterRp clusterRp, + ExtensionsClusterResourceName clusterResourceName, + String clusterName, + Context context); +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ClusterScopeSettings.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ClusterScopeSettings.java new file mode 100644 index 0000000000000..61f0acad72c6f --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ClusterScopeSettings.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.ClusterScopeSettingsProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Extension scope settings. */ +@Fluent +public final class ClusterScopeSettings extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterScopeSettings.class); + + /* + * Extension scope settings + */ + @JsonProperty(value = "properties") + private ClusterScopeSettingsProperties innerProperties; + + /** + * Get the innerProperties property: Extension scope settings. + * + * @return the innerProperties value. + */ + private ClusterScopeSettingsProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the allowMultipleInstances property: Describes if multiple instances of the extension are allowed. + * + * @return the allowMultipleInstances value. + */ + public Boolean allowMultipleInstances() { + return this.innerProperties() == null ? null : this.innerProperties().allowMultipleInstances(); + } + + /** + * Set the allowMultipleInstances property: Describes if multiple instances of the extension are allowed. + * + * @param allowMultipleInstances the allowMultipleInstances value to set. + * @return the ClusterScopeSettings object itself. + */ + public ClusterScopeSettings withAllowMultipleInstances(Boolean allowMultipleInstances) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterScopeSettingsProperties(); + } + this.innerProperties().withAllowMultipleInstances(allowMultipleInstances); + return this; + } + + /** + * Get the defaultReleaseNamespace property: Default extension release namespace. + * + * @return the defaultReleaseNamespace value. + */ + public String defaultReleaseNamespace() { + return this.innerProperties() == null ? null : this.innerProperties().defaultReleaseNamespace(); + } + + /** + * Set the defaultReleaseNamespace property: Default extension release namespace. + * + * @param defaultReleaseNamespace the defaultReleaseNamespace value to set. + * @return the ClusterScopeSettings object itself. + */ + public ClusterScopeSettings withDefaultReleaseNamespace(String defaultReleaseNamespace) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterScopeSettingsProperties(); + } + this.innerProperties().withDefaultReleaseNamespace(defaultReleaseNamespace); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ClusterTypes.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ClusterTypes.java new file mode 100644 index 0000000000000..78999966cb671 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ClusterTypes.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ClusterTypes. */ +public enum ClusterTypes { + /** Enum value connectedClusters. */ + CONNECTED_CLUSTERS("connectedClusters"), + + /** Enum value managedClusters. */ + MANAGED_CLUSTERS("managedClusters"); + + /** The actual serialized value for a ClusterTypes instance. */ + private final String value; + + ClusterTypes(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ClusterTypes instance. + * + * @param value the serialized value to parse. + * @return the parsed ClusterTypes object, or null if unable to parse. + */ + @JsonCreator + public static ClusterTypes fromString(String value) { + ClusterTypes[] items = ClusterTypes.values(); + for (ClusterTypes item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ComplianceStateType.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ComplianceStateType.java new file mode 100644 index 0000000000000..fe79e77156cd3 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ComplianceStateType.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ComplianceStateType. */ +public final class ComplianceStateType extends ExpandableStringEnum { + /** Static value Pending for ComplianceStateType. */ + public static final ComplianceStateType PENDING = fromString("Pending"); + + /** Static value Compliant for ComplianceStateType. */ + public static final ComplianceStateType COMPLIANT = fromString("Compliant"); + + /** Static value Noncompliant for ComplianceStateType. */ + public static final ComplianceStateType NONCOMPLIANT = fromString("Noncompliant"); + + /** Static value Installed for ComplianceStateType. */ + public static final ComplianceStateType INSTALLED = fromString("Installed"); + + /** Static value Failed for ComplianceStateType. */ + public static final ComplianceStateType FAILED = fromString("Failed"); + + /** + * Creates or finds a ComplianceStateType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ComplianceStateType. + */ + @JsonCreator + public static ComplianceStateType fromString(String name) { + return fromString(name, ComplianceStateType.class); + } + + /** @return known ComplianceStateType values. */ + public static Collection values() { + return values(ComplianceStateType.class); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ComplianceStatus.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ComplianceStatus.java new file mode 100644 index 0000000000000..c7baffee43f2a --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ComplianceStatus.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Compliance Status details. */ +@Fluent +public final class ComplianceStatus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ComplianceStatus.class); + + /* + * The compliance state of the configuration. + */ + @JsonProperty(value = "complianceState", access = JsonProperty.Access.WRITE_ONLY) + private ComplianceStateType complianceState; + + /* + * Datetime the configuration was last applied. + */ + @JsonProperty(value = "lastConfigApplied") + private OffsetDateTime lastConfigApplied; + + /* + * Message from when the configuration was applied. + */ + @JsonProperty(value = "message") + private String message; + + /* + * Level of the message. + */ + @JsonProperty(value = "messageLevel") + private MessageLevelType messageLevel; + + /** + * Get the complianceState property: The compliance state of the configuration. + * + * @return the complianceState value. + */ + public ComplianceStateType complianceState() { + return this.complianceState; + } + + /** + * Get the lastConfigApplied property: Datetime the configuration was last applied. + * + * @return the lastConfigApplied value. + */ + public OffsetDateTime lastConfigApplied() { + return this.lastConfigApplied; + } + + /** + * Set the lastConfigApplied property: Datetime the configuration was last applied. + * + * @param lastConfigApplied the lastConfigApplied value to set. + * @return the ComplianceStatus object itself. + */ + public ComplianceStatus withLastConfigApplied(OffsetDateTime lastConfigApplied) { + this.lastConfigApplied = lastConfigApplied; + return this; + } + + /** + * Get the message property: Message from when the configuration was applied. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Message from when the configuration was applied. + * + * @param message the message value to set. + * @return the ComplianceStatus object itself. + */ + public ComplianceStatus withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the messageLevel property: Level of the message. + * + * @return the messageLevel value. + */ + public MessageLevelType messageLevel() { + return this.messageLevel; + } + + /** + * Set the messageLevel property: Level of the message. + * + * @param messageLevel the messageLevel value to set. + * @return the ComplianceStatus object itself. + */ + public ComplianceStatus withMessageLevel(MessageLevelType messageLevel) { + this.messageLevel = messageLevel; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ConnectionDetail.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ConnectionDetail.java new file mode 100644 index 0000000000000..f62476f582457 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ConnectionDetail.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ConnectionDetail model. */ +@Immutable +public final class ConnectionDetail { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionDetail.class); + + /* + * Azure resource Id + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The private endpoint connection private ip address + */ + @JsonProperty(value = "privateIpAddress", access = JsonProperty.Access.WRITE_ONLY) + private String privateIpAddress; + + /* + * The private endpoint connection link identifier + */ + @JsonProperty(value = "linkIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String linkIdentifier; + + /* + * The private endpoint connection group id + */ + @JsonProperty(value = "groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /* + * The private endpoint connection member name + */ + @JsonProperty(value = "memberName", access = JsonProperty.Access.WRITE_ONLY) + private String memberName; + + /** + * Get the id property: Azure resource Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the privateIpAddress property: The private endpoint connection private ip address. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.privateIpAddress; + } + + /** + * Get the linkIdentifier property: The private endpoint connection link identifier. + * + * @return the linkIdentifier value. + */ + public String linkIdentifier() { + return this.linkIdentifier; + } + + /** + * Get the groupId property: The private endpoint connection group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the memberName property: The private endpoint connection member name. + * + * @return the memberName value. + */ + public String memberName() { + return this.memberName; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/Extension.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/Extension.java index 5b3263798641d..f007b037fa051 100644 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/Extension.java +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/Extension.java @@ -48,6 +48,13 @@ public interface Extension { */ SystemData systemData(); + /** + * Gets the plan property: The plan information. + * + * @return the plan value. + */ + Plan plan(); + /** * Gets the extensionType property: Type of the Extension, of which this resource is an instance of. It must be one * of the Extension Types registered with Microsoft.KubernetesConfiguration by the Extension publisher. @@ -104,7 +111,7 @@ public interface Extension { Map configurationProtectedSettings(); /** - * Gets the provisioningState property: The provisioning state of the extension resource. + * Gets the provisioningState property: Status of installation of this extension. * * @return the provisioningState value. */ @@ -118,7 +125,7 @@ public interface Extension { List statuses(); /** - * Gets the errorInfo property: The error detail. + * Gets the errorInfo property: Error information from the Agent - e.g. errors during installation. * * @return the errorInfo value. */ diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ExtensionPropertiesAksAssignedIdentity.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ExtensionPropertiesAksAssignedIdentity.java index 9349e2ee152ba..8b4a155afa47b 100644 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ExtensionPropertiesAksAssignedIdentity.java +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ExtensionPropertiesAksAssignedIdentity.java @@ -30,7 +30,7 @@ public class ExtensionPropertiesAksAssignedIdentity { * The identity type. */ @JsonProperty(value = "type") - private ResourceIdentityType type; + private AksIdentityType type; /** * Get the principalId property: The principal ID of resource identity. @@ -55,7 +55,7 @@ public String tenantId() { * * @return the type value. */ - public ResourceIdentityType type() { + public AksIdentityType type() { return this.type; } @@ -65,7 +65,7 @@ public ResourceIdentityType type() { * @param type the type value to set. * @return the ExtensionPropertiesAksAssignedIdentity object itself. */ - public ExtensionPropertiesAksAssignedIdentity withType(ResourceIdentityType type) { + public ExtensionPropertiesAksAssignedIdentity withType(AksIdentityType type) { this.type = type; return this; } diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ExtensionType.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ExtensionType.java new file mode 100644 index 0000000000000..fd0141c9836f4 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ExtensionType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.ExtensionTypeInner; +import java.util.List; + +/** An immutable client-side representation of ExtensionType. */ +public interface ExtensionType { + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the releaseTrains property: Extension release train: preview or stable. + * + * @return the releaseTrains value. + */ + List releaseTrains(); + + /** + * Gets the clusterTypes property: Cluster types. + * + * @return the clusterTypes value. + */ + ClusterTypes clusterTypes(); + + /** + * Gets the supportedScopes property: Extension scopes. + * + * @return the supportedScopes value. + */ + SupportedScopes supportedScopes(); + + /** + * Gets the inner com.azure.resourcemanager.kubernetesconfiguration.fluent.models.ExtensionTypeInner object. + * + * @return the inner object. + */ + ExtensionTypeInner innerModel(); +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ExtensionTypeList.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ExtensionTypeList.java new file mode 100644 index 0000000000000..3aa0a8464bff5 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ExtensionTypeList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.ExtensionTypeInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List Extension Types. */ +@Fluent +public final class ExtensionTypeList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExtensionTypeList.class); + + /* + * The list of Extension Types + */ + @JsonProperty(value = "value") + private List value; + + /* + * The link to fetch the next page of Extension Types + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of Extension Types. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of Extension Types. + * + * @param value the value value to set. + * @return the ExtensionTypeList object itself. + */ + public ExtensionTypeList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to fetch the next page of Extension Types. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to fetch the next page of Extension Types. + * + * @param nextLink the nextLink value to set. + * @return the ExtensionTypeList object itself. + */ + public ExtensionTypeList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ExtensionTypeVersions.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ExtensionTypeVersions.java new file mode 100644 index 0000000000000..f6a39af789e93 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ExtensionTypeVersions.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of ExtensionTypeVersions. */ +public interface ExtensionTypeVersions { + /** + * List available versions for an Extension Type. + * + * @param location extension location. + * @param extensionTypeName Extension type name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list versions for an Extension as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String location, String extensionTypeName); + + /** + * List available versions for an Extension Type. + * + * @param location extension location. + * @param extensionTypeName Extension type name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list versions for an Extension as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String location, String extensionTypeName, Context context); +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ExtensionVersionList.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ExtensionVersionList.java new file mode 100644 index 0000000000000..18bcdb6b7b412 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ExtensionVersionList.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List versions for an Extension. */ +@Fluent +public final class ExtensionVersionList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExtensionVersionList.class); + + /* + * Versions available for this Extension Type + */ + @JsonProperty(value = "versions") + private List versions; + + /* + * The link to fetch the next page of Extension Types + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the versions property: Versions available for this Extension Type. + * + * @return the versions value. + */ + public List versions() { + return this.versions; + } + + /** + * Set the versions property: Versions available for this Extension Type. + * + * @param versions the versions value to set. + * @return the ExtensionVersionList object itself. + */ + public ExtensionVersionList withVersions(List versions) { + this.versions = versions; + return this; + } + + /** + * Get the nextLink property: The link to fetch the next page of Extension Types. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to fetch the next page of Extension Types. + * + * @param nextLink the nextLink value to set. + * @return the ExtensionVersionList object itself. + */ + public ExtensionVersionList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (versions() != null) { + versions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ExtensionVersionListVersionsItem.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ExtensionVersionListVersionsItem.java new file mode 100644 index 0000000000000..45252cb5b5353 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ExtensionVersionListVersionsItem.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ExtensionVersionListVersionsItem model. */ +@Fluent +public final class ExtensionVersionListVersionsItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExtensionVersionListVersionsItem.class); + + /* + * The release train for this Extension Type + */ + @JsonProperty(value = "releaseTrain") + private String releaseTrain; + + /* + * Versions available for this Extension Type and release train + */ + @JsonProperty(value = "versions") + private List versions; + + /** + * Get the releaseTrain property: The release train for this Extension Type. + * + * @return the releaseTrain value. + */ + public String releaseTrain() { + return this.releaseTrain; + } + + /** + * Set the releaseTrain property: The release train for this Extension Type. + * + * @param releaseTrain the releaseTrain value to set. + * @return the ExtensionVersionListVersionsItem object itself. + */ + public ExtensionVersionListVersionsItem withReleaseTrain(String releaseTrain) { + this.releaseTrain = releaseTrain; + return this; + } + + /** + * Get the versions property: Versions available for this Extension Type and release train. + * + * @return the versions value. + */ + public List versions() { + return this.versions; + } + + /** + * Set the versions property: Versions available for this Extension Type and release train. + * + * @param versions the versions value to set. + * @return the ExtensionVersionListVersionsItem object itself. + */ + public ExtensionVersionListVersionsItem withVersions(List versions) { + this.versions = versions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/Extensions.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/Extensions.java index 42c3a6bd48520..47ce43d2d71b0 100644 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/Extensions.java +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/Extensions.java @@ -15,10 +15,10 @@ public interface Extensions { * Create a new Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param extension Properties necessary to Create an Extension. @@ -29,8 +29,8 @@ public interface Extensions { */ Extension create( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, ExtensionInner extension); @@ -39,10 +39,10 @@ Extension create( * Create a new Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param extension Properties necessary to Create an Extension. @@ -54,8 +54,8 @@ Extension create( */ Extension create( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, ExtensionInner extension, @@ -65,10 +65,10 @@ Extension create( * Gets Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -78,8 +78,8 @@ Extension create( */ Extension get( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName); @@ -87,22 +87,22 @@ Extension get( * Gets Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return kubernetes Cluster Extension. + * @return kubernetes Cluster Extension along with {@link Response}. */ Response getWithResponse( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, Context context); @@ -111,10 +111,10 @@ Response getWithResponse( * Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension from the cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param forceDelete Delete the extension resource in Azure - not the normal asynchronous delete. @@ -124,8 +124,8 @@ Response getWithResponse( */ void delete( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, Boolean forceDelete); @@ -134,10 +134,10 @@ void delete( * Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension from the cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -146,8 +146,8 @@ void delete( */ void delete( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName); @@ -155,10 +155,10 @@ void delete( * Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension from the cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param forceDelete Delete the extension resource in Azure - not the normal asynchronous delete. @@ -169,8 +169,8 @@ void delete( */ void delete( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, Boolean forceDelete, @@ -180,10 +180,10 @@ void delete( * Patch an existing Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param patchExtension Properties to Patch in an existing Extension. @@ -194,8 +194,8 @@ void delete( */ Extension update( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, PatchExtension patchExtension); @@ -204,10 +204,10 @@ Extension update( * Patch an existing Kubernetes Cluster Extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param extensionName Name of the Extension. * @param patchExtension Properties to Patch in an existing Extension. @@ -219,8 +219,8 @@ Extension update( */ Extension update( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, String extensionName, PatchExtension patchExtension, @@ -230,41 +230,34 @@ Extension update( * List all Extensions in the cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Extensions. + * @return result of the request to list Extensions as paginated response with {@link PagedIterable}. */ PagedIterable list( - String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, - String clusterName); + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName); /** * List all Extensions in the cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Extensions. + * @return result of the request to list Extensions as paginated response with {@link PagedIterable}. */ PagedIterable list( - String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, - String clusterName, - Context context); + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, Context context); } diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/FluxComplianceState.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/FluxComplianceState.java new file mode 100644 index 0000000000000..5f708cfccf8b0 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/FluxComplianceState.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FluxComplianceState. */ +public final class FluxComplianceState extends ExpandableStringEnum { + /** Static value Compliant for FluxComplianceState. */ + public static final FluxComplianceState COMPLIANT = fromString("Compliant"); + + /** Static value Non-Compliant for FluxComplianceState. */ + public static final FluxComplianceState NON_COMPLIANT = fromString("Non-Compliant"); + + /** Static value Pending for FluxComplianceState. */ + public static final FluxComplianceState PENDING = fromString("Pending"); + + /** Static value Suspended for FluxComplianceState. */ + public static final FluxComplianceState SUSPENDED = fromString("Suspended"); + + /** Static value Unknown for FluxComplianceState. */ + public static final FluxComplianceState UNKNOWN = fromString("Unknown"); + + /** + * Creates or finds a FluxComplianceState from its string representation. + * + * @param name a name to look for. + * @return the corresponding FluxComplianceState. + */ + @JsonCreator + public static FluxComplianceState fromString(String name) { + return fromString(name, FluxComplianceState.class); + } + + /** @return known FluxComplianceState values. */ + public static Collection values() { + return values(FluxComplianceState.class); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/FluxConfigOperationStatus.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/FluxConfigOperationStatus.java new file mode 100644 index 0000000000000..c6797a2b4b4a4 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/FluxConfigOperationStatus.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of FluxConfigOperationStatus. */ +public interface FluxConfigOperationStatus { + /** + * Get Async Operation status. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param operationId operation Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return async Operation status. + */ + OperationStatusResult get( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + String operationId); + + /** + * Get Async Operation status. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param operationId operation Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return async Operation status along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + String operationId, + Context context); +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/FluxConfiguration.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/FluxConfiguration.java new file mode 100644 index 0000000000000..ee5831891d369 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/FluxConfiguration.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.FluxConfigurationInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of FluxConfiguration. */ +public interface FluxConfiguration { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Top level metadata + * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the scope property: Scope at which the operator will be installed. + * + * @return the scope value. + */ + ScopeType scope(); + + /** + * Gets the namespace property: The namespace to which this configuration is installed to. Maximum of 253 lower case + * alphanumeric characters, hyphen and period only. + * + * @return the namespace value. + */ + String namespace(); + + /** + * Gets the sourceKind property: Source Kind to pull the configuration data from. + * + * @return the sourceKind value. + */ + SourceKindType sourceKind(); + + /** + * Gets the suspend property: Whether this configuration should suspend its reconciliation of its kustomizations and + * sources. + * + * @return the suspend value. + */ + Boolean suspend(); + + /** + * Gets the gitRepository property: Parameters to reconcile to the GitRepository source kind type. + * + * @return the gitRepository value. + */ + GitRepositoryDefinition gitRepository(); + + /** + * Gets the bucket property: Parameters to reconcile to the Bucket source kind type. + * + * @return the bucket value. + */ + BucketDefinition bucket(); + + /** + * Gets the kustomizations property: Array of kustomizations used to reconcile the artifact pulled by the source + * type on the cluster. + * + * @return the kustomizations value. + */ + Map kustomizations(); + + /** + * Gets the configurationProtectedSettings property: Key-value pairs of protected configuration settings for the + * configuration. + * + * @return the configurationProtectedSettings value. + */ + Map configurationProtectedSettings(); + + /** + * Gets the statuses property: Statuses of the Flux Kubernetes resources created by the fluxConfiguration or created + * by the managed objects provisioned by the fluxConfiguration. + * + * @return the statuses value. + */ + List statuses(); + + /** + * Gets the repositoryPublicKey property: Public Key associated with this fluxConfiguration (either generated within + * the cluster or provided by the user). + * + * @return the repositoryPublicKey value. + */ + String repositoryPublicKey(); + + /** + * Gets the sourceSyncedCommitId property: Branch and/or SHA of the source commit synced with the cluster. + * + * @return the sourceSyncedCommitId value. + */ + String sourceSyncedCommitId(); + + /** + * Gets the sourceUpdatedAt property: Datetime the fluxConfiguration synced its source on the cluster. + * + * @return the sourceUpdatedAt value. + */ + OffsetDateTime sourceUpdatedAt(); + + /** + * Gets the statusUpdatedAt property: Datetime the fluxConfiguration synced its status on the cluster with Azure. + * + * @return the statusUpdatedAt value. + */ + OffsetDateTime statusUpdatedAt(); + + /** + * Gets the complianceState property: Combined status of the Flux Kubernetes resources created by the + * fluxConfiguration or created by the managed objects. + * + * @return the complianceState value. + */ + FluxComplianceState complianceState(); + + /** + * Gets the provisioningState property: Status of the creation of the fluxConfiguration. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the errorMessage property: Error message returned to the user in the case of provisioning failure. + * + * @return the errorMessage value. + */ + String errorMessage(); + + /** + * Gets the inner com.azure.resourcemanager.kubernetesconfiguration.fluent.models.FluxConfigurationInner object. + * + * @return the inner object. + */ + FluxConfigurationInner innerModel(); +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/FluxConfigurationPatch.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/FluxConfigurationPatch.java new file mode 100644 index 0000000000000..56ec23571f0b8 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/FluxConfigurationPatch.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.FluxConfigurationPatchProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The Flux Configuration Patch Request object. */ +@Fluent +public final class FluxConfigurationPatch { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FluxConfigurationPatch.class); + + /* + * Updatable properties of an Flux Configuration Patch Request + */ + @JsonProperty(value = "properties") + private FluxConfigurationPatchProperties innerProperties; + + /** + * Get the innerProperties property: Updatable properties of an Flux Configuration Patch Request. + * + * @return the innerProperties value. + */ + private FluxConfigurationPatchProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the sourceKind property: Source Kind to pull the configuration data from. + * + * @return the sourceKind value. + */ + public SourceKindType sourceKind() { + return this.innerProperties() == null ? null : this.innerProperties().sourceKind(); + } + + /** + * Set the sourceKind property: Source Kind to pull the configuration data from. + * + * @param sourceKind the sourceKind value to set. + * @return the FluxConfigurationPatch object itself. + */ + public FluxConfigurationPatch withSourceKind(SourceKindType sourceKind) { + if (this.innerProperties() == null) { + this.innerProperties = new FluxConfigurationPatchProperties(); + } + this.innerProperties().withSourceKind(sourceKind); + return this; + } + + /** + * Get the suspend property: Whether this configuration should suspend its reconciliation of its kustomizations and + * sources. + * + * @return the suspend value. + */ + public Boolean suspend() { + return this.innerProperties() == null ? null : this.innerProperties().suspend(); + } + + /** + * Set the suspend property: Whether this configuration should suspend its reconciliation of its kustomizations and + * sources. + * + * @param suspend the suspend value to set. + * @return the FluxConfigurationPatch object itself. + */ + public FluxConfigurationPatch withSuspend(Boolean suspend) { + if (this.innerProperties() == null) { + this.innerProperties = new FluxConfigurationPatchProperties(); + } + this.innerProperties().withSuspend(suspend); + return this; + } + + /** + * Get the gitRepository property: Parameters to reconcile to the GitRepository source kind type. + * + * @return the gitRepository value. + */ + public GitRepositoryPatchDefinition gitRepository() { + return this.innerProperties() == null ? null : this.innerProperties().gitRepository(); + } + + /** + * Set the gitRepository property: Parameters to reconcile to the GitRepository source kind type. + * + * @param gitRepository the gitRepository value to set. + * @return the FluxConfigurationPatch object itself. + */ + public FluxConfigurationPatch withGitRepository(GitRepositoryPatchDefinition gitRepository) { + if (this.innerProperties() == null) { + this.innerProperties = new FluxConfigurationPatchProperties(); + } + this.innerProperties().withGitRepository(gitRepository); + return this; + } + + /** + * Get the bucket property: Parameters to reconcile to the Bucket source kind type. + * + * @return the bucket value. + */ + public BucketPatchDefinition bucket() { + return this.innerProperties() == null ? null : this.innerProperties().bucket(); + } + + /** + * Set the bucket property: Parameters to reconcile to the Bucket source kind type. + * + * @param bucket the bucket value to set. + * @return the FluxConfigurationPatch object itself. + */ + public FluxConfigurationPatch withBucket(BucketPatchDefinition bucket) { + if (this.innerProperties() == null) { + this.innerProperties = new FluxConfigurationPatchProperties(); + } + this.innerProperties().withBucket(bucket); + return this; + } + + /** + * Get the kustomizations property: Array of kustomizations used to reconcile the artifact pulled by the source type + * on the cluster. + * + * @return the kustomizations value. + */ + public Map kustomizations() { + return this.innerProperties() == null ? null : this.innerProperties().kustomizations(); + } + + /** + * Set the kustomizations property: Array of kustomizations used to reconcile the artifact pulled by the source type + * on the cluster. + * + * @param kustomizations the kustomizations value to set. + * @return the FluxConfigurationPatch object itself. + */ + public FluxConfigurationPatch withKustomizations(Map kustomizations) { + if (this.innerProperties() == null) { + this.innerProperties = new FluxConfigurationPatchProperties(); + } + this.innerProperties().withKustomizations(kustomizations); + return this; + } + + /** + * Get the configurationProtectedSettings property: Key-value pairs of protected configuration settings for the + * configuration. + * + * @return the configurationProtectedSettings value. + */ + public Map configurationProtectedSettings() { + return this.innerProperties() == null ? null : this.innerProperties().configurationProtectedSettings(); + } + + /** + * Set the configurationProtectedSettings property: Key-value pairs of protected configuration settings for the + * configuration. + * + * @param configurationProtectedSettings the configurationProtectedSettings value to set. + * @return the FluxConfigurationPatch object itself. + */ + public FluxConfigurationPatch withConfigurationProtectedSettings( + Map configurationProtectedSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new FluxConfigurationPatchProperties(); + } + this.innerProperties().withConfigurationProtectedSettings(configurationProtectedSettings); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/FluxConfigurations.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/FluxConfigurations.java new file mode 100644 index 0000000000000..d5c04e26862f1 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/FluxConfigurations.java @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.FluxConfigurationInner; + +/** Resource collection API of FluxConfigurations. */ +public interface FluxConfigurations { + /** + * Gets details of the Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the Flux Configuration. + */ + FluxConfiguration get( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName); + + /** + * Gets details of the Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the Flux Configuration along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + Context context); + + /** + * Create a new Kubernetes Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfiguration Properties necessary to Create a FluxConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Flux Configuration object returned in Get & Put response. + */ + FluxConfiguration createOrUpdate( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + FluxConfigurationInner fluxConfiguration); + + /** + * Create a new Kubernetes Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfiguration Properties necessary to Create a FluxConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Flux Configuration object returned in Get & Put response. + */ + FluxConfiguration createOrUpdate( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + FluxConfigurationInner fluxConfiguration, + Context context); + + /** + * Update an existing Kubernetes Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfigurationPatch Properties to Patch in an existing Flux Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Flux Configuration object returned in Get & Put response. + */ + FluxConfiguration update( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + FluxConfigurationPatch fluxConfigurationPatch); + + /** + * Update an existing Kubernetes Flux Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfigurationPatch Properties to Patch in an existing Flux Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Flux Configuration object returned in Get & Put response. + */ + FluxConfiguration update( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + FluxConfigurationPatch fluxConfigurationPatch, + Context context); + + /** + * This will delete the YAML file used to set up the Flux Configuration, thus stopping future sync from the source + * repo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param forceDelete Delete the extension resource in Azure - not the normal asynchronous delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + Boolean forceDelete); + + /** + * This will delete the YAML file used to set up the Flux Configuration, thus stopping future sync from the source + * repo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName); + + /** + * This will delete the YAML file used to set up the Flux Configuration, thus stopping future sync from the source + * repo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param forceDelete Delete the extension resource in Azure - not the normal asynchronous delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String fluxConfigurationName, + Boolean forceDelete, + Context context); + + /** + * List all Flux Configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Flux Configurations as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName); + + /** + * List all Flux Configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Flux Configurations as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, Context context); +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/FluxConfigurationsList.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/FluxConfigurationsList.java new file mode 100644 index 0000000000000..91802fcc2fddc --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/FluxConfigurationsList.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.FluxConfigurationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list Flux Configurations. It contains a list of FluxConfiguration objects and a URL link to + * get the next set of results. + */ +@Immutable +public final class FluxConfigurationsList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FluxConfigurationsList.class); + + /* + * List of Flux Configurations within a Kubernetes cluster. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of configuration objects, if any. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: List of Flux Configurations within a Kubernetes cluster. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of configuration objects, if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/GitRepositoryDefinition.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/GitRepositoryDefinition.java new file mode 100644 index 0000000000000..70f78f173c0fb --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/GitRepositoryDefinition.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters to reconcile to the GitRepository source kind type. */ +@Fluent +public final class GitRepositoryDefinition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GitRepositoryDefinition.class); + + /* + * The URL to sync for the flux configuration git repository. + */ + @JsonProperty(value = "url") + private String url; + + /* + * The maximum time to attempt to reconcile the cluster git repository + * source with the remote. + */ + @JsonProperty(value = "timeoutInSeconds") + private Long timeoutInSeconds; + + /* + * The interval at which to re-reconcile the cluster git repository source + * with the remote. + */ + @JsonProperty(value = "syncIntervalInSeconds") + private Long syncIntervalInSeconds; + + /* + * The source reference for the GitRepository object. + */ + @JsonProperty(value = "repositoryRef") + private RepositoryRefDefinition repositoryRef; + + /* + * Base64-encoded known_hosts value containing public SSH keys required to + * access private git repositories over SSH + */ + @JsonProperty(value = "sshKnownHosts") + private String sshKnownHosts; + + /* + * Plaintext HTTPS username used to access private git repositories over + * HTTPS + */ + @JsonProperty(value = "httpsUser") + private String httpsUser; + + /* + * Base64-encoded HTTPS certificate authority contents used to access git + * private git repositories over HTTPS + */ + @JsonProperty(value = "httpsCACert") + private String httpsCACert; + + /* + * Name of a local secret on the Kubernetes cluster to use as the + * authentication secret rather than the managed or user-provided + * configuration secrets. + */ + @JsonProperty(value = "localAuthRef") + private String localAuthRef; + + /** + * Get the url property: The URL to sync for the flux configuration git repository. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: The URL to sync for the flux configuration git repository. + * + * @param url the url value to set. + * @return the GitRepositoryDefinition object itself. + */ + public GitRepositoryDefinition withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the timeoutInSeconds property: The maximum time to attempt to reconcile the cluster git repository source + * with the remote. + * + * @return the timeoutInSeconds value. + */ + public Long timeoutInSeconds() { + return this.timeoutInSeconds; + } + + /** + * Set the timeoutInSeconds property: The maximum time to attempt to reconcile the cluster git repository source + * with the remote. + * + * @param timeoutInSeconds the timeoutInSeconds value to set. + * @return the GitRepositoryDefinition object itself. + */ + public GitRepositoryDefinition withTimeoutInSeconds(Long timeoutInSeconds) { + this.timeoutInSeconds = timeoutInSeconds; + return this; + } + + /** + * Get the syncIntervalInSeconds property: The interval at which to re-reconcile the cluster git repository source + * with the remote. + * + * @return the syncIntervalInSeconds value. + */ + public Long syncIntervalInSeconds() { + return this.syncIntervalInSeconds; + } + + /** + * Set the syncIntervalInSeconds property: The interval at which to re-reconcile the cluster git repository source + * with the remote. + * + * @param syncIntervalInSeconds the syncIntervalInSeconds value to set. + * @return the GitRepositoryDefinition object itself. + */ + public GitRepositoryDefinition withSyncIntervalInSeconds(Long syncIntervalInSeconds) { + this.syncIntervalInSeconds = syncIntervalInSeconds; + return this; + } + + /** + * Get the repositoryRef property: The source reference for the GitRepository object. + * + * @return the repositoryRef value. + */ + public RepositoryRefDefinition repositoryRef() { + return this.repositoryRef; + } + + /** + * Set the repositoryRef property: The source reference for the GitRepository object. + * + * @param repositoryRef the repositoryRef value to set. + * @return the GitRepositoryDefinition object itself. + */ + public GitRepositoryDefinition withRepositoryRef(RepositoryRefDefinition repositoryRef) { + this.repositoryRef = repositoryRef; + return this; + } + + /** + * Get the sshKnownHosts property: Base64-encoded known_hosts value containing public SSH keys required to access + * private git repositories over SSH. + * + * @return the sshKnownHosts value. + */ + public String sshKnownHosts() { + return this.sshKnownHosts; + } + + /** + * Set the sshKnownHosts property: Base64-encoded known_hosts value containing public SSH keys required to access + * private git repositories over SSH. + * + * @param sshKnownHosts the sshKnownHosts value to set. + * @return the GitRepositoryDefinition object itself. + */ + public GitRepositoryDefinition withSshKnownHosts(String sshKnownHosts) { + this.sshKnownHosts = sshKnownHosts; + return this; + } + + /** + * Get the httpsUser property: Plaintext HTTPS username used to access private git repositories over HTTPS. + * + * @return the httpsUser value. + */ + public String httpsUser() { + return this.httpsUser; + } + + /** + * Set the httpsUser property: Plaintext HTTPS username used to access private git repositories over HTTPS. + * + * @param httpsUser the httpsUser value to set. + * @return the GitRepositoryDefinition object itself. + */ + public GitRepositoryDefinition withHttpsUser(String httpsUser) { + this.httpsUser = httpsUser; + return this; + } + + /** + * Get the httpsCACert property: Base64-encoded HTTPS certificate authority contents used to access git private git + * repositories over HTTPS. + * + * @return the httpsCACert value. + */ + public String httpsCACert() { + return this.httpsCACert; + } + + /** + * Set the httpsCACert property: Base64-encoded HTTPS certificate authority contents used to access git private git + * repositories over HTTPS. + * + * @param httpsCACert the httpsCACert value to set. + * @return the GitRepositoryDefinition object itself. + */ + public GitRepositoryDefinition withHttpsCACert(String httpsCACert) { + this.httpsCACert = httpsCACert; + return this; + } + + /** + * Get the localAuthRef property: Name of a local secret on the Kubernetes cluster to use as the authentication + * secret rather than the managed or user-provided configuration secrets. + * + * @return the localAuthRef value. + */ + public String localAuthRef() { + return this.localAuthRef; + } + + /** + * Set the localAuthRef property: Name of a local secret on the Kubernetes cluster to use as the authentication + * secret rather than the managed or user-provided configuration secrets. + * + * @param localAuthRef the localAuthRef value to set. + * @return the GitRepositoryDefinition object itself. + */ + public GitRepositoryDefinition withLocalAuthRef(String localAuthRef) { + this.localAuthRef = localAuthRef; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (repositoryRef() != null) { + repositoryRef().validate(); + } + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/GitRepositoryPatchDefinition.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/GitRepositoryPatchDefinition.java new file mode 100644 index 0000000000000..9b57bc572ec67 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/GitRepositoryPatchDefinition.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters to reconcile to the GitRepository source kind type. */ +@Fluent +public final class GitRepositoryPatchDefinition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GitRepositoryPatchDefinition.class); + + /* + * The URL to sync for the flux configuration git repository. + */ + @JsonProperty(value = "url") + private String url; + + /* + * The maximum time to attempt to reconcile the cluster git repository + * source with the remote. + */ + @JsonProperty(value = "timeoutInSeconds") + private Long timeoutInSeconds; + + /* + * The interval at which to re-reconcile the cluster git repository source + * with the remote. + */ + @JsonProperty(value = "syncIntervalInSeconds") + private Long syncIntervalInSeconds; + + /* + * The source reference for the GitRepository object. + */ + @JsonProperty(value = "repositoryRef") + private RepositoryRefDefinition repositoryRef; + + /* + * Base64-encoded known_hosts value containing public SSH keys required to + * access private git repositories over SSH + */ + @JsonProperty(value = "sshKnownHosts") + private String sshKnownHosts; + + /* + * Plaintext HTTPS username used to access private git repositories over + * HTTPS + */ + @JsonProperty(value = "httpsUser") + private String httpsUser; + + /* + * Base64-encoded HTTPS certificate authority contents used to access git + * private git repositories over HTTPS + */ + @JsonProperty(value = "httpsCACert") + private String httpsCACert; + + /* + * Name of a local secret on the Kubernetes cluster to use as the + * authentication secret rather than the managed or user-provided + * configuration secrets. + */ + @JsonProperty(value = "localAuthRef") + private String localAuthRef; + + /** + * Get the url property: The URL to sync for the flux configuration git repository. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: The URL to sync for the flux configuration git repository. + * + * @param url the url value to set. + * @return the GitRepositoryPatchDefinition object itself. + */ + public GitRepositoryPatchDefinition withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the timeoutInSeconds property: The maximum time to attempt to reconcile the cluster git repository source + * with the remote. + * + * @return the timeoutInSeconds value. + */ + public Long timeoutInSeconds() { + return this.timeoutInSeconds; + } + + /** + * Set the timeoutInSeconds property: The maximum time to attempt to reconcile the cluster git repository source + * with the remote. + * + * @param timeoutInSeconds the timeoutInSeconds value to set. + * @return the GitRepositoryPatchDefinition object itself. + */ + public GitRepositoryPatchDefinition withTimeoutInSeconds(Long timeoutInSeconds) { + this.timeoutInSeconds = timeoutInSeconds; + return this; + } + + /** + * Get the syncIntervalInSeconds property: The interval at which to re-reconcile the cluster git repository source + * with the remote. + * + * @return the syncIntervalInSeconds value. + */ + public Long syncIntervalInSeconds() { + return this.syncIntervalInSeconds; + } + + /** + * Set the syncIntervalInSeconds property: The interval at which to re-reconcile the cluster git repository source + * with the remote. + * + * @param syncIntervalInSeconds the syncIntervalInSeconds value to set. + * @return the GitRepositoryPatchDefinition object itself. + */ + public GitRepositoryPatchDefinition withSyncIntervalInSeconds(Long syncIntervalInSeconds) { + this.syncIntervalInSeconds = syncIntervalInSeconds; + return this; + } + + /** + * Get the repositoryRef property: The source reference for the GitRepository object. + * + * @return the repositoryRef value. + */ + public RepositoryRefDefinition repositoryRef() { + return this.repositoryRef; + } + + /** + * Set the repositoryRef property: The source reference for the GitRepository object. + * + * @param repositoryRef the repositoryRef value to set. + * @return the GitRepositoryPatchDefinition object itself. + */ + public GitRepositoryPatchDefinition withRepositoryRef(RepositoryRefDefinition repositoryRef) { + this.repositoryRef = repositoryRef; + return this; + } + + /** + * Get the sshKnownHosts property: Base64-encoded known_hosts value containing public SSH keys required to access + * private git repositories over SSH. + * + * @return the sshKnownHosts value. + */ + public String sshKnownHosts() { + return this.sshKnownHosts; + } + + /** + * Set the sshKnownHosts property: Base64-encoded known_hosts value containing public SSH keys required to access + * private git repositories over SSH. + * + * @param sshKnownHosts the sshKnownHosts value to set. + * @return the GitRepositoryPatchDefinition object itself. + */ + public GitRepositoryPatchDefinition withSshKnownHosts(String sshKnownHosts) { + this.sshKnownHosts = sshKnownHosts; + return this; + } + + /** + * Get the httpsUser property: Plaintext HTTPS username used to access private git repositories over HTTPS. + * + * @return the httpsUser value. + */ + public String httpsUser() { + return this.httpsUser; + } + + /** + * Set the httpsUser property: Plaintext HTTPS username used to access private git repositories over HTTPS. + * + * @param httpsUser the httpsUser value to set. + * @return the GitRepositoryPatchDefinition object itself. + */ + public GitRepositoryPatchDefinition withHttpsUser(String httpsUser) { + this.httpsUser = httpsUser; + return this; + } + + /** + * Get the httpsCACert property: Base64-encoded HTTPS certificate authority contents used to access git private git + * repositories over HTTPS. + * + * @return the httpsCACert value. + */ + public String httpsCACert() { + return this.httpsCACert; + } + + /** + * Set the httpsCACert property: Base64-encoded HTTPS certificate authority contents used to access git private git + * repositories over HTTPS. + * + * @param httpsCACert the httpsCACert value to set. + * @return the GitRepositoryPatchDefinition object itself. + */ + public GitRepositoryPatchDefinition withHttpsCACert(String httpsCACert) { + this.httpsCACert = httpsCACert; + return this; + } + + /** + * Get the localAuthRef property: Name of a local secret on the Kubernetes cluster to use as the authentication + * secret rather than the managed or user-provided configuration secrets. + * + * @return the localAuthRef value. + */ + public String localAuthRef() { + return this.localAuthRef; + } + + /** + * Set the localAuthRef property: Name of a local secret on the Kubernetes cluster to use as the authentication + * secret rather than the managed or user-provided configuration secrets. + * + * @param localAuthRef the localAuthRef value to set. + * @return the GitRepositoryPatchDefinition object itself. + */ + public GitRepositoryPatchDefinition withLocalAuthRef(String localAuthRef) { + this.localAuthRef = localAuthRef; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (repositoryRef() != null) { + repositoryRef().validate(); + } + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/HelmOperatorProperties.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/HelmOperatorProperties.java new file mode 100644 index 0000000000000..7b51cd3f8b3c6 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/HelmOperatorProperties.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties for Helm operator. */ +@Fluent +public final class HelmOperatorProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HelmOperatorProperties.class); + + /* + * Version of the operator Helm chart. + */ + @JsonProperty(value = "chartVersion") + private String chartVersion; + + /* + * Values override for the operator Helm chart. + */ + @JsonProperty(value = "chartValues") + private String chartValues; + + /** + * Get the chartVersion property: Version of the operator Helm chart. + * + * @return the chartVersion value. + */ + public String chartVersion() { + return this.chartVersion; + } + + /** + * Set the chartVersion property: Version of the operator Helm chart. + * + * @param chartVersion the chartVersion value to set. + * @return the HelmOperatorProperties object itself. + */ + public HelmOperatorProperties withChartVersion(String chartVersion) { + this.chartVersion = chartVersion; + return this; + } + + /** + * Get the chartValues property: Values override for the operator Helm chart. + * + * @return the chartValues value. + */ + public String chartValues() { + return this.chartValues; + } + + /** + * Set the chartValues property: Values override for the operator Helm chart. + * + * @param chartValues the chartValues value to set. + * @return the HelmOperatorProperties object itself. + */ + public HelmOperatorProperties withChartValues(String chartValues) { + this.chartValues = chartValues; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/HelmReleasePropertiesDefinition.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/HelmReleasePropertiesDefinition.java new file mode 100644 index 0000000000000..5df078fab13e4 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/HelmReleasePropertiesDefinition.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties for HelmRelease objects. */ +@Fluent +public final class HelmReleasePropertiesDefinition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HelmReleasePropertiesDefinition.class); + + /* + * The revision number of the last released object change + */ + @JsonProperty(value = "lastRevisionApplied") + private Long lastRevisionApplied; + + /* + * The reference to the HelmChart object used as the source to this + * HelmRelease + */ + @JsonProperty(value = "helmChartRef") + private ObjectReferenceDefinition helmChartRef; + + /* + * Total number of times that the HelmRelease failed to install or upgrade + */ + @JsonProperty(value = "failureCount") + private Long failureCount; + + /* + * Number of times that the HelmRelease failed to install + */ + @JsonProperty(value = "installFailureCount") + private Long installFailureCount; + + /* + * Number of times that the HelmRelease failed to upgrade + */ + @JsonProperty(value = "upgradeFailureCount") + private Long upgradeFailureCount; + + /** + * Get the lastRevisionApplied property: The revision number of the last released object change. + * + * @return the lastRevisionApplied value. + */ + public Long lastRevisionApplied() { + return this.lastRevisionApplied; + } + + /** + * Set the lastRevisionApplied property: The revision number of the last released object change. + * + * @param lastRevisionApplied the lastRevisionApplied value to set. + * @return the HelmReleasePropertiesDefinition object itself. + */ + public HelmReleasePropertiesDefinition withLastRevisionApplied(Long lastRevisionApplied) { + this.lastRevisionApplied = lastRevisionApplied; + return this; + } + + /** + * Get the helmChartRef property: The reference to the HelmChart object used as the source to this HelmRelease. + * + * @return the helmChartRef value. + */ + public ObjectReferenceDefinition helmChartRef() { + return this.helmChartRef; + } + + /** + * Set the helmChartRef property: The reference to the HelmChart object used as the source to this HelmRelease. + * + * @param helmChartRef the helmChartRef value to set. + * @return the HelmReleasePropertiesDefinition object itself. + */ + public HelmReleasePropertiesDefinition withHelmChartRef(ObjectReferenceDefinition helmChartRef) { + this.helmChartRef = helmChartRef; + return this; + } + + /** + * Get the failureCount property: Total number of times that the HelmRelease failed to install or upgrade. + * + * @return the failureCount value. + */ + public Long failureCount() { + return this.failureCount; + } + + /** + * Set the failureCount property: Total number of times that the HelmRelease failed to install or upgrade. + * + * @param failureCount the failureCount value to set. + * @return the HelmReleasePropertiesDefinition object itself. + */ + public HelmReleasePropertiesDefinition withFailureCount(Long failureCount) { + this.failureCount = failureCount; + return this; + } + + /** + * Get the installFailureCount property: Number of times that the HelmRelease failed to install. + * + * @return the installFailureCount value. + */ + public Long installFailureCount() { + return this.installFailureCount; + } + + /** + * Set the installFailureCount property: Number of times that the HelmRelease failed to install. + * + * @param installFailureCount the installFailureCount value to set. + * @return the HelmReleasePropertiesDefinition object itself. + */ + public HelmReleasePropertiesDefinition withInstallFailureCount(Long installFailureCount) { + this.installFailureCount = installFailureCount; + return this; + } + + /** + * Get the upgradeFailureCount property: Number of times that the HelmRelease failed to upgrade. + * + * @return the upgradeFailureCount value. + */ + public Long upgradeFailureCount() { + return this.upgradeFailureCount; + } + + /** + * Set the upgradeFailureCount property: Number of times that the HelmRelease failed to upgrade. + * + * @param upgradeFailureCount the upgradeFailureCount value to set. + * @return the HelmReleasePropertiesDefinition object itself. + */ + public HelmReleasePropertiesDefinition withUpgradeFailureCount(Long upgradeFailureCount) { + this.upgradeFailureCount = upgradeFailureCount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (helmChartRef() != null) { + helmChartRef().validate(); + } + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/KubernetesConfigurationPrivateLinkScope.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/KubernetesConfigurationPrivateLinkScope.java new file mode 100644 index 0000000000000..74238226547f5 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/KubernetesConfigurationPrivateLinkScope.java @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.KubernetesConfigurationPrivateLinkScopeInner; +import java.util.Map; + +/** An immutable client-side representation of KubernetesConfigurationPrivateLinkScope. */ +public interface KubernetesConfigurationPrivateLinkScope { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: Properties that define a Azure Arc PrivateLinkScope resource. + * + * @return the properties value. + */ + KubernetesConfigurationPrivateLinkScopeProperties properties(); + + /** + * Gets the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner + * com.azure.resourcemanager.kubernetesconfiguration.fluent.models.KubernetesConfigurationPrivateLinkScopeInner + * object. + * + * @return the inner object. + */ + KubernetesConfigurationPrivateLinkScopeInner innerModel(); + + /** The entirety of the KubernetesConfigurationPrivateLinkScope definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The KubernetesConfigurationPrivateLinkScope definition stages. */ + interface DefinitionStages { + /** The first stage of the KubernetesConfigurationPrivateLinkScope definition. */ + interface Blank extends WithLocation { + } + /** The stage of the KubernetesConfigurationPrivateLinkScope definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the KubernetesConfigurationPrivateLinkScope definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the KubernetesConfigurationPrivateLinkScope definition which contains all the minimum required + * properties for the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + KubernetesConfigurationPrivateLinkScope create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + KubernetesConfigurationPrivateLinkScope create(Context context); + } + /** The stage of the KubernetesConfigurationPrivateLinkScope definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the KubernetesConfigurationPrivateLinkScope definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties that define a Azure Arc PrivateLinkScope resource.. + * + * @param properties Properties that define a Azure Arc PrivateLinkScope resource. + * @return the next definition stage. + */ + WithCreate withProperties(KubernetesConfigurationPrivateLinkScopeProperties properties); + } + } + /** + * Begins update for the KubernetesConfigurationPrivateLinkScope resource. + * + * @return the stage of resource update. + */ + KubernetesConfigurationPrivateLinkScope.Update update(); + + /** The template for KubernetesConfigurationPrivateLinkScope update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + KubernetesConfigurationPrivateLinkScope apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + KubernetesConfigurationPrivateLinkScope apply(Context context); + } + /** The KubernetesConfigurationPrivateLinkScope update stages. */ + interface UpdateStages { + /** The stage of the KubernetesConfigurationPrivateLinkScope update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + KubernetesConfigurationPrivateLinkScope refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + KubernetesConfigurationPrivateLinkScope refresh(Context context); +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/KubernetesConfigurationPrivateLinkScopeListResult.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/KubernetesConfigurationPrivateLinkScopeListResult.java new file mode 100644 index 0000000000000..b9973a9d57953 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/KubernetesConfigurationPrivateLinkScopeListResult.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.KubernetesConfigurationPrivateLinkScopeInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes the list of Azure Arc PrivateLinkScope resources. */ +@Fluent +public final class KubernetesConfigurationPrivateLinkScopeListResult { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(KubernetesConfigurationPrivateLinkScopeListResult.class); + + /* + * List of Azure Arc PrivateLinkScope definitions. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The URI to get the next set of Azure Arc PrivateLinkScope definitions if + * too many PrivateLinkScopes where returned in the result set. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of Azure Arc PrivateLinkScope definitions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Azure Arc PrivateLinkScope definitions. + * + * @param value the value value to set. + * @return the KubernetesConfigurationPrivateLinkScopeListResult object itself. + */ + public KubernetesConfigurationPrivateLinkScopeListResult withValue( + List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI to get the next set of Azure Arc PrivateLinkScope definitions if too many + * PrivateLinkScopes where returned in the result set. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI to get the next set of Azure Arc PrivateLinkScope definitions if too many + * PrivateLinkScopes where returned in the result set. + * + * @param nextLink the nextLink value to set. + * @return the KubernetesConfigurationPrivateLinkScopeListResult object itself. + */ + public KubernetesConfigurationPrivateLinkScopeListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property value in model KubernetesConfigurationPrivateLinkScopeListResult")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/KubernetesConfigurationPrivateLinkScopeProperties.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/KubernetesConfigurationPrivateLinkScopeProperties.java new file mode 100644 index 0000000000000..3331b12eb735c --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/KubernetesConfigurationPrivateLinkScopeProperties.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties that define a Azure Arc PrivateLinkScope resource. */ +@Fluent +public final class KubernetesConfigurationPrivateLinkScopeProperties { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(KubernetesConfigurationPrivateLinkScopeProperties.class); + + /* + * Indicates whether machines associated with the private link scope can + * also use public Azure Arc service endpoints. + */ + @JsonProperty(value = "publicNetworkAccess") + private PublicNetworkAccessType publicNetworkAccess; + + /* + * Current state of this PrivateLinkScope: whether or not is has been + * provisioned within the resource group it is defined. Users cannot change + * this value but are able to read from it. Values will include + * Provisioning ,Succeeded, Canceled and Failed. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Managed Cluster ARM ID for the private link scope (Required) + */ + @JsonProperty(value = "clusterArmId", required = true) + private String clusterArmId; + + /* + * The Guid id of the private link scope. + */ + @JsonProperty(value = "privateLinkScopeId", access = JsonProperty.Access.WRITE_ONLY) + private String privateLinkScopeId; + + /* + * The collection of associated Private Endpoint Connections. + */ + @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + + /** + * Get the publicNetworkAccess property: Indicates whether machines associated with the private link scope can also + * use public Azure Arc service endpoints. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccessType publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Indicates whether machines associated with the private link scope can also + * use public Azure Arc service endpoints. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the KubernetesConfigurationPrivateLinkScopeProperties object itself. + */ + public KubernetesConfigurationPrivateLinkScopeProperties withPublicNetworkAccess( + PublicNetworkAccessType publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the provisioningState property: Current state of this PrivateLinkScope: whether or not is has been + * provisioned within the resource group it is defined. Users cannot change this value but are able to read from it. + * Values will include Provisioning ,Succeeded, Canceled and Failed. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the clusterArmId property: Managed Cluster ARM ID for the private link scope (Required). + * + * @return the clusterArmId value. + */ + public String clusterArmId() { + return this.clusterArmId; + } + + /** + * Set the clusterArmId property: Managed Cluster ARM ID for the private link scope (Required). + * + * @param clusterArmId the clusterArmId value to set. + * @return the KubernetesConfigurationPrivateLinkScopeProperties object itself. + */ + public KubernetesConfigurationPrivateLinkScopeProperties withClusterArmId(String clusterArmId) { + this.clusterArmId = clusterArmId; + return this; + } + + /** + * Get the privateLinkScopeId property: The Guid id of the private link scope. + * + * @return the privateLinkScopeId value. + */ + public String privateLinkScopeId() { + return this.privateLinkScopeId; + } + + /** + * Get the privateEndpointConnections property: The collection of associated Private Endpoint Connections. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (clusterArmId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property clusterArmId in model" + + " KubernetesConfigurationPrivateLinkScopeProperties")); + } + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/KustomizationDefinition.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/KustomizationDefinition.java new file mode 100644 index 0000000000000..9dc2cf302d35e --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/KustomizationDefinition.java @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The Kustomization defining how to reconcile the artifact pulled by the source type on the cluster. */ +@Fluent +public final class KustomizationDefinition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KustomizationDefinition.class); + + /* + * Name of the Kustomization, matching the key in the Kustomizations object + * map. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The path in the source reference to reconcile on the cluster. + */ + @JsonProperty(value = "path") + private String path; + + /* + * Specifies other Kustomizations that this Kustomization depends on. This + * Kustomization will not reconcile until all dependencies have completed + * their reconciliation. + */ + @JsonProperty(value = "dependsOn") + private List dependsOn; + + /* + * The maximum time to attempt to reconcile the Kustomization on the + * cluster. + */ + @JsonProperty(value = "timeoutInSeconds") + private Long timeoutInSeconds; + + /* + * The interval at which to re-reconcile the Kustomization on the cluster. + */ + @JsonProperty(value = "syncIntervalInSeconds") + private Long syncIntervalInSeconds; + + /* + * The interval at which to re-reconcile the Kustomization on the cluster + * in the event of failure on reconciliation. + */ + @JsonProperty(value = "retryIntervalInSeconds") + private Long retryIntervalInSeconds; + + /* + * Enable/disable garbage collections of Kubernetes objects created by this + * Kustomization. + */ + @JsonProperty(value = "prune") + private Boolean prune; + + /* + * Enable/disable re-creating Kubernetes resources on the cluster when + * patching fails due to an immutable field change. + */ + @JsonProperty(value = "force") + private Boolean force; + + /** + * Get the name property: Name of the Kustomization, matching the key in the Kustomizations object map. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the path property: The path in the source reference to reconcile on the cluster. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: The path in the source reference to reconcile on the cluster. + * + * @param path the path value to set. + * @return the KustomizationDefinition object itself. + */ + public KustomizationDefinition withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the dependsOn property: Specifies other Kustomizations that this Kustomization depends on. This Kustomization + * will not reconcile until all dependencies have completed their reconciliation. + * + * @return the dependsOn value. + */ + public List dependsOn() { + return this.dependsOn; + } + + /** + * Set the dependsOn property: Specifies other Kustomizations that this Kustomization depends on. This Kustomization + * will not reconcile until all dependencies have completed their reconciliation. + * + * @param dependsOn the dependsOn value to set. + * @return the KustomizationDefinition object itself. + */ + public KustomizationDefinition withDependsOn(List dependsOn) { + this.dependsOn = dependsOn; + return this; + } + + /** + * Get the timeoutInSeconds property: The maximum time to attempt to reconcile the Kustomization on the cluster. + * + * @return the timeoutInSeconds value. + */ + public Long timeoutInSeconds() { + return this.timeoutInSeconds; + } + + /** + * Set the timeoutInSeconds property: The maximum time to attempt to reconcile the Kustomization on the cluster. + * + * @param timeoutInSeconds the timeoutInSeconds value to set. + * @return the KustomizationDefinition object itself. + */ + public KustomizationDefinition withTimeoutInSeconds(Long timeoutInSeconds) { + this.timeoutInSeconds = timeoutInSeconds; + return this; + } + + /** + * Get the syncIntervalInSeconds property: The interval at which to re-reconcile the Kustomization on the cluster. + * + * @return the syncIntervalInSeconds value. + */ + public Long syncIntervalInSeconds() { + return this.syncIntervalInSeconds; + } + + /** + * Set the syncIntervalInSeconds property: The interval at which to re-reconcile the Kustomization on the cluster. + * + * @param syncIntervalInSeconds the syncIntervalInSeconds value to set. + * @return the KustomizationDefinition object itself. + */ + public KustomizationDefinition withSyncIntervalInSeconds(Long syncIntervalInSeconds) { + this.syncIntervalInSeconds = syncIntervalInSeconds; + return this; + } + + /** + * Get the retryIntervalInSeconds property: The interval at which to re-reconcile the Kustomization on the cluster + * in the event of failure on reconciliation. + * + * @return the retryIntervalInSeconds value. + */ + public Long retryIntervalInSeconds() { + return this.retryIntervalInSeconds; + } + + /** + * Set the retryIntervalInSeconds property: The interval at which to re-reconcile the Kustomization on the cluster + * in the event of failure on reconciliation. + * + * @param retryIntervalInSeconds the retryIntervalInSeconds value to set. + * @return the KustomizationDefinition object itself. + */ + public KustomizationDefinition withRetryIntervalInSeconds(Long retryIntervalInSeconds) { + this.retryIntervalInSeconds = retryIntervalInSeconds; + return this; + } + + /** + * Get the prune property: Enable/disable garbage collections of Kubernetes objects created by this Kustomization. + * + * @return the prune value. + */ + public Boolean prune() { + return this.prune; + } + + /** + * Set the prune property: Enable/disable garbage collections of Kubernetes objects created by this Kustomization. + * + * @param prune the prune value to set. + * @return the KustomizationDefinition object itself. + */ + public KustomizationDefinition withPrune(Boolean prune) { + this.prune = prune; + return this; + } + + /** + * Get the force property: Enable/disable re-creating Kubernetes resources on the cluster when patching fails due to + * an immutable field change. + * + * @return the force value. + */ + public Boolean force() { + return this.force; + } + + /** + * Set the force property: Enable/disable re-creating Kubernetes resources on the cluster when patching fails due to + * an immutable field change. + * + * @param force the force value to set. + * @return the KustomizationDefinition object itself. + */ + public KustomizationDefinition withForce(Boolean force) { + this.force = force; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/KustomizationPatchDefinition.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/KustomizationPatchDefinition.java new file mode 100644 index 0000000000000..47768047b5406 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/KustomizationPatchDefinition.java @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The Kustomization defining how to reconcile the artifact pulled by the source type on the cluster. */ +@Fluent +public final class KustomizationPatchDefinition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KustomizationPatchDefinition.class); + + /* + * The path in the source reference to reconcile on the cluster. + */ + @JsonProperty(value = "path") + private String path; + + /* + * Specifies other Kustomizations that this Kustomization depends on. This + * Kustomization will not reconcile until all dependencies have completed + * their reconciliation. + */ + @JsonProperty(value = "dependsOn") + private List dependsOn; + + /* + * The maximum time to attempt to reconcile the Kustomization on the + * cluster. + */ + @JsonProperty(value = "timeoutInSeconds") + private Long timeoutInSeconds; + + /* + * The interval at which to re-reconcile the Kustomization on the cluster. + */ + @JsonProperty(value = "syncIntervalInSeconds") + private Long syncIntervalInSeconds; + + /* + * The interval at which to re-reconcile the Kustomization on the cluster + * in the event of failure on reconciliation. + */ + @JsonProperty(value = "retryIntervalInSeconds") + private Long retryIntervalInSeconds; + + /* + * Enable/disable garbage collections of Kubernetes objects created by this + * Kustomization. + */ + @JsonProperty(value = "prune") + private Boolean prune; + + /* + * Enable/disable re-creating Kubernetes resources on the cluster when + * patching fails due to an immutable field change. + */ + @JsonProperty(value = "force") + private Boolean force; + + /** + * Get the path property: The path in the source reference to reconcile on the cluster. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: The path in the source reference to reconcile on the cluster. + * + * @param path the path value to set. + * @return the KustomizationPatchDefinition object itself. + */ + public KustomizationPatchDefinition withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the dependsOn property: Specifies other Kustomizations that this Kustomization depends on. This Kustomization + * will not reconcile until all dependencies have completed their reconciliation. + * + * @return the dependsOn value. + */ + public List dependsOn() { + return this.dependsOn; + } + + /** + * Set the dependsOn property: Specifies other Kustomizations that this Kustomization depends on. This Kustomization + * will not reconcile until all dependencies have completed their reconciliation. + * + * @param dependsOn the dependsOn value to set. + * @return the KustomizationPatchDefinition object itself. + */ + public KustomizationPatchDefinition withDependsOn(List dependsOn) { + this.dependsOn = dependsOn; + return this; + } + + /** + * Get the timeoutInSeconds property: The maximum time to attempt to reconcile the Kustomization on the cluster. + * + * @return the timeoutInSeconds value. + */ + public Long timeoutInSeconds() { + return this.timeoutInSeconds; + } + + /** + * Set the timeoutInSeconds property: The maximum time to attempt to reconcile the Kustomization on the cluster. + * + * @param timeoutInSeconds the timeoutInSeconds value to set. + * @return the KustomizationPatchDefinition object itself. + */ + public KustomizationPatchDefinition withTimeoutInSeconds(Long timeoutInSeconds) { + this.timeoutInSeconds = timeoutInSeconds; + return this; + } + + /** + * Get the syncIntervalInSeconds property: The interval at which to re-reconcile the Kustomization on the cluster. + * + * @return the syncIntervalInSeconds value. + */ + public Long syncIntervalInSeconds() { + return this.syncIntervalInSeconds; + } + + /** + * Set the syncIntervalInSeconds property: The interval at which to re-reconcile the Kustomization on the cluster. + * + * @param syncIntervalInSeconds the syncIntervalInSeconds value to set. + * @return the KustomizationPatchDefinition object itself. + */ + public KustomizationPatchDefinition withSyncIntervalInSeconds(Long syncIntervalInSeconds) { + this.syncIntervalInSeconds = syncIntervalInSeconds; + return this; + } + + /** + * Get the retryIntervalInSeconds property: The interval at which to re-reconcile the Kustomization on the cluster + * in the event of failure on reconciliation. + * + * @return the retryIntervalInSeconds value. + */ + public Long retryIntervalInSeconds() { + return this.retryIntervalInSeconds; + } + + /** + * Set the retryIntervalInSeconds property: The interval at which to re-reconcile the Kustomization on the cluster + * in the event of failure on reconciliation. + * + * @param retryIntervalInSeconds the retryIntervalInSeconds value to set. + * @return the KustomizationPatchDefinition object itself. + */ + public KustomizationPatchDefinition withRetryIntervalInSeconds(Long retryIntervalInSeconds) { + this.retryIntervalInSeconds = retryIntervalInSeconds; + return this; + } + + /** + * Get the prune property: Enable/disable garbage collections of Kubernetes objects created by this Kustomization. + * + * @return the prune value. + */ + public Boolean prune() { + return this.prune; + } + + /** + * Set the prune property: Enable/disable garbage collections of Kubernetes objects created by this Kustomization. + * + * @param prune the prune value to set. + * @return the KustomizationPatchDefinition object itself. + */ + public KustomizationPatchDefinition withPrune(Boolean prune) { + this.prune = prune; + return this; + } + + /** + * Get the force property: Enable/disable re-creating Kubernetes resources on the cluster when patching fails due to + * an immutable field change. + * + * @return the force value. + */ + public Boolean force() { + return this.force; + } + + /** + * Set the force property: Enable/disable re-creating Kubernetes resources on the cluster when patching fails due to + * an immutable field change. + * + * @param force the force value to set. + * @return the KustomizationPatchDefinition object itself. + */ + public KustomizationPatchDefinition withForce(Boolean force) { + this.force = force; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/LocationExtensionTypes.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/LocationExtensionTypes.java new file mode 100644 index 0000000000000..940ad5ddc1324 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/LocationExtensionTypes.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of LocationExtensionTypes. */ +public interface LocationExtensionTypes { + /** + * List all Extension Types. + * + * @param location extension location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Types as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String location); + + /** + * List all Extension Types. + * + * @param location extension location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Types as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String location, Context context); +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/MessageLevelType.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/MessageLevelType.java new file mode 100644 index 0000000000000..6fc8db2a7b7f4 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/MessageLevelType.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MessageLevelType. */ +public final class MessageLevelType extends ExpandableStringEnum { + /** Static value Error for MessageLevelType. */ + public static final MessageLevelType ERROR = fromString("Error"); + + /** Static value Warning for MessageLevelType. */ + public static final MessageLevelType WARNING = fromString("Warning"); + + /** Static value Information for MessageLevelType. */ + public static final MessageLevelType INFORMATION = fromString("Information"); + + /** + * Creates or finds a MessageLevelType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MessageLevelType. + */ + @JsonCreator + public static MessageLevelType fromString(String name) { + return fromString(name, MessageLevelType.class); + } + + /** @return known MessageLevelType values. */ + public static Collection values() { + return values(MessageLevelType.class); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ObjectReferenceDefinition.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ObjectReferenceDefinition.java new file mode 100644 index 0000000000000..1593ebf3051cd --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ObjectReferenceDefinition.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Object reference to a Kubernetes object on a cluster. */ +@Fluent +public final class ObjectReferenceDefinition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ObjectReferenceDefinition.class); + + /* + * Name of the object + */ + @JsonProperty(value = "name") + private String name; + + /* + * Namespace of the object + */ + @JsonProperty(value = "namespace") + private String namespace; + + /** + * Get the name property: Name of the object. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the object. + * + * @param name the name value to set. + * @return the ObjectReferenceDefinition object itself. + */ + public ObjectReferenceDefinition withName(String name) { + this.name = name; + return this; + } + + /** + * Get the namespace property: Namespace of the object. + * + * @return the namespace value. + */ + public String namespace() { + return this.namespace; + } + + /** + * Set the namespace property: Namespace of the object. + * + * @param namespace the namespace value to set. + * @return the ObjectReferenceDefinition object itself. + */ + public ObjectReferenceDefinition withNamespace(String namespace) { + this.namespace = namespace; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ObjectStatusConditionDefinition.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ObjectStatusConditionDefinition.java new file mode 100644 index 0000000000000..747feb7201845 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ObjectStatusConditionDefinition.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Status condition of Kubernetes object. */ +@Fluent +public final class ObjectStatusConditionDefinition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ObjectStatusConditionDefinition.class); + + /* + * Last time this status condition has changed + */ + @JsonProperty(value = "lastTransitionTime") + private OffsetDateTime lastTransitionTime; + + /* + * A more verbose description of the object status condition + */ + @JsonProperty(value = "message") + private String message; + + /* + * Reason for the specified status condition type status + */ + @JsonProperty(value = "reason") + private String reason; + + /* + * Status of the Kubernetes object condition type + */ + @JsonProperty(value = "status") + private String status; + + /* + * Object status condition type for this object + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the lastTransitionTime property: Last time this status condition has changed. + * + * @return the lastTransitionTime value. + */ + public OffsetDateTime lastTransitionTime() { + return this.lastTransitionTime; + } + + /** + * Set the lastTransitionTime property: Last time this status condition has changed. + * + * @param lastTransitionTime the lastTransitionTime value to set. + * @return the ObjectStatusConditionDefinition object itself. + */ + public ObjectStatusConditionDefinition withLastTransitionTime(OffsetDateTime lastTransitionTime) { + this.lastTransitionTime = lastTransitionTime; + return this; + } + + /** + * Get the message property: A more verbose description of the object status condition. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: A more verbose description of the object status condition. + * + * @param message the message value to set. + * @return the ObjectStatusConditionDefinition object itself. + */ + public ObjectStatusConditionDefinition withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the reason property: Reason for the specified status condition type status. + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * Set the reason property: Reason for the specified status condition type status. + * + * @param reason the reason value to set. + * @return the ObjectStatusConditionDefinition object itself. + */ + public ObjectStatusConditionDefinition withReason(String reason) { + this.reason = reason; + return this; + } + + /** + * Get the status property: Status of the Kubernetes object condition type. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: Status of the Kubernetes object condition type. + * + * @param status the status value to set. + * @return the ObjectStatusConditionDefinition object itself. + */ + public ObjectStatusConditionDefinition withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the type property: Object status condition type for this object. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Object status condition type for this object. + * + * @param type the type value to set. + * @return the ObjectStatusConditionDefinition object itself. + */ + public ObjectStatusConditionDefinition withType(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ObjectStatusDefinition.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ObjectStatusDefinition.java new file mode 100644 index 0000000000000..968fccf1305b9 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ObjectStatusDefinition.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Statuses of objects deployed by the user-specified kustomizations from the git repository. */ +@Fluent +public final class ObjectStatusDefinition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ObjectStatusDefinition.class); + + /* + * Name of the applied object + */ + @JsonProperty(value = "name") + private String name; + + /* + * Namespace of the applied object + */ + @JsonProperty(value = "namespace") + private String namespace; + + /* + * Kind of the applied object + */ + @JsonProperty(value = "kind") + private String kind; + + /* + * Compliance state of the applied object showing whether the applied + * object has come into a ready state on the cluster. + */ + @JsonProperty(value = "complianceState") + private FluxComplianceState complianceState; + + /* + * Object reference to the Kustomization that applied this object + */ + @JsonProperty(value = "appliedBy") + private ObjectReferenceDefinition appliedBy; + + /* + * List of Kubernetes object status conditions present on the cluster + */ + @JsonProperty(value = "statusConditions") + private List statusConditions; + + /* + * Additional properties that are provided from objects of the HelmRelease + * kind + */ + @JsonProperty(value = "helmReleaseProperties") + private HelmReleasePropertiesDefinition helmReleaseProperties; + + /** + * Get the name property: Name of the applied object. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the applied object. + * + * @param name the name value to set. + * @return the ObjectStatusDefinition object itself. + */ + public ObjectStatusDefinition withName(String name) { + this.name = name; + return this; + } + + /** + * Get the namespace property: Namespace of the applied object. + * + * @return the namespace value. + */ + public String namespace() { + return this.namespace; + } + + /** + * Set the namespace property: Namespace of the applied object. + * + * @param namespace the namespace value to set. + * @return the ObjectStatusDefinition object itself. + */ + public ObjectStatusDefinition withNamespace(String namespace) { + this.namespace = namespace; + return this; + } + + /** + * Get the kind property: Kind of the applied object. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Set the kind property: Kind of the applied object. + * + * @param kind the kind value to set. + * @return the ObjectStatusDefinition object itself. + */ + public ObjectStatusDefinition withKind(String kind) { + this.kind = kind; + return this; + } + + /** + * Get the complianceState property: Compliance state of the applied object showing whether the applied object has + * come into a ready state on the cluster. + * + * @return the complianceState value. + */ + public FluxComplianceState complianceState() { + return this.complianceState; + } + + /** + * Set the complianceState property: Compliance state of the applied object showing whether the applied object has + * come into a ready state on the cluster. + * + * @param complianceState the complianceState value to set. + * @return the ObjectStatusDefinition object itself. + */ + public ObjectStatusDefinition withComplianceState(FluxComplianceState complianceState) { + this.complianceState = complianceState; + return this; + } + + /** + * Get the appliedBy property: Object reference to the Kustomization that applied this object. + * + * @return the appliedBy value. + */ + public ObjectReferenceDefinition appliedBy() { + return this.appliedBy; + } + + /** + * Set the appliedBy property: Object reference to the Kustomization that applied this object. + * + * @param appliedBy the appliedBy value to set. + * @return the ObjectStatusDefinition object itself. + */ + public ObjectStatusDefinition withAppliedBy(ObjectReferenceDefinition appliedBy) { + this.appliedBy = appliedBy; + return this; + } + + /** + * Get the statusConditions property: List of Kubernetes object status conditions present on the cluster. + * + * @return the statusConditions value. + */ + public List statusConditions() { + return this.statusConditions; + } + + /** + * Set the statusConditions property: List of Kubernetes object status conditions present on the cluster. + * + * @param statusConditions the statusConditions value to set. + * @return the ObjectStatusDefinition object itself. + */ + public ObjectStatusDefinition withStatusConditions(List statusConditions) { + this.statusConditions = statusConditions; + return this; + } + + /** + * Get the helmReleaseProperties property: Additional properties that are provided from objects of the HelmRelease + * kind. + * + * @return the helmReleaseProperties value. + */ + public HelmReleasePropertiesDefinition helmReleaseProperties() { + return this.helmReleaseProperties; + } + + /** + * Set the helmReleaseProperties property: Additional properties that are provided from objects of the HelmRelease + * kind. + * + * @param helmReleaseProperties the helmReleaseProperties value to set. + * @return the ObjectStatusDefinition object itself. + */ + public ObjectStatusDefinition withHelmReleaseProperties(HelmReleasePropertiesDefinition helmReleaseProperties) { + this.helmReleaseProperties = helmReleaseProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (appliedBy() != null) { + appliedBy().validate(); + } + if (statusConditions() != null) { + statusConditions().forEach(e -> e.validate()); + } + if (helmReleaseProperties() != null) { + helmReleaseProperties().validate(); + } + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/OperationStatus.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/OperationStatus.java index a864a45209968..e6fa460a07239 100644 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/OperationStatus.java +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/OperationStatus.java @@ -11,94 +11,87 @@ /** Resource collection API of OperationStatus. */ public interface OperationStatus { /** - * List Async Operations, currently in progress, in a cluster. + * Get Async Operation status. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. + * @param extensionName Name of the Extension. + * @param operationId operation Id. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the async operations in progress, in the cluster. + * @return async Operation status. */ - PagedIterable list( + OperationStatusResult get( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, - String clusterName); + String clusterRp, + String clusterResourceName, + String clusterName, + String extensionName, + String operationId); /** - * List Async Operations, currently in progress, in a cluster. + * Get Async Operation status. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. + * @param extensionName Name of the Extension. + * @param operationId operation Id. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the async operations in progress, in the cluster. + * @return async Operation status along with {@link Response}. */ - PagedIterable list( + Response getWithResponse( String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, + String clusterRp, + String clusterResourceName, String clusterName, + String extensionName, + String operationId, Context context); /** - * Get Async Operation status. + * List Async Operations, currently in progress, in a cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. - * @param extensionName Name of the Extension. - * @param operationId operation Id. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return async Operation status. + * @return the async operations in progress, in the cluster as paginated response with {@link PagedIterable}. */ - OperationStatusResult get( - String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, - String clusterName, - String extensionName, - String operationId); + PagedIterable list( + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName); /** - * Get Async Operation status. + * List Async Operations, currently in progress, in a cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. * @param clusterName The name of the kubernetes cluster. - * @param extensionName Name of the Extension. - * @param operationId operation Id. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return async Operation status. + * @return the async operations in progress, in the cluster as paginated response with {@link PagedIterable}. */ - Response getWithResponse( - String resourceGroupName, - ExtensionsClusterRp clusterRp, - ExtensionsClusterResourceName clusterResourceName, - String clusterName, - String extensionName, - String operationId, - Context context); + PagedIterable list( + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, Context context); } diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/OperationStatusResult.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/OperationStatusResult.java index 6f9ae4c02597f..c691ace343a69 100644 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/OperationStatusResult.java +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/OperationStatusResult.java @@ -39,7 +39,7 @@ public interface OperationStatusResult { Map properties(); /** - * Gets the error property: The error detail. + * Gets the error property: If present, details of the operation error. * * @return the error value. */ diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/Operations.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/Operations.java index 8ceba9880cacb..336d8e0308a62 100644 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/Operations.java +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/Operations.java @@ -10,22 +10,22 @@ /** Resource collection API of Operations. */ public interface Operations { /** - * List all the available operations the KubernetesConfiguration resource provider supports, in this api-version. + * List all the available operations the KubernetesConfiguration resource provider supports. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list operations. + * @return result of the request to list operations as paginated response with {@link PagedIterable}. */ PagedIterable list(); /** - * List all the available operations the KubernetesConfiguration resource provider supports, in this api-version. + * List all the available operations the KubernetesConfiguration resource provider supports. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list operations. + * @return result of the request to list operations as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); } diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/OperatorScopeType.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/OperatorScopeType.java new file mode 100644 index 0000000000000..2f7bb7464a80f --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/OperatorScopeType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OperatorScopeType. */ +public final class OperatorScopeType extends ExpandableStringEnum { + /** Static value cluster for OperatorScopeType. */ + public static final OperatorScopeType CLUSTER = fromString("cluster"); + + /** Static value namespace for OperatorScopeType. */ + public static final OperatorScopeType NAMESPACE = fromString("namespace"); + + /** + * Creates or finds a OperatorScopeType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperatorScopeType. + */ + @JsonCreator + public static OperatorScopeType fromString(String name) { + return fromString(name, OperatorScopeType.class); + } + + /** @return known OperatorScopeType values. */ + public static Collection values() { + return values(OperatorScopeType.class); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/OperatorType.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/OperatorType.java new file mode 100644 index 0000000000000..984777577f852 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/OperatorType.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OperatorType. */ +public final class OperatorType extends ExpandableStringEnum { + /** Static value Flux for OperatorType. */ + public static final OperatorType FLUX = fromString("Flux"); + + /** + * Creates or finds a OperatorType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperatorType. + */ + @JsonCreator + public static OperatorType fromString(String name) { + return fromString(name, OperatorType.class); + } + + /** @return known OperatorType values. */ + public static Collection values() { + return values(OperatorType.class); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/Plan.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/Plan.java new file mode 100644 index 0000000000000..5c7c405d4868c --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/Plan.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Plan for the resource. */ +@Fluent +public final class Plan { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Plan.class); + + /* + * A user defined name of the 3rd Party Artifact that is being procured. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The publisher of the 3rd Party Artifact that is being bought. E.g. + * NewRelic + */ + @JsonProperty(value = "publisher", required = true) + private String publisher; + + /* + * The 3rd Party artifact that is being procured. E.g. NewRelic. Product + * maps to the OfferID specified for the artifact at the time of Data + * Market onboarding. + */ + @JsonProperty(value = "product", required = true) + private String product; + + /* + * A publisher provided promotion code as provisioned in Data Market for + * the said product/artifact. + */ + @JsonProperty(value = "promotionCode") + private String promotionCode; + + /* + * The version of the desired product/artifact. + */ + @JsonProperty(value = "version") + private String version; + + /** + * Get the name property: A user defined name of the 3rd Party Artifact that is being procured. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: A user defined name of the 3rd Party Artifact that is being procured. + * + * @param name the name value to set. + * @return the Plan object itself. + */ + public Plan withName(String name) { + this.name = name; + return this; + } + + /** + * Get the publisher property: The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic. + * + * @param publisher the publisher value to set. + * @return the Plan object itself. + */ + public Plan withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the product property: The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the + * OfferID specified for the artifact at the time of Data Market onboarding. + * + * @return the product value. + */ + public String product() { + return this.product; + } + + /** + * Set the product property: The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the + * OfferID specified for the artifact at the time of Data Market onboarding. + * + * @param product the product value to set. + * @return the Plan object itself. + */ + public Plan withProduct(String product) { + this.product = product; + return this; + } + + /** + * Get the promotionCode property: A publisher provided promotion code as provisioned in Data Market for the said + * product/artifact. + * + * @return the promotionCode value. + */ + public String promotionCode() { + return this.promotionCode; + } + + /** + * Set the promotionCode property: A publisher provided promotion code as provisioned in Data Market for the said + * product/artifact. + * + * @param promotionCode the promotionCode value to set. + * @return the Plan object itself. + */ + public Plan withPromotionCode(String promotionCode) { + this.promotionCode = promotionCode; + return this; + } + + /** + * Get the version property: The version of the desired product/artifact. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The version of the desired product/artifact. + * + * @param version the version value to set. + * @return the Plan object itself. + */ + public Plan withVersion(String version) { + this.version = version; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Plan")); + } + if (publisher() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property publisher in model Plan")); + } + if (product() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property product in model Plan")); + } + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateEndpointConnection.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateEndpointConnection.java new file mode 100644 index 0000000000000..1536ced7b3aa3 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateEndpointConnection.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.PrivateEndpointConnectionInner; + +/** An immutable client-side representation of PrivateEndpointConnection. */ +public interface PrivateEndpointConnection { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: Resource properties. + * + * @return the properties value. + */ + PrivateEndpointConnectionProperties properties(); + + /** + * Gets the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.kubernetesconfiguration.fluent.models.PrivateEndpointConnectionInner + * object. + * + * @return the inner object. + */ + PrivateEndpointConnectionInner innerModel(); + + /** The entirety of the PrivateEndpointConnection definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The PrivateEndpointConnection definition stages. */ + interface DefinitionStages { + /** The first stage of the PrivateEndpointConnection definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the PrivateEndpointConnection definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, scopeName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @return the next definition stage. + */ + WithCreate withExistingPrivateLinkScope(String resourceGroupName, String scopeName); + } + /** + * The stage of the PrivateEndpointConnection definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + PrivateEndpointConnection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PrivateEndpointConnection create(Context context); + } + /** The stage of the PrivateEndpointConnection definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Resource properties.. + * + * @param properties Resource properties. + * @return the next definition stage. + */ + WithCreate withProperties(PrivateEndpointConnectionProperties properties); + } + } + /** + * Begins update for the PrivateEndpointConnection resource. + * + * @return the stage of resource update. + */ + PrivateEndpointConnection.Update update(); + + /** The template for PrivateEndpointConnection update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PrivateEndpointConnection apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PrivateEndpointConnection apply(Context context); + } + /** The PrivateEndpointConnection update stages. */ + interface UpdateStages { + /** The stage of the PrivateEndpointConnection update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Resource properties.. + * + * @param properties Resource properties. + * @return the next definition stage. + */ + Update withProperties(PrivateEndpointConnectionProperties properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(Context context); +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateEndpointConnectionDataModel.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateEndpointConnectionDataModel.java new file mode 100644 index 0000000000000..ce7bfb23470f0 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateEndpointConnectionDataModel.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Data Model for a Private Endpoint Connection associated with a Private Link Scope. */ +@Fluent +public final class PrivateEndpointConnectionDataModel { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionDataModel.class); + + /* + * The ARM Resource Id of the Private Endpoint. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The Name of the Private Endpoint. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Azure resource type + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The Private Endpoint Connection properties. + */ + @JsonProperty(value = "properties") + private PrivateEndpointConnectionProperties properties; + + /** + * Get the id property: The ARM Resource Id of the Private Endpoint. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The Name of the Private Endpoint. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: Azure resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the properties property: The Private Endpoint Connection properties. + * + * @return the properties value. + */ + public PrivateEndpointConnectionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The Private Endpoint Connection properties. + * + * @param properties the properties value to set. + * @return the PrivateEndpointConnectionDataModel object itself. + */ + public PrivateEndpointConnectionDataModel withProperties(PrivateEndpointConnectionProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateEndpointConnectionListResult.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateEndpointConnectionListResult.java new file mode 100644 index 0000000000000..947e44ed052b7 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateEndpointConnectionListResult.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.PrivateEndpointConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of private endpoint connections. */ +@Immutable +public final class PrivateEndpointConnectionListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionListResult.class); + + /* + * Array of results. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to retrieve next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Array of results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to retrieve next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateEndpointConnectionProperties.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateEndpointConnectionProperties.java new file mode 100644 index 0000000000000..e8ab9d52eb158 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateEndpointConnectionProperties.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of a private endpoint connection. */ +@Fluent +public final class PrivateEndpointConnectionProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionProperties.class); + + /* + * Private endpoint which the connection belongs to. + */ + @JsonProperty(value = "privateEndpoint") + private PrivateEndpointProperty privateEndpoint; + + /* + * Connection state of the private endpoint connection. + */ + @JsonProperty(value = "privateLinkServiceConnectionState") + private PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState; + + /* + * State of the private endpoint connection. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Get the privateEndpoint property: Private endpoint which the connection belongs to. + * + * @return the privateEndpoint value. + */ + public PrivateEndpointProperty privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: Private endpoint which the connection belongs to. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpointProperty privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: Connection state of the private endpoint connection. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: Connection state of the private endpoint connection. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get the provisioningState property: State of the private endpoint connection. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (privateLinkServiceConnectionState() != null) { + privateLinkServiceConnectionState().validate(); + } + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateEndpointConnections.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateEndpointConnections.java new file mode 100644 index 0000000000000..a2ad93f350155 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateEndpointConnections.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PrivateEndpointConnections. */ +public interface PrivateEndpointConnections { + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + PrivateEndpointConnection get(String resourceGroupName, String scopeName, String privateEndpointConnectionName); + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String scopeName, String privateEndpointConnectionName); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context); + + /** + * Gets all private endpoint connections on a private link scope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoint connections on a private link scope as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByPrivateLinkScope(String resourceGroupName, String scopeName); + + /** + * Gets all private endpoint connections on a private link scope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoint connections on a private link scope as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByPrivateLinkScope( + String resourceGroupName, String scopeName, Context context); + + /** + * Gets a private endpoint connection. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection along with {@link Response}. + */ + PrivateEndpointConnection getById(String id); + + /** + * Gets a private endpoint connection. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new PrivateEndpointConnection resource. + * + * @param name resource name. + * @return the first stage of the new PrivateEndpointConnection definition. + */ + PrivateEndpointConnection.DefinitionStages.Blank define(String name); +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateEndpointProperty.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateEndpointProperty.java new file mode 100644 index 0000000000000..d767735bae139 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateEndpointProperty.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Private endpoint which the connection belongs to. */ +@Fluent +public final class PrivateEndpointProperty { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointProperty.class); + + /* + * Resource id of the private endpoint. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id property: Resource id of the private endpoint. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource id of the private endpoint. + * + * @param id the id value to set. + * @return the PrivateEndpointProperty object itself. + */ + public PrivateEndpointProperty withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateLinkResource.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateLinkResource.java new file mode 100644 index 0000000000000..e626c38570e1a --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateLinkResource.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.PrivateLinkResourceInner; + +/** An immutable client-side representation of PrivateLinkResource. */ +public interface PrivateLinkResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: Resource properties. + * + * @return the properties value. + */ + PrivateLinkResourceProperties properties(); + + /** + * Gets the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.kubernetesconfiguration.fluent.models.PrivateLinkResourceInner object. + * + * @return the inner object. + */ + PrivateLinkResourceInner innerModel(); +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateLinkResourceListResult.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateLinkResourceListResult.java new file mode 100644 index 0000000000000..554604ce61625 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateLinkResourceListResult.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.PrivateLinkResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of private link resources. */ +@Immutable +public final class PrivateLinkResourceListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceListResult.class); + + /* + * Array of results. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to retrieve next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Array of results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to retrieve next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateLinkResourceProperties.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateLinkResourceProperties.java new file mode 100644 index 0000000000000..51408a3545224 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateLinkResourceProperties.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of a private link resource. */ +@Immutable +public final class PrivateLinkResourceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceProperties.class); + + /* + * The private link resource group id. + */ + @JsonProperty(value = "groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /* + * The private link resource required member names. + */ + @JsonProperty(value = "requiredMembers", access = JsonProperty.Access.WRITE_ONLY) + private List requiredMembers; + + /* + * Required DNS zone names of the the private link resource. + */ + @JsonProperty(value = "requiredZoneNames", access = JsonProperty.Access.WRITE_ONLY) + private List requiredZoneNames; + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Get the requiredZoneNames property: Required DNS zone names of the the private link resource. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateLinkResources.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateLinkResources.java new file mode 100644 index 0000000000000..6158d646f204a --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateLinkResources.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PrivateLinkResources. */ +public interface PrivateLinkResources { + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope as paginated + * response with {@link PagedIterable}. + */ + PagedIterable listByPrivateLinkScope(String resourceGroupName, String scopeName); + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope as paginated + * response with {@link PagedIterable}. + */ + PagedIterable listByPrivateLinkScope( + String resourceGroupName, String scopeName, Context context); + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param groupName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + */ + PrivateLinkResource get(String resourceGroupName, String scopeName, String groupName); + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param groupName The name of the private link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope along with {@link + * Response}. + */ + Response getWithResponse( + String resourceGroupName, String scopeName, String groupName, Context context); +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateLinkScopeValidationDetails.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateLinkScopeValidationDetails.java new file mode 100644 index 0000000000000..d757b57ce6a99 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateLinkScopeValidationDetails.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.PrivateLinkScopeValidationDetailsInner; +import java.util.List; + +/** An immutable client-side representation of PrivateLinkScopeValidationDetails. */ +public interface PrivateLinkScopeValidationDetails { + /** + * Gets the id property: Azure resource Id. + * + * @return the id value. + */ + String id(); + + /** + * Gets the publicNetworkAccess property: Indicates whether machines associated with the private link scope can also + * use public Azure Arc service endpoints. + * + * @return the publicNetworkAccess value. + */ + PublicNetworkAccessType publicNetworkAccess(); + + /** + * Gets the connectionDetails property: List of Private Endpoint Connection details. + * + * @return the connectionDetails value. + */ + List connectionDetails(); + + /** + * Gets the inner + * com.azure.resourcemanager.kubernetesconfiguration.fluent.models.PrivateLinkScopeValidationDetailsInner object. + * + * @return the inner object. + */ + PrivateLinkScopeValidationDetailsInner innerModel(); +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateLinkScopes.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateLinkScopes.java new file mode 100644 index 0000000000000..30445458d8b87 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateLinkScopes.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PrivateLinkScopes. */ +public interface PrivateLinkScopes { + /** + * Gets a list of all Azure Arc PrivateLinkScopes within a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all Azure Arc PrivateLinkScopes within a subscription as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(); + + /** + * Gets a list of all Azure Arc PrivateLinkScopes within a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all Azure Arc PrivateLinkScopes within a subscription as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Gets a list of Azure Arc PrivateLinkScopes within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Azure Arc PrivateLinkScopes within a resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets a list of Azure Arc PrivateLinkScopes within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Azure Arc PrivateLinkScopes within a resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup( + String resourceGroupName, Context context); + + /** + * Deletes a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String scopeName); + + /** + * Deletes a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String scopeName, Context context); + + /** + * Returns a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition. + */ + KubernetesConfigurationPrivateLinkScope getByResourceGroup(String resourceGroupName, String scopeName); + + /** + * Returns a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String scopeName, Context context); + + /** + * Returns a Azure Arc PrivateLinkScope's validation details. + * + * @param location The location of the target resource. + * @param privateLinkScopeId The id (Guid) of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + PrivateLinkScopeValidationDetails getValidationDetails(String location, String privateLinkScopeId); + + /** + * Returns a Azure Arc PrivateLinkScope's validation details. + * + * @param location The location of the target resource. + * @param privateLinkScopeId The id (Guid) of the Azure Arc PrivateLinkScope resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + Response getValidationDetailsWithResponse( + String location, String privateLinkScopeId, Context context); + + /** + * Returns a Azure Arc PrivateLinkScope's validation details for a given machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the target machine to get the private link scope validation details for. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + PrivateLinkScopeValidationDetails getValidationDetailsForMachine(String resourceGroupName, String machineName); + + /** + * Returns a Azure Arc PrivateLinkScope's validation details for a given machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the target machine to get the private link scope validation details for. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + Response getValidationDetailsForMachineWithResponse( + String resourceGroupName, String machineName, Context context); + + /** + * Returns a Azure Arc PrivateLinkScope. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response}. + */ + KubernetesConfigurationPrivateLinkScope getById(String id); + + /** + * Returns a Azure Arc PrivateLinkScope. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a Azure Arc PrivateLinkScope. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a Azure Arc PrivateLinkScope. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new KubernetesConfigurationPrivateLinkScope resource. + * + * @param name resource name. + * @return the first stage of the new KubernetesConfigurationPrivateLinkScope definition. + */ + KubernetesConfigurationPrivateLinkScope.DefinitionStages.Blank define(String name); +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateLinkScopesResource.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateLinkScopesResource.java new file mode 100644 index 0000000000000..5a25b17d528d5 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateLinkScopesResource.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Map; + +/** An azure resource object. */ +@Fluent +public class PrivateLinkScopesResource extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkScopesResource.class); + + /** {@inheritDoc} */ + @Override + public PrivateLinkScopesResource withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public PrivateLinkScopesResource withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateLinkServiceConnectionStateProperty.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateLinkServiceConnectionStateProperty.java new file mode 100644 index 0000000000000..99382e337e575 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PrivateLinkServiceConnectionStateProperty.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** State of the private endpoint connection. */ +@Fluent +public final class PrivateLinkServiceConnectionStateProperty { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServiceConnectionStateProperty.class); + + /* + * The private link service connection status. + */ + @JsonProperty(value = "status", required = true) + private String status; + + /* + * The private link service connection description. + */ + @JsonProperty(value = "description", required = true) + private String description; + + /* + * The actions required for private link service connection. + */ + @JsonProperty(value = "actionsRequired", access = JsonProperty.Access.WRITE_ONLY) + private String actionsRequired; + + /** + * Get the status property: The private link service connection status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: The private link service connection status. + * + * @param status the status value to set. + * @return the PrivateLinkServiceConnectionStateProperty object itself. + */ + public PrivateLinkServiceConnectionStateProperty withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the description property: The private link service connection description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The private link service connection description. + * + * @param description the description value to set. + * @return the PrivateLinkServiceConnectionStateProperty object itself. + */ + public PrivateLinkServiceConnectionStateProperty withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the actionsRequired property: The actions required for private link service connection. + * + * @return the actionsRequired value. + */ + public String actionsRequired() { + return this.actionsRequired; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (status() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property status in model PrivateLinkServiceConnectionStateProperty")); + } + if (description() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property description in model PrivateLinkServiceConnectionStateProperty")); + } + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ProvisioningStateType.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ProvisioningStateType.java new file mode 100644 index 0000000000000..3ba7b515a1c24 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ProvisioningStateType.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProvisioningStateType. */ +public final class ProvisioningStateType extends ExpandableStringEnum { + /** Static value Accepted for ProvisioningStateType. */ + public static final ProvisioningStateType ACCEPTED = fromString("Accepted"); + + /** Static value Deleting for ProvisioningStateType. */ + public static final ProvisioningStateType DELETING = fromString("Deleting"); + + /** Static value Running for ProvisioningStateType. */ + public static final ProvisioningStateType RUNNING = fromString("Running"); + + /** Static value Succeeded for ProvisioningStateType. */ + public static final ProvisioningStateType SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ProvisioningStateType. */ + public static final ProvisioningStateType FAILED = fromString("Failed"); + + /** + * Creates or finds a ProvisioningStateType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningStateType. + */ + @JsonCreator + public static ProvisioningStateType fromString(String name) { + return fromString(name, ProvisioningStateType.class); + } + + /** @return known ProvisioningStateType values. */ + public static Collection values() { + return values(ProvisioningStateType.class); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PublicNetworkAccessType.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PublicNetworkAccessType.java new file mode 100644 index 0000000000000..accf668edf7a6 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/PublicNetworkAccessType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PublicNetworkAccessType. */ +public final class PublicNetworkAccessType extends ExpandableStringEnum { + /** Static value Enabled for PublicNetworkAccessType. */ + public static final PublicNetworkAccessType ENABLED = fromString("Enabled"); + + /** Static value Disabled for PublicNetworkAccessType. */ + public static final PublicNetworkAccessType DISABLED = fromString("Disabled"); + + /** + * Creates or finds a PublicNetworkAccessType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicNetworkAccessType. + */ + @JsonCreator + public static PublicNetworkAccessType fromString(String name) { + return fromString(name, PublicNetworkAccessType.class); + } + + /** @return known PublicNetworkAccessType values. */ + public static Collection values() { + return values(PublicNetworkAccessType.class); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/RepositoryRefDefinition.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/RepositoryRefDefinition.java new file mode 100644 index 0000000000000..732a1cfaf73c2 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/RepositoryRefDefinition.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The source reference for the GitRepository object. */ +@Fluent +public final class RepositoryRefDefinition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RepositoryRefDefinition.class); + + /* + * The git repository branch name to checkout. + */ + @JsonProperty(value = "branch") + private String branch; + + /* + * The git repository tag name to checkout. This takes precedence over + * branch. + */ + @JsonProperty(value = "tag") + private String tag; + + /* + * The semver range used to match against git repository tags. This takes + * precedence over tag. + */ + @JsonProperty(value = "semver") + private String semver; + + /* + * The commit SHA to checkout. This value must be combined with the branch + * name to be valid. This takes precedence over semver. + */ + @JsonProperty(value = "commit") + private String commit; + + /** + * Get the branch property: The git repository branch name to checkout. + * + * @return the branch value. + */ + public String branch() { + return this.branch; + } + + /** + * Set the branch property: The git repository branch name to checkout. + * + * @param branch the branch value to set. + * @return the RepositoryRefDefinition object itself. + */ + public RepositoryRefDefinition withBranch(String branch) { + this.branch = branch; + return this; + } + + /** + * Get the tag property: The git repository tag name to checkout. This takes precedence over branch. + * + * @return the tag value. + */ + public String tag() { + return this.tag; + } + + /** + * Set the tag property: The git repository tag name to checkout. This takes precedence over branch. + * + * @param tag the tag value to set. + * @return the RepositoryRefDefinition object itself. + */ + public RepositoryRefDefinition withTag(String tag) { + this.tag = tag; + return this; + } + + /** + * Get the semver property: The semver range used to match against git repository tags. This takes precedence over + * tag. + * + * @return the semver value. + */ + public String semver() { + return this.semver; + } + + /** + * Set the semver property: The semver range used to match against git repository tags. This takes precedence over + * tag. + * + * @param semver the semver value to set. + * @return the RepositoryRefDefinition object itself. + */ + public RepositoryRefDefinition withSemver(String semver) { + this.semver = semver; + return this; + } + + /** + * Get the commit property: The commit SHA to checkout. This value must be combined with the branch name to be + * valid. This takes precedence over semver. + * + * @return the commit value. + */ + public String commit() { + return this.commit; + } + + /** + * Set the commit property: The commit SHA to checkout. This value must be combined with the branch name to be + * valid. This takes precedence over semver. + * + * @param commit the commit value to set. + * @return the RepositoryRefDefinition object itself. + */ + public RepositoryRefDefinition withCommit(String commit) { + this.commit = commit; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ScopeType.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ScopeType.java new file mode 100644 index 0000000000000..9e35c0b620612 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ScopeType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ScopeType. */ +public final class ScopeType extends ExpandableStringEnum { + /** Static value cluster for ScopeType. */ + public static final ScopeType CLUSTER = fromString("cluster"); + + /** Static value namespace for ScopeType. */ + public static final ScopeType NAMESPACE = fromString("namespace"); + + /** + * Creates or finds a ScopeType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ScopeType. + */ + @JsonCreator + public static ScopeType fromString(String name) { + return fromString(name, ScopeType.class); + } + + /** @return known ScopeType values. */ + public static Collection values() { + return values(ScopeType.class); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/SourceControlConfiguration.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/SourceControlConfiguration.java new file mode 100644 index 0000000000000..ddbf2b65c02bc --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/SourceControlConfiguration.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.SourceControlConfigurationInner; +import java.util.Map; + +/** An immutable client-side representation of SourceControlConfiguration. */ +public interface SourceControlConfiguration { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Top level metadata + * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the repositoryUrl property: Url of the SourceControl Repository. + * + * @return the repositoryUrl value. + */ + String repositoryUrl(); + + /** + * Gets the operatorNamespace property: The namespace to which this operator is installed to. Maximum of 253 lower + * case alphanumeric characters, hyphen and period only. + * + * @return the operatorNamespace value. + */ + String operatorNamespace(); + + /** + * Gets the operatorInstanceName property: Instance name of the operator - identifying the specific configuration. + * + * @return the operatorInstanceName value. + */ + String operatorInstanceName(); + + /** + * Gets the operatorType property: Type of the operator. + * + * @return the operatorType value. + */ + OperatorType operatorType(); + + /** + * Gets the operatorParams property: Any Parameters for the Operator instance in string format. + * + * @return the operatorParams value. + */ + String operatorParams(); + + /** + * Gets the configurationProtectedSettings property: Name-value pairs of protected configuration settings for the + * configuration. + * + * @return the configurationProtectedSettings value. + */ + Map configurationProtectedSettings(); + + /** + * Gets the operatorScope property: Scope at which the operator will be installed. + * + * @return the operatorScope value. + */ + OperatorScopeType operatorScope(); + + /** + * Gets the repositoryPublicKey property: Public Key associated with this SourceControl configuration (either + * generated within the cluster or provided by the user). + * + * @return the repositoryPublicKey value. + */ + String repositoryPublicKey(); + + /** + * Gets the sshKnownHostsContents property: Base64-encoded known_hosts contents containing public SSH keys required + * to access private Git instances. + * + * @return the sshKnownHostsContents value. + */ + String sshKnownHostsContents(); + + /** + * Gets the enableHelmOperator property: Option to enable Helm Operator for this git configuration. + * + * @return the enableHelmOperator value. + */ + Boolean enableHelmOperator(); + + /** + * Gets the helmOperatorProperties property: Properties for Helm operator. + * + * @return the helmOperatorProperties value. + */ + HelmOperatorProperties helmOperatorProperties(); + + /** + * Gets the provisioningState property: The provisioning state of the resource provider. + * + * @return the provisioningState value. + */ + ProvisioningStateType provisioningState(); + + /** + * Gets the complianceStatus property: Compliance Status of the Configuration. + * + * @return the complianceStatus value. + */ + ComplianceStatus complianceStatus(); + + /** + * Gets the inner com.azure.resourcemanager.kubernetesconfiguration.fluent.models.SourceControlConfigurationInner + * object. + * + * @return the inner object. + */ + SourceControlConfigurationInner innerModel(); +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/SourceControlConfigurationList.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/SourceControlConfigurationList.java new file mode 100644 index 0000000000000..e6f135d505baa --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/SourceControlConfigurationList.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.SourceControlConfigurationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list Source Control Configurations. It contains a list of SourceControlConfiguration objects + * and a URL link to get the next set of results. + */ +@Immutable +public final class SourceControlConfigurationList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SourceControlConfigurationList.class); + + /* + * List of Source Control Configurations within a Kubernetes cluster. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of configuration objects, if any. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: List of Source Control Configurations within a Kubernetes cluster. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of configuration objects, if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/SourceControlConfigurations.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/SourceControlConfigurations.java new file mode 100644 index 0000000000000..1bc79a3794e6a --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/SourceControlConfigurations.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.SourceControlConfigurationInner; + +/** Resource collection API of SourceControlConfigurations. */ +public interface SourceControlConfigurations { + /** + * Gets details of the Source Control Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the Source Control Configuration. + */ + SourceControlConfiguration get( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName); + + /** + * Gets details of the Source Control Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the Source Control Configuration along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName, + Context context); + + /** + * Create a new Kubernetes Source Control Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @param sourceControlConfiguration Properties necessary to Create KubernetesConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SourceControl Configuration object returned in Get & Put response. + */ + SourceControlConfiguration createOrUpdate( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName, + SourceControlConfigurationInner sourceControlConfiguration); + + /** + * Create a new Kubernetes Source Control Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @param sourceControlConfiguration Properties necessary to Create KubernetesConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SourceControl Configuration object returned in Get & Put response along with {@link Response}. + */ + Response createOrUpdateWithResponse( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName, + SourceControlConfigurationInner sourceControlConfiguration, + Context context); + + /** + * This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from + * the source repo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName); + + /** + * This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from + * the source repo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete( + String resourceGroupName, + String clusterRp, + String clusterResourceName, + String clusterName, + String sourceControlConfigurationName, + Context context); + + /** + * List all Source Control Configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Source Control Configurations as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName); + + /** + * List all Source Control Configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters. + * @param clusterName The name of the kubernetes cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Source Control Configurations as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, Context context); +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/SourceKindType.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/SourceKindType.java new file mode 100644 index 0000000000000..cd8c824097702 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/SourceKindType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SourceKindType. */ +public final class SourceKindType extends ExpandableStringEnum { + /** Static value GitRepository for SourceKindType. */ + public static final SourceKindType GIT_REPOSITORY = fromString("GitRepository"); + + /** Static value Bucket for SourceKindType. */ + public static final SourceKindType BUCKET = fromString("Bucket"); + + /** + * Creates or finds a SourceKindType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SourceKindType. + */ + @JsonCreator + public static SourceKindType fromString(String name) { + return fromString(name, SourceKindType.class); + } + + /** @return known SourceKindType values. */ + public static Collection values() { + return values(SourceKindType.class); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/SupportedScopes.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/SupportedScopes.java new file mode 100644 index 0000000000000..fd29a71df3098 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/SupportedScopes.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Extension scopes. */ +@Fluent +public final class SupportedScopes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SupportedScopes.class); + + /* + * Default extension scopes: cluster or namespace + */ + @JsonProperty(value = "defaultScope") + private String defaultScope; + + /* + * Scope settings + */ + @JsonProperty(value = "clusterScopeSettings") + private ClusterScopeSettings clusterScopeSettings; + + /** + * Get the defaultScope property: Default extension scopes: cluster or namespace. + * + * @return the defaultScope value. + */ + public String defaultScope() { + return this.defaultScope; + } + + /** + * Set the defaultScope property: Default extension scopes: cluster or namespace. + * + * @param defaultScope the defaultScope value to set. + * @return the SupportedScopes object itself. + */ + public SupportedScopes withDefaultScope(String defaultScope) { + this.defaultScope = defaultScope; + return this; + } + + /** + * Get the clusterScopeSettings property: Scope settings. + * + * @return the clusterScopeSettings value. + */ + public ClusterScopeSettings clusterScopeSettings() { + return this.clusterScopeSettings; + } + + /** + * Set the clusterScopeSettings property: Scope settings. + * + * @param clusterScopeSettings the clusterScopeSettings value to set. + * @return the SupportedScopes object itself. + */ + public SupportedScopes withClusterScopeSettings(ClusterScopeSettings clusterScopeSettings) { + this.clusterScopeSettings = clusterScopeSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (clusterScopeSettings() != null) { + clusterScopeSettings().validate(); + } + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/TagsResource.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/TagsResource.java new file mode 100644 index 0000000000000..c7c7ccabd9b60 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/TagsResource.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** + * A container holding only the Tags for a resource, allowing the user to update the tags on a PrivateLinkScope + * instance. + */ +@Fluent +public final class TagsResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TagsResource.class); + + /* + * Resource tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the TagsResource object itself. + */ + public TagsResource withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/ClusterExtensionTypeGetSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/ClusterExtensionTypeGetSamples.java new file mode 100644 index 0000000000000..da5633b04dcf1 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/ClusterExtensionTypeGetSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterResourceName; +import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterRp; + +/** Samples for ClusterExtensionType Get. */ +public final class ClusterExtensionTypeGetSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-01-01-preview/examples/ClusterExtensionType_Get.json + */ + /** + * Sample code: ClusterExtensionType_Get_MaximumSet_Gen. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void clusterExtensionTypeGetMaximumSetGen( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .clusterExtensionTypes() + .getWithResponse( + "rg1", + ExtensionsClusterRp.MICROSOFT_CONTAINER_SERVICE, + ExtensionsClusterResourceName.MANAGED_CLUSTERS, + "clusterName1", + "microsoft.example", + Context.NONE); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/ClusterExtensionTypesOperationListSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/ClusterExtensionTypesOperationListSamples.java new file mode 100644 index 0000000000000..ebc562cdbf2a4 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/ClusterExtensionTypesOperationListSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterResourceName; +import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterRp; + +/** Samples for ClusterExtensionTypesOperation List. */ +public final class ClusterExtensionTypesOperationListSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-01-01-preview/examples/ClusterExtensionTypes_List.json + */ + /** + * Sample code: ClusterExtensionTypes_List_MaximumSet_Gen. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void clusterExtensionTypesListMaximumSetGen( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .clusterExtensionTypesOperations() + .list( + "rg1", + ExtensionsClusterRp.MICROSOFT_CONTAINER_SERVICE, + ExtensionsClusterResourceName.MANAGED_CLUSTERS, + "clusterName1", + Context.NONE); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/ExtensionTypeVersionsListSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/ExtensionTypeVersionsListSamples.java new file mode 100644 index 0000000000000..71b2e50c5c0f8 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/ExtensionTypeVersionsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.generated; + +import com.azure.core.util.Context; + +/** Samples for ExtensionTypeVersions List. */ +public final class ExtensionTypeVersionsListSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-01-01-preview/examples/ExtensionTypeVersions_List.json + */ + /** + * Sample code: ExtensionTypeVersions_List_MaximumSet_Gen. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void extensionTypeVersionsListMaximumSetGen( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager.extensionTypeVersions().list("eastus", "microsoft.example", Context.NONE); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/ExtensionsCreateSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/ExtensionsCreateSamples.java index 67dd1b4067415..239f4b7a3db68 100644 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/ExtensionsCreateSamples.java +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/ExtensionsCreateSamples.java @@ -6,8 +6,7 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.ExtensionInner; -import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterResourceName; -import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterRp; +import com.azure.resourcemanager.kubernetesconfiguration.models.Plan; import com.azure.resourcemanager.kubernetesconfiguration.models.Scope; import com.azure.resourcemanager.kubernetesconfiguration.models.ScopeCluster; import java.util.HashMap; @@ -16,7 +15,7 @@ /** Samples for Extensions Create. */ public final class ExtensionsCreateSamples { /* - * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2021-09-01/examples/CreateExtension.json + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/CreateExtension.json */ /** * Sample code: Create Extension. @@ -29,8 +28,8 @@ public static void createExtension( .extensions() .create( "rg1", - ExtensionsClusterRp.MICROSOFT_KUBERNETES, - ExtensionsClusterResourceName.CONNECTED_CLUSTERS, + "Microsoft.Kubernetes", + "connectedClusters", "clusterName1", "ClusterMonitor", new ExtensionInner() @@ -48,6 +47,36 @@ public static void createExtension( Context.NONE); } + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/CreateExtensionWithPlan.json + */ + /** + * Sample code: Create Extension with Plan. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void createExtensionWithPlan( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .extensions() + .create( + "rg1", + "Microsoft.Kubernetes", + "connectedClusters", + "clusterName1", + "azureVote", + new ExtensionInner() + .withPlan( + new Plan() + .withName("azure-vote-standard") + .withPublisher("Microsoft") + .withProduct("azure-vote-standard-offer-id")) + .withExtensionType("azure-vote") + .withAutoUpgradeMinorVersion(true) + .withReleaseTrain("Preview"), + Context.NONE); + } + @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/ExtensionsDeleteSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/ExtensionsDeleteSamples.java index 6134da52f6abe..ca3786fcd6fb1 100644 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/ExtensionsDeleteSamples.java +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/ExtensionsDeleteSamples.java @@ -5,13 +5,11 @@ package com.azure.resourcemanager.kubernetesconfiguration.generated; import com.azure.core.util.Context; -import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterResourceName; -import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterRp; /** Samples for Extensions Delete. */ public final class ExtensionsDeleteSamples { /* - * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2021-09-01/examples/DeleteExtension.json + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/DeleteExtension.json */ /** * Sample code: Delete Extension. @@ -24,8 +22,8 @@ public static void deleteExtension( .extensions() .delete( "rg1", - ExtensionsClusterRp.MICROSOFT_KUBERNETES, - ExtensionsClusterResourceName.CONNECTED_CLUSTERS, + "Microsoft.Kubernetes", + "connectedClusters", "clusterName1", "ClusterMonitor", null, diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/ExtensionsGetSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/ExtensionsGetSamples.java index e3d8c2eda4162..26b17fd4f3984 100644 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/ExtensionsGetSamples.java +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/ExtensionsGetSamples.java @@ -5,13 +5,11 @@ package com.azure.resourcemanager.kubernetesconfiguration.generated; import com.azure.core.util.Context; -import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterResourceName; -import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterRp; /** Samples for Extensions Get. */ public final class ExtensionsGetSamples { /* - * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2021-09-01/examples/GetExtension.json + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/GetExtension.json */ /** * Sample code: Get Extension. @@ -23,11 +21,6 @@ public static void getExtension( manager .extensions() .getWithResponse( - "rg1", - ExtensionsClusterRp.MICROSOFT_KUBERNETES, - ExtensionsClusterResourceName.CONNECTED_CLUSTERS, - "clusterName1", - "ClusterMonitor", - Context.NONE); + "rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", "ClusterMonitor", Context.NONE); } } diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/ExtensionsListSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/ExtensionsListSamples.java index 897d784ed1d99..333ccfced705f 100644 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/ExtensionsListSamples.java +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/ExtensionsListSamples.java @@ -5,13 +5,11 @@ package com.azure.resourcemanager.kubernetesconfiguration.generated; import com.azure.core.util.Context; -import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterResourceName; -import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterRp; /** Samples for Extensions List. */ public final class ExtensionsListSamples { /* - * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2021-09-01/examples/ListExtensions.json + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/ListExtensions.json */ /** * Sample code: List Extensions. @@ -20,13 +18,6 @@ public final class ExtensionsListSamples { */ public static void listExtensions( com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { - manager - .extensions() - .list( - "rg1", - ExtensionsClusterRp.MICROSOFT_KUBERNETES, - ExtensionsClusterResourceName.CONNECTED_CLUSTERS, - "clusterName1", - Context.NONE); + manager.extensions().list("rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", Context.NONE); } } diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/ExtensionsUpdateSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/ExtensionsUpdateSamples.java index cf64a5b0d816c..57665b7ad98d3 100644 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/ExtensionsUpdateSamples.java +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/ExtensionsUpdateSamples.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.kubernetesconfiguration.generated; import com.azure.core.util.Context; -import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterResourceName; -import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterRp; import com.azure.resourcemanager.kubernetesconfiguration.models.PatchExtension; import java.util.HashMap; import java.util.Map; @@ -14,7 +12,7 @@ /** Samples for Extensions Update. */ public final class ExtensionsUpdateSamples { /* - * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2021-09-01/examples/PatchExtension.json + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/PatchExtension.json */ /** * Sample code: Update Extension. @@ -27,8 +25,8 @@ public static void updateExtension( .extensions() .update( "rg1", - ExtensionsClusterRp.MICROSOFT_KUBERNETES, - ExtensionsClusterResourceName.CONNECTED_CLUSTERS, + "Microsoft.Kubernetes", + "connectedClusters", "clusterName1", "ClusterMonitor", new PatchExtension() diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/FluxConfigOperationStatusGetSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/FluxConfigOperationStatusGetSamples.java new file mode 100644 index 0000000000000..76de78984aba1 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/FluxConfigOperationStatusGetSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.generated; + +import com.azure.core.util.Context; + +/** Samples for FluxConfigOperationStatus Get. */ +public final class FluxConfigOperationStatusGetSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/GetFluxConfigurationAsyncOperationStatus.json + */ + /** + * Sample code: FluxConfigurationAsyncOperationStatus Get. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void fluxConfigurationAsyncOperationStatusGet( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .fluxConfigOperationStatus() + .getWithResponse( + "rg1", + "Microsoft.Kubernetes", + "connectedClusters", + "clusterName1", + "srs-fluxconfig", + "99999999-9999-9999-9999-999999999999", + Context.NONE); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/FluxConfigurationsCreateOrUpdateSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/FluxConfigurationsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..cfffcacbec2d9 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/FluxConfigurationsCreateOrUpdateSamples.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.FluxConfigurationInner; +import com.azure.resourcemanager.kubernetesconfiguration.models.BucketDefinition; +import com.azure.resourcemanager.kubernetesconfiguration.models.GitRepositoryDefinition; +import com.azure.resourcemanager.kubernetesconfiguration.models.KustomizationDefinition; +import com.azure.resourcemanager.kubernetesconfiguration.models.RepositoryRefDefinition; +import com.azure.resourcemanager.kubernetesconfiguration.models.ScopeType; +import com.azure.resourcemanager.kubernetesconfiguration.models.SourceKindType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for FluxConfigurations CreateOrUpdate. */ +public final class FluxConfigurationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/CreateFluxConfiguration.json + */ + /** + * Sample code: Create Flux Configuration. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void createFluxConfiguration( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .fluxConfigurations() + .createOrUpdate( + "rg1", + "Microsoft.Kubernetes", + "connectedClusters", + "clusterName1", + "srs-fluxconfig", + new FluxConfigurationInner() + .withScope(ScopeType.CLUSTER) + .withNamespace("srs-namespace") + .withSourceKind(SourceKindType.GIT_REPOSITORY) + .withSuspend(false) + .withGitRepository( + new GitRepositoryDefinition() + .withUrl("https://github.com/Azure/arc-k8s-demo") + .withTimeoutInSeconds(600L) + .withSyncIntervalInSeconds(600L) + .withRepositoryRef(new RepositoryRefDefinition().withBranch("master")) + .withHttpsCACert("ZXhhbXBsZWNlcnRpZmljYXRl")) + .withKustomizations( + mapOf( + "srs-kustomization1", + new KustomizationDefinition() + .withPath("./test/path") + .withDependsOn(Arrays.asList()) + .withTimeoutInSeconds(600L) + .withSyncIntervalInSeconds(600L), + "srs-kustomization2", + new KustomizationDefinition() + .withPath("./other/test/path") + .withDependsOn(Arrays.asList("srs-kustomization1")) + .withTimeoutInSeconds(600L) + .withSyncIntervalInSeconds(600L) + .withRetryIntervalInSeconds(600L) + .withPrune(false))), + Context.NONE); + } + + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/CreateFluxConfigurationWithBucket.json + */ + /** + * Sample code: Create Flux Configuration with Bucket Source Kind. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void createFluxConfigurationWithBucketSourceKind( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .fluxConfigurations() + .createOrUpdate( + "rg1", + "Microsoft.Kubernetes", + "connectedClusters", + "clusterName1", + "srs-fluxconfig", + new FluxConfigurationInner() + .withScope(ScopeType.CLUSTER) + .withNamespace("srs-namespace") + .withSourceKind(SourceKindType.BUCKET) + .withSuspend(false) + .withBucket( + new BucketDefinition() + .withUrl("https://fluxminiotest.az.minio.io") + .withBucketName("flux") + .withTimeoutInSeconds(1000L) + .withSyncIntervalInSeconds(1000L) + .withAccessKey("fluxminiotest")) + .withKustomizations( + mapOf( + "srs-kustomization1", + new KustomizationDefinition() + .withPath("./test/path") + .withDependsOn(Arrays.asList()) + .withTimeoutInSeconds(600L) + .withSyncIntervalInSeconds(600L), + "srs-kustomization2", + new KustomizationDefinition() + .withPath("./other/test/path") + .withDependsOn(Arrays.asList("srs-kustomization1")) + .withTimeoutInSeconds(600L) + .withSyncIntervalInSeconds(600L) + .withRetryIntervalInSeconds(600L) + .withPrune(false))), + Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/FluxConfigurationsDeleteSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/FluxConfigurationsDeleteSamples.java new file mode 100644 index 0000000000000..5203c96c5d252 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/FluxConfigurationsDeleteSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.generated; + +import com.azure.core.util.Context; + +/** Samples for FluxConfigurations Delete. */ +public final class FluxConfigurationsDeleteSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/DeleteFluxConfiguration.json + */ + /** + * Sample code: Delete Flux Configuration. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void deleteFluxConfiguration( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .fluxConfigurations() + .delete( + "rg1", + "Microsoft.Kubernetes", + "connectedClusters", + "clusterName1", + "srs-fluxconfig", + null, + Context.NONE); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/FluxConfigurationsGetSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/FluxConfigurationsGetSamples.java new file mode 100644 index 0000000000000..dbc0b74c0f313 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/FluxConfigurationsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.generated; + +import com.azure.core.util.Context; + +/** Samples for FluxConfigurations Get. */ +public final class FluxConfigurationsGetSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/GetFluxConfiguration.json + */ + /** + * Sample code: Get Flux Configuration. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void getFluxConfiguration( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .fluxConfigurations() + .getWithResponse( + "rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", "srs-fluxconfig", Context.NONE); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/FluxConfigurationsListSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/FluxConfigurationsListSamples.java new file mode 100644 index 0000000000000..c63af333f8248 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/FluxConfigurationsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.generated; + +import com.azure.core.util.Context; + +/** Samples for FluxConfigurations List. */ +public final class FluxConfigurationsListSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/ListFluxConfigurations.json + */ + /** + * Sample code: List Flux Configuration. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void listFluxConfiguration( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .fluxConfigurations() + .list("rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", Context.NONE); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/FluxConfigurationsUpdateSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/FluxConfigurationsUpdateSamples.java new file mode 100644 index 0000000000000..c9be514f29647 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/FluxConfigurationsUpdateSamples.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.kubernetesconfiguration.models.FluxConfigurationPatch; +import com.azure.resourcemanager.kubernetesconfiguration.models.GitRepositoryPatchDefinition; +import com.azure.resourcemanager.kubernetesconfiguration.models.KustomizationPatchDefinition; +import java.util.HashMap; +import java.util.Map; + +/** Samples for FluxConfigurations Update. */ +public final class FluxConfigurationsUpdateSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/PatchFluxConfiguration.json + */ + /** + * Sample code: Patch Flux Configuration. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void patchFluxConfiguration( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .fluxConfigurations() + .update( + "rg1", + "Microsoft.Kubernetes", + "connectedClusters", + "clusterName1", + "srs-fluxconfig", + new FluxConfigurationPatch() + .withSuspend(true) + .withGitRepository( + new GitRepositoryPatchDefinition() + .withUrl("https://github.com/jonathan-innis/flux2-kustomize-helm-example.git")) + .withKustomizations( + mapOf( + "srs-kustomization1", + null, + "srs-kustomization2", + new KustomizationPatchDefinition() + .withPath("./test/alt-path") + .withSyncIntervalInSeconds(300L), + "srs-kustomization3", + new KustomizationPatchDefinition() + .withPath("./test/another-path") + .withSyncIntervalInSeconds(300L))), + Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/LocationExtensionTypesListSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/LocationExtensionTypesListSamples.java new file mode 100644 index 0000000000000..b4f8bc8ff7cfe --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/LocationExtensionTypesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.generated; + +import com.azure.core.util.Context; + +/** Samples for LocationExtensionTypes List. */ +public final class LocationExtensionTypesListSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-01-01-preview/examples/LocationExtensionTypes_List.json + */ + /** + * Sample code: LocationExtensionTypes_List_MaximumSet_Gen. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void locationExtensionTypesListMaximumSetGen( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager.locationExtensionTypes().list("eastus", Context.NONE); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/OperationStatusGetSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/OperationStatusGetSamples.java index 7ad3cbb2f816d..329655581331a 100644 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/OperationStatusGetSamples.java +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/OperationStatusGetSamples.java @@ -5,27 +5,25 @@ package com.azure.resourcemanager.kubernetesconfiguration.generated; import com.azure.core.util.Context; -import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterResourceName; -import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterRp; /** Samples for OperationStatus Get. */ public final class OperationStatusGetSamples { /* - * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2021-09-01/examples/GetAsyncOperationStatus.json + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/GetExtensionAsyncOperationStatus.json */ /** - * Sample code: AsyncOperationStatus Get. + * Sample code: ExtensionAsyncOperationStatus Get. * * @param manager Entry point to SourceControlConfigurationManager. */ - public static void asyncOperationStatusGet( + public static void extensionAsyncOperationStatusGet( com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { manager .operationStatus() .getWithResponse( "rg1", - ExtensionsClusterRp.MICROSOFT_KUBERNETES, - ExtensionsClusterResourceName.CONNECTED_CLUSTERS, + "Microsoft.Kubernetes", + "connectedClusters", "clusterName1", "ClusterMonitor", "99999999-9999-9999-9999-999999999999", diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/OperationStatusListSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/OperationStatusListSamples.java index ffa61f6e98e8f..043452252d062 100644 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/OperationStatusListSamples.java +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/OperationStatusListSamples.java @@ -5,13 +5,11 @@ package com.azure.resourcemanager.kubernetesconfiguration.generated; import com.azure.core.util.Context; -import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterResourceName; -import com.azure.resourcemanager.kubernetesconfiguration.models.ExtensionsClusterRp; /** Samples for OperationStatus List. */ public final class OperationStatusListSamples { /* - * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2021-09-01/examples/ListAsyncOperationStatus.json + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/ListAsyncOperationStatus.json */ /** * Sample code: AsyncOperationStatus List. @@ -22,11 +20,6 @@ public static void asyncOperationStatusList( com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { manager .operationStatus() - .list( - "rg1", - ExtensionsClusterRp.MICROSOFT_KUBERNETES, - ExtensionsClusterResourceName.CONNECTED_CLUSTERS, - "clusterName1", - Context.NONE); + .list("rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", Context.NONE); } } diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/OperationsListSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/OperationsListSamples.java index 696d7a1cd3671..4c86ca6e4d011 100644 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/OperationsListSamples.java +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/OperationsListSamples.java @@ -9,7 +9,7 @@ /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2021-09-01/examples/OperationsList.json + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/OperationsList.json */ /** * Sample code: BatchAccountDelete. diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..e76147611c248 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.generated; + +import com.azure.resourcemanager.kubernetesconfiguration.models.PrivateEndpointConnectionProperties; +import com.azure.resourcemanager.kubernetesconfiguration.models.PrivateLinkServiceConnectionStateProperty; + +/** Samples for PrivateEndpointConnections CreateOrUpdate. */ +public final class PrivateEndpointConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/PrivateEndpointConnectionUpdate.json + */ + /** + * Sample code: Approve or reject a private endpoint connection with a given name. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void approveOrRejectAPrivateEndpointConnectionWithAGivenName( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .privateEndpointConnections() + .define("private-endpoint-connection-name") + .withExistingPrivateLinkScope("myResourceGroup", "myPrivateLinkScope") + .withProperties( + new PrivateEndpointConnectionProperties() + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionStateProperty() + .withStatus("Approved") + .withDescription("Approved by johndoe@contoso.com"))) + .create(); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateEndpointConnectionsDeleteSamples.java new file mode 100644 index 0000000000000..02e2b88ea52d4 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateEndpointConnectionsDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/PrivateEndpointConnectionDelete.json + */ + /** + * Sample code: Deletes a private endpoint connection with a given name. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void deletesAPrivateEndpointConnectionWithAGivenName( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .privateEndpointConnections() + .delete("myResourceGroup", "myPrivateLinkScope", "private-endpoint-connection-name", Context.NONE); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateEndpointConnectionsGetSamples.java new file mode 100644 index 0000000000000..7680c1cd12b1e --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateEndpointConnectionsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/PrivateEndpointConnectionGet.json + */ + /** + * Sample code: Gets private endpoint connection. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void getsPrivateEndpointConnection( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .privateEndpointConnections() + .getWithResponse("myResourceGroup", "myPrivateLinkScope", "private-endpoint-connection-name", Context.NONE); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateEndpointConnectionsListByPrivateLinkScopeSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateEndpointConnectionsListByPrivateLinkScopeSamples.java new file mode 100644 index 0000000000000..6cb748fb95653 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateEndpointConnectionsListByPrivateLinkScopeSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections ListByPrivateLinkScope. */ +public final class PrivateEndpointConnectionsListByPrivateLinkScopeSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/PrivateEndpointConnectionList.json + */ + /** + * Sample code: Gets list of private endpoint connections on a private link scope. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void getsListOfPrivateEndpointConnectionsOnAPrivateLinkScope( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .privateEndpointConnections() + .listByPrivateLinkScope("myResourceGroup", "myPrivateLinkScope", Context.NONE); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateLinkResourcesGetSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateLinkResourcesGetSamples.java new file mode 100644 index 0000000000000..564d57ce45ceb --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateLinkResourcesGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources Get. */ +public final class PrivateLinkResourcesGetSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/PrivateLinkScopePrivateLinkResourceGet.json + */ + /** + * Sample code: Gets private endpoint connection. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void getsPrivateEndpointConnection( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .privateLinkResources() + .getWithResponse("myResourceGroup", "myPrivateLinkScope", "KubernetesConfiguration", Context.NONE); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateLinkResourcesListByPrivateLinkScopeSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateLinkResourcesListByPrivateLinkScopeSamples.java new file mode 100644 index 0000000000000..bb65dcf734ddd --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateLinkResourcesListByPrivateLinkScopeSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources ListByPrivateLinkScope. */ +public final class PrivateLinkResourcesListByPrivateLinkScopeSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/PrivateLinkScopePrivateLinkResourceListGet.json + */ + /** + * Sample code: Gets private endpoint connection. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void getsPrivateEndpointConnection( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager.privateLinkResources().listByPrivateLinkScope("myResourceGroup", "myPrivateLinkScope", Context.NONE); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateLinkScopesCreateOrUpdateSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateLinkScopesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..bbd92a7084bae --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateLinkScopesCreateOrUpdateSamples.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.generated; + +import java.util.HashMap; +import java.util.Map; + +/** Samples for PrivateLinkScopes CreateOrUpdate. */ +public final class PrivateLinkScopesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/PrivateLinkScopesCreate.json + */ + /** + * Sample code: PrivateLinkScopeCreate. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void privateLinkScopeCreate( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .privateLinkScopes() + .define("my-privatelinkscope") + .withRegion("westus") + .withExistingResourceGroup("my-resource-group") + .create(); + } + + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/PrivateLinkScopesUpdate.json + */ + /** + * Sample code: PrivateLinkScopeUpdate. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void privateLinkScopeUpdate( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .privateLinkScopes() + .define("my-privatelinkscope") + .withRegion("westus") + .withExistingResourceGroup("my-resource-group") + .withTags(mapOf("Tag1", "Value1")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateLinkScopesDeleteSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateLinkScopesDeleteSamples.java new file mode 100644 index 0000000000000..9b0fc8aecfcf3 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateLinkScopesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkScopes Delete. */ +public final class PrivateLinkScopesDeleteSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/PrivateLinkScopesDelete.json + */ + /** + * Sample code: PrivateLinkScopesDelete. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void privateLinkScopesDelete( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager.privateLinkScopes().delete("my-resource-group", "my-privatelinkscope", Context.NONE); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateLinkScopesGetByResourceGroupSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateLinkScopesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..12a6c3552f3ea --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateLinkScopesGetByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkScopes GetByResourceGroup. */ +public final class PrivateLinkScopesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/PrivateLinkScopesGet.json + */ + /** + * Sample code: PrivateLinkScopeGet. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void privateLinkScopeGet( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .privateLinkScopes() + .getByResourceGroupWithResponse("my-resource-group", "my-privatelinkscope", Context.NONE); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateLinkScopesGetValidationDetailsForMachineSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateLinkScopesGetValidationDetailsForMachineSamples.java new file mode 100644 index 0000000000000..bdcbcda8b62fb --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateLinkScopesGetValidationDetailsForMachineSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkScopes GetValidationDetailsForMachine. */ +public final class PrivateLinkScopesGetValidationDetailsForMachineSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/PrivateLinkScopesGetValidationForMachine.json + */ + /** + * Sample code: PrivateLinkScopeGet. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void privateLinkScopeGet( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .privateLinkScopes() + .getValidationDetailsForMachineWithResponse("my-resource-group", "machineName", Context.NONE); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateLinkScopesGetValidationDetailsSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateLinkScopesGetValidationDetailsSamples.java new file mode 100644 index 0000000000000..5a5674f24018f --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateLinkScopesGetValidationDetailsSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkScopes GetValidationDetails. */ +public final class PrivateLinkScopesGetValidationDetailsSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/PrivateLinkScopesGetValidation.json + */ + /** + * Sample code: PrivateLinkScopeGet. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void privateLinkScopeGet( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .privateLinkScopes() + .getValidationDetailsWithResponse("wus2", "f5dc51d3-92ed-4d7e-947a-775ea79b4919", Context.NONE); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateLinkScopesListByResourceGroupSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateLinkScopesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..949b98e17787c --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateLinkScopesListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkScopes ListByResourceGroup. */ +public final class PrivateLinkScopesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/PrivateLinkScopesListByResourceGroup.json + */ + /** + * Sample code: PrivateLinkScopeListByResourceGroup. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void privateLinkScopeListByResourceGroup( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager.privateLinkScopes().listByResourceGroup("my-resource-group", Context.NONE); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateLinkScopesListSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateLinkScopesListSamples.java new file mode 100644 index 0000000000000..6c5dd3ce1c948 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateLinkScopesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkScopes List. */ +public final class PrivateLinkScopesListSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/PrivateLinkScopesList.json + */ + /** + * Sample code: PrivateLinkScopesList.json. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void privateLinkScopesListJson( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager.privateLinkScopes().list(Context.NONE); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateLinkScopesUpdateTagsSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateLinkScopesUpdateTagsSamples.java new file mode 100644 index 0000000000000..61296e0370e84 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/PrivateLinkScopesUpdateTagsSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.kubernetesconfiguration.models.KubernetesConfigurationPrivateLinkScope; +import java.util.HashMap; +import java.util.Map; + +/** Samples for PrivateLinkScopes UpdateTags. */ +public final class PrivateLinkScopesUpdateTagsSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/preview/2022-04-02-preview/examples/PrivateLinkScopesUpdateTagsOnly.json + */ + /** + * Sample code: PrivateLinkScopeUpdateTagsOnly. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void privateLinkScopeUpdateTagsOnly( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + KubernetesConfigurationPrivateLinkScope resource = + manager + .privateLinkScopes() + .getByResourceGroupWithResponse("my-resource-group", "my-privatelinkscope", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("Tag1", "Value1", "Tag2", "Value2")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/SourceControlConfigurationsCreateOrUpdateSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/SourceControlConfigurationsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..6e8c76fa604bc --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/SourceControlConfigurationsCreateOrUpdateSamples.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.SourceControlConfigurationInner; +import com.azure.resourcemanager.kubernetesconfiguration.models.HelmOperatorProperties; +import com.azure.resourcemanager.kubernetesconfiguration.models.OperatorScopeType; +import com.azure.resourcemanager.kubernetesconfiguration.models.OperatorType; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SourceControlConfigurations CreateOrUpdate. */ +public final class SourceControlConfigurationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/CreateSourceControlConfiguration.json + */ + /** + * Sample code: Create Source Control Configuration. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void createSourceControlConfiguration( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .sourceControlConfigurations() + .createOrUpdateWithResponse( + "rg1", + "Microsoft.Kubernetes", + "connectedClusters", + "clusterName1", + "SRS_GitHubConfig", + new SourceControlConfigurationInner() + .withRepositoryUrl("git@github.com:k8sdeveloper425/flux-get-started") + .withOperatorNamespace("SRS_Namespace") + .withOperatorInstanceName("SRSGitHubFluxOp-01") + .withOperatorType(OperatorType.FLUX) + .withOperatorParams("--git-email=xyzgituser@users.srs.github.com") + .withConfigurationProtectedSettings(mapOf("protectedSetting1Key", "protectedSetting1Value")) + .withOperatorScope(OperatorScopeType.NAMESPACE) + .withSshKnownHostsContents( + "c3NoLmRldi5henVyZS5jb20gc3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBREFRQUJBQUFCQVFDN0hyMW9UV3FOcU9sekdKT2ZHSjROYWtWeUl6ZjFyWFlkNGQ3d282akJsa0x2Q0E0b2RCbEwwbURVeVowL1FVZlRUcWV1K3RtMjJnT3N2K1ZyVlRNazZ2d1JVNzVnWS95OXV0NU1iM2JSNUJWNThkS1h5cTlBOVVlQjVDYWtlaG41WmdtNngxbUtvVnlmK0ZGbjI2aVlxWEpSZ3pJWlpjWjVWNmhyRTBRZzM5a1ptNGF6NDhvMEFVYmY2U3A0U0xkdm51TWEyc1ZOd0hCYm9TN0VKa201N1hRUFZVMy9RcHlOTEhiV0Rkend0cmxTK2V6MzBTM0FkWWhMS0VPeEFHOHdlT255cnRMSkFVZW45bVRrb2w4b0lJMWVkZjdtV1diV1ZmMG5CbWx5MjErblpjbUNUSVNRQnRkY3lQYUVubzdmRlFNREQyNi9zMGxmS29iNEt3OEg=") + .withEnableHelmOperator(true) + .withHelmOperatorProperties( + new HelmOperatorProperties() + .withChartVersion("0.3.0") + .withChartValues( + "--set git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system")), + Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/SourceControlConfigurationsDeleteSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/SourceControlConfigurationsDeleteSamples.java new file mode 100644 index 0000000000000..60d189272ec27 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/SourceControlConfigurationsDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.generated; + +import com.azure.core.util.Context; + +/** Samples for SourceControlConfigurations Delete. */ +public final class SourceControlConfigurationsDeleteSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/DeleteSourceControlConfiguration.json + */ + /** + * Sample code: Delete Source Control Configuration. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void deleteSourceControlConfiguration( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .sourceControlConfigurations() + .delete( + "rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", "SRS_GitHubConfig", Context.NONE); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/SourceControlConfigurationsGetSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/SourceControlConfigurationsGetSamples.java new file mode 100644 index 0000000000000..23dbe750d4c19 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/SourceControlConfigurationsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.generated; + +import com.azure.core.util.Context; + +/** Samples for SourceControlConfigurations Get. */ +public final class SourceControlConfigurationsGetSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/GetSourceControlConfiguration.json + */ + /** + * Sample code: Get Source Control Configuration. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void getSourceControlConfiguration( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .sourceControlConfigurations() + .getWithResponse( + "rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", "SRS_GitHubConfig", Context.NONE); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/SourceControlConfigurationsListSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/SourceControlConfigurationsListSamples.java new file mode 100644 index 0000000000000..af14d84b94a8a --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/generated/SourceControlConfigurationsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.generated; + +import com.azure.core.util.Context; + +/** Samples for SourceControlConfigurations List. */ +public final class SourceControlConfigurationsListSamples { + /* + * x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/ListSourceControlConfiguration.json + */ + /** + * Sample code: List Source Control Configuration. + * + * @param manager Entry point to SourceControlConfigurationManager. + */ + public static void listSourceControlConfiguration( + com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager) { + manager + .sourceControlConfigurations() + .list("rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", Context.NONE); + } +}