Skip to content

Commit

Permalink
CodeGen from PR 18728 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 3097018f0b5bc2fc44669c9732513be82db60dae into 8f67d564e191f0811dd24c81d21d11491798032f
  • Loading branch information
SDKAuto committed Apr 22, 2022
1 parent f912372 commit 6256cdd
Show file tree
Hide file tree
Showing 75 changed files with 216 additions and 308 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Release History

## 1.0.0-beta.3 (Unreleased)
## 1.0.0-beta.1 (2022-04-22)

- Azure Resource Manager AzureDigitalTwins client library for Java. This package contains Microsoft Azure SDK for AzureDigitalTwins Management SDK. Azure Digital Twins Client for managing DigitalTwinsInstance. Package tag package-2022-05. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

### Features Added

Expand Down
4 changes: 2 additions & 2 deletions sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Azure Resource Manager AzureDigitalTwins client library for Java.

This package contains Microsoft Azure SDK for AzureDigitalTwins Management SDK. Azure Digital Twins Client for managing DigitalTwinsInstance. Package tag package-2021-06-30-preview. 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 AzureDigitalTwins Management SDK. Azure Digital Twins Client for managing DigitalTwinsInstance. Package tag package-2022-05. 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 Expand Up @@ -32,7 +32,7 @@ Various documentation is available to help you get started
<dependency>
<groupId>com.azure.resourcemanager</groupId>
<artifactId>azure-resourcemanager-digitaltwins</artifactId>
<version>1.0.0-beta.2</version>
<version>1.0.0-beta.3</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down
66 changes: 33 additions & 33 deletions sdk/digitaltwins/azure-resourcemanager-digitaltwins/SAMPLE.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<packaging>jar</packaging>

<name>Microsoft Azure SDK for AzureDigitalTwins Management</name>
<description>This package contains Microsoft Azure SDK for AzureDigitalTwins Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Digital Twins Client for managing DigitalTwinsInstance. Package tag package-2021-06-30-preview.</description>
<description>This package contains Microsoft Azure SDK for AzureDigitalTwins Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Digital Twins Client for managing DigitalTwinsInstance. Package tag package-2022-05.</description>
<url>https://github.com/Azure/azure-sdk-for-java</url>

<licenses>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.http.HttpPipelinePosition;
import com.azure.core.http.policy.AddDatePolicy;
import com.azure.core.http.policy.AddHeadersFromContextPolicy;
import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.http.policy.HttpLoggingPolicy;
import com.azure.core.http.policy.HttpPipelinePolicy;
import com.azure.core.http.policy.HttpPolicyProviders;
import com.azure.core.http.policy.RequestIdPolicy;
import com.azure.core.http.policy.RetryOptions;
import com.azure.core.http.policy.RetryPolicy;
import com.azure.core.http.policy.UserAgentPolicy;
import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy;
Expand Down Expand Up @@ -83,6 +85,19 @@ public static AzureDigitalTwinsManager authenticate(TokenCredential credential,
return configure().authenticate(credential, profile);
}

/**
* Creates an instance of AzureDigitalTwins service API entry point.
*
* @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential.
* @param profile the Azure profile for client.
* @return the AzureDigitalTwins service API instance.
*/
public static AzureDigitalTwinsManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) {
Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
Objects.requireNonNull(profile, "'profile' cannot be null.");
return new AzureDigitalTwinsManager(httpPipeline, profile, null);
}

/**
* Gets a Configurable instance that can be used to create AzureDigitalTwinsManager with optional configuration.
*
Expand All @@ -94,13 +109,14 @@ public static Configurable configure() {

/** The Configurable allowing configurations to be set. */
public static final class Configurable {
private final ClientLogger logger = new ClientLogger(Configurable.class);
private static final ClientLogger LOGGER = new ClientLogger(Configurable.class);

private HttpClient httpClient;
private HttpLogOptions httpLogOptions;
private final List<HttpPipelinePolicy> policies = new ArrayList<>();
private final List<String> scopes = new ArrayList<>();
private RetryPolicy retryPolicy;
private RetryOptions retryOptions;
private Duration defaultPollInterval;

private Configurable() {
Expand Down Expand Up @@ -161,16 +177,31 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {
return this;
}

/**
* Sets the retry options for the HTTP pipeline retry policy.
*
* <p>This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}.
*
* @param retryOptions the retry options for the HTTP pipeline retry policy.
* @return the configurable object itself.
*/
public Configurable withRetryOptions(RetryOptions retryOptions) {
this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null.");
return this;
}

/**
* Sets the default poll interval, used when service does not provide "Retry-After" header.
*
* @param defaultPollInterval the default poll interval.
* @return the configurable object itself.
*/
public Configurable withDefaultPollInterval(Duration defaultPollInterval) {
this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null.");
this.defaultPollInterval =
Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null.");
if (this.defaultPollInterval.isNegative()) {
throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative"));
throw LOGGER
.logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative"));
}
return this;
}
Expand All @@ -192,7 +223,7 @@ public AzureDigitalTwinsManager authenticate(TokenCredential credential, AzurePr
.append("-")
.append("com.azure.resourcemanager.digitaltwins")
.append("/")
.append("1.0.0-beta.2");
.append("1.0.0-beta.1");
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder
.append(" (")
Expand All @@ -210,10 +241,15 @@ public AzureDigitalTwinsManager authenticate(TokenCredential credential, AzurePr
scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default");
}
if (retryPolicy == null) {
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
if (retryOptions != null) {
retryPolicy = new RetryPolicy(retryOptions);
} else {
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
}
}
List<HttpPipelinePolicy> policies = new ArrayList<>();
policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
policies.add(new AddHeadersFromContextPolicy());
policies.add(new RequestIdPolicy());
policies
.addAll(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,12 @@
package com.azure.resourcemanager.digitaltwins.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.digitaltwins.models.Reason;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

/** The result returned from a check name availability request. */
@Fluent
public final class CheckNameResultInner {
@JsonIgnore private final ClientLogger logger = new ClientLogger(CheckNameResultInner.class);

/*
* Specifies a Boolean value that indicates if the name is available.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@
package com.azure.resourcemanager.digitaltwins.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.digitaltwins.models.DigitalTwinsIdentity;
import com.azure.resourcemanager.digitaltwins.models.DigitalTwinsResource;
import com.azure.resourcemanager.digitaltwins.models.ProvisioningState;
import com.azure.resourcemanager.digitaltwins.models.PublicNetworkAccess;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.List;
Expand All @@ -19,8 +17,6 @@
/** The description of the DigitalTwins service. */
@Fluent
public final class DigitalTwinsDescriptionInner extends DigitalTwinsResource {
@JsonIgnore private final ClientLogger logger = new ClientLogger(DigitalTwinsDescriptionInner.class);

/*
* DigitalTwins instance properties.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,11 @@
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.digitaltwins.models.DigitalTwinsEndpointResourceProperties;
import com.azure.resourcemanager.digitaltwins.models.ExternalResource;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

/** DigitalTwinsInstance endpoint resource. */
@Fluent
public final class DigitalTwinsEndpointResourceInner extends ExternalResource {
@JsonIgnore private final ClientLogger logger = new ClientLogger(DigitalTwinsEndpointResourceInner.class);

/*
* DigitalTwinsInstance endpoint resource properties.
*/
Expand Down Expand Up @@ -51,12 +48,14 @@ public DigitalTwinsEndpointResourceInner withProperties(DigitalTwinsEndpointReso
public void validate() {
super.validate();
if (properties() == null) {
throw logger
throw LOGGER
.logExceptionAsError(
new IllegalArgumentException(
"Missing required property properties in model DigitalTwinsEndpointResourceInner"));
} else {
properties().validate();
}
}

private static final ClientLogger LOGGER = new ClientLogger(DigitalTwinsEndpointResourceInner.class);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,15 @@
package com.azure.resourcemanager.digitaltwins.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.digitaltwins.models.ProvisioningState;
import com.azure.resourcemanager.digitaltwins.models.PublicNetworkAccess;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.List;

/** The properties of a DigitalTwinsInstance. */
@Fluent
public final class DigitalTwinsProperties {
@JsonIgnore private final ClientLogger logger = new ClientLogger(DigitalTwinsProperties.class);

/*
* Time when DigitalTwinsInstance was created.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.digitaltwins.models.GroupIdInformationProperties;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

/** The group information for creating a private endpoint on Digital Twin. */
@Fluent
public final class GroupIdInformationInner {
@JsonIgnore private final ClientLogger logger = new ClientLogger(GroupIdInformationInner.class);

/*
* The group information properties.
*/
Expand Down Expand Up @@ -104,12 +101,14 @@ public String type() {
*/
public void validate() {
if (properties() == null) {
throw logger
throw LOGGER
.logExceptionAsError(
new IllegalArgumentException(
"Missing required property properties in model GroupIdInformationInner"));
} else {
properties().validate();
}
}

private static final ClientLogger LOGGER = new ClientLogger(GroupIdInformationInner.class);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,12 @@
package com.azure.resourcemanager.digitaltwins.fluent.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 available private link resources for a Digital Twin. */
@Fluent
public final class GroupIdInformationResponseInner {
@JsonIgnore private final ClientLogger logger = new ClientLogger(GroupIdInformationResponseInner.class);

/*
* The list of available private link resources for a Digital Twin.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,14 @@
package com.azure.resourcemanager.digitaltwins.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.digitaltwins.models.OperationDisplay;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** DigitalTwins service REST API operation. */
@Fluent
public final class OperationInner {
@JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class);

/*
* Operation name: {provider}/{resource}/{read | write | action | delete}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@
import com.azure.core.management.SystemData;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.digitaltwins.models.ConnectionProperties;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

/** The private endpoint connection of a Digital Twin. */
@Fluent
public final class PrivateEndpointConnectionInner extends ProxyResource {
@JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionInner.class);

/*
* The connection properties.
*/
Expand Down Expand Up @@ -67,12 +64,14 @@ public SystemData systemData() {
*/
public void validate() {
if (properties() == null) {
throw logger
throw LOGGER
.logExceptionAsError(
new IllegalArgumentException(
"Missing required property properties in model PrivateEndpointConnectionInner"));
} else {
properties().validate();
}
}

private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionInner.class);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,12 @@
package com.azure.resourcemanager.digitaltwins.fluent.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 available private link connections for a Digital Twin. */
@Fluent
public final class PrivateEndpointConnectionsResponseInner {
@JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsResponseInner.class);

/*
* The list of available private link connections for a Digital Twin.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,13 @@
package com.azure.resourcemanager.digitaltwins.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.digitaltwins.models.ExternalResource;
import com.azure.resourcemanager.digitaltwins.models.TimeSeriesDatabaseConnectionProperties;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Describes a time series database connection resource. */
@Fluent
public final class TimeSeriesDatabaseConnectionInner extends ExternalResource {
@JsonIgnore private final ClientLogger logger = new ClientLogger(TimeSeriesDatabaseConnectionInner.class);

/*
* Properties of a specific time series database connection.
*/
Expand Down
Loading

0 comments on commit 6256cdd

Please sign in to comment.