From 62f79f626febef0cb9c0180ba994263f7bcc1a2f Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 30 Jun 2021 15:26:19 +0000 Subject: [PATCH] CodeGen from PR 15034 in Azure/azure-rest-api-specs Merge 2b302a0218947e5f1d44c832c326bf934aa16410 into 91ac14531f0d05b3d6fcf4a817ea0defde59fe63 --- .../azure-resourcemanager-iothub/CHANGELOG.md | 3 +- .../azure-resourcemanager-iothub/README.md | 16 +- .../azure-resourcemanager-iothub/pom.xml | 141 +++++++------ .../resourcemanager/iothub/IotHubManager.java | 24 ++- .../iothub/fluent/IotHubResourcesClient.java | 15 +- .../implementation/IotHubClientImpl.java | 2 +- .../IotHubResourcesClientImpl.java | 36 ++-- .../iothub/models/ArmIdentity.java | 12 +- .../EncryptionPropertiesDescription.java | 80 +++++++ .../iothub/models/IotHubProperties.java | 198 ++++++++++++++++++ .../models/IotHubPropertiesDeviceStreams.java | 51 +++++ .../iothub/models/KeyVaultKeyProperties.java | 79 +++++++ .../iothub/models/RoutingSource.java | 3 + 13 files changed, 544 insertions(+), 116 deletions(-) create mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EncryptionPropertiesDescription.java create mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubPropertiesDeviceStreams.java create mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/KeyVaultKeyProperties.java diff --git a/sdk/iothub/azure-resourcemanager-iothub/CHANGELOG.md b/sdk/iothub/azure-resourcemanager-iothub/CHANGELOG.md index 8e66e76bc61f..16ce7fde6d14 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/CHANGELOG.md +++ b/sdk/iothub/azure-resourcemanager-iothub/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2021-06-30) +- Azure Resource Manager IotHub client library for Java. This package contains Microsoft Azure SDK for IotHub Management SDK. Use this API to manage the IoT hubs in your Azure subscription. Package tag package-preview-2021-07. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.0.0 (2021-05-14) diff --git a/sdk/iothub/azure-resourcemanager-iothub/README.md b/sdk/iothub/azure-resourcemanager-iothub/README.md index f6515c6c2b73..a8d970116d86 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/README.md +++ b/sdk/iothub/azure-resourcemanager-iothub/README.md @@ -2,7 +2,7 @@ Azure Resource Manager IotHub client library for Java. -This package contains Microsoft Azure SDK for IotHub Management SDK. Use this API to manage the IoT hubs in your Azure subscription. Package tag package-2021-03. 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 IotHub Management SDK. Use this API to manage the IoT hubs in your Azure subscription. Package tag package-preview-2021-07. 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-iothub - 1.0.0 + 1.1.0-beta.1 ``` [//]: # ({x-version-update-end}) @@ -74,13 +74,15 @@ See [API design][design] for general introduction on design and key concepts on ## Examples + + ## Troubleshooting ## Next steps ## Contributing -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/master/CONTRIBUTING.md). 1. Fork it 1. Create your feature branch (`git checkout -b my-new-feature`) @@ -93,7 +95,7 @@ For details on contributing to this repository, see the [contributing guide](htt [docs]: https://azure.github.io/azure-sdk-for-java/ [jdk]: https://docs.microsoft.com/java/azure/jdk/ [azure_subscription]: https://azure.microsoft.com/free/ -[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity -[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 +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/iothub/azure-resourcemanager-iothub/pom.xml b/sdk/iothub/azure-resourcemanager-iothub/pom.xml index ef593cdb3b62..155ed039110f 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/pom.xml +++ b/sdk/iothub/azure-resourcemanager-iothub/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-iothub - 1.1.0-beta.1 - jar + com.azure.resourcemanager + azure-resourcemanager-iothub + 1.1.0-beta.1 + jar - Microsoft Azure SDK for IotHub Management - This package contains Microsoft Azure SDK for IotHub Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Use this API to manage the IoT hubs in your Azure subscription. Package tag package-2021-03. - https://github.com/Azure/azure-sdk-for-java + Microsoft Azure SDK for IotHub Management + This package contains Microsoft Azure SDK for IotHub Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Use this API to manage the IoT hubs in your Azure subscription. Package tag package-preview-2021-07. + 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.17.0 - - - com.azure - azure-core-management - 1.3.0 - - - - - - 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.17.0 + + + com.azure + azure-core-management + 1.3.0 + + + + + + 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/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/IotHubManager.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/IotHubManager.java index 2ebe2d85afdc..7cc543ac5fd2 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/IotHubManager.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/IotHubManager.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; @@ -101,6 +101,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; @@ -140,6 +141,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. * @@ -182,7 +194,7 @@ public IotHubManager authenticate(TokenCredential credential, AzureProfile profi .append("-") .append("com.azure.resourcemanager.iothub") .append("/") - .append("1.0.0"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -196,6 +208,9 @@ public IotHubManager authenticate(TokenCredential credential, AzureProfile profi userAgentBuilder.append(" (auto-generated)"); } + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } if (retryPolicy == null) { retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); } @@ -205,10 +220,7 @@ public IotHubManager authenticate(TokenCredential credential, AzureProfile profi 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)); diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/IotHubResourcesClient.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/IotHubResourcesClient.java index 611befd840b7..5213c706fc68 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/IotHubResourcesClient.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/IotHubResourcesClient.java @@ -65,8 +65,7 @@ Response getByResourceGroupWithResponse( /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to - * default, which may lead to unexpected behavior. + * hub. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -86,8 +85,7 @@ SyncPoller, IotHubDescriptionInner> beginCrea /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to - * default, which may lead to unexpected behavior. + * hub. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -112,8 +110,7 @@ SyncPoller, IotHubDescriptionInner> beginCrea /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to - * default, which may lead to unexpected behavior. + * hub. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -133,8 +130,7 @@ IotHubDescriptionInner createOrUpdate( /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to - * default, which may lead to unexpected behavior. + * hub. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -152,8 +148,7 @@ IotHubDescriptionInner createOrUpdate( /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to - * default, which may lead to unexpected behavior. + * hub. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubClientImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubClientImpl.java index 3ab5b4bc3098..a77d23865b0b 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubClientImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubClientImpl.java @@ -222,7 +222,7 @@ public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-03-31"; + this.apiVersion = "2021-07-01-preview"; this.operations = new OperationsClientImpl(this); this.iotHubResources = new IotHubResourcesClientImpl(this); this.resourceProviderCommons = new ResourceProviderCommonsClientImpl(this); diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubResourcesClientImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubResourcesClientImpl.java index 1b0e088be46a..0e9628c455d5 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubResourcesClientImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubResourcesClientImpl.java @@ -678,8 +678,7 @@ public Response getByResourceGroupWithResponse( /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to - * default, which may lead to unexpected behavior. + * hub. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -740,8 +739,7 @@ private Mono>> createOrUpdateWithResponseAsync( /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to - * default, which may lead to unexpected behavior. + * hub. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -804,8 +802,7 @@ private Mono>> createOrUpdateWithResponseAsync( /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to - * default, which may lead to unexpected behavior. + * hub. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -835,8 +832,7 @@ private PollerFlux, IotHubDescriptionInner> b /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to - * default, which may lead to unexpected behavior. + * hub. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -872,8 +868,7 @@ private PollerFlux, IotHubDescriptionInner> b /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to - * default, which may lead to unexpected behavior. + * hub. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -894,8 +889,7 @@ public SyncPoller, IotHubDescriptionInner> be /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to - * default, which may lead to unexpected behavior. + * hub. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -922,8 +916,7 @@ public SyncPoller, IotHubDescriptionInner> be /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to - * default, which may lead to unexpected behavior. + * hub. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -946,8 +939,7 @@ private Mono createOrUpdateAsync( /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to - * default, which may lead to unexpected behavior. + * hub. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -969,8 +961,7 @@ private Mono createOrUpdateAsync( /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to - * default, which may lead to unexpected behavior. + * hub. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -998,8 +989,7 @@ private Mono createOrUpdateAsync( /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to - * default, which may lead to unexpected behavior. + * hub. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -1020,8 +1010,7 @@ public IotHubDescriptionInner createOrUpdate( /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to - * default, which may lead to unexpected behavior. + * hub. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -1041,8 +1030,7 @@ public IotHubDescriptionInner createOrUpdate( /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to - * default, which may lead to unexpected behavior. + * hub. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ArmIdentity.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ArmIdentity.java index 32e27c25e82a..79eb767e5a8d 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ArmIdentity.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ArmIdentity.java @@ -28,10 +28,10 @@ public class ArmIdentity { private String tenantId; /* - * The type of identity used for the resource. The type 'SystemAssigned, - * UserAssigned' includes both an implicitly created identity and a set of - * user assigned identities. The type 'None' will remove any identities - * from the service. + * The type of identity used for the resource. The type + * 'SystemAssigned,UserAssigned' includes both an implicitly created + * identity and a set of user assigned identities. The type 'None' will + * remove any identities from the service. */ @JsonProperty(value = "type") private ResourceIdentityType type; @@ -61,7 +61,7 @@ public String tenantId() { } /** - * Get the type property: The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' + * Get the type property: The type of identity used for the resource. The type 'SystemAssigned,UserAssigned' * includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove * any identities from the service. * @@ -72,7 +72,7 @@ public ResourceIdentityType type() { } /** - * Set the type property: The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' + * Set the type property: The type of identity used for the resource. The type 'SystemAssigned,UserAssigned' * includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove * any identities from the service. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EncryptionPropertiesDescription.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EncryptionPropertiesDescription.java new file mode 100644 index 000000000000..0a4aa8924d48 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EncryptionPropertiesDescription.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The encryption properties for the IoT hub. */ +@Fluent +public final class EncryptionPropertiesDescription { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EncryptionPropertiesDescription.class); + + /* + * The source of the key. + */ + @JsonProperty(value = "keySource") + private String keySource; + + /* + * The properties of the KeyVault key. + */ + @JsonProperty(value = "keyVaultProperties") + private List keyVaultProperties; + + /** + * Get the keySource property: The source of the key. + * + * @return the keySource value. + */ + public String keySource() { + return this.keySource; + } + + /** + * Set the keySource property: The source of the key. + * + * @param keySource the keySource value to set. + * @return the EncryptionPropertiesDescription object itself. + */ + public EncryptionPropertiesDescription withKeySource(String keySource) { + this.keySource = keySource; + return this; + } + + /** + * Get the keyVaultProperties property: The properties of the KeyVault key. + * + * @return the keyVaultProperties value. + */ + public List keyVaultProperties() { + return this.keyVaultProperties; + } + + /** + * Set the keyVaultProperties property: The properties of the KeyVault key. + * + * @param keyVaultProperties the keyVaultProperties value to set. + * @return the EncryptionPropertiesDescription object itself. + */ + public EncryptionPropertiesDescription withKeyVaultProperties(List keyVaultProperties) { + this.keyVaultProperties = keyVaultProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyVaultProperties() != null) { + keyVaultProperties().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubProperties.java index 1a8baac9b4da..afa025a91565 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubProperties.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubProperties.java @@ -25,6 +25,40 @@ public final class IotHubProperties { @JsonProperty(value = "authorizationPolicies") private List authorizationPolicies; + /* + * If true, SAS tokens with Iot hub scoped SAS keys cannot be used for + * authentication. + */ + @JsonProperty(value = "disableLocalAuth") + private Boolean disableLocalAuth; + + /* + * If true, all device(including Edge devices but excluding modules) scoped + * SAS keys cannot be used for authentication. + */ + @JsonProperty(value = "disableDeviceSAS") + private Boolean disableDeviceSas; + + /* + * If true, all module scoped SAS keys cannot be used for authentication. + */ + @JsonProperty(value = "disableModuleSAS") + private Boolean disableModuleSas; + + /* + * If true, egress from IotHub will be restricted to only the allowed FQDNs + * that are configured via allowedFqdnList. + */ + @JsonProperty(value = "restrictOutboundNetworkAccess") + private Boolean restrictOutboundNetworkAccess; + + /* + * List of allowed FQDNs(Fully Qualified Domain Name) for egress from Iot + * Hub. + */ + @JsonProperty(value = "allowedFqdnList") + private List allowedFqdnList; + /* * Whether requests from Public Network are allowed */ @@ -125,12 +159,24 @@ public final class IotHubProperties { @JsonProperty(value = "comments") private String comments; + /* + * The device streams properties of iothub. + */ + @JsonProperty(value = "deviceStreams") + private IotHubPropertiesDeviceStreams deviceStreams; + /* * The capabilities and features enabled for the IoT hub. */ @JsonProperty(value = "features") private Capabilities features; + /* + * The encryption properties for the IoT hub. + */ + @JsonProperty(value = "encryption") + private EncryptionPropertiesDescription encryption; + /* * Primary and secondary location for iot hub */ @@ -160,6 +206,112 @@ public IotHubProperties withAuthorizationPolicies( return this; } + /** + * Get the disableLocalAuth property: If true, SAS tokens with Iot hub scoped SAS keys cannot be used for + * authentication. + * + * @return the disableLocalAuth value. + */ + public Boolean disableLocalAuth() { + return this.disableLocalAuth; + } + + /** + * Set the disableLocalAuth property: If true, SAS tokens with Iot hub scoped SAS keys cannot be used for + * authentication. + * + * @param disableLocalAuth the disableLocalAuth value to set. + * @return the IotHubProperties object itself. + */ + public IotHubProperties withDisableLocalAuth(Boolean disableLocalAuth) { + this.disableLocalAuth = disableLocalAuth; + return this; + } + + /** + * Get the disableDeviceSas property: If true, all device(including Edge devices but excluding modules) scoped SAS + * keys cannot be used for authentication. + * + * @return the disableDeviceSas value. + */ + public Boolean disableDeviceSas() { + return this.disableDeviceSas; + } + + /** + * Set the disableDeviceSas property: If true, all device(including Edge devices but excluding modules) scoped SAS + * keys cannot be used for authentication. + * + * @param disableDeviceSas the disableDeviceSas value to set. + * @return the IotHubProperties object itself. + */ + public IotHubProperties withDisableDeviceSas(Boolean disableDeviceSas) { + this.disableDeviceSas = disableDeviceSas; + return this; + } + + /** + * Get the disableModuleSas property: If true, all module scoped SAS keys cannot be used for authentication. + * + * @return the disableModuleSas value. + */ + public Boolean disableModuleSas() { + return this.disableModuleSas; + } + + /** + * Set the disableModuleSas property: If true, all module scoped SAS keys cannot be used for authentication. + * + * @param disableModuleSas the disableModuleSas value to set. + * @return the IotHubProperties object itself. + */ + public IotHubProperties withDisableModuleSas(Boolean disableModuleSas) { + this.disableModuleSas = disableModuleSas; + return this; + } + + /** + * Get the restrictOutboundNetworkAccess property: If true, egress from IotHub will be restricted to only the + * allowed FQDNs that are configured via allowedFqdnList. + * + * @return the restrictOutboundNetworkAccess value. + */ + public Boolean restrictOutboundNetworkAccess() { + return this.restrictOutboundNetworkAccess; + } + + /** + * Set the restrictOutboundNetworkAccess property: If true, egress from IotHub will be restricted to only the + * allowed FQDNs that are configured via allowedFqdnList. + * + * @param restrictOutboundNetworkAccess the restrictOutboundNetworkAccess value to set. + * @return the IotHubProperties object itself. + */ + public IotHubProperties withRestrictOutboundNetworkAccess(Boolean restrictOutboundNetworkAccess) { + this.restrictOutboundNetworkAccess = restrictOutboundNetworkAccess; + return this; + } + + /** + * Get the allowedFqdnList property: List of allowed FQDNs(Fully Qualified Domain Name) for egress from Iot Hub. + * + * @return the allowedFqdnList value. + */ + public List allowedFqdnList() { + return this.allowedFqdnList; + } + + /** + * Set the allowedFqdnList property: List of allowed FQDNs(Fully Qualified Domain Name) for egress from Iot Hub. + * + * @param allowedFqdnList the allowedFqdnList value to set. + * @return the IotHubProperties object itself. + */ + public IotHubProperties withAllowedFqdnList(List allowedFqdnList) { + this.allowedFqdnList = allowedFqdnList; + return this; + } + /** * Get the publicNetworkAccess property: Whether requests from Public Network are allowed. * @@ -442,6 +594,26 @@ public IotHubProperties withComments(String comments) { return this; } + /** + * Get the deviceStreams property: The device streams properties of iothub. + * + * @return the deviceStreams value. + */ + public IotHubPropertiesDeviceStreams deviceStreams() { + return this.deviceStreams; + } + + /** + * Set the deviceStreams property: The device streams properties of iothub. + * + * @param deviceStreams the deviceStreams value to set. + * @return the IotHubProperties object itself. + */ + public IotHubProperties withDeviceStreams(IotHubPropertiesDeviceStreams deviceStreams) { + this.deviceStreams = deviceStreams; + return this; + } + /** * Get the features property: The capabilities and features enabled for the IoT hub. * @@ -462,6 +634,26 @@ public IotHubProperties withFeatures(Capabilities features) { return this; } + /** + * Get the encryption property: The encryption properties for the IoT hub. + * + * @return the encryption value. + */ + public EncryptionPropertiesDescription encryption() { + return this.encryption; + } + + /** + * Set the encryption property: The encryption properties for the IoT hub. + * + * @param encryption the encryption value to set. + * @return the IotHubProperties object itself. + */ + public IotHubProperties withEncryption(EncryptionPropertiesDescription encryption) { + this.encryption = encryption; + return this; + } + /** * Get the locations property: Primary and secondary location for iot hub. * @@ -525,6 +717,12 @@ public void validate() { if (cloudToDevice() != null) { cloudToDevice().validate(); } + if (deviceStreams() != null) { + deviceStreams().validate(); + } + if (encryption() != null) { + encryption().validate(); + } if (locations() != null) { locations().forEach(e -> e.validate()); } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubPropertiesDeviceStreams.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubPropertiesDeviceStreams.java new file mode 100644 index 000000000000..28bb6f5c29ad --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubPropertiesDeviceStreams.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.iothub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The device streams properties of iothub. */ +@Fluent +public final class IotHubPropertiesDeviceStreams { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IotHubPropertiesDeviceStreams.class); + + /* + * List of Device Streams Endpoints. + */ + @JsonProperty(value = "streamingEndpoints") + private List streamingEndpoints; + + /** + * Get the streamingEndpoints property: List of Device Streams Endpoints. + * + * @return the streamingEndpoints value. + */ + public List streamingEndpoints() { + return this.streamingEndpoints; + } + + /** + * Set the streamingEndpoints property: List of Device Streams Endpoints. + * + * @param streamingEndpoints the streamingEndpoints value to set. + * @return the IotHubPropertiesDeviceStreams object itself. + */ + public IotHubPropertiesDeviceStreams withStreamingEndpoints(List streamingEndpoints) { + this.streamingEndpoints = streamingEndpoints; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/KeyVaultKeyProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/KeyVaultKeyProperties.java new file mode 100644 index 000000000000..1e5461f8ca53 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/KeyVaultKeyProperties.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.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 properties of the KeyVault key. */ +@Fluent +public final class KeyVaultKeyProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyVaultKeyProperties.class); + + /* + * The identifier of the key. + */ + @JsonProperty(value = "keyIdentifier") + private String keyIdentifier; + + /* + * Managed identity properties of KeyVault Key. + */ + @JsonProperty(value = "identity") + private ManagedIdentity identity; + + /** + * Get the keyIdentifier property: The identifier of the key. + * + * @return the keyIdentifier value. + */ + public String keyIdentifier() { + return this.keyIdentifier; + } + + /** + * Set the keyIdentifier property: The identifier of the key. + * + * @param keyIdentifier the keyIdentifier value to set. + * @return the KeyVaultKeyProperties object itself. + */ + public KeyVaultKeyProperties withKeyIdentifier(String keyIdentifier) { + this.keyIdentifier = keyIdentifier; + return this; + } + + /** + * Get the identity property: Managed identity properties of KeyVault Key. + * + * @return the identity value. + */ + public ManagedIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Managed identity properties of KeyVault Key. + * + * @param identity the identity value to set. + * @return the KeyVaultKeyProperties object itself. + */ + public KeyVaultKeyProperties withIdentity(ManagedIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingSource.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingSource.java index 666b10fecd93..3a155d6f59ea 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingSource.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingSource.java @@ -25,6 +25,9 @@ public final class RoutingSource extends ExpandableStringEnum { /** Static value DeviceJobLifecycleEvents for RoutingSource. */ public static final RoutingSource DEVICE_JOB_LIFECYCLE_EVENTS = fromString("DeviceJobLifecycleEvents"); + /** Static value DigitalTwinChangeEvents for RoutingSource. */ + public static final RoutingSource DIGITAL_TWIN_CHANGE_EVENTS = fromString("DigitalTwinChangeEvents"); + /** Static value DeviceConnectionStateEvents for RoutingSource. */ public static final RoutingSource DEVICE_CONNECTION_STATE_EVENTS = fromString("DeviceConnectionStateEvents");