Skip to content

Commit cf68b85

Browse files
SDKAutoArieh Faiga 🙂
andcommitted
CodeGen from PR 22748 in Azure/azure-rest-api-specs
[Hub Generated] Review request for Microsoft.ProfessionalService to add version preview/2023-07-01-preview (Azure#22748) * Generate new Service for professionalservice * Initial Professional Services version * fixes * Fixes2 * Fixes3 * fixes4 * fix5 * fix6 * prettier fixes * Remove ResourceMove and ValidateResourceMove * remove non required readme files --------- Co-authored-by: Arieh Faiga 🙂 <[email protected]>
1 parent 3e789df commit cf68b85

File tree

56 files changed

+7355
-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.

56 files changed

+7355
-0
lines changed

eng/versioning/version_client.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ com.azure.resourcemanager:azure-resourcemanager-reservations;1.0.0-beta.1;1.0.0-
398398
com.azure.resourcemanager:azure-resourcemanager-storagemover;1.0.0-beta.1;1.0.0-beta.2
399399
com.azure.resourcemanager:azure-resourcemanager-containerservicefleet;1.0.0-beta.1;1.0.0-beta.1
400400
com.azure.resourcemanager:azure-resourcemanager-voiceservices;1.0.0-beta.1;1.0.0-beta.2
401+
com.azure.resourcemanager:azure-resourcemanager-professionalservice;1.0.0-beta.1;1.0.0-beta.1
401402
com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1
402403
com.azure.tools:azure-sdk-build-tool;1.0.0-beta.1;1.0.0-beta.2
403404

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@
132132
<module>sdk/postgresql</module>
133133
<module>sdk/postgresqlflexibleserver</module>
134134
<module>sdk/powerbidedicated</module>
135+
<module>sdk/professionalservice</module>
135136
<module>sdk/providerhub</module>
136137
<module>sdk/purview</module>
137138
<module>sdk/quantum</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 (2023-03-06)
4+
5+
- Azure Resource Manager ProfessionalService client library for Java. This package contains Microsoft Azure SDK for ProfessionalService Management SDK. REST APIs for Marketplace Professional Service Offers. Package tag package-2023-07-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# Azure Resource Manager ProfessionalService client library for Java
2+
3+
Azure Resource Manager ProfessionalService client library for Java.
4+
5+
This package contains Microsoft Azure SDK for ProfessionalService Management SDK. REST APIs for Marketplace Professional Service Offers. Package tag package-2023-07-01-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-professionalservice;current})
31+
```xml
32+
<dependency>
33+
<groupId>com.azure.resourcemanager</groupId>
34+
<artifactId>azure-resourcemanager-professionalservice</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] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation.
45+
46+
### Authentication
47+
48+
By default, Azure Active Directory token authentication depends on correct configuration of the 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 `AZURE_SUBSCRIPTION_ID` environment variable.
55+
56+
With above configuration, `azure` client can be authenticated using the 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+
ProfessionalServiceManager manager = ProfessionalServiceManager
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/professionalservice/azure-resourcemanager-professionalservice/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][cg].
87+
88+
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>.
89+
90+
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.
91+
92+
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.
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
103+
[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md
104+
[coc]: https://opensource.microsoft.com/codeofconduct/
105+
[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
Lines changed: 247 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,247 @@
1+
# Code snippets and samples
2+
3+
4+
## Operations
5+
6+
- [List](#operations_list)
7+
8+
## ProfessionalServiceOperation
9+
10+
- [Get](#professionalserviceoperation_get)
11+
12+
## ProfessionalServiceSubscriptionLevel
13+
14+
- [CreateOrUpdate](#professionalservicesubscriptionlevel_createorupdate)
15+
- [Delete](#professionalservicesubscriptionlevel_delete)
16+
- [GetByResourceGroup](#professionalservicesubscriptionlevel_getbyresourcegroup)
17+
- [List](#professionalservicesubscriptionlevel_list)
18+
- [ListByResourceGroup](#professionalservicesubscriptionlevel_listbyresourcegroup)
19+
- [UpdateToUnsubscribed](#professionalservicesubscriptionlevel_updatetounsubscribed)
20+
### Operations_List
21+
22+
```java
23+
/** Samples for Operations List. */
24+
public final class OperationsListSamples {
25+
/*
26+
* x-ms-original-file: specification/professionalservice/resource-manager/Microsoft.ProfessionalService/preview/2023-07-01-preview/examples/Operation/GetRpOperations.json
27+
*/
28+
/**
29+
* Sample code: Get ProfessionalService operations.
30+
*
31+
* @param manager Entry point to ProfessionalServiceManager.
32+
*/
33+
public static void getProfessionalServiceOperations(
34+
com.azure.resourcemanager.professionalservice.ProfessionalServiceManager manager) {
35+
manager.operations().list(com.azure.core.util.Context.NONE);
36+
}
37+
}
38+
```
39+
40+
### ProfessionalServiceOperation_Get
41+
42+
```java
43+
/** Samples for ProfessionalServiceOperation Get. */
44+
public final class ProfessionalServiceOperationGetSamples {
45+
/*
46+
* x-ms-original-file: specification/professionalservice/resource-manager/Microsoft.ProfessionalService/preview/2023-07-01-preview/examples/Operation/GetOperation.json
47+
*/
48+
/**
49+
* Sample code: Get operation status.
50+
*
51+
* @param manager Entry point to ProfessionalServiceManager.
52+
*/
53+
public static void getOperationStatus(
54+
com.azure.resourcemanager.professionalservice.ProfessionalServiceManager manager) {
55+
manager
56+
.professionalServiceOperations()
57+
.get("2499e7c2-d251-4a54-9b0f-7673fe325283", com.azure.core.util.Context.NONE);
58+
}
59+
}
60+
```
61+
62+
### ProfessionalServiceSubscriptionLevel_CreateOrUpdate
63+
64+
```java
65+
import com.azure.resourcemanager.professionalservice.models.ProfessionalServiceCreationProperties;
66+
67+
/** Samples for ProfessionalServiceSubscriptionLevel CreateOrUpdate. */
68+
public final class ProfessionalServiceSubscriptionLevelCreateOrUpdateSamples {
69+
/*
70+
* x-ms-original-file: specification/professionalservice/resource-manager/Microsoft.ProfessionalService/preview/2023-07-01-preview/examples/ProfessionalService/ProfessionalServicePutIndefiniteTerm.json
71+
*/
72+
/**
73+
* Sample code: Create subscription level ProfessionalService resource (indefinite term).
74+
*
75+
* @param manager Entry point to ProfessionalServiceManager.
76+
*/
77+
public static void createSubscriptionLevelProfessionalServiceResourceIndefiniteTerm(
78+
com.azure.resourcemanager.professionalservice.ProfessionalServiceManager manager) {
79+
manager
80+
.professionalServiceSubscriptionLevels()
81+
.define("MyContosoPS")
82+
.withExistingResourceGroup("c825645b-e31b-9cf4-1cee-2aba9e58bc7c", "my-ps-rg")
83+
.withRegion("global")
84+
.withName("MyContosoPS")
85+
.withProperties(
86+
new ProfessionalServiceCreationProperties()
87+
.withOfferId("testprofservice")
88+
.withPublisherId("microsoft-contoso")
89+
.withSkuId("ff051f4f-a6d9-4cbc-8d9a-2a41bd468abc")
90+
.withQuoteId("quoteabc"))
91+
.create();
92+
}
93+
94+
/*
95+
* x-ms-original-file: specification/professionalservice/resource-manager/Microsoft.ProfessionalService/preview/2023-07-01-preview/examples/ProfessionalService/ProfessionalServicePutWithTerm.json
96+
*/
97+
/**
98+
* Sample code: Create subscription level ProfessionalService resource (with term).
99+
*
100+
* @param manager Entry point to ProfessionalServiceManager.
101+
*/
102+
public static void createSubscriptionLevelProfessionalServiceResourceWithTerm(
103+
com.azure.resourcemanager.professionalservice.ProfessionalServiceManager manager) {
104+
manager
105+
.professionalServiceSubscriptionLevels()
106+
.define("MyContosoPS")
107+
.withExistingResourceGroup("c825645b-e31b-9cf4-1cee-2aba9e58bc7c", "my-ps-rg")
108+
.withRegion("global")
109+
.withName("MyContosoPS")
110+
.withProperties(
111+
new ProfessionalServiceCreationProperties()
112+
.withOfferId("testprofservice")
113+
.withPublisherId("microsoft-contoso")
114+
.withSkuId("ff051f4f-a6d9-4cbc-8d9a-2a41bd468abc")
115+
.withQuoteId("quoteabc")
116+
.withTermUnit("P3Y")
117+
.withBillingPeriod("P1Y"))
118+
.create();
119+
}
120+
}
121+
```
122+
123+
### ProfessionalServiceSubscriptionLevel_Delete
124+
125+
```java
126+
/** Samples for ProfessionalServiceSubscriptionLevel Delete. */
127+
public final class ProfessionalServiceSubscriptionLevelDeleteSamples {
128+
/*
129+
* x-ms-original-file: specification/professionalservice/resource-manager/Microsoft.ProfessionalService/preview/2023-07-01-preview/examples/ProfessionalService/ProfessionalServiceDelete.json
130+
*/
131+
/**
132+
* Sample code: Delete Subscription Level ProfessionalService resource.
133+
*
134+
* @param manager Entry point to ProfessionalServiceManager.
135+
*/
136+
public static void deleteSubscriptionLevelProfessionalServiceResource(
137+
com.azure.resourcemanager.professionalservice.ProfessionalServiceManager manager) {
138+
manager
139+
.professionalServiceSubscriptionLevels()
140+
.delete(
141+
"c825645b-e31b-9cf4-1cee-2aba9e58bc7c", "my-ps-rg", "MyContosoPS", com.azure.core.util.Context.NONE);
142+
}
143+
}
144+
```
145+
146+
### ProfessionalServiceSubscriptionLevel_GetByResourceGroup
147+
148+
```java
149+
/** Samples for ProfessionalServiceSubscriptionLevel GetByResourceGroup. */
150+
public final class ProfessionalServiceSubscriptionLevelGetByResourceGroupSamples {
151+
/*
152+
* x-ms-original-file: specification/professionalservice/resource-manager/Microsoft.ProfessionalService/preview/2023-07-01-preview/examples/ProfessionalService/ProfessionalServiceGet.json
153+
*/
154+
/**
155+
* Sample code: Get subscription level ProfessionalService resource.
156+
*
157+
* @param manager Entry point to ProfessionalServiceManager.
158+
*/
159+
public static void getSubscriptionLevelProfessionalServiceResource(
160+
com.azure.resourcemanager.professionalservice.ProfessionalServiceManager manager) {
161+
manager
162+
.professionalServiceSubscriptionLevels()
163+
.getByResourceGroupWithResponse(
164+
"c825645b-e31b-9cf4-1cee-2aba9e58bc7c",
165+
"my-ps-rg",
166+
"ps_subscription",
167+
com.azure.core.util.Context.NONE);
168+
}
169+
}
170+
```
171+
172+
### ProfessionalServiceSubscriptionLevel_List
173+
174+
```java
175+
/** Samples for ProfessionalServiceSubscriptionLevel List. */
176+
public final class ProfessionalServiceSubscriptionLevelListSamples {
177+
/*
178+
* x-ms-original-file: specification/professionalservice/resource-manager/Microsoft.ProfessionalService/preview/2023-07-01-preview/examples/ProfessionalService/ProfessionalServiceGetAllInAzureSubscription.json
179+
*/
180+
/**
181+
* Sample code: Get subscription level ProfessionalService resources in Azure subscription.
182+
*
183+
* @param manager Entry point to ProfessionalServiceManager.
184+
*/
185+
public static void getSubscriptionLevelProfessionalServiceResourcesInAzureSubscription(
186+
com.azure.resourcemanager.professionalservice.ProfessionalServiceManager manager) {
187+
manager
188+
.professionalServiceSubscriptionLevels()
189+
.list("c825645b-e31b-9cf4-1cee-2aba9e58bc7c", com.azure.core.util.Context.NONE);
190+
}
191+
}
192+
```
193+
194+
### ProfessionalServiceSubscriptionLevel_ListByResourceGroup
195+
196+
```java
197+
/** Samples for ProfessionalServiceSubscriptionLevel ListByResourceGroup. */
198+
public final class ProfessionalServiceSubscriptionLevelListByResourceGroupSamples {
199+
/*
200+
* x-ms-original-file: specification/professionalservice/resource-manager/Microsoft.ProfessionalService/preview/2023-07-01-preview/examples/ProfessionalService/ProfessionalServiceGetAllInResourceGroup.json
201+
*/
202+
/**
203+
* Sample code: Get subscription level ProfessionalService resources in resource group.
204+
*
205+
* @param manager Entry point to ProfessionalServiceManager.
206+
*/
207+
public static void getSubscriptionLevelProfessionalServiceResourcesInResourceGroup(
208+
com.azure.resourcemanager.professionalservice.ProfessionalServiceManager manager) {
209+
manager
210+
.professionalServiceSubscriptionLevels()
211+
.listByResourceGroup("c825645b-e31b-9cf4-1cee-2aba9e58bc7c", "my-ps-rg", com.azure.core.util.Context.NONE);
212+
}
213+
}
214+
```
215+
216+
### ProfessionalServiceSubscriptionLevel_UpdateToUnsubscribed
217+
218+
```java
219+
import com.azure.resourcemanager.professionalservice.models.DeleteOptions;
220+
221+
/** Samples for ProfessionalServiceSubscriptionLevel UpdateToUnsubscribed. */
222+
public final class ProfessionalServiceSubscriptionLevelUpdateToUnsubscribedSamples {
223+
/*
224+
* x-ms-original-file: specification/professionalservice/resource-manager/Microsoft.ProfessionalService/preview/2023-07-01-preview/examples/ProfessionalService/ProfessionalServiceUnsubscribe.json
225+
*/
226+
/**
227+
* Sample code: Unsubscribe Subscription Level ProfessionalService resource.
228+
*
229+
* @param manager Entry point to ProfessionalServiceManager.
230+
*/
231+
public static void unsubscribeSubscriptionLevelProfessionalServiceResource(
232+
com.azure.resourcemanager.professionalservice.ProfessionalServiceManager manager) {
233+
manager
234+
.professionalServiceSubscriptionLevels()
235+
.updateToUnsubscribed(
236+
"c825645b-e31b-9cf4-1cee-2aba9e58bc7c",
237+
"my-ps-rg",
238+
"MyContosoPS",
239+
new DeleteOptions()
240+
.withUnsubscribeOnly(true)
241+
.withReasonCode(0.0F)
242+
.withFeedback("No longer need this ProfessionalService"),
243+
com.azure.core.util.Context.NONE);
244+
}
245+
}
246+
```
247+

0 commit comments

Comments
 (0)