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 7607db5c751edfa8137bf8838fce8fec1e78fbc9 into ad5110c7ba2113d5f77946338231f45ac4d09c82
  • Loading branch information
SDKAuto committed Jun 8, 2022
1 parent 7f03155 commit cf199e4
Show file tree
Hide file tree
Showing 92 changed files with 355 additions and 396 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-06-08)

- 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 Expand Up @@ -244,39 +280,59 @@ public AzureDigitalTwinsManager authenticate(TokenCredential credential, AzurePr
}
}

/** @return Resource collection API of DigitalTwins. */
/**
* Gets the resource collection API of DigitalTwins. It manages DigitalTwinsDescription.
*
* @return Resource collection API of DigitalTwins.
*/
public DigitalTwins digitalTwins() {
if (this.digitalTwins == null) {
this.digitalTwins = new DigitalTwinsImpl(clientObject.getDigitalTwins(), this);
}
return digitalTwins;
}

/** @return Resource collection API of DigitalTwinsEndpoints. */
/**
* Gets the resource collection API of DigitalTwinsEndpoints. It manages DigitalTwinsEndpointResource.
*
* @return Resource collection API of DigitalTwinsEndpoints.
*/
public DigitalTwinsEndpoints digitalTwinsEndpoints() {
if (this.digitalTwinsEndpoints == null) {
this.digitalTwinsEndpoints = new DigitalTwinsEndpointsImpl(clientObject.getDigitalTwinsEndpoints(), this);
}
return digitalTwinsEndpoints;
}

/** @return Resource collection API of Operations. */
/**
* Gets the resource collection API of Operations.
*
* @return Resource collection API of Operations.
*/
public Operations operations() {
if (this.operations == null) {
this.operations = new OperationsImpl(clientObject.getOperations(), this);
}
return operations;
}

/** @return Resource collection API of PrivateLinkResources. */
/**
* Gets the resource collection API of PrivateLinkResources.
*
* @return Resource collection API of PrivateLinkResources.
*/
public PrivateLinkResources privateLinkResources() {
if (this.privateLinkResources == null) {
this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this);
}
return privateLinkResources;
}

/** @return Resource collection API of PrivateEndpointConnections. */
/**
* Gets the resource collection API of PrivateEndpointConnections. It manages PrivateEndpointConnection.
*
* @return Resource collection API of PrivateEndpointConnections.
*/
public PrivateEndpointConnections privateEndpointConnections() {
if (this.privateEndpointConnections == null) {
this.privateEndpointConnections =
Expand All @@ -285,7 +341,11 @@ public PrivateEndpointConnections privateEndpointConnections() {
return privateEndpointConnections;
}

/** @return Resource collection API of TimeSeriesDatabaseConnections. */
/**
* Gets the resource collection API of TimeSeriesDatabaseConnections. It manages TimeSeriesDatabaseConnection.
*
* @return Resource collection API of TimeSeriesDatabaseConnections.
*/
public TimeSeriesDatabaseConnections timeSeriesDatabaseConnections() {
if (this.timeSeriesDatabaseConnections == null) {
this.timeSeriesDatabaseConnections =
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
Loading

0 comments on commit cf199e4

Please sign in to comment.