diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/CHANGELOG.md b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/CHANGELOG.md index 5c1b9b364f6f..d96bc836361e 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/CHANGELOG.md +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2021-09-09) +- Azure Resource Manager HybridKubernetes client library for Java. This package contains Microsoft Azure SDK for HybridKubernetes Management SDK. Hybrid Kubernetes Client. Package tag package-2021-10-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.0.0-beta.1 (2021-03-01) diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/README.md b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/README.md index 8dfa2bd8605c..98700edad3c6 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/README.md +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/README.md @@ -2,7 +2,7 @@ Azure Resource Manager HybridKubernetes client library for Java. -This package contains Microsoft Azure SDK for HybridKubernetes Management SDK. Hybrid Kubernetes Client. Package tag package-2021-03-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for HybridKubernetes Management SDK. Hybrid Kubernetes Client. Package tag package-2021-10-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-hybridkubernetes - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -74,6 +74,8 @@ See [API design][design] for general introduction on design and key concepts on ## Examples + + ## Troubleshooting ## Next steps diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/pom.xml b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/pom.xml index 0a39c0e7d852..913cf6caeeb3 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/pom.xml +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/pom.xml @@ -1,67 +1,86 @@ - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + - com.azure.resourcemanager - azure-resourcemanager-hybridkubernetes - 1.0.0-beta.2 - jar + com.azure.resourcemanager + azure-resourcemanager-hybridkubernetes + 1.0.0-beta.2 + jar - Microsoft Azure SDK for HybridKubernetes Management - This package contains Microsoft Azure SDK for HybridKubernetes Management SDK. Hybrid Kubernetes Client. Package tag package-2021-03-01. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt - https://github.com/Azure/azure-sdk-for-java + Microsoft Azure SDK for HybridKubernetes Management + This package contains Microsoft Azure SDK for HybridKubernetes Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Hybrid Kubernetes Client. Package tag package-2021-10-01. + https://github.com/Azure/azure-sdk-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - + + + 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 - - - - - com.azure - azure-core - 1.20.0 - - - com.azure - azure-core-management - 1.4.1 - - - - - - org.jacoco - jacoco-maven-plugin - 0.8.5 - - true - - - - + + 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 + + + + + com.azure + azure-core + 1.20.0 + + + com.azure + azure-core-management + 1.4.1 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + org.revapi + revapi-maven-plugin + 0.11.2 + + + + + java.method.addedToInterface + + + true + .* + com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)* + + + + + + + diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/HybridKubernetesManager.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/HybridKubernetesManager.java index 3835b358ae68..b98bdb2bf576 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/HybridKubernetesManager.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/HybridKubernetesManager.java @@ -9,7 +9,6 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; import com.azure.core.http.policy.AddDatePolicy; -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; @@ -17,6 +16,7 @@ import com.azure.core.http.policy.RequestIdPolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; @@ -81,6 +81,7 @@ public static final class Configurable { private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; private Duration defaultPollInterval; @@ -120,6 +121,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) { 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. * @@ -176,6 +188,9 @@ public HybridKubernetesManager authenticate(TokenCredential credential, AzurePro userAgentBuilder.append(" (auto-generated)"); } + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } if (retryPolicy == null) { retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); } @@ -185,10 +200,8 @@ public HybridKubernetesManager authenticate(TokenCredential credential, AzurePro HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); - policies - .add( - new BearerTokenAuthenticationPolicy( - credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies.addAll(this.policies); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); HttpPipeline httpPipeline = diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/ConnectedClustersClient.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/ConnectedClustersClient.java index 0b7b38ce9891..9887030bc0df 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/ConnectedClustersClient.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/ConnectedClustersClient.java @@ -12,7 +12,9 @@ import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.hybridkubernetes.fluent.models.ConnectedClusterInner; +import com.azure.resourcemanager.hybridkubernetes.fluent.models.CredentialResultsInner; import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusterPatch; +import com.azure.resourcemanager.hybridkubernetes.models.ListClusterUserCredentialProperties; /** An instance of this class provides access to all the operations defined in ConnectedClustersClient. */ public interface ConnectedClustersClient { @@ -190,6 +192,37 @@ Response getByResourceGroupWithResponse( @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String clusterName, Context context); + /** + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param properties ListClusterUserCredential properties. + * @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 cluster user credentials of the connected cluster with a specified resource group and name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CredentialResultsInner listClusterUserCredential( + String resourceGroupName, String clusterName, ListClusterUserCredentialProperties properties); + + /** + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param properties ListClusterUserCredential properties. + * @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 cluster user credentials of the connected cluster with a specified resource group and name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listClusterUserCredentialWithResponse( + String resourceGroupName, String clusterName, ListClusterUserCredentialProperties properties, Context context); + /** * API to enumerate registered connected K8s clusters under a Resource Group. * diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/ConnectedClusterInner.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/ConnectedClusterInner.java index 1470801b61e5..61ca9bff0634 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/ConnectedClusterInner.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/ConnectedClusterInner.java @@ -7,11 +7,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusterIdentity; import com.azure.resourcemanager.hybridkubernetes.models.ConnectivityStatus; import com.azure.resourcemanager.hybridkubernetes.models.ProvisioningState; -import com.azure.resourcemanager.hybridkubernetes.models.SystemData; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; @@ -325,9 +325,6 @@ public void validate() { } else { identity().validate(); } - if (systemData() != null) { - systemData().validate(); - } if (agentPublicKeyCertificate() == null) { throw logger .logExceptionAsError( diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/CredentialResultsInner.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/CredentialResultsInner.java new file mode 100644 index 000000000000..2e6869c986f3 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/CredentialResultsInner.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridkubernetes.models.CredentialResult; +import com.azure.resourcemanager.hybridkubernetes.models.HybridConnectionConfig; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of credential result response. */ +@Immutable +public final class CredentialResultsInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CredentialResultsInner.class); + + /* + * Contains the REP (rendezvous endpoint) and “Sender” access token. + */ + @JsonProperty(value = "hybridConnectionConfig", access = JsonProperty.Access.WRITE_ONLY) + private HybridConnectionConfig hybridConnectionConfig; + + /* + * Base64-encoded Kubernetes configuration file. + */ + @JsonProperty(value = "kubeconfigs", access = JsonProperty.Access.WRITE_ONLY) + private List kubeconfigs; + + /** + * Get the hybridConnectionConfig property: Contains the REP (rendezvous endpoint) and “Sender” access token. + * + * @return the hybridConnectionConfig value. + */ + public HybridConnectionConfig hybridConnectionConfig() { + return this.hybridConnectionConfig; + } + + /** + * Get the kubeconfigs property: Base64-encoded Kubernetes configuration file. + * + * @return the kubeconfigs value. + */ + public List kubeconfigs() { + return this.kubeconfigs; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hybridConnectionConfig() != null) { + hybridConnectionConfig().validate(); + } + if (kubeconfigs() != null) { + kubeconfigs().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClusterImpl.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClusterImpl.java index 4f4736982dee..8b8e05f6fd0d 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClusterImpl.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClusterImpl.java @@ -4,16 +4,18 @@ package com.azure.resourcemanager.hybridkubernetes.implementation; +import com.azure.core.http.rest.Response; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; -import com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager; import com.azure.resourcemanager.hybridkubernetes.fluent.models.ConnectedClusterInner; import com.azure.resourcemanager.hybridkubernetes.models.ConnectedCluster; import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusterIdentity; import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusterPatch; import com.azure.resourcemanager.hybridkubernetes.models.ConnectivityStatus; +import com.azure.resourcemanager.hybridkubernetes.models.CredentialResults; +import com.azure.resourcemanager.hybridkubernetes.models.ListClusterUserCredentialProperties; import com.azure.resourcemanager.hybridkubernetes.models.ProvisioningState; -import com.azure.resourcemanager.hybridkubernetes.models.SystemData; import java.time.OffsetDateTime; import java.util.Collections; import java.util.Map; @@ -22,7 +24,7 @@ public final class ConnectedClusterImpl implements ConnectedCluster, ConnectedCluster.Definition, ConnectedCluster.Update { private ConnectedClusterInner innerObject; - private final HybridKubernetesManager serviceManager; + private final com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager; public String id() { return this.innerModel().id(); @@ -117,7 +119,7 @@ public ConnectedClusterInner innerModel() { return this.innerObject; } - private HybridKubernetesManager manager() { + private com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager() { return this.serviceManager; } @@ -150,7 +152,8 @@ public ConnectedCluster create(Context context) { return this; } - ConnectedClusterImpl(String name, HybridKubernetesManager serviceManager) { + ConnectedClusterImpl( + String name, com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager) { this.innerObject = new ConnectedClusterInner(); this.serviceManager = serviceManager; this.clusterName = name; @@ -181,7 +184,9 @@ public ConnectedCluster apply(Context context) { return this; } - ConnectedClusterImpl(ConnectedClusterInner innerObject, HybridKubernetesManager serviceManager) { + ConnectedClusterImpl( + ConnectedClusterInner innerObject, + com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourcegroups"); @@ -208,6 +213,17 @@ public ConnectedCluster refresh(Context context) { return this; } + public CredentialResults listClusterUserCredential(ListClusterUserCredentialProperties properties) { + return serviceManager.connectedClusters().listClusterUserCredential(resourceGroupName, clusterName, properties); + } + + public Response listClusterUserCredentialWithResponse( + ListClusterUserCredentialProperties properties, Context context) { + return serviceManager + .connectedClusters() + .listClusterUserCredentialWithResponse(resourceGroupName, clusterName, properties, context); + } + public ConnectedClusterImpl withRegion(Region location) { this.innerModel().withLocation(location.toString()); return this; diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClustersClientImpl.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClustersClientImpl.java index 0418689a6bde..3750d30639bf 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClustersClientImpl.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClustersClientImpl.java @@ -14,6 +14,7 @@ import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -35,8 +36,10 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.hybridkubernetes.fluent.ConnectedClustersClient; import com.azure.resourcemanager.hybridkubernetes.fluent.models.ConnectedClusterInner; +import com.azure.resourcemanager.hybridkubernetes.fluent.models.CredentialResultsInner; import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusterList; import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusterPatch; +import com.azure.resourcemanager.hybridkubernetes.models.ListClusterUserCredentialProperties; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -131,6 +134,22 @@ Mono>> delete( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Kubernetes" + + "/connectedClusters/{clusterName}/listClusterUserCredential") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listClusterUserCredential( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @BodyParam("application/json") ListClusterUserCredentialProperties properties, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Kubernetes" @@ -230,7 +249,7 @@ private Mono>> createWithResponseAsync( connectedCluster, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -499,7 +518,7 @@ private Mono> updateWithResponseAsync( connectedClusterPatch, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -662,7 +681,7 @@ private Mono> getByResourceGroupWithResponseAsyn clusterName, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -814,7 +833,7 @@ private Mono>> deleteWithResponseAsync(String resource clusterName, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -996,6 +1015,174 @@ public void delete(String resourceGroupName, String clusterName, Context context deleteAsync(resourceGroupName, clusterName, context).block(); } + /** + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param properties ListClusterUserCredential properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster user credentials of the connected cluster with a specified resource group and name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listClusterUserCredentialWithResponseAsync( + String resourceGroupName, String clusterName, ListClusterUserCredentialProperties properties) { + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listClusterUserCredential( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + properties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param properties ListClusterUserCredential properties. + * @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 cluster user credentials of the connected cluster with a specified resource group and name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listClusterUserCredentialWithResponseAsync( + String resourceGroupName, String clusterName, ListClusterUserCredentialProperties properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listClusterUserCredential( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + properties, + accept, + context); + } + + /** + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param properties ListClusterUserCredential properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster user credentials of the connected cluster with a specified resource group and name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listClusterUserCredentialAsync( + String resourceGroupName, String clusterName, ListClusterUserCredentialProperties properties) { + return listClusterUserCredentialWithResponseAsync(resourceGroupName, clusterName, properties) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param properties ListClusterUserCredential properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster user credentials of the connected cluster with a specified resource group and name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CredentialResultsInner listClusterUserCredential( + String resourceGroupName, String clusterName, ListClusterUserCredentialProperties properties) { + return listClusterUserCredentialAsync(resourceGroupName, clusterName, properties).block(); + } + + /** + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param properties ListClusterUserCredential properties. + * @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 cluster user credentials of the connected cluster with a specified resource group and name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listClusterUserCredentialWithResponse( + String resourceGroupName, String clusterName, ListClusterUserCredentialProperties properties, Context context) { + return listClusterUserCredentialWithResponseAsync(resourceGroupName, clusterName, properties, context).block(); + } + /** * API to enumerate registered connected K8s clusters under a Resource Group. * @@ -1044,7 +1231,7 @@ private Mono> listByResourceGroupSinglePage res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1200,7 +1387,7 @@ private Mono> listSinglePageAsync() { res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1333,7 +1520,7 @@ private Mono> listByResourceGroupNextSingle res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1406,7 +1593,7 @@ private Mono> listBySubscriptionNextSingleP res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClustersImpl.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClustersImpl.java index 607c370ee199..ed5b7d4f86dd 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClustersImpl.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClustersImpl.java @@ -9,11 +9,13 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager; import com.azure.resourcemanager.hybridkubernetes.fluent.ConnectedClustersClient; import com.azure.resourcemanager.hybridkubernetes.fluent.models.ConnectedClusterInner; +import com.azure.resourcemanager.hybridkubernetes.fluent.models.CredentialResultsInner; import com.azure.resourcemanager.hybridkubernetes.models.ConnectedCluster; import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusters; +import com.azure.resourcemanager.hybridkubernetes.models.CredentialResults; +import com.azure.resourcemanager.hybridkubernetes.models.ListClusterUserCredentialProperties; import com.fasterxml.jackson.annotation.JsonIgnore; public final class ConnectedClustersImpl implements ConnectedClusters { @@ -21,9 +23,11 @@ public final class ConnectedClustersImpl implements ConnectedClusters { private final ConnectedClustersClient innerClient; - private final HybridKubernetesManager serviceManager; + private final com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager; - public ConnectedClustersImpl(ConnectedClustersClient innerClient, HybridKubernetesManager serviceManager) { + public ConnectedClustersImpl( + ConnectedClustersClient innerClient, + com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -60,6 +64,34 @@ public void delete(String resourceGroupName, String clusterName, Context context this.serviceClient().delete(resourceGroupName, clusterName, context); } + public CredentialResults listClusterUserCredential( + String resourceGroupName, String clusterName, ListClusterUserCredentialProperties properties) { + CredentialResultsInner inner = + this.serviceClient().listClusterUserCredential(resourceGroupName, clusterName, properties); + if (inner != null) { + return new CredentialResultsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listClusterUserCredentialWithResponse( + String resourceGroupName, String clusterName, ListClusterUserCredentialProperties properties, Context context) { + Response inner = + this + .serviceClient() + .listClusterUserCredentialWithResponse(resourceGroupName, clusterName, properties, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CredentialResultsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); return Utils.mapPage(inner, inner1 -> new ConnectedClusterImpl(inner1, this.manager())); @@ -169,7 +201,7 @@ private ConnectedClustersClient serviceClient() { return this.innerClient; } - private HybridKubernetesManager manager() { + private com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager() { return this.serviceManager; } diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/CredentialResultsImpl.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/CredentialResultsImpl.java new file mode 100644 index 000000000000..09886a72077d --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/CredentialResultsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.implementation; + +import com.azure.resourcemanager.hybridkubernetes.fluent.models.CredentialResultsInner; +import com.azure.resourcemanager.hybridkubernetes.models.CredentialResult; +import com.azure.resourcemanager.hybridkubernetes.models.CredentialResults; +import com.azure.resourcemanager.hybridkubernetes.models.HybridConnectionConfig; +import java.util.Collections; +import java.util.List; + +public final class CredentialResultsImpl implements CredentialResults { + private CredentialResultsInner innerObject; + + private final com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager; + + CredentialResultsImpl( + CredentialResultsInner innerObject, + com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public HybridConnectionConfig hybridConnectionConfig() { + return this.innerModel().hybridConnectionConfig(); + } + + public List kubeconfigs() { + List inner = this.innerModel().kubeconfigs(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public CredentialResultsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/HybridKubernetesManagementClientImpl.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/HybridKubernetesManagementClientImpl.java index 3fb7a045334d..5fb452f6fb3e 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/HybridKubernetesManagementClientImpl.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/HybridKubernetesManagementClientImpl.java @@ -157,7 +157,7 @@ public OperationsClient getOperations() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-03-01"; + this.apiVersion = "2021-10-01"; this.connectedClusters = new ConnectedClustersClientImpl(this); this.operations = new OperationsClientImpl(this); } diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationImpl.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationImpl.java index 68eed1e40fad..9d768e2e4c78 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationImpl.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.hybridkubernetes.implementation; -import com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager; import com.azure.resourcemanager.hybridkubernetes.fluent.models.OperationInner; import com.azure.resourcemanager.hybridkubernetes.models.Operation; import com.azure.resourcemanager.hybridkubernetes.models.OperationDisplay; @@ -12,9 +11,10 @@ public final class OperationImpl implements Operation { private OperationInner innerObject; - private final HybridKubernetesManager serviceManager; + private final com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager; - OperationImpl(OperationInner innerObject, HybridKubernetesManager serviceManager) { + OperationImpl( + OperationInner innerObject, com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -31,7 +31,7 @@ public OperationInner innerModel() { return this.innerObject; } - private HybridKubernetesManager manager() { + private com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager() { return this.serviceManager; } } diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationsClientImpl.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationsClientImpl.java index 37a420749cbc..1f68bfa9e994 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationsClientImpl.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationsClientImpl.java @@ -108,7 +108,7 @@ private Mono> getSinglePageAsync() { res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -228,7 +228,7 @@ private Mono> getNextSinglePageAsync(String nextLi res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationsImpl.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationsImpl.java index 5a268ff3d2af..0b38676f3666 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationsImpl.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationsImpl.java @@ -7,7 +7,6 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager; import com.azure.resourcemanager.hybridkubernetes.fluent.OperationsClient; import com.azure.resourcemanager.hybridkubernetes.fluent.models.OperationInner; import com.azure.resourcemanager.hybridkubernetes.models.Operation; @@ -19,9 +18,11 @@ public final class OperationsImpl implements Operations { private final OperationsClient innerClient; - private final HybridKubernetesManager serviceManager; + private final com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager; - public OperationsImpl(OperationsClient innerClient, HybridKubernetesManager serviceManager) { + public OperationsImpl( + OperationsClient innerClient, + com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -40,7 +41,7 @@ private OperationsClient serviceClient() { return this.innerClient; } - private HybridKubernetesManager manager() { + private com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager() { return this.serviceManager; } } diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/Utils.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/Utils.java index 1585060b87f1..c21531d2505e 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/Utils.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/Utils.java @@ -9,8 +9,6 @@ import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.util.CoreUtils; -import reactor.core.publisher.Mono; - import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -19,6 +17,7 @@ import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; +import reactor.core.publisher.Flux; final class Utils { static String getValueFromIdByName(String id, String name) { @@ -80,76 +79,84 @@ static PagedIterable mapPage(PagedIterable pageIterable, Function extends PagedIterable { - private final PagedIterable pageIterable; + private final PagedIterable pagedIterable; private final Function mapper; private final Function, PagedResponse> pageMapper; - private PagedIterableImpl(PagedIterable pageIterable, Function mapper) { - super(new PagedFlux(() -> Mono.empty())); - this.pageIterable = pageIterable; + 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 = - page -> - new PagedResponseBase( - page.getRequest(), - page.getStatusCode(), - page.getHeaders(), - page.getElements().stream().map(mapper).collect(Collectors.toList()), - page.getContinuationToken(), - null); + 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 pageIterable.stream().map(mapper); + return pagedIterable.stream().map(mapper); } @Override public Stream> streamByPage() { - return pageIterable.streamByPage().map(pageMapper); + return pagedIterable.streamByPage().map(pageMapper); } @Override public Stream> streamByPage(String continuationToken) { - return pageIterable.streamByPage(continuationToken).map(pageMapper); + return pagedIterable.streamByPage(continuationToken).map(pageMapper); } @Override public Stream> streamByPage(int preferredPageSize) { - return pageIterable.streamByPage(preferredPageSize).map(pageMapper); + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); } @Override public Stream> streamByPage(String continuationToken, int preferredPageSize) { - return pageIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); } @Override public Iterator iterator() { - return new IteratorImpl(pageIterable.iterator(), mapper); + return new IteratorImpl(pagedIterable.iterator(), mapper); } @Override public Iterable> iterableByPage() { - return new IterableImpl, PagedResponse>(pageIterable.iterableByPage(), pageMapper); + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken) { return new IterableImpl, PagedResponse>( - pageIterable.iterableByPage(continuationToken), pageMapper); + pagedIterable.iterableByPage(continuationToken), pageMapper); } @Override public Iterable> iterableByPage(int preferredPageSize) { return new IterableImpl, PagedResponse>( - pageIterable.iterableByPage(preferredPageSize), pageMapper); + pagedIterable.iterableByPage(preferredPageSize), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { return new IterableImpl, PagedResponse>( - pageIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); } } diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/AuthenticationMethod.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/AuthenticationMethod.java new file mode 100644 index 000000000000..10c10b4ee19a --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/AuthenticationMethod.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AuthenticationMethod. */ +public final class AuthenticationMethod extends ExpandableStringEnum { + /** Static value Token for AuthenticationMethod. */ + public static final AuthenticationMethod TOKEN = fromString("Token"); + + /** Static value AAD for AuthenticationMethod. */ + public static final AuthenticationMethod AAD = fromString("AAD"); + + /** + * Creates or finds a AuthenticationMethod from its string representation. + * + * @param name a name to look for. + * @return the corresponding AuthenticationMethod. + */ + @JsonCreator + public static AuthenticationMethod fromString(String name) { + return fromString(name, AuthenticationMethod.class); + } + + /** @return known AuthenticationMethod values. */ + public static Collection values() { + return values(AuthenticationMethod.class); + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedCluster.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedCluster.java index 69378473439f..c059675c3cb3 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedCluster.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedCluster.java @@ -4,7 +4,9 @@ package com.azure.resourcemanager.hybridkubernetes.models; +import com.azure.core.http.rest.Response; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.hybridkubernetes.fluent.models.ConnectedClusterInner; import java.time.OffsetDateTime; @@ -363,4 +365,28 @@ interface WithProperties { * @return the refreshed resource. */ ConnectedCluster refresh(Context context); + + /** + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * + * @param properties ListClusterUserCredential properties. + * @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 cluster user credentials of the connected cluster with a specified resource group and name. + */ + CredentialResults listClusterUserCredential(ListClusterUserCredentialProperties properties); + + /** + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * + * @param properties ListClusterUserCredential properties. + * @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 cluster user credentials of the connected cluster with a specified resource group and name. + */ + Response listClusterUserCredentialWithResponse( + ListClusterUserCredentialProperties properties, Context context); } diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterPatch.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterPatch.java index e4640b64f518..2c2f35cd0f8c 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterPatch.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterPatch.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -19,6 +20,7 @@ public final class ConnectedClusterPatch { * Resource tags. */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusters.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusters.java index 02d1f89c7484..470b2d51b120 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusters.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusters.java @@ -61,6 +61,35 @@ Response getByResourceGroupWithResponse( */ void delete(String resourceGroupName, String clusterName, Context context); + /** + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param properties ListClusterUserCredential properties. + * @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 cluster user credentials of the connected cluster with a specified resource group and name. + */ + CredentialResults listClusterUserCredential( + String resourceGroupName, String clusterName, ListClusterUserCredentialProperties properties); + + /** + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param properties ListClusterUserCredential properties. + * @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 cluster user credentials of the connected cluster with a specified resource group and name. + */ + Response listClusterUserCredentialWithResponse( + String resourceGroupName, String clusterName, ListClusterUserCredentialProperties properties, Context context); + /** * API to enumerate registered connected K8s clusters under a Resource Group. * diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/CreatedByType.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/CreatedByType.java deleted file mode 100644 index 35ed5a2753b2..000000000000 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/CreatedByType.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridkubernetes.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for CreatedByType. */ -public final class CreatedByType extends ExpandableStringEnum { - /** Static value User for CreatedByType. */ - public static final CreatedByType USER = fromString("User"); - - /** Static value Application for CreatedByType. */ - public static final CreatedByType APPLICATION = fromString("Application"); - - /** Static value ManagedIdentity for CreatedByType. */ - public static final CreatedByType MANAGED_IDENTITY = fromString("ManagedIdentity"); - - /** Static value Key for CreatedByType. */ - public static final CreatedByType KEY = fromString("Key"); - - /** - * Creates or finds a CreatedByType from its string representation. - * - * @param name a name to look for. - * @return the corresponding CreatedByType. - */ - @JsonCreator - public static CreatedByType fromString(String name) { - return fromString(name, CreatedByType.class); - } - - /** @return known CreatedByType values. */ - public static Collection values() { - return values(CreatedByType.class); - } -} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ErrorAdditionalInfo.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/CredentialResult.java similarity index 50% rename from sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ErrorAdditionalInfo.java rename to sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/CredentialResult.java index 726973f76fe0..9019fae1f3cc 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ErrorAdditionalInfo.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/CredentialResult.java @@ -5,43 +5,44 @@ package com.azure.resourcemanager.hybridkubernetes.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** The resource management error additional info. */ +/** The credential result response. */ @Immutable -public final class ErrorAdditionalInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ErrorAdditionalInfo.class); +public final class CredentialResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CredentialResult.class); /* - * The additional info type. + * The name of the credential. */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; /* - * The additional info. + * Base64-encoded Kubernetes configuration file. */ - @JsonProperty(value = "info", access = JsonProperty.Access.WRITE_ONLY) - private Object info; + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private byte[] value; /** - * Get the type property: The additional info type. + * Get the name property: The name of the credential. * - * @return the type value. + * @return the name value. */ - public String type() { - return this.type; + public String name() { + return this.name; } /** - * Get the info property: The additional info. + * Get the value property: Base64-encoded Kubernetes configuration file. * - * @return the info value. + * @return the value value. */ - public Object info() { - return this.info; + public byte[] value() { + return CoreUtils.clone(this.value); } /** diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/CredentialResults.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/CredentialResults.java new file mode 100644 index 000000000000..da6275bfc883 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/CredentialResults.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.models; + +import com.azure.resourcemanager.hybridkubernetes.fluent.models.CredentialResultsInner; +import java.util.List; + +/** An immutable client-side representation of CredentialResults. */ +public interface CredentialResults { + /** + * Gets the hybridConnectionConfig property: Contains the REP (rendezvous endpoint) and “Sender” access token. + * + * @return the hybridConnectionConfig value. + */ + HybridConnectionConfig hybridConnectionConfig(); + + /** + * Gets the kubeconfigs property: Base64-encoded Kubernetes configuration file. + * + * @return the kubeconfigs value. + */ + List kubeconfigs(); + + /** + * Gets the inner com.azure.resourcemanager.hybridkubernetes.fluent.models.CredentialResultsInner object. + * + * @return the inner object. + */ + CredentialResultsInner innerModel(); +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/HybridConnectionConfig.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/HybridConnectionConfig.java new file mode 100644 index 000000000000..63a2f138548c --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/HybridConnectionConfig.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Contains the REP (rendezvous endpoint) and “Sender” access token. */ +@Immutable +public final class HybridConnectionConfig { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HybridConnectionConfig.class); + + /* + * Timestamp when this token will be expired. + */ + @JsonProperty(value = "expirationTime", access = JsonProperty.Access.WRITE_ONLY) + private Long expirationTime; + + /* + * Name of the connection + */ + @JsonProperty(value = "hybridConnectionName", access = JsonProperty.Access.WRITE_ONLY) + private String hybridConnectionName; + + /* + * Name of the relay. + */ + @JsonProperty(value = "relay", access = JsonProperty.Access.WRITE_ONLY) + private String relay; + + /* + * Sender access token + */ + @JsonProperty(value = "token", access = JsonProperty.Access.WRITE_ONLY) + private String token; + + /** + * Get the expirationTime property: Timestamp when this token will be expired. + * + * @return the expirationTime value. + */ + public Long expirationTime() { + return this.expirationTime; + } + + /** + * Get the hybridConnectionName property: Name of the connection. + * + * @return the hybridConnectionName value. + */ + public String hybridConnectionName() { + return this.hybridConnectionName; + } + + /** + * Get the relay property: Name of the relay. + * + * @return the relay value. + */ + public String relay() { + return this.relay; + } + + /** + * Get the token property: Sender access token. + * + * @return the token value. + */ + public String token() { + return this.token; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/LastModifiedByType.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/LastModifiedByType.java deleted file mode 100644 index 463cca77bf36..000000000000 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/LastModifiedByType.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridkubernetes.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for LastModifiedByType. */ -public final class LastModifiedByType extends ExpandableStringEnum { - /** Static value User for LastModifiedByType. */ - public static final LastModifiedByType USER = fromString("User"); - - /** Static value Application for LastModifiedByType. */ - public static final LastModifiedByType APPLICATION = fromString("Application"); - - /** Static value ManagedIdentity for LastModifiedByType. */ - public static final LastModifiedByType MANAGED_IDENTITY = fromString("ManagedIdentity"); - - /** Static value Key for LastModifiedByType. */ - public static final LastModifiedByType KEY = fromString("Key"); - - /** - * Creates or finds a LastModifiedByType from its string representation. - * - * @param name a name to look for. - * @return the corresponding LastModifiedByType. - */ - @JsonCreator - public static LastModifiedByType fromString(String name) { - return fromString(name, LastModifiedByType.class); - } - - /** @return known LastModifiedByType values. */ - public static Collection values() { - return values(LastModifiedByType.class); - } -} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ListClusterUserCredentialProperties.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ListClusterUserCredentialProperties.java new file mode 100644 index 000000000000..7b7d729fd8e8 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ListClusterUserCredentialProperties.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ListClusterUserCredentialProperties model. */ +@Fluent +public final class ListClusterUserCredentialProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListClusterUserCredentialProperties.class); + + /* + * The mode of client authentication. + */ + @JsonProperty(value = "authenticationMethod", required = true) + private AuthenticationMethod authenticationMethod; + + /* + * Boolean value to indicate whether the request is for client side proxy + * or not + */ + @JsonProperty(value = "clientProxy", required = true) + private boolean clientProxy; + + /** + * Get the authenticationMethod property: The mode of client authentication. + * + * @return the authenticationMethod value. + */ + public AuthenticationMethod authenticationMethod() { + return this.authenticationMethod; + } + + /** + * Set the authenticationMethod property: The mode of client authentication. + * + * @param authenticationMethod the authenticationMethod value to set. + * @return the ListClusterUserCredentialProperties object itself. + */ + public ListClusterUserCredentialProperties withAuthenticationMethod(AuthenticationMethod authenticationMethod) { + this.authenticationMethod = authenticationMethod; + return this; + } + + /** + * Get the clientProxy property: Boolean value to indicate whether the request is for client side proxy or not. + * + * @return the clientProxy value. + */ + public boolean clientProxy() { + return this.clientProxy; + } + + /** + * Set the clientProxy property: Boolean value to indicate whether the request is for client side proxy or not. + * + * @param clientProxy the clientProxy value to set. + * @return the ListClusterUserCredentialProperties object itself. + */ + public ListClusterUserCredentialProperties withClientProxy(boolean clientProxy) { + this.clientProxy = clientProxy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (authenticationMethod() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property authenticationMethod in model ListClusterUserCredentialProperties")); + } + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/SystemData.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/SystemData.java deleted file mode 100644 index 15a1c4838044..000000000000 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/SystemData.java +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridkubernetes.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Metadata pertaining to creation and last modification of the resource. */ -@Fluent -public final class SystemData { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SystemData.class); - - /* - * The identity that created the resource. - */ - @JsonProperty(value = "createdBy") - private String createdBy; - - /* - * The type of identity that created the resource. - */ - @JsonProperty(value = "createdByType") - private CreatedByType createdByType; - - /* - * The timestamp of resource creation (UTC). - */ - @JsonProperty(value = "createdAt") - private OffsetDateTime createdAt; - - /* - * The identity that last modified the resource. - */ - @JsonProperty(value = "lastModifiedBy") - private String lastModifiedBy; - - /* - * The type of identity that last modified the resource. - */ - @JsonProperty(value = "lastModifiedByType") - private LastModifiedByType lastModifiedByType; - - /* - * The timestamp of resource modification (UTC). - */ - @JsonProperty(value = "lastModifiedAt") - private OffsetDateTime lastModifiedAt; - - /** - * Get the createdBy property: The identity that created the resource. - * - * @return the createdBy value. - */ - public String createdBy() { - return this.createdBy; - } - - /** - * Set the createdBy property: The identity that created the resource. - * - * @param createdBy the createdBy value to set. - * @return the SystemData object itself. - */ - public SystemData withCreatedBy(String createdBy) { - this.createdBy = createdBy; - return this; - } - - /** - * Get the createdByType property: The type of identity that created the resource. - * - * @return the createdByType value. - */ - public CreatedByType createdByType() { - return this.createdByType; - } - - /** - * Set the createdByType property: The type of identity that created the resource. - * - * @param createdByType the createdByType value to set. - * @return the SystemData object itself. - */ - public SystemData withCreatedByType(CreatedByType createdByType) { - this.createdByType = createdByType; - return this; - } - - /** - * Get the createdAt property: The timestamp of resource creation (UTC). - * - * @return the createdAt value. - */ - public OffsetDateTime createdAt() { - return this.createdAt; - } - - /** - * Set the createdAt property: The timestamp of resource creation (UTC). - * - * @param createdAt the createdAt value to set. - * @return the SystemData object itself. - */ - public SystemData withCreatedAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * Get the lastModifiedBy property: The identity that last modified the resource. - * - * @return the lastModifiedBy value. - */ - public String lastModifiedBy() { - return this.lastModifiedBy; - } - - /** - * Set the lastModifiedBy property: The identity that last modified the resource. - * - * @param lastModifiedBy the lastModifiedBy value to set. - * @return the SystemData object itself. - */ - public SystemData withLastModifiedBy(String lastModifiedBy) { - this.lastModifiedBy = lastModifiedBy; - return this; - } - - /** - * Get the lastModifiedByType property: The type of identity that last modified the resource. - * - * @return the lastModifiedByType value. - */ - public LastModifiedByType lastModifiedByType() { - return this.lastModifiedByType; - } - - /** - * Set the lastModifiedByType property: The type of identity that last modified the resource. - * - * @param lastModifiedByType the lastModifiedByType value to set. - * @return the SystemData object itself. - */ - public SystemData withLastModifiedByType(LastModifiedByType lastModifiedByType) { - this.lastModifiedByType = lastModifiedByType; - return this; - } - - /** - * Get the lastModifiedAt property: The timestamp of resource modification (UTC). - * - * @return the lastModifiedAt value. - */ - public OffsetDateTime lastModifiedAt() { - return this.lastModifiedAt; - } - - /** - * Set the lastModifiedAt property: The timestamp of resource modification (UTC). - * - * @param lastModifiedAt the lastModifiedAt value to set. - * @return the SystemData object itself. - */ - public SystemData withLastModifiedAt(OffsetDateTime lastModifiedAt) { - this.lastModifiedAt = lastModifiedAt; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -}