Skip to content

Commit

Permalink
CodeGen from PR 3691 in openapi-env-test/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 9d299d7cf949f82280a26d453dca855affb9f351 into 41e238f9fd4ba837de65fca653a971f577529b12
  • Loading branch information
SDKAuto committed Nov 22, 2023
1 parent b5f4a18 commit d2155df
Show file tree
Hide file tree
Showing 62 changed files with 347 additions and 1,461 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 (2023-11-22)

- Azure Resource Manager ServiceLinker client library for Java. This package contains Microsoft Azure SDK for ServiceLinker Management SDK. Microsoft.ServiceLinker provider. Package tag package-2022-05-01. 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
25 changes: 14 additions & 11 deletions sdk/servicelinker/azure-resourcemanager-servicelinker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Various documentation is available to help you get started
<dependency>
<groupId>com.azure.resourcemanager</groupId>
<artifactId>azure-resourcemanager-servicelinker</artifactId>
<version>1.0.0-beta.2</version>
<version>1.0.0-beta.3</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand All @@ -41,19 +41,19 @@ Various documentation is available to help you get started

Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client.

[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation.
[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation.

### Authentication

By default, Azure Active Directory token authentication depends on correct configure of following environment variables.
By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables.

- `AZURE_CLIENT_ID` for Azure client ID.
- `AZURE_TENANT_ID` for Azure tenant ID.
- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate.

In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`.
In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable.

With above configuration, `azure` client can be authenticated by following code:
With above configuration, `azure` client can be authenticated using the following code:

```java
AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE);
Expand Down Expand Up @@ -83,13 +83,13 @@ See [API design][design] for general introduction on design and key concepts on

## 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][cg].

1. Fork it
1. Create your feature branch (`git checkout -b my-new-feature`)
1. Commit your changes (`git commit -am 'Add some feature'`)
1. Push to the branch (`git push origin my-new-feature`)
1. Create new Pull Request
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit <https://cla.microsoft.com>.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA.

This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact <[email protected]> with any additional questions or comments.

<!-- LINKS -->
[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS
Expand All @@ -100,3 +100,6 @@ For details on contributing to this repository, see the [contributing guide](htt
[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
[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md
[coc]: https://opensource.microsoft.com/codeofconduct/
[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
60 changes: 11 additions & 49 deletions sdk/servicelinker/azure-resourcemanager-servicelinker/SAMPLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
- [List](#linker_list)
- [ListConfigurations](#linker_listconfigurations)
- [Update](#linker_update)
- [Validate](#linker_validate)

## Operations

Expand Down Expand Up @@ -46,10 +45,7 @@ public final class LinkerCreateOrUpdateSamples {
.withId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db"))
.withAuthInfo(new SecretAuthInfo())
.withSecretStore(
new SecretStore()
.withKeyVaultId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.KeyVault/vaults/test-kv"))
.withSecretStore(new SecretStore().withKeyVaultId("fakeTokenPlaceholder"))
.create();
}

Expand Down Expand Up @@ -111,8 +107,6 @@ public final class LinkerCreateOrUpdateSamples {
### Linker_Delete

```java
import com.azure.core.util.Context;

/** Samples for Linker Delete. */
public final class LinkerDeleteSamples {
/*
Expand All @@ -129,16 +123,14 @@ public final class LinkerDeleteSamples {
.delete(
"subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app",
"linkName",
Context.NONE);
com.azure.core.util.Context.NONE);
}
}
```

### Linker_Get

```java
import com.azure.core.util.Context;

/** Samples for Linker Get. */
public final class LinkerGetSamples {
/*
Expand All @@ -155,16 +147,14 @@ public final class LinkerGetSamples {
.getWithResponse(
"subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app",
"linkName",
Context.NONE);
com.azure.core.util.Context.NONE);
}
}
```

### Linker_List

```java
import com.azure.core.util.Context;

/** Samples for Linker List. */
public final class LinkerListSamples {
/*
Expand All @@ -180,16 +170,14 @@ public final class LinkerListSamples {
.linkers()
.list(
"subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app",
Context.NONE);
com.azure.core.util.Context.NONE);
}
}
```

### Linker_ListConfigurations

```java
import com.azure.core.util.Context;

/** Samples for Linker ListConfigurations. */
public final class LinkerListConfigurationsSamples {
/*
Expand All @@ -206,15 +194,14 @@ public final class LinkerListConfigurationsSamples {
.listConfigurationsWithResponse(
"subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app",
"linkName",
Context.NONE);
com.azure.core.util.Context.NONE);
}
}
```

### Linker_Update

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.servicelinker.models.AzureResource;
import com.azure.resourcemanager.servicelinker.models.LinkerResource;
import com.azure.resourcemanager.servicelinker.models.ServicePrincipalSecretAuthInfo;
Expand All @@ -236,7 +223,7 @@ public final class LinkerUpdateSamples {
.getWithResponse(
"subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app",
"linkName",
Context.NONE)
com.azure.core.util.Context.NONE)
.getValue();
resource
.update()
Expand All @@ -245,43 +232,18 @@ public final class LinkerUpdateSamples {
.withId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db"))
.withAuthInfo(
new ServicePrincipalSecretAuthInfo().withClientId("name").withPrincipalId("id").withSecret("secret"))
new ServicePrincipalSecretAuthInfo()
.withClientId("name")
.withPrincipalId("id")
.withSecret("fakeTokenPlaceholder"))
.apply();
}
}
```

### Linker_Validate

```java
import com.azure.core.util.Context;

/** Samples for Linker Validate. */
public final class LinkerValidateSamples {
/*
* x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/ValidateLinkSuccess.json
*/
/**
* Sample code: ValidateLinkSuccess.
*
* @param manager Entry point to ServiceLinkerManager.
*/
public static void validateLinkSuccess(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) {
manager
.linkers()
.validate(
"subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app",
"linkName",
Context.NONE);
}
}
```

### Operations_List

```java
import com.azure.core.util.Context;

/** Samples for Operations List. */
public final class OperationsListSamples {
/*
Expand All @@ -293,7 +255,7 @@ public final class OperationsListSamples {
* @param manager Entry point to ServiceLinkerManager.
*/
public static void getConfiguration(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) {
manager.operations().list(Context.NONE);
manager.operations().list(com.azure.core.util.Context.NONE);
}
}
```
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<!--
~ Copyright (c) Microsoft Corporation. All rights reserved.
~ Licensed under the MIT License.
~ Code generated by Microsoft (R) AutoRest Code Generator.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
Expand Down Expand Up @@ -38,7 +43,8 @@
</developers>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jacoco.skip>true</jacoco.skip>
<jacoco.min.linecoverage>0</jacoco.min.linecoverage>
<jacoco.min.branchcoverage>0</jacoco.min.branchcoverage>
</properties>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public ServiceLinkerManager authenticate(TokenCredential credential, AzureProfil
.append("-")
.append("com.azure.resourcemanager.servicelinker")
.append("/")
.append("1.0.0-beta.2");
.append("1.0.0-beta.1");
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder
.append(" (")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import com.azure.core.util.polling.SyncPoller;
import com.azure.resourcemanager.servicelinker.fluent.models.LinkerResourceInner;
import com.azure.resourcemanager.servicelinker.fluent.models.SourceConfigurationResultInner;
import com.azure.resourcemanager.servicelinker.fluent.models.ValidateOperationResultInner;
import com.azure.resourcemanager.servicelinker.models.LinkerPatch;

/** An instance of this class provides access to all the operations defined in LinkersClient. */
Expand Down Expand Up @@ -48,27 +47,27 @@ public interface LinkersClient {
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return linker of source and target resource.
* @return linker of source and target resource along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
LinkerResourceInner get(String resourceUri, String linkerName);
Response<LinkerResourceInner> getWithResponse(String resourceUri, String linkerName, Context context);

/**
* Returns Linker resource for a given name.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return linker of source and target resource along with {@link Response}.
* @return linker of source and target resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<LinkerResourceInner> getWithResponse(String resourceUri, String linkerName, Context context);
LinkerResourceInner get(String resourceUri, String linkerName);

/**
* Create or update linker resource.
Expand Down Expand Up @@ -244,60 +243,20 @@ SyncPoller<PollResult<LinkerResourceInner>, LinkerResourceInner> beginUpdate(
LinkerResourceInner update(String resourceUri, String linkerName, LinkerPatch parameters, Context context);

/**
* Validate a link.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of the validation operation result for a linker.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<ValidateOperationResultInner>, ValidateOperationResultInner> beginValidate(
String resourceUri, String linkerName);

/**
* Validate a link.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of the validation operation result for a linker.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<ValidateOperationResultInner>, ValidateOperationResultInner> beginValidate(
String resourceUri, String linkerName, Context context);

/**
* Validate a link.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the validation operation result for a linker.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
ValidateOperationResultInner validate(String resourceUri, String linkerName);

/**
* Validate a link.
* list source configurations for a linker.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the validation operation result for a linker.
* @return configurations for source resource, include appSettings, connectionString and serviceBindings along with
* {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
ValidateOperationResultInner validate(String resourceUri, String linkerName, Context context);
Response<SourceConfigurationResultInner> listConfigurationsWithResponse(
String resourceUri, String linkerName, Context context);

/**
* list source configurations for a linker.
Expand All @@ -311,20 +270,4 @@ SyncPoller<PollResult<ValidateOperationResultInner>, ValidateOperationResultInne
*/
@ServiceMethod(returns = ReturnType.SINGLE)
SourceConfigurationResultInner listConfigurations(String resourceUri, String linkerName);

/**
* list source configurations for a linker.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return configurations for source resource, include appSettings, connectionString and serviceBindings along with
* {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<SourceConfigurationResultInner> listConfigurationsWithResponse(
String resourceUri, String linkerName, Context context);
}
Loading

0 comments on commit d2155df

Please sign in to comment.