Skip to content

Commit

Permalink
CodeGen from PR 17332 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge f39006d4f734eababd5282739a1a9cfdd84130f1 into c6f6d277e9f4f61caf651541af3eea20d9c5d0a4
  • Loading branch information
SDKAuto committed Jan 13, 2022
1 parent 6c30af3 commit 3dfb5e3
Show file tree
Hide file tree
Showing 66 changed files with 1,817 additions and 602 deletions.
4 changes: 4 additions & 0 deletions sdk/iothub/azure-resourcemanager-iothub/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release History

## 1.0.0-beta.1 (2022-01-13)

- 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.1.0 (2021-08-30)

- Add support for new service API version 2021-07-01
Expand Down
2 changes: 1 addition & 1 deletion sdk/iothub/azure-resourcemanager-iothub/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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-07. 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

Expand Down
1,180 changes: 1,122 additions & 58 deletions sdk/iothub/azure-resourcemanager-iothub/SAMPLE.md

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion sdk/iothub/azure-resourcemanager-iothub/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<packaging>jar</packaging>

<name>Microsoft Azure SDK for IotHub Management</name>
<description>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-07.</description>
<description>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.</description>
<url>https://github.com/Azure/azure-sdk-for-java</url>

<licenses>
Expand Down Expand Up @@ -79,4 +79,8 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.azure.core.http.HttpClient;
import com.azure.core.http.HttpPipeline;
import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.http.HttpPipelinePosition;
import com.azure.core.http.policy.AddDatePolicy;
import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.http.policy.HttpLoggingPolicy;
Expand Down Expand Up @@ -41,6 +42,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;

/** Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure subscription. */
public final class IotHubManager {
Expand Down Expand Up @@ -194,7 +196,7 @@ public IotHubManager authenticate(TokenCredential credential, AzureProfile profi
.append("-")
.append("com.azure.resourcemanager.iothub")
.append("/")
.append("1.1.0");
.append("1.0.0-beta.1");
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder
.append(" (")
Expand All @@ -217,11 +219,24 @@ public IotHubManager authenticate(TokenCredential credential, AzureProfile profi
List<HttpPipelinePolicy> policies = new ArrayList<>();
policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
policies.add(new RequestIdPolicy());
policies
.addAll(
this
.policies
.stream()
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
.collect(Collectors.toList()));
HttpPolicyProviders.addBeforeRetryPolicies(policies);
policies.add(retryPolicy);
policies.add(new AddDatePolicy());
policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
policies.addAll(this.policies);
policies
.addAll(
this
.policies
.stream()
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
.collect(Collectors.toList()));
HttpPolicyProviders.addAfterRetryPolicies(policies);
policies.add(new HttpLoggingPolicy(httpLogOptions));
HttpPipeline httpPipeline =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ Response<IotHubDescriptionInner> 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.
Expand All @@ -79,15 +78,14 @@ Response<IotHubDescriptionInner> getByResourceGroupWithResponse(
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the description of the IoT hub.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<IotHubDescriptionInner>, IotHubDescriptionInner> beginCreateOrUpdate(
String resourceGroupName, String resourceName, IotHubDescriptionInner iotHubDescription, String ifMatch);

/**
* 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.
Expand All @@ -101,7 +99,7 @@ SyncPoller<PollResult<IotHubDescriptionInner>, IotHubDescriptionInner> beginCrea
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the description of the IoT hub.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<IotHubDescriptionInner>, IotHubDescriptionInner> beginCreateOrUpdate(
String resourceGroupName,
String resourceName,
Expand All @@ -112,8 +110,7 @@ SyncPoller<PollResult<IotHubDescriptionInner>, 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.
Expand All @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -186,7 +181,7 @@ IotHubDescriptionInner createOrUpdate(
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the description of the IoT hub.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<IotHubDescriptionInner>, IotHubDescriptionInner> beginUpdate(
String resourceGroupName, String resourceName, TagsResource iotHubTags);

Expand All @@ -202,7 +197,7 @@ SyncPoller<PollResult<IotHubDescriptionInner>, IotHubDescriptionInner> beginUpda
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the description of the IoT hub.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<IotHubDescriptionInner>, IotHubDescriptionInner> beginUpdate(
String resourceGroupName, String resourceName, TagsResource iotHubTags, Context context);

Expand Down Expand Up @@ -247,7 +242,7 @@ IotHubDescriptionInner update(
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the description of the IoT hub.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<IotHubDescriptionInner>, IotHubDescriptionInner> beginDelete(
String resourceGroupName, String resourceName);

Expand All @@ -263,7 +258,7 @@ SyncPoller<PollResult<IotHubDescriptionInner>, IotHubDescriptionInner> beginDele
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the description of the IoT hub.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<IotHubDescriptionInner>, IotHubDescriptionInner> beginDelete(
String resourceGroupName, String resourceName, Context context);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public interface IotHubsClient {
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the completion.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<Void>, Void> beginManualFailover(
String iotHubName, String resourceGroupName, FailoverInput failoverInput);

Expand All @@ -46,7 +46,7 @@ SyncPoller<PollResult<Void>, Void> beginManualFailover(
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the completion.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<Void>, Void> beginManualFailover(
String iotHubName, String resourceGroupName, FailoverInput failoverInput, Context context);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Response<PrivateEndpointConnectionInner> getWithResponse(
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the private endpoint connection of an IotHub.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<PrivateEndpointConnectionInner>, PrivateEndpointConnectionInner> beginUpdate(
String resourceGroupName,
String resourceName,
Expand All @@ -112,7 +112,7 @@ SyncPoller<PollResult<PrivateEndpointConnectionInner>, PrivateEndpointConnection
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the private endpoint connection of an IotHub.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<PrivateEndpointConnectionInner>, PrivateEndpointConnectionInner> beginUpdate(
String resourceGroupName,
String resourceName,
Expand Down Expand Up @@ -174,7 +174,7 @@ PrivateEndpointConnectionInner update(
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the private endpoint connection of an IotHub.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<PrivateEndpointConnectionInner>, PrivateEndpointConnectionInner> beginDelete(
String resourceGroupName, String resourceName, String privateEndpointConnectionName);

Expand All @@ -191,7 +191,7 @@ SyncPoller<PollResult<PrivateEndpointConnectionInner>, PrivateEndpointConnection
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the private endpoint connection of an IotHub.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<PrivateEndpointConnectionInner>, PrivateEndpointConnectionInner> beginDelete(
String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.azure.core.management.ProxyResource;
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;

Expand All @@ -20,6 +21,7 @@ public final class EventHubConsumerGroupInfoInner extends ProxyResource {
* The tags.
*/
@JsonProperty(value = "properties")
@JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
private Map<String, Object> properties;

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,7 @@ public void deleteById(String id) {
String.format("The resource ID '%s' is not valid. Missing path segment 'certificates'.", id)));
}
String localIfMatch = null;
this
.deleteWithResponse(resourceGroupName, resourceName, certificateName, localIfMatch, Context.NONE)
.getValue();
this.deleteWithResponse(resourceGroupName, resourceName, certificateName, localIfMatch, Context.NONE);
}

public Response<Void> deleteByIdWithResponse(String id, String ifMatch, Context context) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public PrivateEndpointConnectionsClient getPrivateEndpointConnections() {
this.defaultPollInterval = defaultPollInterval;
this.subscriptionId = subscriptionId;
this.endpoint = endpoint;
this.apiVersion = "2021-07-01";
this.apiVersion = "2021-07-01-preview";
this.operations = new OperationsClientImpl(this);
this.iotHubResources = new IotHubResourcesClientImpl(this);
this.resourceProviderCommons = new ResourceProviderCommonsClientImpl(this);
Expand Down
Loading

0 comments on commit 3dfb5e3

Please sign in to comment.