Skip to content

Commit

Permalink
CodeGen from PR 17304 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge fb01001816b87a07df45057f81faac117f911a9d into 3ffc36f7f7623032d3e22f23c99eec36f9ceed09
  • Loading branch information
SDKAuto committed Jan 13, 2022
1 parent eb63833 commit 4bf7dd2
Show file tree
Hide file tree
Showing 63 changed files with 1,529 additions and 526 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-2021-07-02. 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-2021-07-02. 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,172 changes: 1,114 additions & 58 deletions sdk/iothub/azure-resourcemanager-iothub/SAMPLE.md

Large diffs are not rendered by default.

9 changes: 8 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-2021-07-02.</description>
<url>https://github.com/Azure/azure-sdk-for-java</url>

<licenses>
Expand All @@ -39,6 +39,9 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jacoco.skip>true</jacoco.skip>
<codesnippet.skip>false</codesnippet.skip>
<javadocDoclet></javadocDoclet>
<javadocDocletOptions></javadocDocletOptions>
</properties>
<dependencies>
<dependency>
Expand Down Expand Up @@ -76,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 @@ -79,7 +79,7 @@ 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);

Expand All @@ -101,7 +101,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 Down Expand Up @@ -186,7 +186,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 +202,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 +247,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 +263,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 @@ -6,6 +6,7 @@

import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
import com.azure.core.management.SystemData;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.iothub.models.ArmIdentity;
import com.azure.resourcemanager.iothub.models.IotHubProperties;
Expand Down Expand Up @@ -45,6 +46,12 @@ public final class IotHubDescriptionInner extends Resource {
@JsonProperty(value = "identity")
private ArmIdentity identity;

/*
* The system meta data relating to this resource.
*/
@JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
private SystemData systemData;

/**
* Get the etag property: The Etag field is *not* required. If it is provided in the response body, it must also be
* provided as a header per the normal ETag convention.
Expand Down Expand Up @@ -127,6 +134,15 @@ public IotHubDescriptionInner withIdentity(ArmIdentity identity) {
return this;
}

/**
* Get the systemData property: The system meta data relating to this resource.
*
* @return the systemData value.
*/
public SystemData systemData() {
return this.systemData;
}

/** {@inheritDoc} */
@Override
public IotHubDescriptionInner withLocation(String location) {
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-02";
this.operations = new OperationsClientImpl(this);
this.iotHubResources = new IotHubResourcesClientImpl(this);
this.resourceProviderCommons = new ResourceProviderCommonsClientImpl(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.azure.core.http.rest.PagedIterable;
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.iothub.fluent.models.IotHubDescriptionInner;
import com.azure.resourcemanager.iothub.models.ArmIdentity;
Expand Down Expand Up @@ -68,6 +69,10 @@ public ArmIdentity identity() {
return this.innerModel().identity();
}

public SystemData systemData() {
return this.innerModel().systemData();
}

public Region region() {
return Region.fromName(this.regionName());
}
Expand Down
Loading

0 comments on commit 4bf7dd2

Please sign in to comment.