Skip to content

Commit ba173c7

Browse files
author
SDKAuto
committed
CodeGen from PR 18824 in Azure/azure-rest-api-specs
Merge 0acfed550c14f0828a61197d0267f04e804251ae into 398da0c0e050b5f39857661d1b104056ad48c0a2
1 parent 2f71125 commit ba173c7

File tree

66 files changed

+6759
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+6759
-0
lines changed

eng/versioning/version_client.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ com.azure.resourcemanager:azure-resourcemanager-dashboard;1.0.0-beta.1;1.0.0-bet
339339
com.azure.resourcemanager:azure-resourcemanager-servicelinker;1.0.0-beta.1;1.0.0-beta.2
340340
com.azure.resourcemanager:azure-resourcemanager-appcontainers;1.0.0-beta.1;1.0.0-beta.2
341341
com.azure.resourcemanager:azure-resourcemanager-scvmm;1.0.0-beta.1;1.0.0-beta.1
342+
com.azure.resourcemanager:azure-resourcemanager-fluidrelay;1.0.0-beta.1;1.0.0-beta.1
342343
com.azure.tools:azure-sdk-archetype;1.0.0;1.0.0
343344
com.azure.tools:azure-sdk-build-tool;1.0.0-beta.1;1.0.0-beta.2
344345

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,7 @@
898898
<module>sdk/eventgrid</module>
899899
<module>sdk/eventhubs</module>
900900
<module>sdk/extendedlocation</module>
901+
<module>sdk/fluidrelay</module>
901902
<module>sdk/formrecognizer</module>
902903
<module>sdk/frontdoor</module>
903904
<module>sdk/hanaonazure</module>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Release History
2+
3+
## 1.0.0-beta.1 (2022-05-02)
4+
5+
- Azure Resource Manager FluidRelay client library for Java. This package contains Microsoft Azure SDK for FluidRelay Management SDK. Package tag package-2021-06-15-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Azure Resource Manager FluidRelay client library for Java
2+
3+
Azure Resource Manager FluidRelay client library for Java.
4+
5+
This package contains Microsoft Azure SDK for FluidRelay Management SDK. Package tag package-2021-06-15-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
6+
7+
## We'd love to hear your feedback
8+
9+
We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better.
10+
11+
If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together.
12+
13+
Thank you in advance for your collaboration. We really appreciate your time!
14+
15+
## Documentation
16+
17+
Various documentation is available to help you get started
18+
19+
- [API reference documentation][docs]
20+
21+
## Getting started
22+
23+
### Prerequisites
24+
25+
- [Java Development Kit (JDK)][jdk] with version 8 or above
26+
- [Azure Subscription][azure_subscription]
27+
28+
### Adding the package to your product
29+
30+
[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-fluidrelay;current})
31+
```xml
32+
<dependency>
33+
<groupId>com.azure.resourcemanager</groupId>
34+
<artifactId>azure-resourcemanager-fluidrelay</artifactId>
35+
<version>1.0.0-beta.1</version>
36+
</dependency>
37+
```
38+
[//]: # ({x-version-update-end})
39+
40+
### Include the recommended packages
41+
42+
Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client.
43+
44+
[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation.
45+
46+
### Authentication
47+
48+
By default, Azure Active Directory token authentication depends on correct configure of following environment variables.
49+
50+
- `AZURE_CLIENT_ID` for Azure client ID.
51+
- `AZURE_TENANT_ID` for Azure tenant ID.
52+
- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate.
53+
54+
In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`.
55+
56+
With above configuration, `azure` client can be authenticated by following code:
57+
58+
```java
59+
AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE);
60+
TokenCredential credential = new DefaultAzureCredentialBuilder()
61+
.authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint())
62+
.build();
63+
FluidRelayManager manager = FluidRelayManager
64+
.authenticate(credential, profile);
65+
```
66+
67+
The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise.
68+
69+
See [Authentication][authenticate] for more options.
70+
71+
## Key concepts
72+
73+
See [API design][design] for general introduction on design and key concepts on Azure Management Libraries.
74+
75+
## Examples
76+
77+
[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/fluidrelay/azure-resourcemanager-fluidrelay/SAMPLE.md)
78+
79+
80+
## Troubleshooting
81+
82+
## Next steps
83+
84+
## Contributing
85+
86+
For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md).
87+
88+
1. Fork it
89+
1. Create your feature branch (`git checkout -b my-new-feature`)
90+
1. Commit your changes (`git commit -am 'Add some feature'`)
91+
1. Push to the branch (`git push origin my-new-feature`)
92+
1. Create new Pull Request
93+
94+
<!-- LINKS -->
95+
[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS
96+
[docs]: https://azure.github.io/azure-sdk-for-java/
97+
[jdk]: https://docs.microsoft.com/java/azure/jdk/
98+
[azure_subscription]: https://azure.microsoft.com/free/
99+
[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity
100+
[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty
101+
[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md
102+
[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md
Lines changed: 259 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,259 @@
1+
# Code snippets and samples
2+
3+
4+
## FluidRelayOperations
5+
6+
- [List](#fluidrelayoperations_list)
7+
8+
## FluidRelayServers
9+
10+
- [CreateOrUpdate](#fluidrelayservers_createorupdate)
11+
- [Delete](#fluidrelayservers_delete)
12+
- [GetByResourceGroup](#fluidrelayservers_getbyresourcegroup)
13+
- [GetKeys](#fluidrelayservers_getkeys)
14+
- [List](#fluidrelayservers_list)
15+
- [ListByResourceGroup](#fluidrelayservers_listbyresourcegroup)
16+
- [RegenerateKey](#fluidrelayservers_regeneratekey)
17+
- [Update](#fluidrelayservers_update)
18+
### FluidRelayOperations_List
19+
20+
```java
21+
import com.azure.core.util.Context;
22+
23+
/** Samples for FluidRelayOperations List. */
24+
public final class FluidRelayOperationsListSamples {
25+
/*
26+
* x-ms-original-file: specification/fluidrelay/resource-manager/Microsoft.FluidRelay/preview/2021-06-15-preview/examples/FluidRelayServerOperations.json
27+
*/
28+
/**
29+
* Sample code: List Fluid Relay server operations.
30+
*
31+
* @param manager Entry point to FluidRelayManager.
32+
*/
33+
public static void listFluidRelayServerOperations(com.azure.resourcemanager.fluidrelay.FluidRelayManager manager) {
34+
manager.fluidRelayOperations().list(Context.NONE);
35+
}
36+
}
37+
```
38+
39+
### FluidRelayServers_CreateOrUpdate
40+
41+
```java
42+
import com.azure.resourcemanager.fluidrelay.models.Identity;
43+
import com.azure.resourcemanager.fluidrelay.models.ResourceIdentityType;
44+
import java.util.HashMap;
45+
import java.util.Map;
46+
47+
/** Samples for FluidRelayServers CreateOrUpdate. */
48+
public final class FluidRelayServersCreateOrUpdateSamples {
49+
/*
50+
* x-ms-original-file: specification/fluidrelay/resource-manager/Microsoft.FluidRelay/preview/2021-06-15-preview/examples/FluidRelayServers_CreateOrUpdate.json
51+
*/
52+
/**
53+
* Sample code: Create a Fluid Relay server.
54+
*
55+
* @param manager Entry point to FluidRelayManager.
56+
*/
57+
public static void createAFluidRelayServer(com.azure.resourcemanager.fluidrelay.FluidRelayManager manager) {
58+
manager
59+
.fluidRelayServers()
60+
.define("myFluidRelayServer")
61+
.withRegion("west-us")
62+
.withExistingResourceGroup("myResourceGroup")
63+
.withTags(mapOf("Category", "sales"))
64+
.withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED))
65+
.create();
66+
}
67+
68+
@SuppressWarnings("unchecked")
69+
private static <T> Map<String, T> mapOf(Object... inputs) {
70+
Map<String, T> map = new HashMap<>();
71+
for (int i = 0; i < inputs.length; i += 2) {
72+
String key = (String) inputs[i];
73+
T value = (T) inputs[i + 1];
74+
map.put(key, value);
75+
}
76+
return map;
77+
}
78+
}
79+
```
80+
81+
### FluidRelayServers_Delete
82+
83+
```java
84+
import com.azure.core.util.Context;
85+
86+
/** Samples for FluidRelayServers Delete. */
87+
public final class FluidRelayServersDeleteSamples {
88+
/*
89+
* x-ms-original-file: specification/fluidrelay/resource-manager/Microsoft.FluidRelay/preview/2021-06-15-preview/examples/FluidRelayServers_Delete.json
90+
*/
91+
/**
92+
* Sample code: Delete a Fluid Relay server.
93+
*
94+
* @param manager Entry point to FluidRelayManager.
95+
*/
96+
public static void deleteAFluidRelayServer(com.azure.resourcemanager.fluidrelay.FluidRelayManager manager) {
97+
manager.fluidRelayServers().deleteWithResponse("myResourceGroup", "myFluidRelayServer", Context.NONE);
98+
}
99+
}
100+
```
101+
102+
### FluidRelayServers_GetByResourceGroup
103+
104+
```java
105+
import com.azure.core.util.Context;
106+
107+
/** Samples for FluidRelayServers GetByResourceGroup. */
108+
public final class FluidRelayServersGetByResourceGroupSamples {
109+
/*
110+
* x-ms-original-file: specification/fluidrelay/resource-manager/Microsoft.FluidRelay/preview/2021-06-15-preview/examples/FluidRelayServers_Get.json
111+
*/
112+
/**
113+
* Sample code: Get Fluid Relay server details.
114+
*
115+
* @param manager Entry point to FluidRelayManager.
116+
*/
117+
public static void getFluidRelayServerDetails(com.azure.resourcemanager.fluidrelay.FluidRelayManager manager) {
118+
manager
119+
.fluidRelayServers()
120+
.getByResourceGroupWithResponse("myResourceGroup", "myFluidRelayServer", Context.NONE);
121+
}
122+
}
123+
```
124+
125+
### FluidRelayServers_GetKeys
126+
127+
```java
128+
import com.azure.core.util.Context;
129+
130+
/** Samples for FluidRelayServers GetKeys. */
131+
public final class FluidRelayServersGetKeysSamples {
132+
/*
133+
* x-ms-original-file: specification/fluidrelay/resource-manager/Microsoft.FluidRelay/preview/2021-06-15-preview/examples/FluidRelayServers_GetKeys.json
134+
*/
135+
/**
136+
* Sample code: Get keys for a Fluid Relay server.
137+
*
138+
* @param manager Entry point to FluidRelayManager.
139+
*/
140+
public static void getKeysForAFluidRelayServer(com.azure.resourcemanager.fluidrelay.FluidRelayManager manager) {
141+
manager.fluidRelayServers().getKeysWithResponse("myResourceGroup", "myFluidRelayServer", Context.NONE);
142+
}
143+
}
144+
```
145+
146+
### FluidRelayServers_List
147+
148+
```java
149+
import com.azure.core.util.Context;
150+
151+
/** Samples for FluidRelayServers List. */
152+
public final class FluidRelayServersListSamples {
153+
/*
154+
* x-ms-original-file: specification/fluidrelay/resource-manager/Microsoft.FluidRelay/preview/2021-06-15-preview/examples/FluidRelayServers_ListBySubscription.json
155+
*/
156+
/**
157+
* Sample code: List all Fluid Relay servers in a subscription.
158+
*
159+
* @param manager Entry point to FluidRelayManager.
160+
*/
161+
public static void listAllFluidRelayServersInASubscription(
162+
com.azure.resourcemanager.fluidrelay.FluidRelayManager manager) {
163+
manager.fluidRelayServers().list(Context.NONE);
164+
}
165+
}
166+
```
167+
168+
### FluidRelayServers_ListByResourceGroup
169+
170+
```java
171+
import com.azure.core.util.Context;
172+
173+
/** Samples for FluidRelayServers ListByResourceGroup. */
174+
public final class FluidRelayServersListByResourceGroupSamples {
175+
/*
176+
* x-ms-original-file: specification/fluidrelay/resource-manager/Microsoft.FluidRelay/preview/2021-06-15-preview/examples/FluidRelayServers_ListByResourceGroup.json
177+
*/
178+
/**
179+
* Sample code: List all Fluid Relay servers in a resource group.
180+
*
181+
* @param manager Entry point to FluidRelayManager.
182+
*/
183+
public static void listAllFluidRelayServersInAResourceGroup(
184+
com.azure.resourcemanager.fluidrelay.FluidRelayManager manager) {
185+
manager.fluidRelayServers().listByResourceGroup("myResourceGroup", Context.NONE);
186+
}
187+
}
188+
```
189+
190+
### FluidRelayServers_RegenerateKey
191+
192+
```java
193+
import com.azure.core.util.Context;
194+
import com.azure.resourcemanager.fluidrelay.models.KeyName;
195+
import com.azure.resourcemanager.fluidrelay.models.RegenerateKeyRequest;
196+
197+
/** Samples for FluidRelayServers RegenerateKey. */
198+
public final class FluidRelayServersRegenerateKeySamples {
199+
/*
200+
* x-ms-original-file: specification/fluidrelay/resource-manager/Microsoft.FluidRelay/preview/2021-06-15-preview/examples/FluidRelayServers_RegenerateKeys.json
201+
*/
202+
/**
203+
* Sample code: Regenerate keys for a Fluid Relay server.
204+
*
205+
* @param manager Entry point to FluidRelayManager.
206+
*/
207+
public static void regenerateKeysForAFluidRelayServer(
208+
com.azure.resourcemanager.fluidrelay.FluidRelayManager manager) {
209+
manager
210+
.fluidRelayServers()
211+
.regenerateKeyWithResponse(
212+
"myResourceGroup",
213+
"myFluidRelayServer",
214+
new RegenerateKeyRequest().withKeyName(KeyName.KEY1),
215+
Context.NONE);
216+
}
217+
}
218+
```
219+
220+
### FluidRelayServers_Update
221+
222+
```java
223+
import com.azure.core.util.Context;
224+
import com.azure.resourcemanager.fluidrelay.models.FluidRelayServer;
225+
import java.util.HashMap;
226+
import java.util.Map;
227+
228+
/** Samples for FluidRelayServers Update. */
229+
public final class FluidRelayServersUpdateSamples {
230+
/*
231+
* x-ms-original-file: specification/fluidrelay/resource-manager/Microsoft.FluidRelay/preview/2021-06-15-preview/examples/FluidRelayServers_Update.json
232+
*/
233+
/**
234+
* Sample code: Create a Fluid Relay server.
235+
*
236+
* @param manager Entry point to FluidRelayManager.
237+
*/
238+
public static void createAFluidRelayServer(com.azure.resourcemanager.fluidrelay.FluidRelayManager manager) {
239+
FluidRelayServer resource =
240+
manager
241+
.fluidRelayServers()
242+
.getByResourceGroupWithResponse("myResourceGroup", "myFluidRelayServer", Context.NONE)
243+
.getValue();
244+
resource.update().withTags(mapOf("Category", "sales")).apply();
245+
}
246+
247+
@SuppressWarnings("unchecked")
248+
private static <T> Map<String, T> mapOf(Object... inputs) {
249+
Map<String, T> map = new HashMap<>();
250+
for (int i = 0; i < inputs.length; i += 2) {
251+
String key = (String) inputs[i];
252+
T value = (T) inputs[i + 1];
253+
map.put(key, value);
254+
}
255+
return map;
256+
}
257+
}
258+
```
259+

0 commit comments

Comments
 (0)