From 71efb0755fe157c7ca31e216b561fc755a0eca2f Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 12 May 2025 22:25:30 +0000 Subject: [PATCH] CodeGen from PR 34249 in Azure/azure-rest-api-specs Merge d79afec79761a4a13ff3129381c938a49e8b5ed5 into 134d3fd8ae9c7a05ebb458412d029667f439b4be --- eng/automation/api-specs.yaml | 2 + eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 8 + .../README.md | 102 + .../SAMPLE.md | 390 ++++ .../pom.xml | 62 + .../FluxConfigurationManager.java | 299 +++ .../FluxConfigOperationStatusClient.java | 58 + .../fluent/FluxConfigurationClient.java | 62 + .../fluent/FluxConfigurationsClient.java | 348 ++++ .../fluent/models/FluxConfigurationInner.java | 534 +++++ .../FluxConfigurationPatchProperties.java | 332 ++++ .../models/FluxConfigurationProperties.java | 596 ++++++ .../models/OperationStatusResultInner.java | 205 ++ .../fluent/models/package-info.java | 9 + .../fluent/package-info.java | 9 + .../FluxConfigOperationStatusClientImpl.java | 250 +++ .../FluxConfigOperationStatusImpl.java | 61 + .../FluxConfigurationClientBuilder.java | 138 ++ .../FluxConfigurationClientImpl.java | 324 +++ .../implementation/FluxConfigurationImpl.java | 154 ++ .../FluxConfigurationsClientImpl.java | 1730 +++++++++++++++++ .../FluxConfigurationsImpl.java | 138 ++ .../OperationStatusResultImpl.java | 56 + .../implementation/ResourceManagerUtils.java | 195 ++ .../implementation/package-info.java | 9 + .../models/AzureBlobDefinition.java | 332 ++++ .../models/AzureBlobPatchDefinition.java | 335 ++++ .../models/BucketDefinition.java | 268 +++ .../models/BucketPatchDefinition.java | 268 +++ .../models/FluxComplianceState.java | 66 + .../models/FluxConfigOperationStatus.java | 53 + .../models/FluxConfiguration.java | 202 ++ .../models/FluxConfigurationPatch.java | 279 +++ .../models/FluxConfigurations.java | 203 ++ .../models/FluxConfigurationsList.java | 105 + .../models/GitRepositoryDefinition.java | 331 ++++ .../models/GitRepositoryPatchDefinition.java | 332 ++++ .../HelmReleasePropertiesDefinition.java | 213 ++ .../models/KustomizationDefinition.java | 349 ++++ .../models/KustomizationPatchDefinition.java | 334 ++++ .../models/LayerSelectorDefinition.java | 124 ++ .../models/LayerSelectorPatchDefinition.java | 124 ++ .../models/ManagedIdentityDefinition.java | 93 + .../ManagedIdentityPatchDefinition.java | 94 + .../models/MatchOidcIdentityDefinition.java | 121 ++ .../MatchOidcIdentityPatchDefinition.java | 122 ++ .../models/ObjectReferenceDefinition.java | 121 ++ .../ObjectStatusConditionDefinition.java | 213 ++ .../models/ObjectStatusDefinition.java | 282 +++ .../models/OciRepositoryDefinition.java | 395 ++++ .../models/OciRepositoryPatchDefinition.java | 398 ++++ .../models/OciRepositoryRefDefinition.java | 154 ++ .../OciRepositoryRefPatchDefinition.java | 155 ++ .../models/OperationStatusResult.java | 57 + .../models/OperationType.java | 51 + .../models/PostBuildDefinition.java | 132 ++ .../models/PostBuildPatchDefinition.java | 132 ++ .../models/ProviderType.java | 56 + .../models/ProvisioningState.java | 71 + .../models/RepositoryRefDefinition.java | 182 ++ .../models/ScopeType.java | 51 + .../models/ServicePrincipalDefinition.java | 239 +++ .../ServicePrincipalPatchDefinition.java | 240 +++ .../models/SourceKindType.java | 61 + .../models/SubstituteFromDefinition.java | 151 ++ .../models/SubstituteFromPatchDefinition.java | 152 ++ .../models/TlsConfigDefinition.java | 151 ++ .../models/TlsConfigPatchDefinition.java | 151 ++ .../models/VerifyDefinition.java | 161 ++ .../models/VerifyPatchDefinition.java | 161 ++ .../models/package-info.java | 9 + .../package-info.java | 9 + .../src/main/java/module-info.java | 15 + .../proxy-config.json | 1 + .../reflect-config.json | 1 + ...ubernetesconfigurationfluxconfi.properties | 1 + .../FluxConfigOperationStatusGetSamples.java | 27 + .../FluxConfigurationsCreateOrUpdateSam.java | 223 +++ .../FluxConfigurationsDeleteSamples.java | 27 + .../FluxConfigurationsGetSamples.java | 27 + .../FluxConfigurationsListSamples.java | 26 + .../FluxConfigurationsUpdateSamples.java | 52 + sdk/kubernetesconfigurationfluxconfi/ci.yml | 46 + sdk/kubernetesconfigurationfluxconfi/pom.xml | 15 + 86 files changed, 14817 insertions(+) create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/CHANGELOG.md create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/README.md create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/SAMPLE.md create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/pom.xml create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/FluxConfigurationManager.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/fluent/FluxConfigOperationStatusClient.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/fluent/FluxConfigurationClient.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/fluent/FluxConfigurationsClient.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/fluent/models/FluxConfigurationInner.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/fluent/models/FluxConfigurationPatchProperties.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/fluent/models/FluxConfigurationProperties.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/fluent/models/OperationStatusResultInner.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/fluent/models/package-info.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/fluent/package-info.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/FluxConfigOperationStatusClientImpl.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/FluxConfigOperationStatusImpl.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/FluxConfigurationClientBuilder.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/FluxConfigurationClientImpl.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/FluxConfigurationImpl.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/FluxConfigurationsClientImpl.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/FluxConfigurationsImpl.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/OperationStatusResultImpl.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/ResourceManagerUtils.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/package-info.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/AzureBlobDefinition.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/AzureBlobPatchDefinition.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/BucketDefinition.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/BucketPatchDefinition.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/FluxComplianceState.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/FluxConfigOperationStatus.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/FluxConfiguration.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/FluxConfigurationPatch.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/FluxConfigurations.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/FluxConfigurationsList.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/GitRepositoryDefinition.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/GitRepositoryPatchDefinition.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/HelmReleasePropertiesDefinition.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/KustomizationDefinition.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/KustomizationPatchDefinition.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/LayerSelectorDefinition.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/LayerSelectorPatchDefinition.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ManagedIdentityDefinition.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ManagedIdentityPatchDefinition.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/MatchOidcIdentityDefinition.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/MatchOidcIdentityPatchDefinition.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ObjectReferenceDefinition.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ObjectStatusConditionDefinition.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ObjectStatusDefinition.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/OciRepositoryDefinition.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/OciRepositoryPatchDefinition.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/OciRepositoryRefDefinition.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/OciRepositoryRefPatchDefinition.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/OperationStatusResult.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/OperationType.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/PostBuildDefinition.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/PostBuildPatchDefinition.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ProviderType.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ProvisioningState.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/RepositoryRefDefinition.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ScopeType.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ServicePrincipalDefinition.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ServicePrincipalPatchDefinition.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/SourceKindType.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/SubstituteFromDefinition.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/SubstituteFromPatchDefinition.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/TlsConfigDefinition.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/TlsConfigPatchDefinition.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/VerifyDefinition.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/VerifyPatchDefinition.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/package-info.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/package-info.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/module-info.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-kubernetesconfigurationfluxconfi/proxy-config.json create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-kubernetesconfigurationfluxconfi/reflect-config.json create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/resources/azure-resourcemanager-kubernetesconfigurationfluxconfi.properties create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/generated/FluxConfigOperationStatusGetSamples.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/generated/FluxConfigurationsCreateOrUpdateSam.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/generated/FluxConfigurationsDeleteSamples.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/generated/FluxConfigurationsGetSamples.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/generated/FluxConfigurationsListSamples.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/generated/FluxConfigurationsUpdateSamples.java create mode 100644 sdk/kubernetesconfigurationfluxconfi/ci.yml create mode 100644 sdk/kubernetesconfigurationfluxconfi/pom.xml diff --git a/eng/automation/api-specs.yaml b/eng/automation/api-specs.yaml index e1784ce597af..3081dca4141f 100644 --- a/eng/automation/api-specs.yaml +++ b/eng/automation/api-specs.yaml @@ -66,6 +66,8 @@ informatica: service: informaticadatamanagement keyvault: suffix: generated +kubernetesconfiguration/Microsoft.KubernetesConfiguration/fluxConfigurations: + service: kubernetesconfigurationfluxconfi liftrastronomer: service: astro liftrqumulo: diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 5c15727540dd..d5111da698a5 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -483,6 +483,7 @@ com.azure.resourcemanager:azure-resourcemanager-programmableconnectivity;1.0.0-b com.azure.resourcemanager:azure-resourcemanager-dell-storage;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-sitemanager;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-mongodbatlas;1.0.0-beta.1;1.0.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-kubernetesconfigurationfluxconfi;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0;1.1.0-beta.1 com.azure.v2:azure-client-sdk-parent;2.0.0-beta.1;2.0.0-beta.1 diff --git a/pom.xml b/pom.xml index a0c18e0cb24e..6893ae3d0fc9 100644 --- a/pom.xml +++ b/pom.xml @@ -130,6 +130,7 @@ sdk/iotoperations sdk/keyvault sdk/kubernetesconfiguration + sdk/kubernetesconfigurationfluxconfi sdk/kusto sdk/labservices sdk/lambdatesthyperexecute diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/CHANGELOG.md b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/CHANGELOG.md new file mode 100644 index 000000000000..aa4e65a17448 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/CHANGELOG.md @@ -0,0 +1,8 @@ +# Release History + +## 1.0.0-beta.1 (2025-05-12) + +- Azure Resource Manager FluxConfiguration client library for Java. This package contains Microsoft Azure SDK for FluxConfiguration Management SDK. KubernetesConfiguration Flux Client. Package tag package-2025-04. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +### Features Added + +- Initial release for the azure-resourcemanager-kubernetesconfigurationfluxconfi Java SDK. diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/README.md b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/README.md new file mode 100644 index 000000000000..beda1bcefefa --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager FluxConfiguration client library for Java + +Azure Resource Manager FluxConfiguration client library for Java. + +This package contains Microsoft Azure SDK for FluxConfiguration Management SDK. KubernetesConfiguration Flux Client. Package tag package-2025-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 + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-kubernetesconfigurationfluxconfi;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-kubernetesconfigurationfluxconfi + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. + +### Authentication + +Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package. + +Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. + +Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: + +```java +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +FluxConfigurationManager manager = FluxConfigurationManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/SAMPLE.md b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/SAMPLE.md new file mode 100644 index 000000000000..d8d6f4edf64c --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/SAMPLE.md @@ -0,0 +1,390 @@ +# Code snippets and samples + + +## FluxConfigOperationStatus + +- [Get](#fluxconfigoperationstatus_get) + +## FluxConfigurations + +- [CreateOrUpdate](#fluxconfigurations_createorupdate) +- [Delete](#fluxconfigurations_delete) +- [Get](#fluxconfigurations_get) +- [List](#fluxconfigurations_list) +- [Update](#fluxconfigurations_update) +### FluxConfigOperationStatus_Get + +```java +/** + * Samples for FluxConfigurations Get. + */ +public final class FluxConfigurationsGetSamples { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/fluxConfigurations/ + * stable/2025-04-01/examples/GetFluxConfiguration.json + */ + /** + * Sample code: Get Flux Configuration. + * + * @param manager Entry point to FluxConfigurationManager. + */ + public static void getFluxConfiguration( + com.azure.resourcemanager.kubernetesconfigurationfluxconfi.FluxConfigurationManager manager) { + manager.fluxConfigurations() + .getWithResponse("rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", "srs-fluxconfig", + com.azure.core.util.Context.NONE); + } +} +``` + +### FluxConfigurations_CreateOrUpdate + +```java +/** + * Samples for FluxConfigOperationStatus Get. + */ +public final class FluxConfigOperationStatusGetSamples { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/fluxConfigurations/ + * stable/2025-04-01/examples/GetFluxConfigurationAsyncOperationStatus.json + */ + /** + * Sample code: FluxConfigurationAsyncOperationStatus Get. + * + * @param manager Entry point to FluxConfigurationManager. + */ + public static void fluxConfigurationAsyncOperationStatusGet( + com.azure.resourcemanager.kubernetesconfigurationfluxconfi.FluxConfigurationManager manager) { + manager.fluxConfigOperationStatus() + .getWithResponse("rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", "srs-fluxconfig", + "99999999-9999-9999-9999-999999999999", com.azure.core.util.Context.NONE); + } +} +``` + +### FluxConfigurations_Delete + +```java +/** + * Samples for FluxConfigurations Delete. + */ +public final class FluxConfigurationsDeleteSamples { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/fluxConfigurations/ + * stable/2025-04-01/examples/DeleteFluxConfiguration.json + */ + /** + * Sample code: Delete Flux Configuration. + * + * @param manager Entry point to FluxConfigurationManager. + */ + public static void deleteFluxConfiguration( + com.azure.resourcemanager.kubernetesconfigurationfluxconfi.FluxConfigurationManager manager) { + manager.fluxConfigurations() + .delete("rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", "srs-fluxconfig", null, + com.azure.core.util.Context.NONE); + } +} +``` + +### FluxConfigurations_Get + +```java +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.fluent.models.FluxConfigurationInner; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.BucketDefinition; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.GitRepositoryDefinition; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.KustomizationDefinition; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.OciRepositoryDefinition; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.PostBuildDefinition; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.ProviderType; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.RepositoryRefDefinition; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.ScopeType; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.SourceKindType; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.SubstituteFromDefinition; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for FluxConfigurations CreateOrUpdate. + */ +public final class FluxConfigurationsCreateOrUpdateSam { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/fluxConfigurations/ + * stable/2025-04-01/examples/CreateFluxConfigurationWithOCIRepository.json + */ + /** + * Sample code: Create Flux Configuration with OCIRepository Source Kind. + * + * @param manager Entry point to FluxConfigurationManager. + */ + public static void createFluxConfigurationWithOCIRepositorySourceKind( + com.azure.resourcemanager.kubernetesconfigurationfluxconfi.FluxConfigurationManager manager) { + manager.fluxConfigurations() + .createOrUpdate("rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", "srs-fluxconfig", + new FluxConfigurationInner().withScope(ScopeType.CLUSTER) + .withNamespace("srs-namespace") + .withSourceKind(SourceKindType.OCIREPOSITORY) + .withSuspend(false) + .withOciRepository( + new OciRepositoryDefinition().withUrl("oci://ghcr.io/stefanprodan/manifests/podinfo") + .withTimeoutInSeconds(1000L) + .withSyncIntervalInSeconds(1000L) + .withServiceAccountName("testserviceaccount")) + .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))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/fluxConfigurations/ + * stable/2025-04-01/examples/CreateFluxConfiguration.json + */ + /** + * Sample code: Create Flux Configuration. + * + * @param manager Entry point to FluxConfigurationManager. + */ + public static void createFluxConfiguration( + com.azure.resourcemanager.kubernetesconfigurationfluxconfi.FluxConfigurationManager 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) + .withEnableWait(true) + .withPostBuild(new PostBuildDefinition() + .withSubstitute(mapOf("cluster_env", "prod", "replica_count", "2")) + .withSubstituteFrom(Arrays.asList(new SubstituteFromDefinition().withKind("ConfigMap") + .withName("cluster-test") + .withOptional(true)))), + "srs-kustomization2", + new KustomizationDefinition().withPath("./other/test/path") + .withDependsOn(Arrays.asList("srs-kustomization1")) + .withTimeoutInSeconds(600L) + .withSyncIntervalInSeconds(600L) + .withRetryIntervalInSeconds(600L) + .withPrune(false) + .withEnableWait(false) + .withPostBuild(new PostBuildDefinition().withSubstituteFrom(Arrays.asList( + new SubstituteFromDefinition().withKind("ConfigMap") + .withName("cluster-values") + .withOptional(true), + new SubstituteFromDefinition().withKind("Secret") + .withName("secret-name") + .withOptional(false)))))) + .withWaitForReconciliation(true) + .withReconciliationWaitDuration("PT30M"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/fluxConfigurations/ + * stable/2025-04-01/examples/CreateFluxConfigurationWithProvider.json + */ + /** + * Sample code: Create Flux Configuration with Git Repository Provider. + * + * @param manager Entry point to FluxConfigurationManager. + */ + public static void createFluxConfigurationWithGitRepositoryProvider( + com.azure.resourcemanager.kubernetesconfigurationfluxconfi.FluxConfigurationManager 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://dev.azure.com/org/proj/_git/arc-k8s-demo") + .withTimeoutInSeconds(600L) + .withSyncIntervalInSeconds(600L) + .withRepositoryRef(new RepositoryRefDefinition().withBranch("master")) + .withHttpsCACert("ZXhhbXBsZWNlcnRpZmljYXRl") + .withProvider(ProviderType.AZURE)) + .withKustomizations(mapOf("srs-kustomization1", + new KustomizationDefinition().withPath("./test/path") + .withDependsOn(Arrays.asList()) + .withTimeoutInSeconds(600L) + .withSyncIntervalInSeconds(600L) + .withEnableWait(true) + .withPostBuild(new PostBuildDefinition() + .withSubstitute(mapOf("cluster_env", "prod", "replica_count", "2")) + .withSubstituteFrom(Arrays.asList(new SubstituteFromDefinition().withKind("ConfigMap") + .withName("cluster-test") + .withOptional(true)))), + "srs-kustomization2", + new KustomizationDefinition().withPath("./other/test/path") + .withDependsOn(Arrays.asList("srs-kustomization1")) + .withTimeoutInSeconds(600L) + .withSyncIntervalInSeconds(600L) + .withRetryIntervalInSeconds(600L) + .withPrune(false) + .withEnableWait(false) + .withPostBuild(new PostBuildDefinition().withSubstituteFrom(Arrays.asList( + new SubstituteFromDefinition().withKind("ConfigMap") + .withName("cluster-values") + .withOptional(true), + new SubstituteFromDefinition().withKind("Secret") + .withName("secret-name") + .withOptional(false)))))) + .withWaitForReconciliation(true) + .withReconciliationWaitDuration("PT30M"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/fluxConfigurations/ + * stable/2025-04-01/examples/CreateFluxConfigurationWithBucket.json + */ + /** + * Sample code: Create Flux Configuration with Bucket Source Kind. + * + * @param manager Entry point to FluxConfigurationManager. + */ + public static void createFluxConfigurationWithBucketSourceKind( + com.azure.resourcemanager.kubernetesconfigurationfluxconfi.FluxConfigurationManager 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("fakeTokenPlaceholder")) + .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))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @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_List + +```java +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.FluxConfigurationPatch; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.GitRepositoryPatchDefinition; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.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/fluxConfigurations/ + * stable/2025-04-01/examples/PatchFluxConfiguration.json + */ + /** + * Sample code: Patch Flux Configuration. + * + * @param manager Entry point to FluxConfigurationManager. + */ + public static void patchFluxConfiguration( + com.azure.resourcemanager.kubernetesconfigurationfluxconfi.FluxConfigurationManager 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))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @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_Update + +```java +/** + * Samples for FluxConfigurations List. + */ +public final class FluxConfigurationsListSamples { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/fluxConfigurations/ + * stable/2025-04-01/examples/ListFluxConfigurations.json + */ + /** + * Sample code: List Flux Configuration. + * + * @param manager Entry point to FluxConfigurationManager. + */ + public static void listFluxConfiguration( + com.azure.resourcemanager.kubernetesconfigurationfluxconfi.FluxConfigurationManager manager) { + manager.fluxConfigurations() + .list("rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/pom.xml b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/pom.xml new file mode 100644 index 000000000000..4e2c598906f1 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/pom.xml @@ -0,0 +1,62 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-kubernetesconfigurationfluxconfi + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for FluxConfiguration Management + This package contains Microsoft Azure SDK for FluxConfiguration Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. KubernetesConfiguration Flux Client. Package tag package-2025-04. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + 0 + 0 + true + + + + com.azure + azure-core + 1.55.3 + + + com.azure + azure-core-management + 1.17.0 + + + diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/FluxConfigurationManager.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/FluxConfigurationManager.java new file mode 100644 index 000000000000..48ef4bbe6a27 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/FluxConfigurationManager.java @@ -0,0 +1,299 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.fluent.FluxConfigurationClient; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.implementation.FluxConfigOperationStatusImpl; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.implementation.FluxConfigurationClientBuilder; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.implementation.FluxConfigurationsImpl; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.FluxConfigOperationStatus; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.FluxConfigurations; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * Entry point to FluxConfigurationManager. + * KubernetesConfiguration Flux Client. + */ +public final class FluxConfigurationManager { + private FluxConfigurations fluxConfigurations; + + private FluxConfigOperationStatus fluxConfigOperationStatus; + + private final FluxConfigurationClient clientObject; + + private FluxConfigurationManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = new FluxConfigurationClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of FluxConfiguration service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the FluxConfiguration service API instance. + */ + public static FluxConfigurationManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Creates an instance of FluxConfiguration service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the FluxConfiguration service API instance. + */ + public static FluxConfigurationManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new FluxConfigurationManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create FluxConfigurationManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new FluxConfigurationManager.Configurable(); + } + + /** + * The Configurable allowing configurations to be set. + */ + public static final class Configurable { + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-kubernetesconfigurationfluxconfi.properties"); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private RetryOptions retryOptions; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the retry options for the HTTP pipeline retry policy. + *

+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval + = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of FluxConfiguration service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the FluxConfiguration service API instance. + */ + public FluxConfigurationManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder.append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.kubernetesconfigurationfluxconfi") + .append("/") + .append(clientVersion); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder.append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + policies.add(new RequestIdPolicy()); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new FluxConfigurationManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of FluxConfigurations. + * + * @return Resource collection API of FluxConfigurations. + */ + public FluxConfigurations fluxConfigurations() { + if (this.fluxConfigurations == null) { + this.fluxConfigurations = new FluxConfigurationsImpl(clientObject.getFluxConfigurations(), this); + } + return fluxConfigurations; + } + + /** + * Gets the resource collection API of FluxConfigOperationStatus. + * + * @return Resource collection API of FluxConfigOperationStatus. + */ + public FluxConfigOperationStatus fluxConfigOperationStatus() { + if (this.fluxConfigOperationStatus == null) { + this.fluxConfigOperationStatus + = new FluxConfigOperationStatusImpl(clientObject.getFluxConfigOperationStatus(), this); + } + return fluxConfigOperationStatus; + } + + /** + * Gets wrapped service client FluxConfigurationClient providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + * + * @return Wrapped service client FluxConfigurationClient. + */ + public FluxConfigurationClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/fluent/FluxConfigOperationStatusClient.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/fluent/FluxConfigOperationStatusClient.java new file mode 100644 index 000000000000..767992c6372c --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/fluent/FluxConfigOperationStatusClient.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.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.kubernetesconfigurationfluxconfi.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, appliances. + * @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); + + /** + * 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, appliances. + * @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); +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/fluent/FluxConfigurationClient.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/fluent/FluxConfigurationClient.java new file mode 100644 index 000000000000..46bfa004fd95 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/fluent/FluxConfigurationClient.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.kubernetesconfigurationfluxconfi.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** + * The interface for FluxConfigurationClient class. + */ +public interface FluxConfigurationClient { + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * 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(); +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/fluent/FluxConfigurationsClient.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/fluent/FluxConfigurationsClient.java new file mode 100644 index 000000000000..d265ab3ec7c1 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/fluent/FluxConfigurationsClient.java @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.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.kubernetesconfigurationfluxconfi.fluent.models.FluxConfigurationInner; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.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, appliances. + * @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); + + /** + * 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, appliances. + * @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); + + /** + * 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, appliances. + * @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, appliances. + * @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, appliances. + * @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, appliances. + * @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, appliances. + * @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, appliances. + * @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, appliances. + * @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, appliances. + * @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, appliances. + * @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 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); + + /** + * 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, appliances. + * @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, appliances. + * @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, appliances. + * @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, appliances. + * @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, appliances. + * @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/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/fluent/models/FluxConfigurationInner.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/fluent/models/FluxConfigurationInner.java new file mode 100644 index 000000000000..70300bbf7027 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/fluent/models/FluxConfigurationInner.java @@ -0,0 +1,534 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.AzureBlobDefinition; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.BucketDefinition; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.FluxComplianceState; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.GitRepositoryDefinition; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.KustomizationDefinition; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.ObjectStatusDefinition; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.OciRepositoryDefinition; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.ProvisioningState; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.ScopeType; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.SourceKindType; +import java.io.IOException; +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 { + /* + * Properties to create a Flux Configuration resource + */ + 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 + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of FluxConfigurationInner class. + */ + public FluxConfigurationInner() { + } + + /** + * 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 type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * 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 azureBlob property: Parameters to reconcile to the AzureBlob source kind type. + * + * @return the azureBlob value. + */ + public AzureBlobDefinition azureBlob() { + return this.innerProperties() == null ? null : this.innerProperties().azureBlob(); + } + + /** + * Set the azureBlob property: Parameters to reconcile to the AzureBlob source kind type. + * + * @param azureBlob the azureBlob value to set. + * @return the FluxConfigurationInner object itself. + */ + public FluxConfigurationInner withAzureBlob(AzureBlobDefinition azureBlob) { + if (this.innerProperties() == null) { + this.innerProperties = new FluxConfigurationProperties(); + } + this.innerProperties().withAzureBlob(azureBlob); + return this; + } + + /** + * Get the ociRepository property: Parameters to reconcile to the OCIRepository source kind type. + * + * @return the ociRepository value. + */ + public OciRepositoryDefinition ociRepository() { + return this.innerProperties() == null ? null : this.innerProperties().ociRepository(); + } + + /** + * Set the ociRepository property: Parameters to reconcile to the OCIRepository source kind type. + * + * @param ociRepository the ociRepository value to set. + * @return the FluxConfigurationInner object itself. + */ + public FluxConfigurationInner withOciRepository(OciRepositoryDefinition ociRepository) { + if (this.innerProperties() == null) { + this.innerProperties = new FluxConfigurationProperties(); + } + this.innerProperties().withOciRepository(ociRepository); + 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 waitForReconciliation property: Whether flux configuration deployment should wait for cluster to + * reconcile the kustomizations. + * + * @return the waitForReconciliation value. + */ + public Boolean waitForReconciliation() { + return this.innerProperties() == null ? null : this.innerProperties().waitForReconciliation(); + } + + /** + * Set the waitForReconciliation property: Whether flux configuration deployment should wait for cluster to + * reconcile the kustomizations. + * + * @param waitForReconciliation the waitForReconciliation value to set. + * @return the FluxConfigurationInner object itself. + */ + public FluxConfigurationInner withWaitForReconciliation(Boolean waitForReconciliation) { + if (this.innerProperties() == null) { + this.innerProperties = new FluxConfigurationProperties(); + } + this.innerProperties().withWaitForReconciliation(waitForReconciliation); + return this; + } + + /** + * Get the reconciliationWaitDuration property: Maximum duration to wait for flux configuration reconciliation. E.g + * PT1H, PT5M, P1D. + * + * @return the reconciliationWaitDuration value. + */ + public String reconciliationWaitDuration() { + return this.innerProperties() == null ? null : this.innerProperties().reconciliationWaitDuration(); + } + + /** + * Set the reconciliationWaitDuration property: Maximum duration to wait for flux configuration reconciliation. E.g + * PT1H, PT5M, P1D. + * + * @param reconciliationWaitDuration the reconciliationWaitDuration value to set. + * @return the FluxConfigurationInner object itself. + */ + public FluxConfigurationInner withReconciliationWaitDuration(String reconciliationWaitDuration) { + if (this.innerProperties() == null) { + this.innerProperties = new FluxConfigurationProperties(); + } + this.innerProperties().withReconciliationWaitDuration(reconciliationWaitDuration); + return this; + } + + /** + * 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FluxConfigurationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FluxConfigurationInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FluxConfigurationInner. + */ + public static FluxConfigurationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FluxConfigurationInner deserializedFluxConfigurationInner = new FluxConfigurationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedFluxConfigurationInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedFluxConfigurationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedFluxConfigurationInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedFluxConfigurationInner.innerProperties = FluxConfigurationProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedFluxConfigurationInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFluxConfigurationInner; + }); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/fluent/models/FluxConfigurationPatchProperties.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/fluent/models/FluxConfigurationPatchProperties.java new file mode 100644 index 000000000000..3d428dfcc82b --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/fluent/models/FluxConfigurationPatchProperties.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.kubernetesconfigurationfluxconfi.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.AzureBlobPatchDefinition; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.BucketPatchDefinition; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.GitRepositoryPatchDefinition; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.KustomizationPatchDefinition; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.OciRepositoryPatchDefinition; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.SourceKindType; +import java.io.IOException; +import java.util.Map; + +/** + * Updatable properties of an Flux Configuration Patch Request. + */ +@Fluent +public final class FluxConfigurationPatchProperties implements JsonSerializable { + /* + * Source Kind to pull the configuration data from. + */ + private SourceKindType sourceKind; + + /* + * Whether this configuration should suspend its reconciliation of its kustomizations and sources. + */ + private Boolean suspend; + + /* + * Parameters to reconcile to the GitRepository source kind type. + */ + private GitRepositoryPatchDefinition gitRepository; + + /* + * Parameters to reconcile to the Bucket source kind type. + */ + private BucketPatchDefinition bucket; + + /* + * Parameters to reconcile to the AzureBlob source kind type. + */ + private AzureBlobPatchDefinition azureBlob; + + /* + * Parameters to reconcile to the OCIRepository source kind type. + */ + private OciRepositoryPatchDefinition ociRepository; + + /* + * Array of kustomizations used to reconcile the artifact pulled by the source type on the cluster. + */ + private Map kustomizations; + + /* + * Key-value pairs of protected configuration settings for the configuration + */ + private Map configurationProtectedSettings; + + /** + * Creates an instance of FluxConfigurationPatchProperties class. + */ + public FluxConfigurationPatchProperties() { + } + + /** + * 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 azureBlob property: Parameters to reconcile to the AzureBlob source kind type. + * + * @return the azureBlob value. + */ + public AzureBlobPatchDefinition azureBlob() { + return this.azureBlob; + } + + /** + * Set the azureBlob property: Parameters to reconcile to the AzureBlob source kind type. + * + * @param azureBlob the azureBlob value to set. + * @return the FluxConfigurationPatchProperties object itself. + */ + public FluxConfigurationPatchProperties withAzureBlob(AzureBlobPatchDefinition azureBlob) { + this.azureBlob = azureBlob; + return this; + } + + /** + * Get the ociRepository property: Parameters to reconcile to the OCIRepository source kind type. + * + * @return the ociRepository value. + */ + public OciRepositoryPatchDefinition ociRepository() { + return this.ociRepository; + } + + /** + * Set the ociRepository property: Parameters to reconcile to the OCIRepository source kind type. + * + * @param ociRepository the ociRepository value to set. + * @return the FluxConfigurationPatchProperties object itself. + */ + public FluxConfigurationPatchProperties withOciRepository(OciRepositoryPatchDefinition ociRepository) { + this.ociRepository = ociRepository; + 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 (azureBlob() != null) { + azureBlob().validate(); + } + if (ociRepository() != null) { + ociRepository().validate(); + } + if (kustomizations() != null) { + kustomizations().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sourceKind", this.sourceKind == null ? null : this.sourceKind.toString()); + jsonWriter.writeBooleanField("suspend", this.suspend); + jsonWriter.writeJsonField("gitRepository", this.gitRepository); + jsonWriter.writeJsonField("bucket", this.bucket); + jsonWriter.writeJsonField("azureBlob", this.azureBlob); + jsonWriter.writeJsonField("ociRepository", this.ociRepository); + jsonWriter.writeMapField("kustomizations", this.kustomizations, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeMapField("configurationProtectedSettings", this.configurationProtectedSettings, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FluxConfigurationPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FluxConfigurationPatchProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FluxConfigurationPatchProperties. + */ + public static FluxConfigurationPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FluxConfigurationPatchProperties deserializedFluxConfigurationPatchProperties + = new FluxConfigurationPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sourceKind".equals(fieldName)) { + deserializedFluxConfigurationPatchProperties.sourceKind + = SourceKindType.fromString(reader.getString()); + } else if ("suspend".equals(fieldName)) { + deserializedFluxConfigurationPatchProperties.suspend = reader.getNullable(JsonReader::getBoolean); + } else if ("gitRepository".equals(fieldName)) { + deserializedFluxConfigurationPatchProperties.gitRepository + = GitRepositoryPatchDefinition.fromJson(reader); + } else if ("bucket".equals(fieldName)) { + deserializedFluxConfigurationPatchProperties.bucket = BucketPatchDefinition.fromJson(reader); + } else if ("azureBlob".equals(fieldName)) { + deserializedFluxConfigurationPatchProperties.azureBlob = AzureBlobPatchDefinition.fromJson(reader); + } else if ("ociRepository".equals(fieldName)) { + deserializedFluxConfigurationPatchProperties.ociRepository + = OciRepositoryPatchDefinition.fromJson(reader); + } else if ("kustomizations".equals(fieldName)) { + Map kustomizations + = reader.readMap(reader1 -> KustomizationPatchDefinition.fromJson(reader1)); + deserializedFluxConfigurationPatchProperties.kustomizations = kustomizations; + } else if ("configurationProtectedSettings".equals(fieldName)) { + Map configurationProtectedSettings = reader.readMap(reader1 -> reader1.getString()); + deserializedFluxConfigurationPatchProperties.configurationProtectedSettings + = configurationProtectedSettings; + } else { + reader.skipChildren(); + } + } + + return deserializedFluxConfigurationPatchProperties; + }); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/fluent/models/FluxConfigurationProperties.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/fluent/models/FluxConfigurationProperties.java new file mode 100644 index 000000000000..eef9f5254764 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/fluent/models/FluxConfigurationProperties.java @@ -0,0 +1,596 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.AzureBlobDefinition; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.BucketDefinition; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.FluxComplianceState; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.GitRepositoryDefinition; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.KustomizationDefinition; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.ObjectStatusDefinition; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.OciRepositoryDefinition; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.ProvisioningState; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.ScopeType; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.SourceKindType; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * Properties to create a Flux Configuration resource. + */ +@Fluent +public final class FluxConfigurationProperties implements JsonSerializable { + /* + * Scope at which the operator will be installed. + */ + private ScopeType scope; + + /* + * The namespace to which this configuration is installed to. Maximum of 253 lower case alphanumeric characters, + * hyphen and period only. + */ + private String namespace; + + /* + * Source Kind to pull the configuration data from. + */ + private SourceKindType sourceKind; + + /* + * Whether this configuration should suspend its reconciliation of its kustomizations and sources. + */ + private Boolean suspend; + + /* + * Parameters to reconcile to the GitRepository source kind type. + */ + private GitRepositoryDefinition gitRepository; + + /* + * Parameters to reconcile to the Bucket source kind type. + */ + private BucketDefinition bucket; + + /* + * Parameters to reconcile to the AzureBlob source kind type. + */ + private AzureBlobDefinition azureBlob; + + /* + * Parameters to reconcile to the OCIRepository source kind type. + */ + private OciRepositoryDefinition ociRepository; + + /* + * Array of kustomizations used to reconcile the artifact pulled by the source type on the cluster. + */ + private Map kustomizations; + + /* + * Key-value pairs of protected configuration settings for the configuration + */ + private Map configurationProtectedSettings; + + /* + * Statuses of the Flux Kubernetes resources created by the fluxConfiguration or created by the managed objects + * provisioned by the fluxConfiguration. + */ + private List statuses; + + /* + * Public Key associated with this fluxConfiguration (either generated within the cluster or provided by the user). + */ + private String repositoryPublicKey; + + /* + * Branch and/or SHA of the source commit synced with the cluster. + */ + private String sourceSyncedCommitId; + + /* + * Datetime the fluxConfiguration synced its source on the cluster. + */ + private OffsetDateTime sourceUpdatedAt; + + /* + * Datetime the fluxConfiguration synced its status on the cluster with Azure. + */ + private OffsetDateTime statusUpdatedAt; + + /* + * Whether flux configuration deployment should wait for cluster to reconcile the kustomizations. + */ + private Boolean waitForReconciliation; + + /* + * Maximum duration to wait for flux configuration reconciliation. E.g PT1H, PT5M, P1D + */ + private String reconciliationWaitDuration; + + /* + * Combined status of the Flux Kubernetes resources created by the fluxConfiguration or created by the managed + * objects. + */ + private FluxComplianceState complianceState; + + /* + * Status of the creation of the fluxConfiguration. + */ + private ProvisioningState provisioningState; + + /* + * Error message returned to the user in the case of provisioning failure. + */ + private String errorMessage; + + /** + * Creates an instance of FluxConfigurationProperties class. + */ + public FluxConfigurationProperties() { + } + + /** + * 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 azureBlob property: Parameters to reconcile to the AzureBlob source kind type. + * + * @return the azureBlob value. + */ + public AzureBlobDefinition azureBlob() { + return this.azureBlob; + } + + /** + * Set the azureBlob property: Parameters to reconcile to the AzureBlob source kind type. + * + * @param azureBlob the azureBlob value to set. + * @return the FluxConfigurationProperties object itself. + */ + public FluxConfigurationProperties withAzureBlob(AzureBlobDefinition azureBlob) { + this.azureBlob = azureBlob; + return this; + } + + /** + * Get the ociRepository property: Parameters to reconcile to the OCIRepository source kind type. + * + * @return the ociRepository value. + */ + public OciRepositoryDefinition ociRepository() { + return this.ociRepository; + } + + /** + * Set the ociRepository property: Parameters to reconcile to the OCIRepository source kind type. + * + * @param ociRepository the ociRepository value to set. + * @return the FluxConfigurationProperties object itself. + */ + public FluxConfigurationProperties withOciRepository(OciRepositoryDefinition ociRepository) { + this.ociRepository = ociRepository; + 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 waitForReconciliation property: Whether flux configuration deployment should wait for cluster to + * reconcile the kustomizations. + * + * @return the waitForReconciliation value. + */ + public Boolean waitForReconciliation() { + return this.waitForReconciliation; + } + + /** + * Set the waitForReconciliation property: Whether flux configuration deployment should wait for cluster to + * reconcile the kustomizations. + * + * @param waitForReconciliation the waitForReconciliation value to set. + * @return the FluxConfigurationProperties object itself. + */ + public FluxConfigurationProperties withWaitForReconciliation(Boolean waitForReconciliation) { + this.waitForReconciliation = waitForReconciliation; + return this; + } + + /** + * Get the reconciliationWaitDuration property: Maximum duration to wait for flux configuration reconciliation. E.g + * PT1H, PT5M, P1D. + * + * @return the reconciliationWaitDuration value. + */ + public String reconciliationWaitDuration() { + return this.reconciliationWaitDuration; + } + + /** + * Set the reconciliationWaitDuration property: Maximum duration to wait for flux configuration reconciliation. E.g + * PT1H, PT5M, P1D. + * + * @param reconciliationWaitDuration the reconciliationWaitDuration value to set. + * @return the FluxConfigurationProperties object itself. + */ + public FluxConfigurationProperties withReconciliationWaitDuration(String reconciliationWaitDuration) { + this.reconciliationWaitDuration = reconciliationWaitDuration; + return this; + } + + /** + * 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 (azureBlob() != null) { + azureBlob().validate(); + } + if (ociRepository() != null) { + ociRepository().validate(); + } + if (kustomizations() != null) { + kustomizations().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + if (statuses() != null) { + statuses().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("scope", this.scope == null ? null : this.scope.toString()); + jsonWriter.writeStringField("namespace", this.namespace); + jsonWriter.writeStringField("sourceKind", this.sourceKind == null ? null : this.sourceKind.toString()); + jsonWriter.writeBooleanField("suspend", this.suspend); + jsonWriter.writeJsonField("gitRepository", this.gitRepository); + jsonWriter.writeJsonField("bucket", this.bucket); + jsonWriter.writeJsonField("azureBlob", this.azureBlob); + jsonWriter.writeJsonField("ociRepository", this.ociRepository); + jsonWriter.writeMapField("kustomizations", this.kustomizations, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeMapField("configurationProtectedSettings", this.configurationProtectedSettings, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("waitForReconciliation", this.waitForReconciliation); + jsonWriter.writeStringField("reconciliationWaitDuration", this.reconciliationWaitDuration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FluxConfigurationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FluxConfigurationProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FluxConfigurationProperties. + */ + public static FluxConfigurationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FluxConfigurationProperties deserializedFluxConfigurationProperties = new FluxConfigurationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("scope".equals(fieldName)) { + deserializedFluxConfigurationProperties.scope = ScopeType.fromString(reader.getString()); + } else if ("namespace".equals(fieldName)) { + deserializedFluxConfigurationProperties.namespace = reader.getString(); + } else if ("sourceKind".equals(fieldName)) { + deserializedFluxConfigurationProperties.sourceKind = SourceKindType.fromString(reader.getString()); + } else if ("suspend".equals(fieldName)) { + deserializedFluxConfigurationProperties.suspend = reader.getNullable(JsonReader::getBoolean); + } else if ("gitRepository".equals(fieldName)) { + deserializedFluxConfigurationProperties.gitRepository = GitRepositoryDefinition.fromJson(reader); + } else if ("bucket".equals(fieldName)) { + deserializedFluxConfigurationProperties.bucket = BucketDefinition.fromJson(reader); + } else if ("azureBlob".equals(fieldName)) { + deserializedFluxConfigurationProperties.azureBlob = AzureBlobDefinition.fromJson(reader); + } else if ("ociRepository".equals(fieldName)) { + deserializedFluxConfigurationProperties.ociRepository = OciRepositoryDefinition.fromJson(reader); + } else if ("kustomizations".equals(fieldName)) { + Map kustomizations + = reader.readMap(reader1 -> KustomizationDefinition.fromJson(reader1)); + deserializedFluxConfigurationProperties.kustomizations = kustomizations; + } else if ("configurationProtectedSettings".equals(fieldName)) { + Map configurationProtectedSettings = reader.readMap(reader1 -> reader1.getString()); + deserializedFluxConfigurationProperties.configurationProtectedSettings + = configurationProtectedSettings; + } else if ("statuses".equals(fieldName)) { + List statuses + = reader.readArray(reader1 -> ObjectStatusDefinition.fromJson(reader1)); + deserializedFluxConfigurationProperties.statuses = statuses; + } else if ("repositoryPublicKey".equals(fieldName)) { + deserializedFluxConfigurationProperties.repositoryPublicKey = reader.getString(); + } else if ("sourceSyncedCommitId".equals(fieldName)) { + deserializedFluxConfigurationProperties.sourceSyncedCommitId = reader.getString(); + } else if ("sourceUpdatedAt".equals(fieldName)) { + deserializedFluxConfigurationProperties.sourceUpdatedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("statusUpdatedAt".equals(fieldName)) { + deserializedFluxConfigurationProperties.statusUpdatedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("waitForReconciliation".equals(fieldName)) { + deserializedFluxConfigurationProperties.waitForReconciliation + = reader.getNullable(JsonReader::getBoolean); + } else if ("reconciliationWaitDuration".equals(fieldName)) { + deserializedFluxConfigurationProperties.reconciliationWaitDuration = reader.getString(); + } else if ("complianceState".equals(fieldName)) { + deserializedFluxConfigurationProperties.complianceState + = FluxComplianceState.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedFluxConfigurationProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("errorMessage".equals(fieldName)) { + deserializedFluxConfigurationProperties.errorMessage = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFluxConfigurationProperties; + }); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/fluent/models/OperationStatusResultInner.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/fluent/models/OperationStatusResultInner.java new file mode 100644 index 000000000000..793447c79a37 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/fluent/models/OperationStatusResultInner.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The current status of an async operation. + */ +@Fluent +public final class OperationStatusResultInner implements JsonSerializable { + /* + * Fully qualified ID for the async operation. + */ + private String id; + + /* + * Name of the async operation. + */ + private String name; + + /* + * Operation status. + */ + private String status; + + /* + * Additional information, if available. + */ + private Map properties; + + /* + * If present, details of the operation error. + */ + private ManagementError error; + + /** + * Creates an instance of OperationStatusResultInner class. + */ + public OperationStatusResultInner() { + } + + /** + * Get the id property: Fully qualified ID for the async operation. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Fully qualified ID for the async operation. + * + * @param id the id value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: Name of the async operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the async operation. + * + * @param name the name value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the status property: Operation status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: Operation status. + * + * @param status the status value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the properties property: Additional information, if available. + * + * @return the properties value. + */ + public Map properties() { + return this.properties; + } + + /** + * Set the properties property: Additional information, if available. + * + * @param properties the properties value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withProperties(Map properties) { + this.properties = properties; + return this; + } + + /** + * Get the error property: If present, details of the operation error. + * + * @return the error value. + */ + public ManagementError error() { + return this.error; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (status() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property status in model OperationStatusResultInner")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OperationStatusResultInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeMapField("properties", this.properties, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationStatusResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationStatusResultInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OperationStatusResultInner. + */ + public static OperationStatusResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationStatusResultInner deserializedOperationStatusResultInner = new OperationStatusResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedOperationStatusResultInner.status = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedOperationStatusResultInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedOperationStatusResultInner.name = reader.getString(); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedOperationStatusResultInner.properties = properties; + } else if ("error".equals(fieldName)) { + deserializedOperationStatusResultInner.error = ManagementError.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationStatusResultInner; + }); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/fluent/models/package-info.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/fluent/models/package-info.java new file mode 100644 index 000000000000..49f2cdb9645d --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/fluent/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the inner data models for FluxConfigurationClient. + * KubernetesConfiguration Flux Client. + */ +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.fluent.models; diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/fluent/package-info.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/fluent/package-info.java new file mode 100644 index 000000000000..d9bdf0ac554d --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/fluent/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the service clients for FluxConfigurationClient. + * KubernetesConfiguration Flux Client. + */ +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.fluent; diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/FluxConfigOperationStatusClientImpl.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/FluxConfigOperationStatusClientImpl.java new file mode 100644 index 000000000000..df705d6f1ad7 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/FluxConfigOperationStatusClientImpl.java @@ -0,0 +1,250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.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.kubernetesconfigurationfluxconfi.fluent.FluxConfigOperationStatusClient; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.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 { + /** + * The proxy service used to perform REST calls. + */ + private final FluxConfigOperationStatusService service; + + /** + * The service client containing this operation class. + */ + private final FluxConfigurationClientImpl client; + + /** + * Initializes an instance of FluxConfigOperationStatusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FluxConfigOperationStatusClientImpl(FluxConfigurationClientImpl client) { + this.service = RestProxy.create(FluxConfigOperationStatusService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for FluxConfigurationClientFluxConfigOperationStatus to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "FluxConfigurationCli") + public 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); + + @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) + Response getSync(@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, appliances. + * @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 accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, + this.client.getApiVersion(), 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, appliances. + * @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(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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, appliances. + * @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) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (fluxConfigurationName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter fluxConfigurationName is required and cannot be null.")); + } + if (operationId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterRp, + clusterResourceName, clusterName, fluxConfigurationName, this.client.getApiVersion(), 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, appliances. + * @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 getWithResponse(resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, + operationId, Context.NONE).getValue(); + } + + private static final ClientLogger LOGGER = new ClientLogger(FluxConfigOperationStatusClientImpl.class); +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/FluxConfigOperationStatusImpl.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/FluxConfigOperationStatusImpl.java new file mode 100644 index 000000000000..3590f1a4f297 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/FluxConfigOperationStatusImpl.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.kubernetesconfigurationfluxconfi.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.kubernetesconfigurationfluxconfi.fluent.FluxConfigOperationStatusClient; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.FluxConfigOperationStatus; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.OperationStatusResult; + +public final class FluxConfigOperationStatusImpl implements FluxConfigOperationStatus { + private static final ClientLogger LOGGER = new ClientLogger(FluxConfigOperationStatusImpl.class); + + private final FluxConfigOperationStatusClient innerClient; + + private final com.azure.resourcemanager.kubernetesconfigurationfluxconfi.FluxConfigurationManager serviceManager; + + public FluxConfigOperationStatusImpl(FluxConfigOperationStatusClient innerClient, + com.azure.resourcemanager.kubernetesconfigurationfluxconfi.FluxConfigurationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + 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; + } + } + + 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; + } + } + + private FluxConfigOperationStatusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.kubernetesconfigurationfluxconfi.FluxConfigurationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/FluxConfigurationClientBuilder.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/FluxConfigurationClientBuilder.java new file mode 100644 index 000000000000..a98da4435e52 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/FluxConfigurationClientBuilder.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** + * A builder for creating a new instance of the FluxConfigurationClientImpl type. + */ +@ServiceClientBuilder(serviceClients = { FluxConfigurationClientImpl.class }) +public final class FluxConfigurationClientBuilder { + /* + * The ID of the target subscription. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the FluxConfigurationClientBuilder. + */ + public FluxConfigurationClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the FluxConfigurationClientBuilder. + */ + public FluxConfigurationClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the FluxConfigurationClientBuilder. + */ + public FluxConfigurationClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the FluxConfigurationClientBuilder. + */ + public FluxConfigurationClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the FluxConfigurationClientBuilder. + */ + public FluxConfigurationClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the FluxConfigurationClientBuilder. + */ + public FluxConfigurationClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of FluxConfigurationClientImpl with the provided parameters. + * + * @return an instance of FluxConfigurationClientImpl. + */ + public FluxConfigurationClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval + = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + FluxConfigurationClientImpl client = new FluxConfigurationClientImpl(localPipeline, localSerializerAdapter, + localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + return client; + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/FluxConfigurationClientImpl.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/FluxConfigurationClientImpl.java new file mode 100644 index 000000000000..2d92b0751e04 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/FluxConfigurationClientImpl.java @@ -0,0 +1,324 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.management.polling.SyncPollerFactory; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.fluent.FluxConfigOperationStatusClient; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.fluent.FluxConfigurationClient; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.fluent.FluxConfigurationsClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the FluxConfigurationClientImpl type. + */ +@ServiceClient(builder = FluxConfigurationClientBuilder.class) +public final class FluxConfigurationClientImpl implements FluxConfigurationClient { + /** + * The ID of the target subscription. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** + * server parameter. + */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + 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; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** + * The serializer to serialize an object into a string. + */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * The default poll interval for long-running operation. + */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** + * 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; + } + + /** + * Initializes an instance of FluxConfigurationClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId The ID of the target subscription. + * @param endpoint server parameter. + */ + FluxConfigurationClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2025-04-01"; + this.fluxConfigurations = new FluxConfigurationsClientImpl(this); + this.fluxConfigOperationStatus = new FluxConfigOperationStatusClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + return CoreUtils.mergeContexts(this.getContext(), context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult(Mono>> activationResponse, + HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { + return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, activationResponse, context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return SyncPoller for poll result and final result. + */ + public SyncPoller, U> getLroResult(Response activationResponse, + Type pollResultType, Type finalResultType, Context context) { + return SyncPollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, () -> activationResponse, context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), + lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = this.getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(HttpHeaderName.fromString(s)); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FluxConfigurationClientImpl.class); +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/FluxConfigurationImpl.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/FluxConfigurationImpl.java new file mode 100644 index 000000000000..c269d2973089 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/FluxConfigurationImpl.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.fluent.models.FluxConfigurationInner; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.AzureBlobDefinition; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.BucketDefinition; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.FluxComplianceState; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.FluxConfiguration; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.GitRepositoryDefinition; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.KustomizationDefinition; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.ObjectStatusDefinition; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.OciRepositoryDefinition; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.ProvisioningState; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.ScopeType; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.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.kubernetesconfigurationfluxconfi.FluxConfigurationManager serviceManager; + + FluxConfigurationImpl(FluxConfigurationInner innerObject, + com.azure.resourcemanager.kubernetesconfigurationfluxconfi.FluxConfigurationManager 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 AzureBlobDefinition azureBlob() { + return this.innerModel().azureBlob(); + } + + public OciRepositoryDefinition ociRepository() { + return this.innerModel().ociRepository(); + } + + 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 Boolean waitForReconciliation() { + return this.innerModel().waitForReconciliation(); + } + + public String reconciliationWaitDuration() { + return this.innerModel().reconciliationWaitDuration(); + } + + 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.kubernetesconfigurationfluxconfi.FluxConfigurationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/FluxConfigurationsClientImpl.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/FluxConfigurationsClientImpl.java new file mode 100644 index 000000000000..e8fbea4608cf --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/FluxConfigurationsClientImpl.java @@ -0,0 +1,1730 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.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.BinaryData; +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.kubernetesconfigurationfluxconfi.fluent.FluxConfigurationsClient; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.fluent.models.FluxConfigurationInner; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.FluxConfigurationPatch; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.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 { + /** + * The proxy service used to perform REST calls. + */ + private final FluxConfigurationsService service; + + /** + * The service client containing this operation class. + */ + private final FluxConfigurationClientImpl client; + + /** + * Initializes an instance of FluxConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FluxConfigurationsClientImpl(FluxConfigurationClientImpl client) { + this.service = RestProxy.create(FluxConfigurationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for FluxConfigurationClientFluxConfigurations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "FluxConfigurationCli") + public 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" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@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" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@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({ 200, 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" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@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" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@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("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@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); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@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, appliances. + * @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 accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, + this.client.getApiVersion(), 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, appliances. + * @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(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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, appliances. + * @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) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (fluxConfigurationName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter fluxConfigurationName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterRp, + clusterResourceName, clusterName, fluxConfigurationName, this.client.getApiVersion(), 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, appliances. + * @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 getWithResponse(resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, + Context.NONE).getValue(); + } + + /** + * 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, appliances. + * @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 accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, + this.client.getApiVersion(), 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, appliances. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String clusterRp, + String clusterResourceName, String clusterName, String fluxConfigurationName, + FluxConfigurationInner fluxConfiguration) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (fluxConfigurationName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter fluxConfigurationName is required and cannot be null.")); + } + if (fluxConfiguration == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter fluxConfiguration is required and cannot be null.")); + } else { + fluxConfiguration.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterRp, clusterResourceName, clusterName, fluxConfigurationName, this.client.getApiVersion(), + fluxConfiguration, accept, Context.NONE); + } + + /** + * 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, appliances. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String clusterRp, + String clusterResourceName, String clusterName, String fluxConfigurationName, + FluxConfigurationInner fluxConfiguration, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (fluxConfigurationName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter fluxConfigurationName is required and cannot be null.")); + } + if (fluxConfiguration == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter fluxConfiguration is required and cannot be null.")); + } else { + fluxConfiguration.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterRp, clusterResourceName, clusterName, fluxConfigurationName, this.client.getApiVersion(), + 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, appliances. + * @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, appliances. + * @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) { + Response response = createOrUpdateWithResponse(resourceGroupName, clusterRp, clusterResourceName, + clusterName, fluxConfigurationName, fluxConfiguration); + return this.client.getLroResult(response, + FluxConfigurationInner.class, FluxConfigurationInner.class, Context.NONE); + } + + /** + * 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, appliances. + * @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) { + Response response = createOrUpdateWithResponse(resourceGroupName, clusterRp, clusterResourceName, + clusterName, fluxConfigurationName, fluxConfiguration, context); + return this.client.getLroResult(response, + 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, appliances. + * @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, appliances. + * @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 beginCreateOrUpdate(resourceGroupName, clusterRp, clusterResourceName, clusterName, + fluxConfigurationName, fluxConfiguration).getFinalResult(); + } + + /** + * 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, appliances. + * @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 beginCreateOrUpdate(resourceGroupName, clusterRp, clusterResourceName, clusterName, + fluxConfigurationName, fluxConfiguration, context).getFinalResult(); + } + + /** + * 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, appliances. + * @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 accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, + this.client.getApiVersion(), 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, appliances. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String clusterRp, + String clusterResourceName, String clusterName, String fluxConfigurationName, + FluxConfigurationPatch fluxConfigurationPatch) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (fluxConfigurationName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter fluxConfigurationName is required and cannot be null.")); + } + if (fluxConfigurationPatch == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter fluxConfigurationPatch is required and cannot be null.")); + } else { + fluxConfigurationPatch.validate(); + } + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterRp, clusterResourceName, clusterName, fluxConfigurationName, this.client.getApiVersion(), + fluxConfigurationPatch, accept, Context.NONE); + } + + /** + * 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, appliances. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String clusterRp, + String clusterResourceName, String clusterName, String fluxConfigurationName, + FluxConfigurationPatch fluxConfigurationPatch, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (fluxConfigurationName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter fluxConfigurationName is required and cannot be null.")); + } + if (fluxConfigurationPatch == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter fluxConfigurationPatch is required and cannot be null.")); + } else { + fluxConfigurationPatch.validate(); + } + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterRp, clusterResourceName, clusterName, fluxConfigurationName, this.client.getApiVersion(), + 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, appliances. + * @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, appliances. + * @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) { + Response response = updateWithResponse(resourceGroupName, clusterRp, clusterResourceName, + clusterName, fluxConfigurationName, fluxConfigurationPatch); + return this.client.getLroResult(response, + FluxConfigurationInner.class, FluxConfigurationInner.class, Context.NONE); + } + + /** + * 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, appliances. + * @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) { + Response response = updateWithResponse(resourceGroupName, clusterRp, clusterResourceName, + clusterName, fluxConfigurationName, fluxConfigurationPatch, context); + return this.client.getLroResult(response, + 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, appliances. + * @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, appliances. + * @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 beginUpdate(resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, + fluxConfigurationPatch).getFinalResult(); + } + + /** + * 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, appliances. + * @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 beginUpdate(resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, + fluxConfigurationPatch, context).getFinalResult(); + } + + /** + * 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, appliances. + * @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 accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, + this.client.getApiVersion(), 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, appliances. + * @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 response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String clusterRp, + String clusterResourceName, String clusterName, String fluxConfigurationName, Boolean forceDelete) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (fluxConfigurationName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter fluxConfigurationName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterRp, clusterResourceName, clusterName, fluxConfigurationName, this.client.getApiVersion(), + forceDelete, accept, Context.NONE); + } + + /** + * 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, appliances. + * @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 response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String clusterRp, + String clusterResourceName, String clusterName, String fluxConfigurationName, Boolean forceDelete, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (fluxConfigurationName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter fluxConfigurationName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterRp, clusterResourceName, clusterName, fluxConfigurationName, this.client.getApiVersion(), + 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, appliances. + * @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, appliances. + * @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 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) { + final Boolean forceDelete = null; + 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, appliances. + * @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) { + Response response = deleteWithResponse(resourceGroupName, clusterRp, clusterResourceName, + clusterName, fluxConfigurationName, forceDelete); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * 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, appliances. + * @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 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) { + final Boolean forceDelete = null; + Response response = deleteWithResponse(resourceGroupName, clusterRp, clusterResourceName, + clusterName, fluxConfigurationName, forceDelete); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * 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, appliances. + * @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) { + Response response = deleteWithResponse(resourceGroupName, clusterRp, clusterResourceName, + clusterName, fluxConfigurationName, forceDelete, context); + return this.client.getLroResult(response, 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, appliances. + * @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, appliances. + * @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, appliances. + * @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; + beginDelete(resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, forceDelete) + .getFinalResult(); + } + + /** + * 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, appliances. + * @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) { + beginDelete(resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, forceDelete, + context).getFinalResult(); + } + + /** + * 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, appliances. + * @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 accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterRp, clusterResourceName, clusterName, this.client.getApiVersion(), 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, appliances. + * @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, appliances. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String clusterRp, + String clusterResourceName, String clusterName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterRp, + clusterResourceName, clusterName, this.client.getApiVersion(), accept, Context.NONE); + return 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, appliances. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String clusterRp, + String clusterResourceName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterRp, + clusterResourceName, clusterName, this.client.getApiVersion(), accept, context); + return 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, appliances. + * @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<>(() -> listSinglePage(resourceGroupName, clusterRp, clusterResourceName, clusterName), + nextLink -> listNextSinglePage(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, appliances. + * @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<>( + () -> listSinglePage(resourceGroupName, clusterRp, clusterResourceName, clusterName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + private static final ClientLogger LOGGER = new ClientLogger(FluxConfigurationsClientImpl.class); +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/FluxConfigurationsImpl.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/FluxConfigurationsImpl.java new file mode 100644 index 000000000000..e52cf35f0fb5 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/FluxConfigurationsImpl.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.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.kubernetesconfigurationfluxconfi.fluent.FluxConfigurationsClient; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.fluent.models.FluxConfigurationInner; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.FluxConfiguration; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.FluxConfigurationPatch; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.FluxConfigurations; + +public final class FluxConfigurationsImpl implements FluxConfigurations { + private static final ClientLogger LOGGER = new ClientLogger(FluxConfigurationsImpl.class); + + private final FluxConfigurationsClient innerClient; + + private final com.azure.resourcemanager.kubernetesconfigurationfluxconfi.FluxConfigurationManager serviceManager; + + public FluxConfigurationsImpl(FluxConfigurationsClient innerClient, + com.azure.resourcemanager.kubernetesconfigurationfluxconfi.FluxConfigurationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + 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 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 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) { + 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 ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new FluxConfigurationImpl(inner1, this.manager())); + } + + private FluxConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.kubernetesconfigurationfluxconfi.FluxConfigurationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/OperationStatusResultImpl.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/OperationStatusResultImpl.java new file mode 100644 index 000000000000..014ebc0e3ffa --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/OperationStatusResultImpl.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.kubernetesconfigurationfluxconfi.implementation; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.OperationStatusResult; +import java.util.Collections; +import java.util.Map; + +public final class OperationStatusResultImpl implements OperationStatusResult { + private OperationStatusResultInner innerObject; + + private final com.azure.resourcemanager.kubernetesconfigurationfluxconfi.FluxConfigurationManager serviceManager; + + OperationStatusResultImpl(OperationStatusResultInner innerObject, + com.azure.resourcemanager.kubernetesconfigurationfluxconfi.FluxConfigurationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String status() { + return this.innerModel().status(); + } + + public Map properties() { + Map inner = this.innerModel().properties(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ManagementError error() { + return this.innerModel().error(); + } + + public OperationStatusResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.kubernetesconfigurationfluxconfi.FluxConfigurationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/ResourceManagerUtils.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/ResourceManagerUtils.java new file mode 100644 index 000000000000..c16d52fe5e77 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/ResourceManagerUtils.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.implementation; + +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.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class ResourceManagerUtils { + private ResourceManagerUtils() { + } + + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (!segments.isEmpty() && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl<>(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux + .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/package-info.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/package-info.java new file mode 100644 index 000000000000..414b5eb59a2e --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/implementation/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the implementations for FluxConfigurationClient. + * KubernetesConfiguration Flux Client. + */ +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.implementation; diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/AzureBlobDefinition.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/AzureBlobDefinition.java new file mode 100644 index 000000000000..9d74990ad749 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/AzureBlobDefinition.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.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters to reconcile to the AzureBlob source kind type. + */ +@Fluent +public final class AzureBlobDefinition implements JsonSerializable { + /* + * The URL to sync for the flux configuration Azure Blob storage account. + */ + private String url; + + /* + * The Azure Blob container name to sync from the url endpoint for the flux configuration. + */ + private String containerName; + + /* + * The maximum time to attempt to reconcile the cluster Azure Blob source with the remote. + */ + private Long timeoutInSeconds; + + /* + * The interval at which to re-reconcile the cluster Azure Blob source with the remote. + */ + private Long syncIntervalInSeconds; + + /* + * Parameters to authenticate using Service Principal. + */ + private ServicePrincipalDefinition servicePrincipal; + + /* + * The account key (shared key) to access the storage account + */ + private String accountKey; + + /* + * The Shared Access token to access the storage container + */ + private String sasToken; + + /* + * Parameters to authenticate using a Managed Identity. + */ + private ManagedIdentityDefinition managedIdentity; + + /* + * Name of a local secret on the Kubernetes cluster to use as the authentication secret rather than the managed or + * user-provided configuration secrets. + */ + private String localAuthRef; + + /** + * Creates an instance of AzureBlobDefinition class. + */ + public AzureBlobDefinition() { + } + + /** + * Get the url property: The URL to sync for the flux configuration Azure Blob storage account. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: The URL to sync for the flux configuration Azure Blob storage account. + * + * @param url the url value to set. + * @return the AzureBlobDefinition object itself. + */ + public AzureBlobDefinition withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the containerName property: The Azure Blob container name to sync from the url endpoint for the flux + * configuration. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the containerName property: The Azure Blob container name to sync from the url endpoint for the flux + * configuration. + * + * @param containerName the containerName value to set. + * @return the AzureBlobDefinition object itself. + */ + public AzureBlobDefinition withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get the timeoutInSeconds property: The maximum time to attempt to reconcile the cluster Azure Blob 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 Azure Blob source with + * the remote. + * + * @param timeoutInSeconds the timeoutInSeconds value to set. + * @return the AzureBlobDefinition object itself. + */ + public AzureBlobDefinition withTimeoutInSeconds(Long timeoutInSeconds) { + this.timeoutInSeconds = timeoutInSeconds; + return this; + } + + /** + * Get the syncIntervalInSeconds property: The interval at which to re-reconcile the cluster Azure Blob 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 Azure Blob source with + * the remote. + * + * @param syncIntervalInSeconds the syncIntervalInSeconds value to set. + * @return the AzureBlobDefinition object itself. + */ + public AzureBlobDefinition withSyncIntervalInSeconds(Long syncIntervalInSeconds) { + this.syncIntervalInSeconds = syncIntervalInSeconds; + return this; + } + + /** + * Get the servicePrincipal property: Parameters to authenticate using Service Principal. + * + * @return the servicePrincipal value. + */ + public ServicePrincipalDefinition servicePrincipal() { + return this.servicePrincipal; + } + + /** + * Set the servicePrincipal property: Parameters to authenticate using Service Principal. + * + * @param servicePrincipal the servicePrincipal value to set. + * @return the AzureBlobDefinition object itself. + */ + public AzureBlobDefinition withServicePrincipal(ServicePrincipalDefinition servicePrincipal) { + this.servicePrincipal = servicePrincipal; + return this; + } + + /** + * Get the accountKey property: The account key (shared key) to access the storage account. + * + * @return the accountKey value. + */ + public String accountKey() { + return this.accountKey; + } + + /** + * Set the accountKey property: The account key (shared key) to access the storage account. + * + * @param accountKey the accountKey value to set. + * @return the AzureBlobDefinition object itself. + */ + public AzureBlobDefinition withAccountKey(String accountKey) { + this.accountKey = accountKey; + return this; + } + + /** + * Get the sasToken property: The Shared Access token to access the storage container. + * + * @return the sasToken value. + */ + public String sasToken() { + return this.sasToken; + } + + /** + * Set the sasToken property: The Shared Access token to access the storage container. + * + * @param sasToken the sasToken value to set. + * @return the AzureBlobDefinition object itself. + */ + public AzureBlobDefinition withSasToken(String sasToken) { + this.sasToken = sasToken; + return this; + } + + /** + * Get the managedIdentity property: Parameters to authenticate using a Managed Identity. + * + * @return the managedIdentity value. + */ + public ManagedIdentityDefinition managedIdentity() { + return this.managedIdentity; + } + + /** + * Set the managedIdentity property: Parameters to authenticate using a Managed Identity. + * + * @param managedIdentity the managedIdentity value to set. + * @return the AzureBlobDefinition object itself. + */ + public AzureBlobDefinition withManagedIdentity(ManagedIdentityDefinition managedIdentity) { + this.managedIdentity = managedIdentity; + 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 AzureBlobDefinition object itself. + */ + public AzureBlobDefinition withLocalAuthRef(String localAuthRef) { + this.localAuthRef = localAuthRef; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (servicePrincipal() != null) { + servicePrincipal().validate(); + } + if (managedIdentity() != null) { + managedIdentity().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("url", this.url); + jsonWriter.writeStringField("containerName", this.containerName); + jsonWriter.writeNumberField("timeoutInSeconds", this.timeoutInSeconds); + jsonWriter.writeNumberField("syncIntervalInSeconds", this.syncIntervalInSeconds); + jsonWriter.writeJsonField("servicePrincipal", this.servicePrincipal); + jsonWriter.writeStringField("accountKey", this.accountKey); + jsonWriter.writeStringField("sasToken", this.sasToken); + jsonWriter.writeJsonField("managedIdentity", this.managedIdentity); + jsonWriter.writeStringField("localAuthRef", this.localAuthRef); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureBlobDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureBlobDefinition if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureBlobDefinition. + */ + public static AzureBlobDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureBlobDefinition deserializedAzureBlobDefinition = new AzureBlobDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("url".equals(fieldName)) { + deserializedAzureBlobDefinition.url = reader.getString(); + } else if ("containerName".equals(fieldName)) { + deserializedAzureBlobDefinition.containerName = reader.getString(); + } else if ("timeoutInSeconds".equals(fieldName)) { + deserializedAzureBlobDefinition.timeoutInSeconds = reader.getNullable(JsonReader::getLong); + } else if ("syncIntervalInSeconds".equals(fieldName)) { + deserializedAzureBlobDefinition.syncIntervalInSeconds = reader.getNullable(JsonReader::getLong); + } else if ("servicePrincipal".equals(fieldName)) { + deserializedAzureBlobDefinition.servicePrincipal = ServicePrincipalDefinition.fromJson(reader); + } else if ("accountKey".equals(fieldName)) { + deserializedAzureBlobDefinition.accountKey = reader.getString(); + } else if ("sasToken".equals(fieldName)) { + deserializedAzureBlobDefinition.sasToken = reader.getString(); + } else if ("managedIdentity".equals(fieldName)) { + deserializedAzureBlobDefinition.managedIdentity = ManagedIdentityDefinition.fromJson(reader); + } else if ("localAuthRef".equals(fieldName)) { + deserializedAzureBlobDefinition.localAuthRef = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureBlobDefinition; + }); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/AzureBlobPatchDefinition.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/AzureBlobPatchDefinition.java new file mode 100644 index 000000000000..7ee3669e5721 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/AzureBlobPatchDefinition.java @@ -0,0 +1,335 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters to reconcile to the AzureBlob source kind type. + */ +@Fluent +public final class AzureBlobPatchDefinition implements JsonSerializable { + /* + * The URL to sync for the flux configuration Azure Blob storage account. + */ + private String url; + + /* + * The Azure Blob container name to sync from the url endpoint for the flux configuration. + */ + private String containerName; + + /* + * The maximum time to attempt to reconcile the cluster Azure Blob source with the remote. + */ + private Long timeoutInSeconds; + + /* + * The interval at which to re-reconcile the cluster Azure Blob source with the remote. + */ + private Long syncIntervalInSeconds; + + /* + * Parameters to authenticate using Service Principal. + */ + private ServicePrincipalPatchDefinition servicePrincipal; + + /* + * The account key (shared key) to access the storage account + */ + private String accountKey; + + /* + * The Shared Access token to access the storage container + */ + private String sasToken; + + /* + * Parameters to authenticate using a Managed Identity. + */ + private ManagedIdentityPatchDefinition managedIdentity; + + /* + * Name of a local secret on the Kubernetes cluster to use as the authentication secret rather than the managed or + * user-provided configuration secrets. + */ + private String localAuthRef; + + /** + * Creates an instance of AzureBlobPatchDefinition class. + */ + public AzureBlobPatchDefinition() { + } + + /** + * Get the url property: The URL to sync for the flux configuration Azure Blob storage account. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: The URL to sync for the flux configuration Azure Blob storage account. + * + * @param url the url value to set. + * @return the AzureBlobPatchDefinition object itself. + */ + public AzureBlobPatchDefinition withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the containerName property: The Azure Blob container name to sync from the url endpoint for the flux + * configuration. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the containerName property: The Azure Blob container name to sync from the url endpoint for the flux + * configuration. + * + * @param containerName the containerName value to set. + * @return the AzureBlobPatchDefinition object itself. + */ + public AzureBlobPatchDefinition withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get the timeoutInSeconds property: The maximum time to attempt to reconcile the cluster Azure Blob 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 Azure Blob source with + * the remote. + * + * @param timeoutInSeconds the timeoutInSeconds value to set. + * @return the AzureBlobPatchDefinition object itself. + */ + public AzureBlobPatchDefinition withTimeoutInSeconds(Long timeoutInSeconds) { + this.timeoutInSeconds = timeoutInSeconds; + return this; + } + + /** + * Get the syncIntervalInSeconds property: The interval at which to re-reconcile the cluster Azure Blob 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 Azure Blob source with + * the remote. + * + * @param syncIntervalInSeconds the syncIntervalInSeconds value to set. + * @return the AzureBlobPatchDefinition object itself. + */ + public AzureBlobPatchDefinition withSyncIntervalInSeconds(Long syncIntervalInSeconds) { + this.syncIntervalInSeconds = syncIntervalInSeconds; + return this; + } + + /** + * Get the servicePrincipal property: Parameters to authenticate using Service Principal. + * + * @return the servicePrincipal value. + */ + public ServicePrincipalPatchDefinition servicePrincipal() { + return this.servicePrincipal; + } + + /** + * Set the servicePrincipal property: Parameters to authenticate using Service Principal. + * + * @param servicePrincipal the servicePrincipal value to set. + * @return the AzureBlobPatchDefinition object itself. + */ + public AzureBlobPatchDefinition withServicePrincipal(ServicePrincipalPatchDefinition servicePrincipal) { + this.servicePrincipal = servicePrincipal; + return this; + } + + /** + * Get the accountKey property: The account key (shared key) to access the storage account. + * + * @return the accountKey value. + */ + public String accountKey() { + return this.accountKey; + } + + /** + * Set the accountKey property: The account key (shared key) to access the storage account. + * + * @param accountKey the accountKey value to set. + * @return the AzureBlobPatchDefinition object itself. + */ + public AzureBlobPatchDefinition withAccountKey(String accountKey) { + this.accountKey = accountKey; + return this; + } + + /** + * Get the sasToken property: The Shared Access token to access the storage container. + * + * @return the sasToken value. + */ + public String sasToken() { + return this.sasToken; + } + + /** + * Set the sasToken property: The Shared Access token to access the storage container. + * + * @param sasToken the sasToken value to set. + * @return the AzureBlobPatchDefinition object itself. + */ + public AzureBlobPatchDefinition withSasToken(String sasToken) { + this.sasToken = sasToken; + return this; + } + + /** + * Get the managedIdentity property: Parameters to authenticate using a Managed Identity. + * + * @return the managedIdentity value. + */ + public ManagedIdentityPatchDefinition managedIdentity() { + return this.managedIdentity; + } + + /** + * Set the managedIdentity property: Parameters to authenticate using a Managed Identity. + * + * @param managedIdentity the managedIdentity value to set. + * @return the AzureBlobPatchDefinition object itself. + */ + public AzureBlobPatchDefinition withManagedIdentity(ManagedIdentityPatchDefinition managedIdentity) { + this.managedIdentity = managedIdentity; + 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 AzureBlobPatchDefinition object itself. + */ + public AzureBlobPatchDefinition withLocalAuthRef(String localAuthRef) { + this.localAuthRef = localAuthRef; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (servicePrincipal() != null) { + servicePrincipal().validate(); + } + if (managedIdentity() != null) { + managedIdentity().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("url", this.url); + jsonWriter.writeStringField("containerName", this.containerName); + jsonWriter.writeNumberField("timeoutInSeconds", this.timeoutInSeconds); + jsonWriter.writeNumberField("syncIntervalInSeconds", this.syncIntervalInSeconds); + jsonWriter.writeJsonField("servicePrincipal", this.servicePrincipal); + jsonWriter.writeStringField("accountKey", this.accountKey); + jsonWriter.writeStringField("sasToken", this.sasToken); + jsonWriter.writeJsonField("managedIdentity", this.managedIdentity); + jsonWriter.writeStringField("localAuthRef", this.localAuthRef); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureBlobPatchDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureBlobPatchDefinition if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureBlobPatchDefinition. + */ + public static AzureBlobPatchDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureBlobPatchDefinition deserializedAzureBlobPatchDefinition = new AzureBlobPatchDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("url".equals(fieldName)) { + deserializedAzureBlobPatchDefinition.url = reader.getString(); + } else if ("containerName".equals(fieldName)) { + deserializedAzureBlobPatchDefinition.containerName = reader.getString(); + } else if ("timeoutInSeconds".equals(fieldName)) { + deserializedAzureBlobPatchDefinition.timeoutInSeconds = reader.getNullable(JsonReader::getLong); + } else if ("syncIntervalInSeconds".equals(fieldName)) { + deserializedAzureBlobPatchDefinition.syncIntervalInSeconds + = reader.getNullable(JsonReader::getLong); + } else if ("servicePrincipal".equals(fieldName)) { + deserializedAzureBlobPatchDefinition.servicePrincipal + = ServicePrincipalPatchDefinition.fromJson(reader); + } else if ("accountKey".equals(fieldName)) { + deserializedAzureBlobPatchDefinition.accountKey = reader.getString(); + } else if ("sasToken".equals(fieldName)) { + deserializedAzureBlobPatchDefinition.sasToken = reader.getString(); + } else if ("managedIdentity".equals(fieldName)) { + deserializedAzureBlobPatchDefinition.managedIdentity + = ManagedIdentityPatchDefinition.fromJson(reader); + } else if ("localAuthRef".equals(fieldName)) { + deserializedAzureBlobPatchDefinition.localAuthRef = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureBlobPatchDefinition; + }); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/BucketDefinition.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/BucketDefinition.java new file mode 100644 index 000000000000..968fc7def94e --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/BucketDefinition.java @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters to reconcile to the Bucket source kind type. + */ +@Fluent +public final class BucketDefinition implements JsonSerializable { + /* + * The URL to sync for the flux configuration S3 bucket. + */ + private String url; + + /* + * The bucket name to sync from the url endpoint for the flux configuration. + */ + private String bucketName; + + /* + * Specify whether to use insecure communication when puling data from the S3 bucket. + */ + private Boolean insecure; + + /* + * The maximum time to attempt to reconcile the cluster bucket source with the remote. + */ + private Long timeoutInSeconds; + + /* + * The interval at which to re-reconcile the cluster bucket source with the remote. + */ + private Long syncIntervalInSeconds; + + /* + * Plaintext access key used to securely access the S3 bucket + */ + 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. + */ + private String localAuthRef; + + /** + * Creates an instance of BucketDefinition class. + */ + public BucketDefinition() { + } + + /** + * 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 bucket 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 bucket 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 bucket 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 bucket 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("url", this.url); + jsonWriter.writeStringField("bucketName", this.bucketName); + jsonWriter.writeBooleanField("insecure", this.insecure); + jsonWriter.writeNumberField("timeoutInSeconds", this.timeoutInSeconds); + jsonWriter.writeNumberField("syncIntervalInSeconds", this.syncIntervalInSeconds); + jsonWriter.writeStringField("accessKey", this.accessKey); + jsonWriter.writeStringField("localAuthRef", this.localAuthRef); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BucketDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BucketDefinition if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the BucketDefinition. + */ + public static BucketDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BucketDefinition deserializedBucketDefinition = new BucketDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("url".equals(fieldName)) { + deserializedBucketDefinition.url = reader.getString(); + } else if ("bucketName".equals(fieldName)) { + deserializedBucketDefinition.bucketName = reader.getString(); + } else if ("insecure".equals(fieldName)) { + deserializedBucketDefinition.insecure = reader.getNullable(JsonReader::getBoolean); + } else if ("timeoutInSeconds".equals(fieldName)) { + deserializedBucketDefinition.timeoutInSeconds = reader.getNullable(JsonReader::getLong); + } else if ("syncIntervalInSeconds".equals(fieldName)) { + deserializedBucketDefinition.syncIntervalInSeconds = reader.getNullable(JsonReader::getLong); + } else if ("accessKey".equals(fieldName)) { + deserializedBucketDefinition.accessKey = reader.getString(); + } else if ("localAuthRef".equals(fieldName)) { + deserializedBucketDefinition.localAuthRef = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBucketDefinition; + }); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/BucketPatchDefinition.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/BucketPatchDefinition.java new file mode 100644 index 000000000000..b70c4edd8e82 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/BucketPatchDefinition.java @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters to reconcile to the Bucket source kind type. + */ +@Fluent +public final class BucketPatchDefinition implements JsonSerializable { + /* + * The URL to sync for the flux configuration S3 bucket. + */ + private String url; + + /* + * The bucket name to sync from the url endpoint for the flux configuration. + */ + private String bucketName; + + /* + * Specify whether to use insecure communication when puling data from the S3 bucket. + */ + private Boolean insecure; + + /* + * The maximum time to attempt to reconcile the cluster bucket source with the remote. + */ + private Long timeoutInSeconds; + + /* + * The interval at which to re-reconcile the cluster bucket source with the remote. + */ + private Long syncIntervalInSeconds; + + /* + * Plaintext access key used to securely access the S3 bucket + */ + 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. + */ + private String localAuthRef; + + /** + * Creates an instance of BucketPatchDefinition class. + */ + public BucketPatchDefinition() { + } + + /** + * 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 bucket 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 bucket 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 bucket 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 bucket 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("url", this.url); + jsonWriter.writeStringField("bucketName", this.bucketName); + jsonWriter.writeBooleanField("insecure", this.insecure); + jsonWriter.writeNumberField("timeoutInSeconds", this.timeoutInSeconds); + jsonWriter.writeNumberField("syncIntervalInSeconds", this.syncIntervalInSeconds); + jsonWriter.writeStringField("accessKey", this.accessKey); + jsonWriter.writeStringField("localAuthRef", this.localAuthRef); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BucketPatchDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BucketPatchDefinition if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the BucketPatchDefinition. + */ + public static BucketPatchDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BucketPatchDefinition deserializedBucketPatchDefinition = new BucketPatchDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("url".equals(fieldName)) { + deserializedBucketPatchDefinition.url = reader.getString(); + } else if ("bucketName".equals(fieldName)) { + deserializedBucketPatchDefinition.bucketName = reader.getString(); + } else if ("insecure".equals(fieldName)) { + deserializedBucketPatchDefinition.insecure = reader.getNullable(JsonReader::getBoolean); + } else if ("timeoutInSeconds".equals(fieldName)) { + deserializedBucketPatchDefinition.timeoutInSeconds = reader.getNullable(JsonReader::getLong); + } else if ("syncIntervalInSeconds".equals(fieldName)) { + deserializedBucketPatchDefinition.syncIntervalInSeconds = reader.getNullable(JsonReader::getLong); + } else if ("accessKey".equals(fieldName)) { + deserializedBucketPatchDefinition.accessKey = reader.getString(); + } else if ("localAuthRef".equals(fieldName)) { + deserializedBucketPatchDefinition.localAuthRef = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBucketPatchDefinition; + }); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/FluxComplianceState.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/FluxComplianceState.java new file mode 100644 index 000000000000..a6ebf1fb3899 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/FluxComplianceState.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.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Compliance state of the cluster object. + */ +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 a new instance of FluxComplianceState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FluxComplianceState() { + } + + /** + * Creates or finds a FluxComplianceState from its string representation. + * + * @param name a name to look for. + * @return the corresponding FluxComplianceState. + */ + public static FluxComplianceState fromString(String name) { + return fromString(name, FluxComplianceState.class); + } + + /** + * Gets known FluxComplianceState values. + * + * @return known FluxComplianceState values. + */ + public static Collection values() { + return values(FluxComplianceState.class); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/FluxConfigOperationStatus.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/FluxConfigOperationStatus.java new file mode 100644 index 000000000000..5d2eab1bb707 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/FluxConfigOperationStatus.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.kubernetesconfigurationfluxconfi.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, appliances. + * @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); + + /** + * 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, appliances. + * @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); +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/FluxConfiguration.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/FluxConfiguration.java new file mode 100644 index 000000000000..92e579a3e0d7 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/FluxConfiguration.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.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 azureBlob property: Parameters to reconcile to the AzureBlob source kind type. + * + * @return the azureBlob value. + */ + AzureBlobDefinition azureBlob(); + + /** + * Gets the ociRepository property: Parameters to reconcile to the OCIRepository source kind type. + * + * @return the ociRepository value. + */ + OciRepositoryDefinition ociRepository(); + + /** + * 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 waitForReconciliation property: Whether flux configuration deployment should wait for cluster to + * reconcile the kustomizations. + * + * @return the waitForReconciliation value. + */ + Boolean waitForReconciliation(); + + /** + * Gets the reconciliationWaitDuration property: Maximum duration to wait for flux configuration reconciliation. E.g + * PT1H, PT5M, P1D. + * + * @return the reconciliationWaitDuration value. + */ + String reconciliationWaitDuration(); + + /** + * 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.kubernetesconfigurationfluxconfi.fluent.models.FluxConfigurationInner + * object. + * + * @return the inner object. + */ + FluxConfigurationInner innerModel(); +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/FluxConfigurationPatch.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/FluxConfigurationPatch.java new file mode 100644 index 000000000000..26ee5e4d8250 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/FluxConfigurationPatch.java @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.fluent.models.FluxConfigurationPatchProperties; +import java.io.IOException; +import java.util.Map; + +/** + * The Flux Configuration Patch Request object. + */ +@Fluent +public final class FluxConfigurationPatch implements JsonSerializable { + /* + * Updatable properties of an Flux Configuration Patch Request + */ + private FluxConfigurationPatchProperties innerProperties; + + /** + * Creates an instance of FluxConfigurationPatch class. + */ + public FluxConfigurationPatch() { + } + + /** + * 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 azureBlob property: Parameters to reconcile to the AzureBlob source kind type. + * + * @return the azureBlob value. + */ + public AzureBlobPatchDefinition azureBlob() { + return this.innerProperties() == null ? null : this.innerProperties().azureBlob(); + } + + /** + * Set the azureBlob property: Parameters to reconcile to the AzureBlob source kind type. + * + * @param azureBlob the azureBlob value to set. + * @return the FluxConfigurationPatch object itself. + */ + public FluxConfigurationPatch withAzureBlob(AzureBlobPatchDefinition azureBlob) { + if (this.innerProperties() == null) { + this.innerProperties = new FluxConfigurationPatchProperties(); + } + this.innerProperties().withAzureBlob(azureBlob); + return this; + } + + /** + * Get the ociRepository property: Parameters to reconcile to the OCIRepository source kind type. + * + * @return the ociRepository value. + */ + public OciRepositoryPatchDefinition ociRepository() { + return this.innerProperties() == null ? null : this.innerProperties().ociRepository(); + } + + /** + * Set the ociRepository property: Parameters to reconcile to the OCIRepository source kind type. + * + * @param ociRepository the ociRepository value to set. + * @return the FluxConfigurationPatch object itself. + */ + public FluxConfigurationPatch withOciRepository(OciRepositoryPatchDefinition ociRepository) { + if (this.innerProperties() == null) { + this.innerProperties = new FluxConfigurationPatchProperties(); + } + this.innerProperties().withOciRepository(ociRepository); + 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FluxConfigurationPatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FluxConfigurationPatch if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the FluxConfigurationPatch. + */ + public static FluxConfigurationPatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FluxConfigurationPatch deserializedFluxConfigurationPatch = new FluxConfigurationPatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedFluxConfigurationPatch.innerProperties + = FluxConfigurationPatchProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFluxConfigurationPatch; + }); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/FluxConfigurations.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/FluxConfigurations.java new file mode 100644 index 000000000000..155d54d0952d --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/FluxConfigurations.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.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.kubernetesconfigurationfluxconfi.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, appliances. + * @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); + + /** + * 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, appliances. + * @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); + + /** + * 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, appliances. + * @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, appliances. + * @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, appliances. + * @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, appliances. + * @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, appliances. + * @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, appliances. + * @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, appliances. + * @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, appliances. + * @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/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/FluxConfigurationsList.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/FluxConfigurationsList.java new file mode 100644 index 000000000000..57b534bf2d81 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/FluxConfigurationsList.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.fluent.models.FluxConfigurationInner; +import java.io.IOException; +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 implements JsonSerializable { + /* + * List of Flux Configurations within a Kubernetes cluster. + */ + private List value; + + /* + * URL to get the next set of configuration objects, if any. + */ + private String nextLink; + + /** + * Creates an instance of FluxConfigurationsList class. + */ + public FluxConfigurationsList() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FluxConfigurationsList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FluxConfigurationsList if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the FluxConfigurationsList. + */ + public static FluxConfigurationsList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FluxConfigurationsList deserializedFluxConfigurationsList = new FluxConfigurationsList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> FluxConfigurationInner.fromJson(reader1)); + deserializedFluxConfigurationsList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedFluxConfigurationsList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFluxConfigurationsList; + }); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/GitRepositoryDefinition.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/GitRepositoryDefinition.java new file mode 100644 index 000000000000..eb665b57b8bc --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/GitRepositoryDefinition.java @@ -0,0 +1,331 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters to reconcile to the GitRepository source kind type. + */ +@Fluent +public final class GitRepositoryDefinition implements JsonSerializable { + /* + * The URL to sync for the flux configuration git repository. + */ + private String url; + + /* + * The maximum time to attempt to reconcile the cluster git repository source with the remote. + */ + private Long timeoutInSeconds; + + /* + * The interval at which to re-reconcile the cluster git repository source with the remote. + */ + private Long syncIntervalInSeconds; + + /* + * The source reference for the GitRepository object. + */ + private RepositoryRefDefinition repositoryRef; + + /* + * Base64-encoded known_hosts value containing public SSH keys required to access private git repositories over SSH + */ + private String sshKnownHosts; + + /* + * Plaintext HTTPS username used to access private git repositories over HTTPS + */ + private String httpsUser; + + /* + * Base64-encoded HTTPS certificate authority contents used to access git private git repositories over HTTPS + */ + 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. + */ + private String localAuthRef; + + /* + * Name of the provider used for authentication. + */ + private ProviderType provider; + + /** + * Creates an instance of GitRepositoryDefinition class. + */ + public GitRepositoryDefinition() { + } + + /** + * 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; + } + + /** + * Get the provider property: Name of the provider used for authentication. + * + * @return the provider value. + */ + public ProviderType provider() { + return this.provider; + } + + /** + * Set the provider property: Name of the provider used for authentication. + * + * @param provider the provider value to set. + * @return the GitRepositoryDefinition object itself. + */ + public GitRepositoryDefinition withProvider(ProviderType provider) { + this.provider = provider; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (repositoryRef() != null) { + repositoryRef().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("url", this.url); + jsonWriter.writeNumberField("timeoutInSeconds", this.timeoutInSeconds); + jsonWriter.writeNumberField("syncIntervalInSeconds", this.syncIntervalInSeconds); + jsonWriter.writeJsonField("repositoryRef", this.repositoryRef); + jsonWriter.writeStringField("sshKnownHosts", this.sshKnownHosts); + jsonWriter.writeStringField("httpsUser", this.httpsUser); + jsonWriter.writeStringField("httpsCACert", this.httpsCACert); + jsonWriter.writeStringField("localAuthRef", this.localAuthRef); + jsonWriter.writeStringField("provider", this.provider == null ? null : this.provider.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GitRepositoryDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GitRepositoryDefinition if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the GitRepositoryDefinition. + */ + public static GitRepositoryDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GitRepositoryDefinition deserializedGitRepositoryDefinition = new GitRepositoryDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("url".equals(fieldName)) { + deserializedGitRepositoryDefinition.url = reader.getString(); + } else if ("timeoutInSeconds".equals(fieldName)) { + deserializedGitRepositoryDefinition.timeoutInSeconds = reader.getNullable(JsonReader::getLong); + } else if ("syncIntervalInSeconds".equals(fieldName)) { + deserializedGitRepositoryDefinition.syncIntervalInSeconds = reader.getNullable(JsonReader::getLong); + } else if ("repositoryRef".equals(fieldName)) { + deserializedGitRepositoryDefinition.repositoryRef = RepositoryRefDefinition.fromJson(reader); + } else if ("sshKnownHosts".equals(fieldName)) { + deserializedGitRepositoryDefinition.sshKnownHosts = reader.getString(); + } else if ("httpsUser".equals(fieldName)) { + deserializedGitRepositoryDefinition.httpsUser = reader.getString(); + } else if ("httpsCACert".equals(fieldName)) { + deserializedGitRepositoryDefinition.httpsCACert = reader.getString(); + } else if ("localAuthRef".equals(fieldName)) { + deserializedGitRepositoryDefinition.localAuthRef = reader.getString(); + } else if ("provider".equals(fieldName)) { + deserializedGitRepositoryDefinition.provider = ProviderType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedGitRepositoryDefinition; + }); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/GitRepositoryPatchDefinition.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/GitRepositoryPatchDefinition.java new file mode 100644 index 000000000000..4b3f1695a004 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/GitRepositoryPatchDefinition.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.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters to reconcile to the GitRepository source kind type. + */ +@Fluent +public final class GitRepositoryPatchDefinition implements JsonSerializable { + /* + * The URL to sync for the flux configuration git repository. + */ + private String url; + + /* + * The maximum time to attempt to reconcile the cluster git repository source with the remote. + */ + private Long timeoutInSeconds; + + /* + * The interval at which to re-reconcile the cluster git repository source with the remote. + */ + private Long syncIntervalInSeconds; + + /* + * The source reference for the GitRepository object. + */ + private RepositoryRefDefinition repositoryRef; + + /* + * Base64-encoded known_hosts value containing public SSH keys required to access private git repositories over SSH + */ + private String sshKnownHosts; + + /* + * Plaintext HTTPS username used to access private git repositories over HTTPS + */ + private String httpsUser; + + /* + * Base64-encoded HTTPS certificate authority contents used to access git private git repositories over HTTPS + */ + 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. + */ + private String localAuthRef; + + /* + * Name of the provider used for authentication. + */ + private ProviderType provider; + + /** + * Creates an instance of GitRepositoryPatchDefinition class. + */ + public GitRepositoryPatchDefinition() { + } + + /** + * 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; + } + + /** + * Get the provider property: Name of the provider used for authentication. + * + * @return the provider value. + */ + public ProviderType provider() { + return this.provider; + } + + /** + * Set the provider property: Name of the provider used for authentication. + * + * @param provider the provider value to set. + * @return the GitRepositoryPatchDefinition object itself. + */ + public GitRepositoryPatchDefinition withProvider(ProviderType provider) { + this.provider = provider; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (repositoryRef() != null) { + repositoryRef().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("url", this.url); + jsonWriter.writeNumberField("timeoutInSeconds", this.timeoutInSeconds); + jsonWriter.writeNumberField("syncIntervalInSeconds", this.syncIntervalInSeconds); + jsonWriter.writeJsonField("repositoryRef", this.repositoryRef); + jsonWriter.writeStringField("sshKnownHosts", this.sshKnownHosts); + jsonWriter.writeStringField("httpsUser", this.httpsUser); + jsonWriter.writeStringField("httpsCACert", this.httpsCACert); + jsonWriter.writeStringField("localAuthRef", this.localAuthRef); + jsonWriter.writeStringField("provider", this.provider == null ? null : this.provider.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GitRepositoryPatchDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GitRepositoryPatchDefinition if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GitRepositoryPatchDefinition. + */ + public static GitRepositoryPatchDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GitRepositoryPatchDefinition deserializedGitRepositoryPatchDefinition = new GitRepositoryPatchDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("url".equals(fieldName)) { + deserializedGitRepositoryPatchDefinition.url = reader.getString(); + } else if ("timeoutInSeconds".equals(fieldName)) { + deserializedGitRepositoryPatchDefinition.timeoutInSeconds = reader.getNullable(JsonReader::getLong); + } else if ("syncIntervalInSeconds".equals(fieldName)) { + deserializedGitRepositoryPatchDefinition.syncIntervalInSeconds + = reader.getNullable(JsonReader::getLong); + } else if ("repositoryRef".equals(fieldName)) { + deserializedGitRepositoryPatchDefinition.repositoryRef = RepositoryRefDefinition.fromJson(reader); + } else if ("sshKnownHosts".equals(fieldName)) { + deserializedGitRepositoryPatchDefinition.sshKnownHosts = reader.getString(); + } else if ("httpsUser".equals(fieldName)) { + deserializedGitRepositoryPatchDefinition.httpsUser = reader.getString(); + } else if ("httpsCACert".equals(fieldName)) { + deserializedGitRepositoryPatchDefinition.httpsCACert = reader.getString(); + } else if ("localAuthRef".equals(fieldName)) { + deserializedGitRepositoryPatchDefinition.localAuthRef = reader.getString(); + } else if ("provider".equals(fieldName)) { + deserializedGitRepositoryPatchDefinition.provider = ProviderType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedGitRepositoryPatchDefinition; + }); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/HelmReleasePropertiesDefinition.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/HelmReleasePropertiesDefinition.java new file mode 100644 index 000000000000..cd52d366e8a0 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/HelmReleasePropertiesDefinition.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.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties for HelmRelease objects. + */ +@Fluent +public final class HelmReleasePropertiesDefinition implements JsonSerializable { + /* + * The revision number of the last released object change + */ + private Long lastRevisionApplied; + + /* + * The reference to the HelmChart object used as the source to this HelmRelease + */ + private ObjectReferenceDefinition helmChartRef; + + /* + * Total number of times that the HelmRelease failed to install or upgrade + */ + private Long failureCount; + + /* + * Number of times that the HelmRelease failed to install + */ + private Long installFailureCount; + + /* + * Number of times that the HelmRelease failed to upgrade + */ + private Long upgradeFailureCount; + + /** + * Creates an instance of HelmReleasePropertiesDefinition class. + */ + public HelmReleasePropertiesDefinition() { + } + + /** + * 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("lastRevisionApplied", this.lastRevisionApplied); + jsonWriter.writeJsonField("helmChartRef", this.helmChartRef); + jsonWriter.writeNumberField("failureCount", this.failureCount); + jsonWriter.writeNumberField("installFailureCount", this.installFailureCount); + jsonWriter.writeNumberField("upgradeFailureCount", this.upgradeFailureCount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HelmReleasePropertiesDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HelmReleasePropertiesDefinition if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the HelmReleasePropertiesDefinition. + */ + public static HelmReleasePropertiesDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HelmReleasePropertiesDefinition deserializedHelmReleasePropertiesDefinition + = new HelmReleasePropertiesDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("lastRevisionApplied".equals(fieldName)) { + deserializedHelmReleasePropertiesDefinition.lastRevisionApplied + = reader.getNullable(JsonReader::getLong); + } else if ("helmChartRef".equals(fieldName)) { + deserializedHelmReleasePropertiesDefinition.helmChartRef + = ObjectReferenceDefinition.fromJson(reader); + } else if ("failureCount".equals(fieldName)) { + deserializedHelmReleasePropertiesDefinition.failureCount = reader.getNullable(JsonReader::getLong); + } else if ("installFailureCount".equals(fieldName)) { + deserializedHelmReleasePropertiesDefinition.installFailureCount + = reader.getNullable(JsonReader::getLong); + } else if ("upgradeFailureCount".equals(fieldName)) { + deserializedHelmReleasePropertiesDefinition.upgradeFailureCount + = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedHelmReleasePropertiesDefinition; + }); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/KustomizationDefinition.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/KustomizationDefinition.java new file mode 100644 index 000000000000..282af304264e --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/KustomizationDefinition.java @@ -0,0 +1,349 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +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 implements JsonSerializable { + /* + * Name of the Kustomization, matching the key in the Kustomizations object map. + */ + private String name; + + /* + * The path in the source reference to reconcile on the cluster. + */ + private String path; + + /* + * Specifies other Kustomizations that this Kustomization depends on. This Kustomization will not reconcile until + * all dependencies have completed their reconciliation. + */ + private List dependsOn; + + /* + * The maximum time to attempt to reconcile the Kustomization on the cluster. + */ + private Long timeoutInSeconds; + + /* + * The interval at which to re-reconcile the Kustomization on the cluster. + */ + private Long syncIntervalInSeconds; + + /* + * The interval at which to re-reconcile the Kustomization on the cluster in the event of failure on reconciliation. + */ + private Long retryIntervalInSeconds; + + /* + * Enable/disable garbage collections of Kubernetes objects created by this Kustomization. + */ + private Boolean prune; + + /* + * Enable/disable re-creating Kubernetes resources on the cluster when patching fails due to an immutable field + * change. + */ + private Boolean force; + + /* + * Enable/disable health check for all Kubernetes objects created by this Kustomization. + */ + private Boolean enableWait; + + /* + * Used for variable substitution for this Kustomization after kustomize build. + */ + private PostBuildDefinition postBuild; + + /** + * Creates an instance of KustomizationDefinition class. + */ + public KustomizationDefinition() { + } + + /** + * 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; + } + + /** + * Get the enableWait property: Enable/disable health check for all Kubernetes objects created by this + * Kustomization. + * + * @return the enableWait value. + */ + public Boolean enableWait() { + return this.enableWait; + } + + /** + * Set the enableWait property: Enable/disable health check for all Kubernetes objects created by this + * Kustomization. + * + * @param enableWait the enableWait value to set. + * @return the KustomizationDefinition object itself. + */ + public KustomizationDefinition withEnableWait(Boolean enableWait) { + this.enableWait = enableWait; + return this; + } + + /** + * Get the postBuild property: Used for variable substitution for this Kustomization after kustomize build. + * + * @return the postBuild value. + */ + public PostBuildDefinition postBuild() { + return this.postBuild; + } + + /** + * Set the postBuild property: Used for variable substitution for this Kustomization after kustomize build. + * + * @param postBuild the postBuild value to set. + * @return the KustomizationDefinition object itself. + */ + public KustomizationDefinition withPostBuild(PostBuildDefinition postBuild) { + this.postBuild = postBuild; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (postBuild() != null) { + postBuild().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("path", this.path); + jsonWriter.writeArrayField("dependsOn", this.dependsOn, (writer, element) -> writer.writeString(element)); + jsonWriter.writeNumberField("timeoutInSeconds", this.timeoutInSeconds); + jsonWriter.writeNumberField("syncIntervalInSeconds", this.syncIntervalInSeconds); + jsonWriter.writeNumberField("retryIntervalInSeconds", this.retryIntervalInSeconds); + jsonWriter.writeBooleanField("prune", this.prune); + jsonWriter.writeBooleanField("force", this.force); + jsonWriter.writeBooleanField("wait", this.enableWait); + jsonWriter.writeJsonField("postBuild", this.postBuild); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KustomizationDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KustomizationDefinition if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the KustomizationDefinition. + */ + public static KustomizationDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KustomizationDefinition deserializedKustomizationDefinition = new KustomizationDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedKustomizationDefinition.name = reader.getString(); + } else if ("path".equals(fieldName)) { + deserializedKustomizationDefinition.path = reader.getString(); + } else if ("dependsOn".equals(fieldName)) { + List dependsOn = reader.readArray(reader1 -> reader1.getString()); + deserializedKustomizationDefinition.dependsOn = dependsOn; + } else if ("timeoutInSeconds".equals(fieldName)) { + deserializedKustomizationDefinition.timeoutInSeconds = reader.getNullable(JsonReader::getLong); + } else if ("syncIntervalInSeconds".equals(fieldName)) { + deserializedKustomizationDefinition.syncIntervalInSeconds = reader.getNullable(JsonReader::getLong); + } else if ("retryIntervalInSeconds".equals(fieldName)) { + deserializedKustomizationDefinition.retryIntervalInSeconds + = reader.getNullable(JsonReader::getLong); + } else if ("prune".equals(fieldName)) { + deserializedKustomizationDefinition.prune = reader.getNullable(JsonReader::getBoolean); + } else if ("force".equals(fieldName)) { + deserializedKustomizationDefinition.force = reader.getNullable(JsonReader::getBoolean); + } else if ("wait".equals(fieldName)) { + deserializedKustomizationDefinition.enableWait = reader.getNullable(JsonReader::getBoolean); + } else if ("postBuild".equals(fieldName)) { + deserializedKustomizationDefinition.postBuild = PostBuildDefinition.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedKustomizationDefinition; + }); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/KustomizationPatchDefinition.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/KustomizationPatchDefinition.java new file mode 100644 index 000000000000..d292a9f33597 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/KustomizationPatchDefinition.java @@ -0,0 +1,334 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +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 implements JsonSerializable { + /* + * The path in the source reference to reconcile on the cluster. + */ + private String path; + + /* + * Specifies other Kustomizations that this Kustomization depends on. This Kustomization will not reconcile until + * all dependencies have completed their reconciliation. + */ + private List dependsOn; + + /* + * The maximum time to attempt to reconcile the Kustomization on the cluster. + */ + private Long timeoutInSeconds; + + /* + * The interval at which to re-reconcile the Kustomization on the cluster. + */ + private Long syncIntervalInSeconds; + + /* + * The interval at which to re-reconcile the Kustomization on the cluster in the event of failure on reconciliation. + */ + private Long retryIntervalInSeconds; + + /* + * Enable/disable garbage collections of Kubernetes objects created by this Kustomization. + */ + private Boolean prune; + + /* + * Enable/disable re-creating Kubernetes resources on the cluster when patching fails due to an immutable field + * change. + */ + private Boolean force; + + /* + * Enable/disable health check for all Kubernetes objects created by this Kustomization. + */ + private Boolean enableWait; + + /* + * Used for variable substitution for this Kustomization after kustomize build. + */ + private PostBuildPatchDefinition postBuild; + + /** + * Creates an instance of KustomizationPatchDefinition class. + */ + public KustomizationPatchDefinition() { + } + + /** + * 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; + } + + /** + * Get the enableWait property: Enable/disable health check for all Kubernetes objects created by this + * Kustomization. + * + * @return the enableWait value. + */ + public Boolean enableWait() { + return this.enableWait; + } + + /** + * Set the enableWait property: Enable/disable health check for all Kubernetes objects created by this + * Kustomization. + * + * @param enableWait the enableWait value to set. + * @return the KustomizationPatchDefinition object itself. + */ + public KustomizationPatchDefinition withEnableWait(Boolean enableWait) { + this.enableWait = enableWait; + return this; + } + + /** + * Get the postBuild property: Used for variable substitution for this Kustomization after kustomize build. + * + * @return the postBuild value. + */ + public PostBuildPatchDefinition postBuild() { + return this.postBuild; + } + + /** + * Set the postBuild property: Used for variable substitution for this Kustomization after kustomize build. + * + * @param postBuild the postBuild value to set. + * @return the KustomizationPatchDefinition object itself. + */ + public KustomizationPatchDefinition withPostBuild(PostBuildPatchDefinition postBuild) { + this.postBuild = postBuild; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (postBuild() != null) { + postBuild().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("path", this.path); + jsonWriter.writeArrayField("dependsOn", this.dependsOn, (writer, element) -> writer.writeString(element)); + jsonWriter.writeNumberField("timeoutInSeconds", this.timeoutInSeconds); + jsonWriter.writeNumberField("syncIntervalInSeconds", this.syncIntervalInSeconds); + jsonWriter.writeNumberField("retryIntervalInSeconds", this.retryIntervalInSeconds); + jsonWriter.writeBooleanField("prune", this.prune); + jsonWriter.writeBooleanField("force", this.force); + jsonWriter.writeBooleanField("wait", this.enableWait); + jsonWriter.writeJsonField("postBuild", this.postBuild); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KustomizationPatchDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KustomizationPatchDefinition if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the KustomizationPatchDefinition. + */ + public static KustomizationPatchDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KustomizationPatchDefinition deserializedKustomizationPatchDefinition = new KustomizationPatchDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("path".equals(fieldName)) { + deserializedKustomizationPatchDefinition.path = reader.getString(); + } else if ("dependsOn".equals(fieldName)) { + List dependsOn = reader.readArray(reader1 -> reader1.getString()); + deserializedKustomizationPatchDefinition.dependsOn = dependsOn; + } else if ("timeoutInSeconds".equals(fieldName)) { + deserializedKustomizationPatchDefinition.timeoutInSeconds = reader.getNullable(JsonReader::getLong); + } else if ("syncIntervalInSeconds".equals(fieldName)) { + deserializedKustomizationPatchDefinition.syncIntervalInSeconds + = reader.getNullable(JsonReader::getLong); + } else if ("retryIntervalInSeconds".equals(fieldName)) { + deserializedKustomizationPatchDefinition.retryIntervalInSeconds + = reader.getNullable(JsonReader::getLong); + } else if ("prune".equals(fieldName)) { + deserializedKustomizationPatchDefinition.prune = reader.getNullable(JsonReader::getBoolean); + } else if ("force".equals(fieldName)) { + deserializedKustomizationPatchDefinition.force = reader.getNullable(JsonReader::getBoolean); + } else if ("wait".equals(fieldName)) { + deserializedKustomizationPatchDefinition.enableWait = reader.getNullable(JsonReader::getBoolean); + } else if ("postBuild".equals(fieldName)) { + deserializedKustomizationPatchDefinition.postBuild = PostBuildPatchDefinition.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedKustomizationPatchDefinition; + }); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/LayerSelectorDefinition.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/LayerSelectorDefinition.java new file mode 100644 index 000000000000..98228cb886ec --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/LayerSelectorDefinition.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters to specify which layer to pull from the OCI artifact. By default, the first layer in the artifact is + * pulled. + */ +@Fluent +public final class LayerSelectorDefinition implements JsonSerializable { + /* + * The first layer matching the specified media type will be used. + */ + private String mediaType; + + /* + * The operation to be performed on the selected layer. The default value is 'extract', but it can be set to 'copy'. + */ + private OperationType operation; + + /** + * Creates an instance of LayerSelectorDefinition class. + */ + public LayerSelectorDefinition() { + } + + /** + * Get the mediaType property: The first layer matching the specified media type will be used. + * + * @return the mediaType value. + */ + public String mediaType() { + return this.mediaType; + } + + /** + * Set the mediaType property: The first layer matching the specified media type will be used. + * + * @param mediaType the mediaType value to set. + * @return the LayerSelectorDefinition object itself. + */ + public LayerSelectorDefinition withMediaType(String mediaType) { + this.mediaType = mediaType; + return this; + } + + /** + * Get the operation property: The operation to be performed on the selected layer. The default value is 'extract', + * but it can be set to 'copy'. + * + * @return the operation value. + */ + public OperationType operation() { + return this.operation; + } + + /** + * Set the operation property: The operation to be performed on the selected layer. The default value is 'extract', + * but it can be set to 'copy'. + * + * @param operation the operation value to set. + * @return the LayerSelectorDefinition object itself. + */ + public LayerSelectorDefinition withOperation(OperationType operation) { + this.operation = operation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("mediaType", this.mediaType); + jsonWriter.writeStringField("operation", this.operation == null ? null : this.operation.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LayerSelectorDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LayerSelectorDefinition if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the LayerSelectorDefinition. + */ + public static LayerSelectorDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LayerSelectorDefinition deserializedLayerSelectorDefinition = new LayerSelectorDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("mediaType".equals(fieldName)) { + deserializedLayerSelectorDefinition.mediaType = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedLayerSelectorDefinition.operation = OperationType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedLayerSelectorDefinition; + }); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/LayerSelectorPatchDefinition.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/LayerSelectorPatchDefinition.java new file mode 100644 index 000000000000..0a83318f4ff0 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/LayerSelectorPatchDefinition.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters to specify which layer to pull from the OCI artifact. By default, the first layer in the artifact is + * pulled. + */ +@Fluent +public final class LayerSelectorPatchDefinition implements JsonSerializable { + /* + * The first layer matching the specified media type will be used. + */ + private String mediaType; + + /* + * The operation to be performed on the selected layer. The default value is 'extract', but it can be set to 'copy'. + */ + private OperationType operation; + + /** + * Creates an instance of LayerSelectorPatchDefinition class. + */ + public LayerSelectorPatchDefinition() { + } + + /** + * Get the mediaType property: The first layer matching the specified media type will be used. + * + * @return the mediaType value. + */ + public String mediaType() { + return this.mediaType; + } + + /** + * Set the mediaType property: The first layer matching the specified media type will be used. + * + * @param mediaType the mediaType value to set. + * @return the LayerSelectorPatchDefinition object itself. + */ + public LayerSelectorPatchDefinition withMediaType(String mediaType) { + this.mediaType = mediaType; + return this; + } + + /** + * Get the operation property: The operation to be performed on the selected layer. The default value is 'extract', + * but it can be set to 'copy'. + * + * @return the operation value. + */ + public OperationType operation() { + return this.operation; + } + + /** + * Set the operation property: The operation to be performed on the selected layer. The default value is 'extract', + * but it can be set to 'copy'. + * + * @param operation the operation value to set. + * @return the LayerSelectorPatchDefinition object itself. + */ + public LayerSelectorPatchDefinition withOperation(OperationType operation) { + this.operation = operation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("mediaType", this.mediaType); + jsonWriter.writeStringField("operation", this.operation == null ? null : this.operation.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LayerSelectorPatchDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LayerSelectorPatchDefinition if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LayerSelectorPatchDefinition. + */ + public static LayerSelectorPatchDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LayerSelectorPatchDefinition deserializedLayerSelectorPatchDefinition = new LayerSelectorPatchDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("mediaType".equals(fieldName)) { + deserializedLayerSelectorPatchDefinition.mediaType = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedLayerSelectorPatchDefinition.operation = OperationType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedLayerSelectorPatchDefinition; + }); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ManagedIdentityDefinition.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ManagedIdentityDefinition.java new file mode 100644 index 000000000000..8836164e2a8b --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ManagedIdentityDefinition.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.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters to authenticate using a Managed Identity. + */ +@Fluent +public final class ManagedIdentityDefinition implements JsonSerializable { + /* + * The client Id for authenticating a Managed Identity. + */ + private String clientId; + + /** + * Creates an instance of ManagedIdentityDefinition class. + */ + public ManagedIdentityDefinition() { + } + + /** + * Get the clientId property: The client Id for authenticating a Managed Identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: The client Id for authenticating a Managed Identity. + * + * @param clientId the clientId value to set. + * @return the ManagedIdentityDefinition object itself. + */ + public ManagedIdentityDefinition withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("clientId", this.clientId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedIdentityDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedIdentityDefinition if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedIdentityDefinition. + */ + public static ManagedIdentityDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedIdentityDefinition deserializedManagedIdentityDefinition = new ManagedIdentityDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clientId".equals(fieldName)) { + deserializedManagedIdentityDefinition.clientId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedIdentityDefinition; + }); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ManagedIdentityPatchDefinition.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ManagedIdentityPatchDefinition.java new file mode 100644 index 000000000000..3dd0a18c7643 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ManagedIdentityPatchDefinition.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters to authenticate using a Managed Identity. + */ +@Fluent +public final class ManagedIdentityPatchDefinition implements JsonSerializable { + /* + * The client Id for authenticating a Managed Identity. + */ + private String clientId; + + /** + * Creates an instance of ManagedIdentityPatchDefinition class. + */ + public ManagedIdentityPatchDefinition() { + } + + /** + * Get the clientId property: The client Id for authenticating a Managed Identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: The client Id for authenticating a Managed Identity. + * + * @param clientId the clientId value to set. + * @return the ManagedIdentityPatchDefinition object itself. + */ + public ManagedIdentityPatchDefinition withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("clientId", this.clientId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedIdentityPatchDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedIdentityPatchDefinition if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedIdentityPatchDefinition. + */ + public static ManagedIdentityPatchDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedIdentityPatchDefinition deserializedManagedIdentityPatchDefinition + = new ManagedIdentityPatchDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clientId".equals(fieldName)) { + deserializedManagedIdentityPatchDefinition.clientId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedIdentityPatchDefinition; + }); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/MatchOidcIdentityDefinition.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/MatchOidcIdentityDefinition.java new file mode 100644 index 000000000000..bf4bcc030195 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/MatchOidcIdentityDefinition.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * MatchOIDCIdentity defines the criteria for matching the identity while verifying an OCI artifact. + */ +@Fluent +public final class MatchOidcIdentityDefinition implements JsonSerializable { + /* + * The regex pattern to match against to verify the OIDC issuer. + */ + private String issuer; + + /* + * The regex pattern to match against to verify the identity subject. + */ + private String subject; + + /** + * Creates an instance of MatchOidcIdentityDefinition class. + */ + public MatchOidcIdentityDefinition() { + } + + /** + * Get the issuer property: The regex pattern to match against to verify the OIDC issuer. + * + * @return the issuer value. + */ + public String issuer() { + return this.issuer; + } + + /** + * Set the issuer property: The regex pattern to match against to verify the OIDC issuer. + * + * @param issuer the issuer value to set. + * @return the MatchOidcIdentityDefinition object itself. + */ + public MatchOidcIdentityDefinition withIssuer(String issuer) { + this.issuer = issuer; + return this; + } + + /** + * Get the subject property: The regex pattern to match against to verify the identity subject. + * + * @return the subject value. + */ + public String subject() { + return this.subject; + } + + /** + * Set the subject property: The regex pattern to match against to verify the identity subject. + * + * @param subject the subject value to set. + * @return the MatchOidcIdentityDefinition object itself. + */ + public MatchOidcIdentityDefinition withSubject(String subject) { + this.subject = subject; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("issuer", this.issuer); + jsonWriter.writeStringField("subject", this.subject); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MatchOidcIdentityDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MatchOidcIdentityDefinition if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MatchOidcIdentityDefinition. + */ + public static MatchOidcIdentityDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MatchOidcIdentityDefinition deserializedMatchOidcIdentityDefinition = new MatchOidcIdentityDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("issuer".equals(fieldName)) { + deserializedMatchOidcIdentityDefinition.issuer = reader.getString(); + } else if ("subject".equals(fieldName)) { + deserializedMatchOidcIdentityDefinition.subject = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMatchOidcIdentityDefinition; + }); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/MatchOidcIdentityPatchDefinition.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/MatchOidcIdentityPatchDefinition.java new file mode 100644 index 000000000000..579459150c62 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/MatchOidcIdentityPatchDefinition.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * MatchOIDCIdentity defines the criteria for matching the identity while verifying an OCI artifact. + */ +@Fluent +public final class MatchOidcIdentityPatchDefinition implements JsonSerializable { + /* + * The regex pattern to match against to verify the OIDC issuer. + */ + private String issuer; + + /* + * The regex pattern to match against to verify the identity subject. + */ + private String subject; + + /** + * Creates an instance of MatchOidcIdentityPatchDefinition class. + */ + public MatchOidcIdentityPatchDefinition() { + } + + /** + * Get the issuer property: The regex pattern to match against to verify the OIDC issuer. + * + * @return the issuer value. + */ + public String issuer() { + return this.issuer; + } + + /** + * Set the issuer property: The regex pattern to match against to verify the OIDC issuer. + * + * @param issuer the issuer value to set. + * @return the MatchOidcIdentityPatchDefinition object itself. + */ + public MatchOidcIdentityPatchDefinition withIssuer(String issuer) { + this.issuer = issuer; + return this; + } + + /** + * Get the subject property: The regex pattern to match against to verify the identity subject. + * + * @return the subject value. + */ + public String subject() { + return this.subject; + } + + /** + * Set the subject property: The regex pattern to match against to verify the identity subject. + * + * @param subject the subject value to set. + * @return the MatchOidcIdentityPatchDefinition object itself. + */ + public MatchOidcIdentityPatchDefinition withSubject(String subject) { + this.subject = subject; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("issuer", this.issuer); + jsonWriter.writeStringField("subject", this.subject); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MatchOidcIdentityPatchDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MatchOidcIdentityPatchDefinition if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MatchOidcIdentityPatchDefinition. + */ + public static MatchOidcIdentityPatchDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MatchOidcIdentityPatchDefinition deserializedMatchOidcIdentityPatchDefinition + = new MatchOidcIdentityPatchDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("issuer".equals(fieldName)) { + deserializedMatchOidcIdentityPatchDefinition.issuer = reader.getString(); + } else if ("subject".equals(fieldName)) { + deserializedMatchOidcIdentityPatchDefinition.subject = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMatchOidcIdentityPatchDefinition; + }); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ObjectReferenceDefinition.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ObjectReferenceDefinition.java new file mode 100644 index 000000000000..d7e49c236fb4 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ObjectReferenceDefinition.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Object reference to a Kubernetes object on a cluster. + */ +@Fluent +public final class ObjectReferenceDefinition implements JsonSerializable { + /* + * Name of the object + */ + private String name; + + /* + * Namespace of the object + */ + private String namespace; + + /** + * Creates an instance of ObjectReferenceDefinition class. + */ + public ObjectReferenceDefinition() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("namespace", this.namespace); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ObjectReferenceDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ObjectReferenceDefinition if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ObjectReferenceDefinition. + */ + public static ObjectReferenceDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ObjectReferenceDefinition deserializedObjectReferenceDefinition = new ObjectReferenceDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedObjectReferenceDefinition.name = reader.getString(); + } else if ("namespace".equals(fieldName)) { + deserializedObjectReferenceDefinition.namespace = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedObjectReferenceDefinition; + }); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ObjectStatusConditionDefinition.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ObjectStatusConditionDefinition.java new file mode 100644 index 000000000000..59967b6dd0f7 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ObjectStatusConditionDefinition.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.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Status condition of Kubernetes object. + */ +@Fluent +public final class ObjectStatusConditionDefinition implements JsonSerializable { + /* + * Last time this status condition has changed + */ + private OffsetDateTime lastTransitionTime; + + /* + * A more verbose description of the object status condition + */ + private String message; + + /* + * Reason for the specified status condition type status + */ + private String reason; + + /* + * Status of the Kubernetes object condition type + */ + private String status; + + /* + * Object status condition type for this object + */ + private String type; + + /** + * Creates an instance of ObjectStatusConditionDefinition class. + */ + public ObjectStatusConditionDefinition() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("lastTransitionTime", + this.lastTransitionTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastTransitionTime)); + jsonWriter.writeStringField("message", this.message); + jsonWriter.writeStringField("reason", this.reason); + jsonWriter.writeStringField("status", this.status); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ObjectStatusConditionDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ObjectStatusConditionDefinition if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ObjectStatusConditionDefinition. + */ + public static ObjectStatusConditionDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ObjectStatusConditionDefinition deserializedObjectStatusConditionDefinition + = new ObjectStatusConditionDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("lastTransitionTime".equals(fieldName)) { + deserializedObjectStatusConditionDefinition.lastTransitionTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("message".equals(fieldName)) { + deserializedObjectStatusConditionDefinition.message = reader.getString(); + } else if ("reason".equals(fieldName)) { + deserializedObjectStatusConditionDefinition.reason = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedObjectStatusConditionDefinition.status = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedObjectStatusConditionDefinition.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedObjectStatusConditionDefinition; + }); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ObjectStatusDefinition.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ObjectStatusDefinition.java new file mode 100644 index 000000000000..0132610ecf74 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ObjectStatusDefinition.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Statuses of objects deployed by the user-specified kustomizations from the git repository. + */ +@Fluent +public final class ObjectStatusDefinition implements JsonSerializable { + /* + * Name of the applied object + */ + private String name; + + /* + * Namespace of the applied object + */ + private String namespace; + + /* + * Kind of the applied object + */ + private String kind; + + /* + * Compliance state of the applied object showing whether the applied object has come into a ready state on the + * cluster. + */ + private FluxComplianceState complianceState; + + /* + * Object reference to the Kustomization that applied this object + */ + private ObjectReferenceDefinition appliedBy; + + /* + * List of Kubernetes object status conditions present on the cluster + */ + private List statusConditions; + + /* + * Additional properties that are provided from objects of the HelmRelease kind + */ + private HelmReleasePropertiesDefinition helmReleaseProperties; + + /** + * Creates an instance of ObjectStatusDefinition class. + */ + public ObjectStatusDefinition() { + } + + /** + * 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("namespace", this.namespace); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeStringField("complianceState", + this.complianceState == null ? null : this.complianceState.toString()); + jsonWriter.writeJsonField("appliedBy", this.appliedBy); + jsonWriter.writeArrayField("statusConditions", this.statusConditions, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("helmReleaseProperties", this.helmReleaseProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ObjectStatusDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ObjectStatusDefinition if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ObjectStatusDefinition. + */ + public static ObjectStatusDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ObjectStatusDefinition deserializedObjectStatusDefinition = new ObjectStatusDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedObjectStatusDefinition.name = reader.getString(); + } else if ("namespace".equals(fieldName)) { + deserializedObjectStatusDefinition.namespace = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedObjectStatusDefinition.kind = reader.getString(); + } else if ("complianceState".equals(fieldName)) { + deserializedObjectStatusDefinition.complianceState + = FluxComplianceState.fromString(reader.getString()); + } else if ("appliedBy".equals(fieldName)) { + deserializedObjectStatusDefinition.appliedBy = ObjectReferenceDefinition.fromJson(reader); + } else if ("statusConditions".equals(fieldName)) { + List statusConditions + = reader.readArray(reader1 -> ObjectStatusConditionDefinition.fromJson(reader1)); + deserializedObjectStatusDefinition.statusConditions = statusConditions; + } else if ("helmReleaseProperties".equals(fieldName)) { + deserializedObjectStatusDefinition.helmReleaseProperties + = HelmReleasePropertiesDefinition.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedObjectStatusDefinition; + }); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/OciRepositoryDefinition.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/OciRepositoryDefinition.java new file mode 100644 index 000000000000..9441c1e93950 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/OciRepositoryDefinition.java @@ -0,0 +1,395 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters to reconcile to the OCIRepository source kind type. + */ +@Fluent +public final class OciRepositoryDefinition implements JsonSerializable { + /* + * The URL to sync for the flux configuration OCI repository. + */ + private String url; + + /* + * The maximum time to attempt to reconcile the cluster OCI repository source with the remote. + */ + private Long timeoutInSeconds; + + /* + * The interval at which to re-reconcile the cluster OCI repository source with the remote. + */ + private Long syncIntervalInSeconds; + + /* + * The source reference for the OCIRepository object. + */ + private OciRepositoryRefDefinition repositoryRef; + + /* + * The layer to be pulled from the OCI artifact. + */ + private LayerSelectorDefinition layerSelector; + + /* + * Verification of the authenticity of an OCI Artifact. + */ + private VerifyDefinition verify; + + /* + * Specify whether to allow connecting to a non-TLS HTTP container registry. + */ + private Boolean insecure; + + /* + * Specifies whether to use Workload Identity to authenticate with the OCI repository. + */ + private Boolean useWorkloadIdentity; + + /* + * The service account name to authenticate with the OCI repository. + */ + private String serviceAccountName; + + /* + * Parameters to authenticate using TLS config for OCI repository. + */ + private TlsConfigDefinition tlsConfig; + + /* + * Name of a local secret on the Kubernetes cluster to use as the authentication secret rather than the managed or + * user-provided configuration secrets. + */ + private String localAuthRef; + + /** + * Creates an instance of OciRepositoryDefinition class. + */ + public OciRepositoryDefinition() { + } + + /** + * Get the url property: The URL to sync for the flux configuration OCI repository. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: The URL to sync for the flux configuration OCI repository. + * + * @param url the url value to set. + * @return the OciRepositoryDefinition object itself. + */ + public OciRepositoryDefinition withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the timeoutInSeconds property: The maximum time to attempt to reconcile the cluster OCI 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 OCI repository source + * with the remote. + * + * @param timeoutInSeconds the timeoutInSeconds value to set. + * @return the OciRepositoryDefinition object itself. + */ + public OciRepositoryDefinition withTimeoutInSeconds(Long timeoutInSeconds) { + this.timeoutInSeconds = timeoutInSeconds; + return this; + } + + /** + * Get the syncIntervalInSeconds property: The interval at which to re-reconcile the cluster OCI 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 OCI repository source + * with the remote. + * + * @param syncIntervalInSeconds the syncIntervalInSeconds value to set. + * @return the OciRepositoryDefinition object itself. + */ + public OciRepositoryDefinition withSyncIntervalInSeconds(Long syncIntervalInSeconds) { + this.syncIntervalInSeconds = syncIntervalInSeconds; + return this; + } + + /** + * Get the repositoryRef property: The source reference for the OCIRepository object. + * + * @return the repositoryRef value. + */ + public OciRepositoryRefDefinition repositoryRef() { + return this.repositoryRef; + } + + /** + * Set the repositoryRef property: The source reference for the OCIRepository object. + * + * @param repositoryRef the repositoryRef value to set. + * @return the OciRepositoryDefinition object itself. + */ + public OciRepositoryDefinition withRepositoryRef(OciRepositoryRefDefinition repositoryRef) { + this.repositoryRef = repositoryRef; + return this; + } + + /** + * Get the layerSelector property: The layer to be pulled from the OCI artifact. + * + * @return the layerSelector value. + */ + public LayerSelectorDefinition layerSelector() { + return this.layerSelector; + } + + /** + * Set the layerSelector property: The layer to be pulled from the OCI artifact. + * + * @param layerSelector the layerSelector value to set. + * @return the OciRepositoryDefinition object itself. + */ + public OciRepositoryDefinition withLayerSelector(LayerSelectorDefinition layerSelector) { + this.layerSelector = layerSelector; + return this; + } + + /** + * Get the verify property: Verification of the authenticity of an OCI Artifact. + * + * @return the verify value. + */ + public VerifyDefinition verify() { + return this.verify; + } + + /** + * Set the verify property: Verification of the authenticity of an OCI Artifact. + * + * @param verify the verify value to set. + * @return the OciRepositoryDefinition object itself. + */ + public OciRepositoryDefinition withVerify(VerifyDefinition verify) { + this.verify = verify; + return this; + } + + /** + * Get the insecure property: Specify whether to allow connecting to a non-TLS HTTP container registry. + * + * @return the insecure value. + */ + public Boolean insecure() { + return this.insecure; + } + + /** + * Set the insecure property: Specify whether to allow connecting to a non-TLS HTTP container registry. + * + * @param insecure the insecure value to set. + * @return the OciRepositoryDefinition object itself. + */ + public OciRepositoryDefinition withInsecure(Boolean insecure) { + this.insecure = insecure; + return this; + } + + /** + * Get the useWorkloadIdentity property: Specifies whether to use Workload Identity to authenticate with the OCI + * repository. + * + * @return the useWorkloadIdentity value. + */ + public Boolean useWorkloadIdentity() { + return this.useWorkloadIdentity; + } + + /** + * Set the useWorkloadIdentity property: Specifies whether to use Workload Identity to authenticate with the OCI + * repository. + * + * @param useWorkloadIdentity the useWorkloadIdentity value to set. + * @return the OciRepositoryDefinition object itself. + */ + public OciRepositoryDefinition withUseWorkloadIdentity(Boolean useWorkloadIdentity) { + this.useWorkloadIdentity = useWorkloadIdentity; + return this; + } + + /** + * Get the serviceAccountName property: The service account name to authenticate with the OCI repository. + * + * @return the serviceAccountName value. + */ + public String serviceAccountName() { + return this.serviceAccountName; + } + + /** + * Set the serviceAccountName property: The service account name to authenticate with the OCI repository. + * + * @param serviceAccountName the serviceAccountName value to set. + * @return the OciRepositoryDefinition object itself. + */ + public OciRepositoryDefinition withServiceAccountName(String serviceAccountName) { + this.serviceAccountName = serviceAccountName; + return this; + } + + /** + * Get the tlsConfig property: Parameters to authenticate using TLS config for OCI repository. + * + * @return the tlsConfig value. + */ + public TlsConfigDefinition tlsConfig() { + return this.tlsConfig; + } + + /** + * Set the tlsConfig property: Parameters to authenticate using TLS config for OCI repository. + * + * @param tlsConfig the tlsConfig value to set. + * @return the OciRepositoryDefinition object itself. + */ + public OciRepositoryDefinition withTlsConfig(TlsConfigDefinition tlsConfig) { + this.tlsConfig = tlsConfig; + 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 OciRepositoryDefinition object itself. + */ + public OciRepositoryDefinition 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(); + } + if (layerSelector() != null) { + layerSelector().validate(); + } + if (verify() != null) { + verify().validate(); + } + if (tlsConfig() != null) { + tlsConfig().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("url", this.url); + jsonWriter.writeNumberField("timeoutInSeconds", this.timeoutInSeconds); + jsonWriter.writeNumberField("syncIntervalInSeconds", this.syncIntervalInSeconds); + jsonWriter.writeJsonField("repositoryRef", this.repositoryRef); + jsonWriter.writeJsonField("layerSelector", this.layerSelector); + jsonWriter.writeJsonField("verify", this.verify); + jsonWriter.writeBooleanField("insecure", this.insecure); + jsonWriter.writeBooleanField("useWorkloadIdentity", this.useWorkloadIdentity); + jsonWriter.writeStringField("serviceAccountName", this.serviceAccountName); + jsonWriter.writeJsonField("tlsConfig", this.tlsConfig); + jsonWriter.writeStringField("localAuthRef", this.localAuthRef); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OciRepositoryDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OciRepositoryDefinition if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the OciRepositoryDefinition. + */ + public static OciRepositoryDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OciRepositoryDefinition deserializedOciRepositoryDefinition = new OciRepositoryDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("url".equals(fieldName)) { + deserializedOciRepositoryDefinition.url = reader.getString(); + } else if ("timeoutInSeconds".equals(fieldName)) { + deserializedOciRepositoryDefinition.timeoutInSeconds = reader.getNullable(JsonReader::getLong); + } else if ("syncIntervalInSeconds".equals(fieldName)) { + deserializedOciRepositoryDefinition.syncIntervalInSeconds = reader.getNullable(JsonReader::getLong); + } else if ("repositoryRef".equals(fieldName)) { + deserializedOciRepositoryDefinition.repositoryRef = OciRepositoryRefDefinition.fromJson(reader); + } else if ("layerSelector".equals(fieldName)) { + deserializedOciRepositoryDefinition.layerSelector = LayerSelectorDefinition.fromJson(reader); + } else if ("verify".equals(fieldName)) { + deserializedOciRepositoryDefinition.verify = VerifyDefinition.fromJson(reader); + } else if ("insecure".equals(fieldName)) { + deserializedOciRepositoryDefinition.insecure = reader.getNullable(JsonReader::getBoolean); + } else if ("useWorkloadIdentity".equals(fieldName)) { + deserializedOciRepositoryDefinition.useWorkloadIdentity + = reader.getNullable(JsonReader::getBoolean); + } else if ("serviceAccountName".equals(fieldName)) { + deserializedOciRepositoryDefinition.serviceAccountName = reader.getString(); + } else if ("tlsConfig".equals(fieldName)) { + deserializedOciRepositoryDefinition.tlsConfig = TlsConfigDefinition.fromJson(reader); + } else if ("localAuthRef".equals(fieldName)) { + deserializedOciRepositoryDefinition.localAuthRef = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOciRepositoryDefinition; + }); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/OciRepositoryPatchDefinition.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/OciRepositoryPatchDefinition.java new file mode 100644 index 000000000000..f8a4fc930e1d --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/OciRepositoryPatchDefinition.java @@ -0,0 +1,398 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters to reconcile to the OCIRepository source kind type. + */ +@Fluent +public final class OciRepositoryPatchDefinition implements JsonSerializable { + /* + * The URL to sync for the flux configuration OCI repository. + */ + private String url; + + /* + * The maximum time to attempt to reconcile the cluster OCI repository source with the remote. + */ + private Long timeoutInSeconds; + + /* + * The interval at which to re-reconcile the cluster OCI repository source with the remote. + */ + private Long syncIntervalInSeconds; + + /* + * The source reference for the OCIRepository object. + */ + private OciRepositoryRefPatchDefinition repositoryRef; + + /* + * The layer to be pulled from the OCI artifact. + */ + private LayerSelectorPatchDefinition layerSelector; + + /* + * Verification of the authenticity of an OCI Artifact. + */ + private VerifyPatchDefinition verify; + + /* + * Specify whether to allow connecting to a non-TLS HTTP container registry. + */ + private Boolean insecure; + + /* + * Specifies whether to use Workload Identity to authenticate with the OCI repository. + */ + private Boolean useWorkloadIdentity; + + /* + * The service account name to authenticate with the OCI repository. + */ + private String serviceAccountName; + + /* + * Parameters to authenticate using TLS config for OCI repository. + */ + private TlsConfigPatchDefinition tlsConfig; + + /* + * Name of a local secret on the Kubernetes cluster to use as the authentication secret rather than the managed or + * user-provided configuration secrets. + */ + private String localAuthRef; + + /** + * Creates an instance of OciRepositoryPatchDefinition class. + */ + public OciRepositoryPatchDefinition() { + } + + /** + * Get the url property: The URL to sync for the flux configuration OCI repository. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: The URL to sync for the flux configuration OCI repository. + * + * @param url the url value to set. + * @return the OciRepositoryPatchDefinition object itself. + */ + public OciRepositoryPatchDefinition withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the timeoutInSeconds property: The maximum time to attempt to reconcile the cluster OCI 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 OCI repository source + * with the remote. + * + * @param timeoutInSeconds the timeoutInSeconds value to set. + * @return the OciRepositoryPatchDefinition object itself. + */ + public OciRepositoryPatchDefinition withTimeoutInSeconds(Long timeoutInSeconds) { + this.timeoutInSeconds = timeoutInSeconds; + return this; + } + + /** + * Get the syncIntervalInSeconds property: The interval at which to re-reconcile the cluster OCI 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 OCI repository source + * with the remote. + * + * @param syncIntervalInSeconds the syncIntervalInSeconds value to set. + * @return the OciRepositoryPatchDefinition object itself. + */ + public OciRepositoryPatchDefinition withSyncIntervalInSeconds(Long syncIntervalInSeconds) { + this.syncIntervalInSeconds = syncIntervalInSeconds; + return this; + } + + /** + * Get the repositoryRef property: The source reference for the OCIRepository object. + * + * @return the repositoryRef value. + */ + public OciRepositoryRefPatchDefinition repositoryRef() { + return this.repositoryRef; + } + + /** + * Set the repositoryRef property: The source reference for the OCIRepository object. + * + * @param repositoryRef the repositoryRef value to set. + * @return the OciRepositoryPatchDefinition object itself. + */ + public OciRepositoryPatchDefinition withRepositoryRef(OciRepositoryRefPatchDefinition repositoryRef) { + this.repositoryRef = repositoryRef; + return this; + } + + /** + * Get the layerSelector property: The layer to be pulled from the OCI artifact. + * + * @return the layerSelector value. + */ + public LayerSelectorPatchDefinition layerSelector() { + return this.layerSelector; + } + + /** + * Set the layerSelector property: The layer to be pulled from the OCI artifact. + * + * @param layerSelector the layerSelector value to set. + * @return the OciRepositoryPatchDefinition object itself. + */ + public OciRepositoryPatchDefinition withLayerSelector(LayerSelectorPatchDefinition layerSelector) { + this.layerSelector = layerSelector; + return this; + } + + /** + * Get the verify property: Verification of the authenticity of an OCI Artifact. + * + * @return the verify value. + */ + public VerifyPatchDefinition verify() { + return this.verify; + } + + /** + * Set the verify property: Verification of the authenticity of an OCI Artifact. + * + * @param verify the verify value to set. + * @return the OciRepositoryPatchDefinition object itself. + */ + public OciRepositoryPatchDefinition withVerify(VerifyPatchDefinition verify) { + this.verify = verify; + return this; + } + + /** + * Get the insecure property: Specify whether to allow connecting to a non-TLS HTTP container registry. + * + * @return the insecure value. + */ + public Boolean insecure() { + return this.insecure; + } + + /** + * Set the insecure property: Specify whether to allow connecting to a non-TLS HTTP container registry. + * + * @param insecure the insecure value to set. + * @return the OciRepositoryPatchDefinition object itself. + */ + public OciRepositoryPatchDefinition withInsecure(Boolean insecure) { + this.insecure = insecure; + return this; + } + + /** + * Get the useWorkloadIdentity property: Specifies whether to use Workload Identity to authenticate with the OCI + * repository. + * + * @return the useWorkloadIdentity value. + */ + public Boolean useWorkloadIdentity() { + return this.useWorkloadIdentity; + } + + /** + * Set the useWorkloadIdentity property: Specifies whether to use Workload Identity to authenticate with the OCI + * repository. + * + * @param useWorkloadIdentity the useWorkloadIdentity value to set. + * @return the OciRepositoryPatchDefinition object itself. + */ + public OciRepositoryPatchDefinition withUseWorkloadIdentity(Boolean useWorkloadIdentity) { + this.useWorkloadIdentity = useWorkloadIdentity; + return this; + } + + /** + * Get the serviceAccountName property: The service account name to authenticate with the OCI repository. + * + * @return the serviceAccountName value. + */ + public String serviceAccountName() { + return this.serviceAccountName; + } + + /** + * Set the serviceAccountName property: The service account name to authenticate with the OCI repository. + * + * @param serviceAccountName the serviceAccountName value to set. + * @return the OciRepositoryPatchDefinition object itself. + */ + public OciRepositoryPatchDefinition withServiceAccountName(String serviceAccountName) { + this.serviceAccountName = serviceAccountName; + return this; + } + + /** + * Get the tlsConfig property: Parameters to authenticate using TLS config for OCI repository. + * + * @return the tlsConfig value. + */ + public TlsConfigPatchDefinition tlsConfig() { + return this.tlsConfig; + } + + /** + * Set the tlsConfig property: Parameters to authenticate using TLS config for OCI repository. + * + * @param tlsConfig the tlsConfig value to set. + * @return the OciRepositoryPatchDefinition object itself. + */ + public OciRepositoryPatchDefinition withTlsConfig(TlsConfigPatchDefinition tlsConfig) { + this.tlsConfig = tlsConfig; + 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 OciRepositoryPatchDefinition object itself. + */ + public OciRepositoryPatchDefinition 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(); + } + if (layerSelector() != null) { + layerSelector().validate(); + } + if (verify() != null) { + verify().validate(); + } + if (tlsConfig() != null) { + tlsConfig().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("url", this.url); + jsonWriter.writeNumberField("timeoutInSeconds", this.timeoutInSeconds); + jsonWriter.writeNumberField("syncIntervalInSeconds", this.syncIntervalInSeconds); + jsonWriter.writeJsonField("repositoryRef", this.repositoryRef); + jsonWriter.writeJsonField("layerSelector", this.layerSelector); + jsonWriter.writeJsonField("verify", this.verify); + jsonWriter.writeBooleanField("insecure", this.insecure); + jsonWriter.writeBooleanField("useWorkloadIdentity", this.useWorkloadIdentity); + jsonWriter.writeStringField("serviceAccountName", this.serviceAccountName); + jsonWriter.writeJsonField("tlsConfig", this.tlsConfig); + jsonWriter.writeStringField("localAuthRef", this.localAuthRef); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OciRepositoryPatchDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OciRepositoryPatchDefinition if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OciRepositoryPatchDefinition. + */ + public static OciRepositoryPatchDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OciRepositoryPatchDefinition deserializedOciRepositoryPatchDefinition = new OciRepositoryPatchDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("url".equals(fieldName)) { + deserializedOciRepositoryPatchDefinition.url = reader.getString(); + } else if ("timeoutInSeconds".equals(fieldName)) { + deserializedOciRepositoryPatchDefinition.timeoutInSeconds = reader.getNullable(JsonReader::getLong); + } else if ("syncIntervalInSeconds".equals(fieldName)) { + deserializedOciRepositoryPatchDefinition.syncIntervalInSeconds + = reader.getNullable(JsonReader::getLong); + } else if ("repositoryRef".equals(fieldName)) { + deserializedOciRepositoryPatchDefinition.repositoryRef + = OciRepositoryRefPatchDefinition.fromJson(reader); + } else if ("layerSelector".equals(fieldName)) { + deserializedOciRepositoryPatchDefinition.layerSelector + = LayerSelectorPatchDefinition.fromJson(reader); + } else if ("verify".equals(fieldName)) { + deserializedOciRepositoryPatchDefinition.verify = VerifyPatchDefinition.fromJson(reader); + } else if ("insecure".equals(fieldName)) { + deserializedOciRepositoryPatchDefinition.insecure = reader.getNullable(JsonReader::getBoolean); + } else if ("useWorkloadIdentity".equals(fieldName)) { + deserializedOciRepositoryPatchDefinition.useWorkloadIdentity + = reader.getNullable(JsonReader::getBoolean); + } else if ("serviceAccountName".equals(fieldName)) { + deserializedOciRepositoryPatchDefinition.serviceAccountName = reader.getString(); + } else if ("tlsConfig".equals(fieldName)) { + deserializedOciRepositoryPatchDefinition.tlsConfig = TlsConfigPatchDefinition.fromJson(reader); + } else if ("localAuthRef".equals(fieldName)) { + deserializedOciRepositoryPatchDefinition.localAuthRef = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOciRepositoryPatchDefinition; + }); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/OciRepositoryRefDefinition.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/OciRepositoryRefDefinition.java new file mode 100644 index 000000000000..6703a43b61ba --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/OciRepositoryRefDefinition.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The source reference for the OCIRepository object. + */ +@Fluent +public final class OciRepositoryRefDefinition implements JsonSerializable { + /* + * The OCI repository image tag name to pull. This defaults to 'latest'. + */ + private String tag; + + /* + * The semver range used to match against OCI repository tags. This takes precedence over tag. + */ + private String semver; + + /* + * The image digest to pull from OCI repository, the value should be in the format ‘sha256:’. This takes precedence + * over semver. + */ + private String digest; + + /** + * Creates an instance of OciRepositoryRefDefinition class. + */ + public OciRepositoryRefDefinition() { + } + + /** + * Get the tag property: The OCI repository image tag name to pull. This defaults to 'latest'. + * + * @return the tag value. + */ + public String tag() { + return this.tag; + } + + /** + * Set the tag property: The OCI repository image tag name to pull. This defaults to 'latest'. + * + * @param tag the tag value to set. + * @return the OciRepositoryRefDefinition object itself. + */ + public OciRepositoryRefDefinition withTag(String tag) { + this.tag = tag; + return this; + } + + /** + * Get the semver property: The semver range used to match against OCI 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 OCI repository tags. This takes precedence over + * tag. + * + * @param semver the semver value to set. + * @return the OciRepositoryRefDefinition object itself. + */ + public OciRepositoryRefDefinition withSemver(String semver) { + this.semver = semver; + return this; + } + + /** + * Get the digest property: The image digest to pull from OCI repository, the value should be in the format + * ‘sha256:’. This takes precedence over semver. + * + * @return the digest value. + */ + public String digest() { + return this.digest; + } + + /** + * Set the digest property: The image digest to pull from OCI repository, the value should be in the format + * ‘sha256:’. This takes precedence over semver. + * + * @param digest the digest value to set. + * @return the OciRepositoryRefDefinition object itself. + */ + public OciRepositoryRefDefinition withDigest(String digest) { + this.digest = digest; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tag", this.tag); + jsonWriter.writeStringField("semver", this.semver); + jsonWriter.writeStringField("digest", this.digest); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OciRepositoryRefDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OciRepositoryRefDefinition if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OciRepositoryRefDefinition. + */ + public static OciRepositoryRefDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OciRepositoryRefDefinition deserializedOciRepositoryRefDefinition = new OciRepositoryRefDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tag".equals(fieldName)) { + deserializedOciRepositoryRefDefinition.tag = reader.getString(); + } else if ("semver".equals(fieldName)) { + deserializedOciRepositoryRefDefinition.semver = reader.getString(); + } else if ("digest".equals(fieldName)) { + deserializedOciRepositoryRefDefinition.digest = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOciRepositoryRefDefinition; + }); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/OciRepositoryRefPatchDefinition.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/OciRepositoryRefPatchDefinition.java new file mode 100644 index 000000000000..ecf7b272a8d0 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/OciRepositoryRefPatchDefinition.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.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The source reference for the OCIRepository object. + */ +@Fluent +public final class OciRepositoryRefPatchDefinition implements JsonSerializable { + /* + * The OCI repository image tag name to pull. This defaults to 'latest'. + */ + private String tag; + + /* + * The semver range used to match against OCI repository tags. This takes precedence over tag. + */ + private String semver; + + /* + * The image digest to pull from OCI repository, the value should be in the format ‘sha256:’. This takes precedence + * over semver. + */ + private String digest; + + /** + * Creates an instance of OciRepositoryRefPatchDefinition class. + */ + public OciRepositoryRefPatchDefinition() { + } + + /** + * Get the tag property: The OCI repository image tag name to pull. This defaults to 'latest'. + * + * @return the tag value. + */ + public String tag() { + return this.tag; + } + + /** + * Set the tag property: The OCI repository image tag name to pull. This defaults to 'latest'. + * + * @param tag the tag value to set. + * @return the OciRepositoryRefPatchDefinition object itself. + */ + public OciRepositoryRefPatchDefinition withTag(String tag) { + this.tag = tag; + return this; + } + + /** + * Get the semver property: The semver range used to match against OCI 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 OCI repository tags. This takes precedence over + * tag. + * + * @param semver the semver value to set. + * @return the OciRepositoryRefPatchDefinition object itself. + */ + public OciRepositoryRefPatchDefinition withSemver(String semver) { + this.semver = semver; + return this; + } + + /** + * Get the digest property: The image digest to pull from OCI repository, the value should be in the format + * ‘sha256:’. This takes precedence over semver. + * + * @return the digest value. + */ + public String digest() { + return this.digest; + } + + /** + * Set the digest property: The image digest to pull from OCI repository, the value should be in the format + * ‘sha256:’. This takes precedence over semver. + * + * @param digest the digest value to set. + * @return the OciRepositoryRefPatchDefinition object itself. + */ + public OciRepositoryRefPatchDefinition withDigest(String digest) { + this.digest = digest; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tag", this.tag); + jsonWriter.writeStringField("semver", this.semver); + jsonWriter.writeStringField("digest", this.digest); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OciRepositoryRefPatchDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OciRepositoryRefPatchDefinition if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OciRepositoryRefPatchDefinition. + */ + public static OciRepositoryRefPatchDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OciRepositoryRefPatchDefinition deserializedOciRepositoryRefPatchDefinition + = new OciRepositoryRefPatchDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tag".equals(fieldName)) { + deserializedOciRepositoryRefPatchDefinition.tag = reader.getString(); + } else if ("semver".equals(fieldName)) { + deserializedOciRepositoryRefPatchDefinition.semver = reader.getString(); + } else if ("digest".equals(fieldName)) { + deserializedOciRepositoryRefPatchDefinition.digest = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOciRepositoryRefPatchDefinition; + }); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/OperationStatusResult.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/OperationStatusResult.java new file mode 100644 index 000000000000..86e144b157b2 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/OperationStatusResult.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.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.fluent.models.OperationStatusResultInner; +import java.util.Map; + +/** + * An immutable client-side representation of OperationStatusResult. + */ +public interface OperationStatusResult { + /** + * Gets the id property: Fully qualified ID for the async operation. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of the async operation. + * + * @return the name value. + */ + String name(); + + /** + * Gets the status property: Operation status. + * + * @return the status value. + */ + String status(); + + /** + * Gets the properties property: Additional information, if available. + * + * @return the properties value. + */ + Map properties(); + + /** + * Gets the error property: If present, details of the operation error. + * + * @return the error value. + */ + ManagementError error(); + + /** + * Gets the inner + * com.azure.resourcemanager.kubernetesconfigurationfluxconfi.fluent.models.OperationStatusResultInner object. + * + * @return the inner object. + */ + OperationStatusResultInner innerModel(); +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/OperationType.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/OperationType.java new file mode 100644 index 000000000000..05a3a48a4c2f --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/OperationType.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.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The operation to be performed on the selected layer. The default value is 'extract', but it can be set to 'copy'. + */ +public final class OperationType extends ExpandableStringEnum { + /** + * Static value extract for OperationType. + */ + public static final OperationType EXTRACT = fromString("extract"); + + /** + * Static value copy for OperationType. + */ + public static final OperationType COPY = fromString("copy"); + + /** + * Creates a new instance of OperationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OperationType() { + } + + /** + * Creates or finds a OperationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperationType. + */ + public static OperationType fromString(String name) { + return fromString(name, OperationType.class); + } + + /** + * Gets known OperationType values. + * + * @return known OperationType values. + */ + public static Collection values() { + return values(OperationType.class); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/PostBuildDefinition.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/PostBuildDefinition.java new file mode 100644 index 000000000000..3cdf439a7f57 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/PostBuildDefinition.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * The postBuild definitions defining variable substitutions for this Kustomization after kustomize build. + */ +@Fluent +public final class PostBuildDefinition implements JsonSerializable { + /* + * Key/value pairs holding the variables to be substituted in this Kustomization. + */ + private Map substitute; + + /* + * Array of ConfigMaps/Secrets from which the variables are substituted for this Kustomization. + */ + private List substituteFrom; + + /** + * Creates an instance of PostBuildDefinition class. + */ + public PostBuildDefinition() { + } + + /** + * Get the substitute property: Key/value pairs holding the variables to be substituted in this Kustomization. + * + * @return the substitute value. + */ + public Map substitute() { + return this.substitute; + } + + /** + * Set the substitute property: Key/value pairs holding the variables to be substituted in this Kustomization. + * + * @param substitute the substitute value to set. + * @return the PostBuildDefinition object itself. + */ + public PostBuildDefinition withSubstitute(Map substitute) { + this.substitute = substitute; + return this; + } + + /** + * Get the substituteFrom property: Array of ConfigMaps/Secrets from which the variables are substituted for this + * Kustomization. + * + * @return the substituteFrom value. + */ + public List substituteFrom() { + return this.substituteFrom; + } + + /** + * Set the substituteFrom property: Array of ConfigMaps/Secrets from which the variables are substituted for this + * Kustomization. + * + * @param substituteFrom the substituteFrom value to set. + * @return the PostBuildDefinition object itself. + */ + public PostBuildDefinition withSubstituteFrom(List substituteFrom) { + this.substituteFrom = substituteFrom; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (substituteFrom() != null) { + substituteFrom().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("substitute", this.substitute, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("substituteFrom", this.substituteFrom, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PostBuildDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PostBuildDefinition if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PostBuildDefinition. + */ + public static PostBuildDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PostBuildDefinition deserializedPostBuildDefinition = new PostBuildDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("substitute".equals(fieldName)) { + Map substitute = reader.readMap(reader1 -> reader1.getString()); + deserializedPostBuildDefinition.substitute = substitute; + } else if ("substituteFrom".equals(fieldName)) { + List substituteFrom + = reader.readArray(reader1 -> SubstituteFromDefinition.fromJson(reader1)); + deserializedPostBuildDefinition.substituteFrom = substituteFrom; + } else { + reader.skipChildren(); + } + } + + return deserializedPostBuildDefinition; + }); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/PostBuildPatchDefinition.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/PostBuildPatchDefinition.java new file mode 100644 index 000000000000..b35b0e4011f7 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/PostBuildPatchDefinition.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * The postBuild definitions defining variable substitutions for this Kustomization after kustomize build. + */ +@Fluent +public final class PostBuildPatchDefinition implements JsonSerializable { + /* + * Key/value pairs holding the variables to be substituted in this Kustomization. + */ + private Map substitute; + + /* + * Array of ConfigMaps/Secrets from which the variables are substituted for this Kustomization. + */ + private List substituteFrom; + + /** + * Creates an instance of PostBuildPatchDefinition class. + */ + public PostBuildPatchDefinition() { + } + + /** + * Get the substitute property: Key/value pairs holding the variables to be substituted in this Kustomization. + * + * @return the substitute value. + */ + public Map substitute() { + return this.substitute; + } + + /** + * Set the substitute property: Key/value pairs holding the variables to be substituted in this Kustomization. + * + * @param substitute the substitute value to set. + * @return the PostBuildPatchDefinition object itself. + */ + public PostBuildPatchDefinition withSubstitute(Map substitute) { + this.substitute = substitute; + return this; + } + + /** + * Get the substituteFrom property: Array of ConfigMaps/Secrets from which the variables are substituted for this + * Kustomization. + * + * @return the substituteFrom value. + */ + public List substituteFrom() { + return this.substituteFrom; + } + + /** + * Set the substituteFrom property: Array of ConfigMaps/Secrets from which the variables are substituted for this + * Kustomization. + * + * @param substituteFrom the substituteFrom value to set. + * @return the PostBuildPatchDefinition object itself. + */ + public PostBuildPatchDefinition withSubstituteFrom(List substituteFrom) { + this.substituteFrom = substituteFrom; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (substituteFrom() != null) { + substituteFrom().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("substitute", this.substitute, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("substituteFrom", this.substituteFrom, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PostBuildPatchDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PostBuildPatchDefinition if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PostBuildPatchDefinition. + */ + public static PostBuildPatchDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PostBuildPatchDefinition deserializedPostBuildPatchDefinition = new PostBuildPatchDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("substitute".equals(fieldName)) { + Map substitute = reader.readMap(reader1 -> reader1.getString()); + deserializedPostBuildPatchDefinition.substitute = substitute; + } else if ("substituteFrom".equals(fieldName)) { + List substituteFrom + = reader.readArray(reader1 -> SubstituteFromPatchDefinition.fromJson(reader1)); + deserializedPostBuildPatchDefinition.substituteFrom = substituteFrom; + } else { + reader.skipChildren(); + } + } + + return deserializedPostBuildPatchDefinition; + }); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ProviderType.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ProviderType.java new file mode 100644 index 000000000000..9aa4d56d9358 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ProviderType.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.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Name of the provider used for authentication. + */ +public final class ProviderType extends ExpandableStringEnum { + /** + * Static value Azure for ProviderType. + */ + public static final ProviderType AZURE = fromString("Azure"); + + /** + * Static value GitHub for ProviderType. + */ + public static final ProviderType GIT_HUB = fromString("GitHub"); + + /** + * Static value Generic for ProviderType. + */ + public static final ProviderType GENERIC = fromString("Generic"); + + /** + * Creates a new instance of ProviderType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProviderType() { + } + + /** + * Creates or finds a ProviderType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProviderType. + */ + public static ProviderType fromString(String name) { + return fromString(name, ProviderType.class); + } + + /** + * Gets known ProviderType values. + * + * @return known ProviderType values. + */ + public static Collection values() { + return values(ProviderType.class); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ProvisioningState.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ProvisioningState.java new file mode 100644 index 000000000000..ede8d07acd5d --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ProvisioningState.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.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The provisioning state of the resource. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** + * Static value Succeeded for ProvisioningState. + */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for ProvisioningState. + */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Canceled for ProvisioningState. + */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** + * Static value Creating for ProvisioningState. + */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** + * Static value Updating for ProvisioningState. + */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** + * Static value Deleting for ProvisioningState. + */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** + * Creates a new instance of ProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningState() { + } + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * Gets known ProvisioningState values. + * + * @return known ProvisioningState values. + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/RepositoryRefDefinition.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/RepositoryRefDefinition.java new file mode 100644 index 000000000000..fe393c925df3 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/RepositoryRefDefinition.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The source reference for the GitRepository object. + */ +@Fluent +public final class RepositoryRefDefinition implements JsonSerializable { + /* + * The git repository branch name to checkout. + */ + private String branch; + + /* + * The git repository tag name to checkout. This takes precedence over branch. + */ + private String tag; + + /* + * The semver range used to match against git repository tags. This takes precedence over tag. + */ + 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. + */ + private String commit; + + /** + * Creates an instance of RepositoryRefDefinition class. + */ + public RepositoryRefDefinition() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("branch", this.branch); + jsonWriter.writeStringField("tag", this.tag); + jsonWriter.writeStringField("semver", this.semver); + jsonWriter.writeStringField("commit", this.commit); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RepositoryRefDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RepositoryRefDefinition if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RepositoryRefDefinition. + */ + public static RepositoryRefDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RepositoryRefDefinition deserializedRepositoryRefDefinition = new RepositoryRefDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("branch".equals(fieldName)) { + deserializedRepositoryRefDefinition.branch = reader.getString(); + } else if ("tag".equals(fieldName)) { + deserializedRepositoryRefDefinition.tag = reader.getString(); + } else if ("semver".equals(fieldName)) { + deserializedRepositoryRefDefinition.semver = reader.getString(); + } else if ("commit".equals(fieldName)) { + deserializedRepositoryRefDefinition.commit = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRepositoryRefDefinition; + }); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ScopeType.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ScopeType.java new file mode 100644 index 000000000000..c23374fb1395 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ScopeType.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.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Scope at which the configuration will be installed. + */ +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 a new instance of ScopeType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ScopeType() { + } + + /** + * Creates or finds a ScopeType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ScopeType. + */ + public static ScopeType fromString(String name) { + return fromString(name, ScopeType.class); + } + + /** + * Gets known ScopeType values. + * + * @return known ScopeType values. + */ + public static Collection values() { + return values(ScopeType.class); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ServicePrincipalDefinition.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ServicePrincipalDefinition.java new file mode 100644 index 000000000000..87e9413b688a --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ServicePrincipalDefinition.java @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters to authenticate using Service Principal. + */ +@Fluent +public final class ServicePrincipalDefinition implements JsonSerializable { + /* + * The client Id for authenticating a Service Principal. + */ + private String clientId; + + /* + * The tenant Id for authenticating a Service Principal + */ + private String tenantId; + + /* + * The client secret for authenticating a Service Principal + */ + private String clientSecret; + + /* + * Base64-encoded certificate used to authenticate a Service Principal + */ + private String clientCertificate; + + /* + * The password for the certificate used to authenticate a Service Principal + */ + private String clientCertificatePassword; + + /* + * Specifies whether to include x5c header in client claims when acquiring a token to enable subject name / issuer + * based authentication for the Client Certificate + */ + private Boolean clientCertificateSendChain; + + /** + * Creates an instance of ServicePrincipalDefinition class. + */ + public ServicePrincipalDefinition() { + } + + /** + * Get the clientId property: The client Id for authenticating a Service Principal. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: The client Id for authenticating a Service Principal. + * + * @param clientId the clientId value to set. + * @return the ServicePrincipalDefinition object itself. + */ + public ServicePrincipalDefinition withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the tenantId property: The tenant Id for authenticating a Service Principal. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: The tenant Id for authenticating a Service Principal. + * + * @param tenantId the tenantId value to set. + * @return the ServicePrincipalDefinition object itself. + */ + public ServicePrincipalDefinition withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the clientSecret property: The client secret for authenticating a Service Principal. + * + * @return the clientSecret value. + */ + public String clientSecret() { + return this.clientSecret; + } + + /** + * Set the clientSecret property: The client secret for authenticating a Service Principal. + * + * @param clientSecret the clientSecret value to set. + * @return the ServicePrincipalDefinition object itself. + */ + public ServicePrincipalDefinition withClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Get the clientCertificate property: Base64-encoded certificate used to authenticate a Service Principal. + * + * @return the clientCertificate value. + */ + public String clientCertificate() { + return this.clientCertificate; + } + + /** + * Set the clientCertificate property: Base64-encoded certificate used to authenticate a Service Principal. + * + * @param clientCertificate the clientCertificate value to set. + * @return the ServicePrincipalDefinition object itself. + */ + public ServicePrincipalDefinition withClientCertificate(String clientCertificate) { + this.clientCertificate = clientCertificate; + return this; + } + + /** + * Get the clientCertificatePassword property: The password for the certificate used to authenticate a Service + * Principal. + * + * @return the clientCertificatePassword value. + */ + public String clientCertificatePassword() { + return this.clientCertificatePassword; + } + + /** + * Set the clientCertificatePassword property: The password for the certificate used to authenticate a Service + * Principal. + * + * @param clientCertificatePassword the clientCertificatePassword value to set. + * @return the ServicePrincipalDefinition object itself. + */ + public ServicePrincipalDefinition withClientCertificatePassword(String clientCertificatePassword) { + this.clientCertificatePassword = clientCertificatePassword; + return this; + } + + /** + * Get the clientCertificateSendChain property: Specifies whether to include x5c header in client claims when + * acquiring a token to enable subject name / issuer based authentication for the Client Certificate. + * + * @return the clientCertificateSendChain value. + */ + public Boolean clientCertificateSendChain() { + return this.clientCertificateSendChain; + } + + /** + * Set the clientCertificateSendChain property: Specifies whether to include x5c header in client claims when + * acquiring a token to enable subject name / issuer based authentication for the Client Certificate. + * + * @param clientCertificateSendChain the clientCertificateSendChain value to set. + * @return the ServicePrincipalDefinition object itself. + */ + public ServicePrincipalDefinition withClientCertificateSendChain(Boolean clientCertificateSendChain) { + this.clientCertificateSendChain = clientCertificateSendChain; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("clientId", this.clientId); + jsonWriter.writeStringField("tenantId", this.tenantId); + jsonWriter.writeStringField("clientSecret", this.clientSecret); + jsonWriter.writeStringField("clientCertificate", this.clientCertificate); + jsonWriter.writeStringField("clientCertificatePassword", this.clientCertificatePassword); + jsonWriter.writeBooleanField("clientCertificateSendChain", this.clientCertificateSendChain); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServicePrincipalDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServicePrincipalDefinition if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServicePrincipalDefinition. + */ + public static ServicePrincipalDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServicePrincipalDefinition deserializedServicePrincipalDefinition = new ServicePrincipalDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clientId".equals(fieldName)) { + deserializedServicePrincipalDefinition.clientId = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedServicePrincipalDefinition.tenantId = reader.getString(); + } else if ("clientSecret".equals(fieldName)) { + deserializedServicePrincipalDefinition.clientSecret = reader.getString(); + } else if ("clientCertificate".equals(fieldName)) { + deserializedServicePrincipalDefinition.clientCertificate = reader.getString(); + } else if ("clientCertificatePassword".equals(fieldName)) { + deserializedServicePrincipalDefinition.clientCertificatePassword = reader.getString(); + } else if ("clientCertificateSendChain".equals(fieldName)) { + deserializedServicePrincipalDefinition.clientCertificateSendChain + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedServicePrincipalDefinition; + }); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ServicePrincipalPatchDefinition.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ServicePrincipalPatchDefinition.java new file mode 100644 index 000000000000..31dfb9dc311a --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/ServicePrincipalPatchDefinition.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters to authenticate using Service Principal. + */ +@Fluent +public final class ServicePrincipalPatchDefinition implements JsonSerializable { + /* + * The client Id for authenticating a Service Principal. + */ + private String clientId; + + /* + * The tenant Id for authenticating a Service Principal + */ + private String tenantId; + + /* + * The client secret for authenticating a Service Principal + */ + private String clientSecret; + + /* + * Base64-encoded certificate used to authenticate a Service Principal + */ + private String clientCertificate; + + /* + * The password for the certificate used to authenticate a Service Principal + */ + private String clientCertificatePassword; + + /* + * Specifies whether to include x5c header in client claims when acquiring a token to enable subject name / issuer + * based authentication for the Client Certificate + */ + private Boolean clientCertificateSendChain; + + /** + * Creates an instance of ServicePrincipalPatchDefinition class. + */ + public ServicePrincipalPatchDefinition() { + } + + /** + * Get the clientId property: The client Id for authenticating a Service Principal. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: The client Id for authenticating a Service Principal. + * + * @param clientId the clientId value to set. + * @return the ServicePrincipalPatchDefinition object itself. + */ + public ServicePrincipalPatchDefinition withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the tenantId property: The tenant Id for authenticating a Service Principal. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: The tenant Id for authenticating a Service Principal. + * + * @param tenantId the tenantId value to set. + * @return the ServicePrincipalPatchDefinition object itself. + */ + public ServicePrincipalPatchDefinition withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the clientSecret property: The client secret for authenticating a Service Principal. + * + * @return the clientSecret value. + */ + public String clientSecret() { + return this.clientSecret; + } + + /** + * Set the clientSecret property: The client secret for authenticating a Service Principal. + * + * @param clientSecret the clientSecret value to set. + * @return the ServicePrincipalPatchDefinition object itself. + */ + public ServicePrincipalPatchDefinition withClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Get the clientCertificate property: Base64-encoded certificate used to authenticate a Service Principal. + * + * @return the clientCertificate value. + */ + public String clientCertificate() { + return this.clientCertificate; + } + + /** + * Set the clientCertificate property: Base64-encoded certificate used to authenticate a Service Principal. + * + * @param clientCertificate the clientCertificate value to set. + * @return the ServicePrincipalPatchDefinition object itself. + */ + public ServicePrincipalPatchDefinition withClientCertificate(String clientCertificate) { + this.clientCertificate = clientCertificate; + return this; + } + + /** + * Get the clientCertificatePassword property: The password for the certificate used to authenticate a Service + * Principal. + * + * @return the clientCertificatePassword value. + */ + public String clientCertificatePassword() { + return this.clientCertificatePassword; + } + + /** + * Set the clientCertificatePassword property: The password for the certificate used to authenticate a Service + * Principal. + * + * @param clientCertificatePassword the clientCertificatePassword value to set. + * @return the ServicePrincipalPatchDefinition object itself. + */ + public ServicePrincipalPatchDefinition withClientCertificatePassword(String clientCertificatePassword) { + this.clientCertificatePassword = clientCertificatePassword; + return this; + } + + /** + * Get the clientCertificateSendChain property: Specifies whether to include x5c header in client claims when + * acquiring a token to enable subject name / issuer based authentication for the Client Certificate. + * + * @return the clientCertificateSendChain value. + */ + public Boolean clientCertificateSendChain() { + return this.clientCertificateSendChain; + } + + /** + * Set the clientCertificateSendChain property: Specifies whether to include x5c header in client claims when + * acquiring a token to enable subject name / issuer based authentication for the Client Certificate. + * + * @param clientCertificateSendChain the clientCertificateSendChain value to set. + * @return the ServicePrincipalPatchDefinition object itself. + */ + public ServicePrincipalPatchDefinition withClientCertificateSendChain(Boolean clientCertificateSendChain) { + this.clientCertificateSendChain = clientCertificateSendChain; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("clientId", this.clientId); + jsonWriter.writeStringField("tenantId", this.tenantId); + jsonWriter.writeStringField("clientSecret", this.clientSecret); + jsonWriter.writeStringField("clientCertificate", this.clientCertificate); + jsonWriter.writeStringField("clientCertificatePassword", this.clientCertificatePassword); + jsonWriter.writeBooleanField("clientCertificateSendChain", this.clientCertificateSendChain); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServicePrincipalPatchDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServicePrincipalPatchDefinition if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServicePrincipalPatchDefinition. + */ + public static ServicePrincipalPatchDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServicePrincipalPatchDefinition deserializedServicePrincipalPatchDefinition + = new ServicePrincipalPatchDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clientId".equals(fieldName)) { + deserializedServicePrincipalPatchDefinition.clientId = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedServicePrincipalPatchDefinition.tenantId = reader.getString(); + } else if ("clientSecret".equals(fieldName)) { + deserializedServicePrincipalPatchDefinition.clientSecret = reader.getString(); + } else if ("clientCertificate".equals(fieldName)) { + deserializedServicePrincipalPatchDefinition.clientCertificate = reader.getString(); + } else if ("clientCertificatePassword".equals(fieldName)) { + deserializedServicePrincipalPatchDefinition.clientCertificatePassword = reader.getString(); + } else if ("clientCertificateSendChain".equals(fieldName)) { + deserializedServicePrincipalPatchDefinition.clientCertificateSendChain + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedServicePrincipalPatchDefinition; + }); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/SourceKindType.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/SourceKindType.java new file mode 100644 index 000000000000..71d6e84f4027 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/SourceKindType.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.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Source Kind to pull the configuration data from. + */ +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"); + + /** + * Static value AzureBlob for SourceKindType. + */ + public static final SourceKindType AZURE_BLOB = fromString("AzureBlob"); + + /** + * Static value OCIRepository for SourceKindType. + */ + public static final SourceKindType OCIREPOSITORY = fromString("OCIRepository"); + + /** + * Creates a new instance of SourceKindType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SourceKindType() { + } + + /** + * Creates or finds a SourceKindType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SourceKindType. + */ + public static SourceKindType fromString(String name) { + return fromString(name, SourceKindType.class); + } + + /** + * Gets known SourceKindType values. + * + * @return known SourceKindType values. + */ + public static Collection values() { + return values(SourceKindType.class); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/SubstituteFromDefinition.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/SubstituteFromDefinition.java new file mode 100644 index 000000000000..88d01217f722 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/SubstituteFromDefinition.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Array of ConfigMaps/Secrets from which the variables are substituted for this Kustomization. + */ +@Fluent +public final class SubstituteFromDefinition implements JsonSerializable { + /* + * Define whether it is ConfigMap or Secret that holds the variables to be used in substitution. + */ + private String kind; + + /* + * Name of the ConfigMap/Secret that holds the variables to be used in substitution. + */ + private String name; + + /* + * Set to True to proceed without ConfigMap/Secret, if it is not present. + */ + private Boolean optional; + + /** + * Creates an instance of SubstituteFromDefinition class. + */ + public SubstituteFromDefinition() { + } + + /** + * Get the kind property: Define whether it is ConfigMap or Secret that holds the variables to be used in + * substitution. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Set the kind property: Define whether it is ConfigMap or Secret that holds the variables to be used in + * substitution. + * + * @param kind the kind value to set. + * @return the SubstituteFromDefinition object itself. + */ + public SubstituteFromDefinition withKind(String kind) { + this.kind = kind; + return this; + } + + /** + * Get the name property: Name of the ConfigMap/Secret that holds the variables to be used in substitution. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the ConfigMap/Secret that holds the variables to be used in substitution. + * + * @param name the name value to set. + * @return the SubstituteFromDefinition object itself. + */ + public SubstituteFromDefinition withName(String name) { + this.name = name; + return this; + } + + /** + * Get the optional property: Set to True to proceed without ConfigMap/Secret, if it is not present. + * + * @return the optional value. + */ + public Boolean optional() { + return this.optional; + } + + /** + * Set the optional property: Set to True to proceed without ConfigMap/Secret, if it is not present. + * + * @param optional the optional value to set. + * @return the SubstituteFromDefinition object itself. + */ + public SubstituteFromDefinition withOptional(Boolean optional) { + this.optional = optional; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeBooleanField("optional", this.optional); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SubstituteFromDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SubstituteFromDefinition if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SubstituteFromDefinition. + */ + public static SubstituteFromDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SubstituteFromDefinition deserializedSubstituteFromDefinition = new SubstituteFromDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedSubstituteFromDefinition.kind = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSubstituteFromDefinition.name = reader.getString(); + } else if ("optional".equals(fieldName)) { + deserializedSubstituteFromDefinition.optional = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedSubstituteFromDefinition; + }); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/SubstituteFromPatchDefinition.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/SubstituteFromPatchDefinition.java new file mode 100644 index 000000000000..7a471ba40907 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/SubstituteFromPatchDefinition.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Array of ConfigMaps/Secrets from which the variables are substituted for this Kustomization. + */ +@Fluent +public final class SubstituteFromPatchDefinition implements JsonSerializable { + /* + * Define whether it is ConfigMap or Secret that holds the variables to be used in substitution. + */ + private String kind; + + /* + * Name of the ConfigMap/Secret that holds the variables to be used in substitution. + */ + private String name; + + /* + * Set to True to proceed without ConfigMap/Secret, if it is not present. + */ + private Boolean optional; + + /** + * Creates an instance of SubstituteFromPatchDefinition class. + */ + public SubstituteFromPatchDefinition() { + } + + /** + * Get the kind property: Define whether it is ConfigMap or Secret that holds the variables to be used in + * substitution. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Set the kind property: Define whether it is ConfigMap or Secret that holds the variables to be used in + * substitution. + * + * @param kind the kind value to set. + * @return the SubstituteFromPatchDefinition object itself. + */ + public SubstituteFromPatchDefinition withKind(String kind) { + this.kind = kind; + return this; + } + + /** + * Get the name property: Name of the ConfigMap/Secret that holds the variables to be used in substitution. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the ConfigMap/Secret that holds the variables to be used in substitution. + * + * @param name the name value to set. + * @return the SubstituteFromPatchDefinition object itself. + */ + public SubstituteFromPatchDefinition withName(String name) { + this.name = name; + return this; + } + + /** + * Get the optional property: Set to True to proceed without ConfigMap/Secret, if it is not present. + * + * @return the optional value. + */ + public Boolean optional() { + return this.optional; + } + + /** + * Set the optional property: Set to True to proceed without ConfigMap/Secret, if it is not present. + * + * @param optional the optional value to set. + * @return the SubstituteFromPatchDefinition object itself. + */ + public SubstituteFromPatchDefinition withOptional(Boolean optional) { + this.optional = optional; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeBooleanField("optional", this.optional); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SubstituteFromPatchDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SubstituteFromPatchDefinition if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SubstituteFromPatchDefinition. + */ + public static SubstituteFromPatchDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SubstituteFromPatchDefinition deserializedSubstituteFromPatchDefinition + = new SubstituteFromPatchDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedSubstituteFromPatchDefinition.kind = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSubstituteFromPatchDefinition.name = reader.getString(); + } else if ("optional".equals(fieldName)) { + deserializedSubstituteFromPatchDefinition.optional = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedSubstituteFromPatchDefinition; + }); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/TlsConfigDefinition.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/TlsConfigDefinition.java new file mode 100644 index 000000000000..0fb693d2250c --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/TlsConfigDefinition.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters to authenticate using TLS config for OCI repository. + */ +@Fluent +public final class TlsConfigDefinition implements JsonSerializable { + /* + * Base64-encoded certificate used to authenticate a client with the OCI repository. + */ + private String clientCertificate; + + /* + * Base64-encoded private key used to authenticate a client with the OCI repository. + */ + private String privateKey; + + /* + * Base64-encoded CA certificate used to verify the server. + */ + private String caCertificate; + + /** + * Creates an instance of TlsConfigDefinition class. + */ + public TlsConfigDefinition() { + } + + /** + * Get the clientCertificate property: Base64-encoded certificate used to authenticate a client with the OCI + * repository. + * + * @return the clientCertificate value. + */ + public String clientCertificate() { + return this.clientCertificate; + } + + /** + * Set the clientCertificate property: Base64-encoded certificate used to authenticate a client with the OCI + * repository. + * + * @param clientCertificate the clientCertificate value to set. + * @return the TlsConfigDefinition object itself. + */ + public TlsConfigDefinition withClientCertificate(String clientCertificate) { + this.clientCertificate = clientCertificate; + return this; + } + + /** + * Get the privateKey property: Base64-encoded private key used to authenticate a client with the OCI repository. + * + * @return the privateKey value. + */ + public String privateKey() { + return this.privateKey; + } + + /** + * Set the privateKey property: Base64-encoded private key used to authenticate a client with the OCI repository. + * + * @param privateKey the privateKey value to set. + * @return the TlsConfigDefinition object itself. + */ + public TlsConfigDefinition withPrivateKey(String privateKey) { + this.privateKey = privateKey; + return this; + } + + /** + * Get the caCertificate property: Base64-encoded CA certificate used to verify the server. + * + * @return the caCertificate value. + */ + public String caCertificate() { + return this.caCertificate; + } + + /** + * Set the caCertificate property: Base64-encoded CA certificate used to verify the server. + * + * @param caCertificate the caCertificate value to set. + * @return the TlsConfigDefinition object itself. + */ + public TlsConfigDefinition withCaCertificate(String caCertificate) { + this.caCertificate = caCertificate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("clientCertificate", this.clientCertificate); + jsonWriter.writeStringField("privateKey", this.privateKey); + jsonWriter.writeStringField("caCertificate", this.caCertificate); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TlsConfigDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TlsConfigDefinition if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TlsConfigDefinition. + */ + public static TlsConfigDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TlsConfigDefinition deserializedTlsConfigDefinition = new TlsConfigDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clientCertificate".equals(fieldName)) { + deserializedTlsConfigDefinition.clientCertificate = reader.getString(); + } else if ("privateKey".equals(fieldName)) { + deserializedTlsConfigDefinition.privateKey = reader.getString(); + } else if ("caCertificate".equals(fieldName)) { + deserializedTlsConfigDefinition.caCertificate = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTlsConfigDefinition; + }); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/TlsConfigPatchDefinition.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/TlsConfigPatchDefinition.java new file mode 100644 index 000000000000..b86e8ab422c0 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/TlsConfigPatchDefinition.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters to authenticate using TLS config for OCI repository. + */ +@Fluent +public final class TlsConfigPatchDefinition implements JsonSerializable { + /* + * Base64-encoded certificate used to authenticate a client with the OCI repository. + */ + private String clientCertificate; + + /* + * Base64-encoded private key used to authenticate a client with the OCI repository. + */ + private String privateKey; + + /* + * Base64-encoded CA certificate used to verify the server. + */ + private String caCertificate; + + /** + * Creates an instance of TlsConfigPatchDefinition class. + */ + public TlsConfigPatchDefinition() { + } + + /** + * Get the clientCertificate property: Base64-encoded certificate used to authenticate a client with the OCI + * repository. + * + * @return the clientCertificate value. + */ + public String clientCertificate() { + return this.clientCertificate; + } + + /** + * Set the clientCertificate property: Base64-encoded certificate used to authenticate a client with the OCI + * repository. + * + * @param clientCertificate the clientCertificate value to set. + * @return the TlsConfigPatchDefinition object itself. + */ + public TlsConfigPatchDefinition withClientCertificate(String clientCertificate) { + this.clientCertificate = clientCertificate; + return this; + } + + /** + * Get the privateKey property: Base64-encoded private key used to authenticate a client with the OCI repository. + * + * @return the privateKey value. + */ + public String privateKey() { + return this.privateKey; + } + + /** + * Set the privateKey property: Base64-encoded private key used to authenticate a client with the OCI repository. + * + * @param privateKey the privateKey value to set. + * @return the TlsConfigPatchDefinition object itself. + */ + public TlsConfigPatchDefinition withPrivateKey(String privateKey) { + this.privateKey = privateKey; + return this; + } + + /** + * Get the caCertificate property: Base64-encoded CA certificate used to verify the server. + * + * @return the caCertificate value. + */ + public String caCertificate() { + return this.caCertificate; + } + + /** + * Set the caCertificate property: Base64-encoded CA certificate used to verify the server. + * + * @param caCertificate the caCertificate value to set. + * @return the TlsConfigPatchDefinition object itself. + */ + public TlsConfigPatchDefinition withCaCertificate(String caCertificate) { + this.caCertificate = caCertificate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("clientCertificate", this.clientCertificate); + jsonWriter.writeStringField("privateKey", this.privateKey); + jsonWriter.writeStringField("caCertificate", this.caCertificate); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TlsConfigPatchDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TlsConfigPatchDefinition if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TlsConfigPatchDefinition. + */ + public static TlsConfigPatchDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TlsConfigPatchDefinition deserializedTlsConfigPatchDefinition = new TlsConfigPatchDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clientCertificate".equals(fieldName)) { + deserializedTlsConfigPatchDefinition.clientCertificate = reader.getString(); + } else if ("privateKey".equals(fieldName)) { + deserializedTlsConfigPatchDefinition.privateKey = reader.getString(); + } else if ("caCertificate".equals(fieldName)) { + deserializedTlsConfigPatchDefinition.caCertificate = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTlsConfigPatchDefinition; + }); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/VerifyDefinition.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/VerifyDefinition.java new file mode 100644 index 000000000000..7fb5efb3fc8d --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/VerifyDefinition.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Parameters to verify the authenticity of an OCI Artifact. + */ +@Fluent +public final class VerifyDefinition implements JsonSerializable { + /* + * Verification provider name. + */ + private String provider; + + /* + * An object containing trusted public keys of trusted authors. + */ + private Map verificationConfig; + + /* + * Array defining the criteria for matching the identity while verifying an OCI artifact. + */ + private List matchOidcIdentity; + + /** + * Creates an instance of VerifyDefinition class. + */ + public VerifyDefinition() { + } + + /** + * Get the provider property: Verification provider name. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: Verification provider name. + * + * @param provider the provider value to set. + * @return the VerifyDefinition object itself. + */ + public VerifyDefinition withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the verificationConfig property: An object containing trusted public keys of trusted authors. + * + * @return the verificationConfig value. + */ + public Map verificationConfig() { + return this.verificationConfig; + } + + /** + * Set the verificationConfig property: An object containing trusted public keys of trusted authors. + * + * @param verificationConfig the verificationConfig value to set. + * @return the VerifyDefinition object itself. + */ + public VerifyDefinition withVerificationConfig(Map verificationConfig) { + this.verificationConfig = verificationConfig; + return this; + } + + /** + * Get the matchOidcIdentity property: Array defining the criteria for matching the identity while verifying an OCI + * artifact. + * + * @return the matchOidcIdentity value. + */ + public List matchOidcIdentity() { + return this.matchOidcIdentity; + } + + /** + * Set the matchOidcIdentity property: Array defining the criteria for matching the identity while verifying an OCI + * artifact. + * + * @param matchOidcIdentity the matchOidcIdentity value to set. + * @return the VerifyDefinition object itself. + */ + public VerifyDefinition withMatchOidcIdentity(List matchOidcIdentity) { + this.matchOidcIdentity = matchOidcIdentity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (matchOidcIdentity() != null) { + matchOidcIdentity().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("provider", this.provider); + jsonWriter.writeMapField("verificationConfig", this.verificationConfig, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("matchOidcIdentity", this.matchOidcIdentity, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VerifyDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VerifyDefinition if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the VerifyDefinition. + */ + public static VerifyDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VerifyDefinition deserializedVerifyDefinition = new VerifyDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedVerifyDefinition.provider = reader.getString(); + } else if ("verificationConfig".equals(fieldName)) { + Map verificationConfig = reader.readMap(reader1 -> reader1.getString()); + deserializedVerifyDefinition.verificationConfig = verificationConfig; + } else if ("matchOidcIdentity".equals(fieldName)) { + List matchOidcIdentity + = reader.readArray(reader1 -> MatchOidcIdentityDefinition.fromJson(reader1)); + deserializedVerifyDefinition.matchOidcIdentity = matchOidcIdentity; + } else { + reader.skipChildren(); + } + } + + return deserializedVerifyDefinition; + }); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/VerifyPatchDefinition.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/VerifyPatchDefinition.java new file mode 100644 index 000000000000..3176e80466d4 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/VerifyPatchDefinition.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Parameters to verify the authenticity of an OCI Artifact. + */ +@Fluent +public final class VerifyPatchDefinition implements JsonSerializable { + /* + * Verification provider name. + */ + private String provider; + + /* + * An object containing trusted public keys of trusted authors. + */ + private Map verificationConfig; + + /* + * Array defining the criteria for matching the OIDC identity while verifying an OCI artifact. + */ + private List matchOidcIdentity; + + /** + * Creates an instance of VerifyPatchDefinition class. + */ + public VerifyPatchDefinition() { + } + + /** + * Get the provider property: Verification provider name. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: Verification provider name. + * + * @param provider the provider value to set. + * @return the VerifyPatchDefinition object itself. + */ + public VerifyPatchDefinition withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the verificationConfig property: An object containing trusted public keys of trusted authors. + * + * @return the verificationConfig value. + */ + public Map verificationConfig() { + return this.verificationConfig; + } + + /** + * Set the verificationConfig property: An object containing trusted public keys of trusted authors. + * + * @param verificationConfig the verificationConfig value to set. + * @return the VerifyPatchDefinition object itself. + */ + public VerifyPatchDefinition withVerificationConfig(Map verificationConfig) { + this.verificationConfig = verificationConfig; + return this; + } + + /** + * Get the matchOidcIdentity property: Array defining the criteria for matching the OIDC identity while verifying an + * OCI artifact. + * + * @return the matchOidcIdentity value. + */ + public List matchOidcIdentity() { + return this.matchOidcIdentity; + } + + /** + * Set the matchOidcIdentity property: Array defining the criteria for matching the OIDC identity while verifying an + * OCI artifact. + * + * @param matchOidcIdentity the matchOidcIdentity value to set. + * @return the VerifyPatchDefinition object itself. + */ + public VerifyPatchDefinition withMatchOidcIdentity(List matchOidcIdentity) { + this.matchOidcIdentity = matchOidcIdentity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (matchOidcIdentity() != null) { + matchOidcIdentity().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("provider", this.provider); + jsonWriter.writeMapField("verificationConfig", this.verificationConfig, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("matchOidcIdentity", this.matchOidcIdentity, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VerifyPatchDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VerifyPatchDefinition if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the VerifyPatchDefinition. + */ + public static VerifyPatchDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VerifyPatchDefinition deserializedVerifyPatchDefinition = new VerifyPatchDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedVerifyPatchDefinition.provider = reader.getString(); + } else if ("verificationConfig".equals(fieldName)) { + Map verificationConfig = reader.readMap(reader1 -> reader1.getString()); + deserializedVerifyPatchDefinition.verificationConfig = verificationConfig; + } else if ("matchOidcIdentity".equals(fieldName)) { + List matchOidcIdentity + = reader.readArray(reader1 -> MatchOidcIdentityPatchDefinition.fromJson(reader1)); + deserializedVerifyPatchDefinition.matchOidcIdentity = matchOidcIdentity; + } else { + reader.skipChildren(); + } + } + + return deserializedVerifyPatchDefinition; + }); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/package-info.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/package-info.java new file mode 100644 index 000000000000..b81d96464d23 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the data models for FluxConfigurationClient. + * KubernetesConfiguration Flux Client. + */ +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models; diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/package-info.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/package-info.java new file mode 100644 index 000000000000..828f292dcf02 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the classes for FluxConfigurationClient. + * KubernetesConfiguration Flux Client. + */ +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi; diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/module-info.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/module-info.java new file mode 100644 index 000000000000..ff7b7f56502c --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/java/module-info.java @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.kubernetesconfigurationfluxconfi { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.kubernetesconfigurationfluxconfi; + exports com.azure.resourcemanager.kubernetesconfigurationfluxconfi.fluent; + exports com.azure.resourcemanager.kubernetesconfigurationfluxconfi.fluent.models; + exports com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models; + + opens com.azure.resourcemanager.kubernetesconfigurationfluxconfi.fluent.models to com.azure.core; + opens com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models to com.azure.core; +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-kubernetesconfigurationfluxconfi/proxy-config.json b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-kubernetesconfigurationfluxconfi/proxy-config.json new file mode 100644 index 000000000000..b6f6d035955a --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-kubernetesconfigurationfluxconfi/proxy-config.json @@ -0,0 +1 @@ +[["com.azure.resourcemanager.kubernetesconfigurationfluxconfi.implementation.FluxConfigOperationStatusClientImpl$FluxConfigOperationStatusService"],["com.azure.resourcemanager.kubernetesconfigurationfluxconfi.implementation.FluxConfigurationsClientImpl$FluxConfigurationsService"]] \ No newline at end of file diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-kubernetesconfigurationfluxconfi/reflect-config.json b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-kubernetesconfigurationfluxconfi/reflect-config.json new file mode 100644 index 000000000000..0637a088a01e --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-kubernetesconfigurationfluxconfi/reflect-config.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/resources/azure-resourcemanager-kubernetesconfigurationfluxconfi.properties b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/resources/azure-resourcemanager-kubernetesconfigurationfluxconfi.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/main/resources/azure-resourcemanager-kubernetesconfigurationfluxconfi.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/generated/FluxConfigOperationStatusGetSamples.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/generated/FluxConfigOperationStatusGetSamples.java new file mode 100644 index 000000000000..e0e189700b08 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/generated/FluxConfigOperationStatusGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.generated; + +/** + * Samples for FluxConfigOperationStatus Get. + */ +public final class FluxConfigOperationStatusGetSamples { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/fluxConfigurations/ + * stable/2025-04-01/examples/GetFluxConfigurationAsyncOperationStatus.json + */ + /** + * Sample code: FluxConfigurationAsyncOperationStatus Get. + * + * @param manager Entry point to FluxConfigurationManager. + */ + public static void fluxConfigurationAsyncOperationStatusGet( + com.azure.resourcemanager.kubernetesconfigurationfluxconfi.FluxConfigurationManager manager) { + manager.fluxConfigOperationStatus() + .getWithResponse("rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", "srs-fluxconfig", + "99999999-9999-9999-9999-999999999999", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/generated/FluxConfigurationsCreateOrUpdateSam.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/generated/FluxConfigurationsCreateOrUpdateSam.java new file mode 100644 index 000000000000..35468b4cde99 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/generated/FluxConfigurationsCreateOrUpdateSam.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.generated; + +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.fluent.models.FluxConfigurationInner; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.BucketDefinition; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.GitRepositoryDefinition; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.KustomizationDefinition; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.OciRepositoryDefinition; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.PostBuildDefinition; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.ProviderType; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.RepositoryRefDefinition; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.ScopeType; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.SourceKindType; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.SubstituteFromDefinition; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for FluxConfigurations CreateOrUpdate. + */ +public final class FluxConfigurationsCreateOrUpdateSam { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/fluxConfigurations/ + * stable/2025-04-01/examples/CreateFluxConfigurationWithOCIRepository.json + */ + /** + * Sample code: Create Flux Configuration with OCIRepository Source Kind. + * + * @param manager Entry point to FluxConfigurationManager. + */ + public static void createFluxConfigurationWithOCIRepositorySourceKind( + com.azure.resourcemanager.kubernetesconfigurationfluxconfi.FluxConfigurationManager manager) { + manager.fluxConfigurations() + .createOrUpdate("rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", "srs-fluxconfig", + new FluxConfigurationInner().withScope(ScopeType.CLUSTER) + .withNamespace("srs-namespace") + .withSourceKind(SourceKindType.OCIREPOSITORY) + .withSuspend(false) + .withOciRepository( + new OciRepositoryDefinition().withUrl("oci://ghcr.io/stefanprodan/manifests/podinfo") + .withTimeoutInSeconds(1000L) + .withSyncIntervalInSeconds(1000L) + .withServiceAccountName("testserviceaccount")) + .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))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/fluxConfigurations/ + * stable/2025-04-01/examples/CreateFluxConfiguration.json + */ + /** + * Sample code: Create Flux Configuration. + * + * @param manager Entry point to FluxConfigurationManager. + */ + public static void createFluxConfiguration( + com.azure.resourcemanager.kubernetesconfigurationfluxconfi.FluxConfigurationManager 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) + .withEnableWait(true) + .withPostBuild(new PostBuildDefinition() + .withSubstitute(mapOf("cluster_env", "prod", "replica_count", "2")) + .withSubstituteFrom(Arrays.asList(new SubstituteFromDefinition().withKind("ConfigMap") + .withName("cluster-test") + .withOptional(true)))), + "srs-kustomization2", + new KustomizationDefinition().withPath("./other/test/path") + .withDependsOn(Arrays.asList("srs-kustomization1")) + .withTimeoutInSeconds(600L) + .withSyncIntervalInSeconds(600L) + .withRetryIntervalInSeconds(600L) + .withPrune(false) + .withEnableWait(false) + .withPostBuild(new PostBuildDefinition().withSubstituteFrom(Arrays.asList( + new SubstituteFromDefinition().withKind("ConfigMap") + .withName("cluster-values") + .withOptional(true), + new SubstituteFromDefinition().withKind("Secret") + .withName("secret-name") + .withOptional(false)))))) + .withWaitForReconciliation(true) + .withReconciliationWaitDuration("PT30M"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/fluxConfigurations/ + * stable/2025-04-01/examples/CreateFluxConfigurationWithProvider.json + */ + /** + * Sample code: Create Flux Configuration with Git Repository Provider. + * + * @param manager Entry point to FluxConfigurationManager. + */ + public static void createFluxConfigurationWithGitRepositoryProvider( + com.azure.resourcemanager.kubernetesconfigurationfluxconfi.FluxConfigurationManager 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://dev.azure.com/org/proj/_git/arc-k8s-demo") + .withTimeoutInSeconds(600L) + .withSyncIntervalInSeconds(600L) + .withRepositoryRef(new RepositoryRefDefinition().withBranch("master")) + .withHttpsCACert("ZXhhbXBsZWNlcnRpZmljYXRl") + .withProvider(ProviderType.AZURE)) + .withKustomizations(mapOf("srs-kustomization1", + new KustomizationDefinition().withPath("./test/path") + .withDependsOn(Arrays.asList()) + .withTimeoutInSeconds(600L) + .withSyncIntervalInSeconds(600L) + .withEnableWait(true) + .withPostBuild(new PostBuildDefinition() + .withSubstitute(mapOf("cluster_env", "prod", "replica_count", "2")) + .withSubstituteFrom(Arrays.asList(new SubstituteFromDefinition().withKind("ConfigMap") + .withName("cluster-test") + .withOptional(true)))), + "srs-kustomization2", + new KustomizationDefinition().withPath("./other/test/path") + .withDependsOn(Arrays.asList("srs-kustomization1")) + .withTimeoutInSeconds(600L) + .withSyncIntervalInSeconds(600L) + .withRetryIntervalInSeconds(600L) + .withPrune(false) + .withEnableWait(false) + .withPostBuild(new PostBuildDefinition().withSubstituteFrom(Arrays.asList( + new SubstituteFromDefinition().withKind("ConfigMap") + .withName("cluster-values") + .withOptional(true), + new SubstituteFromDefinition().withKind("Secret") + .withName("secret-name") + .withOptional(false)))))) + .withWaitForReconciliation(true) + .withReconciliationWaitDuration("PT30M"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/fluxConfigurations/ + * stable/2025-04-01/examples/CreateFluxConfigurationWithBucket.json + */ + /** + * Sample code: Create Flux Configuration with Bucket Source Kind. + * + * @param manager Entry point to FluxConfigurationManager. + */ + public static void createFluxConfigurationWithBucketSourceKind( + com.azure.resourcemanager.kubernetesconfigurationfluxconfi.FluxConfigurationManager 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("fakeTokenPlaceholder")) + .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))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @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/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/generated/FluxConfigurationsDeleteSamples.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/generated/FluxConfigurationsDeleteSamples.java new file mode 100644 index 000000000000..f78bd4930877 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/generated/FluxConfigurationsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.generated; + +/** + * Samples for FluxConfigurations Delete. + */ +public final class FluxConfigurationsDeleteSamples { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/fluxConfigurations/ + * stable/2025-04-01/examples/DeleteFluxConfiguration.json + */ + /** + * Sample code: Delete Flux Configuration. + * + * @param manager Entry point to FluxConfigurationManager. + */ + public static void deleteFluxConfiguration( + com.azure.resourcemanager.kubernetesconfigurationfluxconfi.FluxConfigurationManager manager) { + manager.fluxConfigurations() + .delete("rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", "srs-fluxconfig", null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/generated/FluxConfigurationsGetSamples.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/generated/FluxConfigurationsGetSamples.java new file mode 100644 index 000000000000..73e73f7a9902 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/generated/FluxConfigurationsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.generated; + +/** + * Samples for FluxConfigurations Get. + */ +public final class FluxConfigurationsGetSamples { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/fluxConfigurations/ + * stable/2025-04-01/examples/GetFluxConfiguration.json + */ + /** + * Sample code: Get Flux Configuration. + * + * @param manager Entry point to FluxConfigurationManager. + */ + public static void getFluxConfiguration( + com.azure.resourcemanager.kubernetesconfigurationfluxconfi.FluxConfigurationManager manager) { + manager.fluxConfigurations() + .getWithResponse("rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", "srs-fluxconfig", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/generated/FluxConfigurationsListSamples.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/generated/FluxConfigurationsListSamples.java new file mode 100644 index 000000000000..43b6c79232d3 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/generated/FluxConfigurationsListSamples.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.kubernetesconfigurationfluxconfi.generated; + +/** + * Samples for FluxConfigurations List. + */ +public final class FluxConfigurationsListSamples { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/fluxConfigurations/ + * stable/2025-04-01/examples/ListFluxConfigurations.json + */ + /** + * Sample code: List Flux Configuration. + * + * @param manager Entry point to FluxConfigurationManager. + */ + public static void listFluxConfiguration( + com.azure.resourcemanager.kubernetesconfigurationfluxconfi.FluxConfigurationManager manager) { + manager.fluxConfigurations() + .list("rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/generated/FluxConfigurationsUpdateSamples.java b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/generated/FluxConfigurationsUpdateSamples.java new file mode 100644 index 000000000000..a2eee88e4e30 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationfluxconfi/generated/FluxConfigurationsUpdateSamples.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationfluxconfi.generated; + +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.FluxConfigurationPatch; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.models.GitRepositoryPatchDefinition; +import com.azure.resourcemanager.kubernetesconfigurationfluxconfi.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/fluxConfigurations/ + * stable/2025-04-01/examples/PatchFluxConfiguration.json + */ + /** + * Sample code: Patch Flux Configuration. + * + * @param manager Entry point to FluxConfigurationManager. + */ + public static void patchFluxConfiguration( + com.azure.resourcemanager.kubernetesconfigurationfluxconfi.FluxConfigurationManager 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))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @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/kubernetesconfigurationfluxconfi/ci.yml b/sdk/kubernetesconfigurationfluxconfi/ci.yml new file mode 100644 index 000000000000..ed08ae7b1205 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/ci.yml @@ -0,0 +1,46 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/kubernetesconfigurationfluxconfi/ci.yml + - sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/ + exclude: + - sdk/kubernetesconfigurationfluxconfi/pom.xml + - sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/kubernetesconfigurationfluxconfi/ci.yml + - sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/ + exclude: + - sdk/kubernetesconfigurationfluxconfi/pom.xml + - sdk/kubernetesconfigurationfluxconfi/azure-resourcemanager-kubernetesconfigurationfluxconfi/pom.xml + +parameters: + - name: release_azureresourcemanagerkubernetesconfigurationfluxconfi + displayName: azure-resourcemanager-kubernetesconfigurationfluxconfi + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: kubernetesconfigurationfluxconfi + Artifacts: + - name: azure-resourcemanager-kubernetesconfigurationfluxconfi + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerkubernetesconfigurationfluxconfi + releaseInBatch: ${{ parameters.release_azureresourcemanagerkubernetesconfigurationfluxconfi }} diff --git a/sdk/kubernetesconfigurationfluxconfi/pom.xml b/sdk/kubernetesconfigurationfluxconfi/pom.xml new file mode 100644 index 000000000000..203e3e61e640 --- /dev/null +++ b/sdk/kubernetesconfigurationfluxconfi/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-kubernetesconfigurationfluxconfi-service + pom + 1.0.0 + + + azure-resourcemanager-kubernetesconfigurationfluxconfi + +