Skip to content

Commit 34847f4

Browse files
author
SDKAuto
committed
CodeGen from PR 33742 in Azure/azure-rest-api-specs
Merge d6b9e54d4082ab3d1c5ece9c57dbf19a8835c064 into 53d9b54ab9c016bf6866057c8e3ac923ceb073d4
1 parent 668d00c commit 34847f4

File tree

40 files changed

+2517
-217
lines changed

40 files changed

+2517
-217
lines changed

sdk/computeschedule/azure-resourcemanager-computeschedule/CHANGELOG.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,29 @@
11
# Release History
22

3-
## 1.1.0-beta.1 (Unreleased)
3+
## 1.1.0-beta.1 (2025-04-15)
4+
5+
- Azure Resource Manager Compute Schedule client library for Java. This package contains Microsoft Azure SDK for Compute Schedule Management SDK. Microsoft.ComputeSchedule Resource Provider management API. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
46

57
### Features Added
68

7-
### Breaking Changes
9+
* `models.ResourceProvisionPayload` was added
10+
11+
* `models.CreateResourceOperationResponse` was added
12+
13+
* `models.ExecuteDeleteRequest` was added
14+
15+
* `models.ExecuteCreateRequest` was added
16+
17+
* `models.DeleteResourceOperationResponse` was added
18+
19+
* `models.VirtualMachineExtensionData` was added
820

9-
### Bugs Fixed
21+
#### `models.ScheduledActions` was modified
1022

11-
### Other Changes
23+
* `virtualMachinesExecuteCreate(java.lang.String,models.ExecuteCreateRequest)` was added
24+
* `virtualMachinesExecuteDelete(java.lang.String,models.ExecuteDeleteRequest)` was added
25+
* `virtualMachinesExecuteCreateWithResponse(java.lang.String,models.ExecuteCreateRequest,com.azure.core.util.Context)` was added
26+
* `virtualMachinesExecuteDeleteWithResponse(java.lang.String,models.ExecuteDeleteRequest,com.azure.core.util.Context)` was added
1227

1328
## 1.0.0 (2025-01-22)
1429

sdk/computeschedule/azure-resourcemanager-computeschedule/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment
5252
Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code:
5353

5454
```java
55-
AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE);
55+
AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD);
5656
TokenCredential credential = new DefaultAzureCredentialBuilder()
5757
.authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint())
5858
.build();
5959
ComputeScheduleManager manager = ComputeScheduleManager
6060
.authenticate(credential, profile);
6161
```
6262

63-
The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise.
63+
The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise.
6464

6565
See [Authentication][authenticate] for more options.
6666

@@ -100,5 +100,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m
100100
[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md
101101
[coc]: https://opensource.microsoft.com/codeofconduct/
102102
[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
103-
104-

sdk/computeschedule/azure-resourcemanager-computeschedule/SAMPLE.md

Lines changed: 257 additions & 110 deletions
Large diffs are not rendered by default.

sdk/computeschedule/azure-resourcemanager-computeschedule/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
<jacoco.min.linecoverage>0</jacoco.min.linecoverage>
4747
<jacoco.min.branchcoverage>0</jacoco.min.branchcoverage>
4848
<revapi.skip>true</revapi.skip>
49-
<spotless.skip>false</spotless.skip>
5049
</properties>
5150
<dependencies>
5251
<dependency>

sdk/computeschedule/azure-resourcemanager-computeschedule/src/main/java/com/azure/resourcemanager/computeschedule/fluent/ScheduledActionsClient.java

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@
99
import com.azure.core.http.rest.Response;
1010
import com.azure.core.util.Context;
1111
import com.azure.resourcemanager.computeschedule.fluent.models.CancelOperationsResponseInner;
12+
import com.azure.resourcemanager.computeschedule.fluent.models.CreateResourceOperationResponseInner;
1213
import com.azure.resourcemanager.computeschedule.fluent.models.DeallocateResourceOperationResponseInner;
14+
import com.azure.resourcemanager.computeschedule.fluent.models.DeleteResourceOperationResponseInner;
1315
import com.azure.resourcemanager.computeschedule.fluent.models.GetOperationErrorsResponseInner;
1416
import com.azure.resourcemanager.computeschedule.fluent.models.GetOperationStatusResponseInner;
1517
import com.azure.resourcemanager.computeschedule.fluent.models.HibernateResourceOperationResponseInner;
1618
import com.azure.resourcemanager.computeschedule.fluent.models.StartResourceOperationResponseInner;
1719
import com.azure.resourcemanager.computeschedule.models.CancelOperationsRequest;
20+
import com.azure.resourcemanager.computeschedule.models.ExecuteCreateRequest;
1821
import com.azure.resourcemanager.computeschedule.models.ExecuteDeallocateRequest;
22+
import com.azure.resourcemanager.computeschedule.models.ExecuteDeleteRequest;
1923
import com.azure.resourcemanager.computeschedule.models.ExecuteHibernateRequest;
2024
import com.azure.resourcemanager.computeschedule.models.ExecuteStartRequest;
2125
import com.azure.resourcemanager.computeschedule.models.GetOperationErrorsRequest;
@@ -212,6 +216,68 @@ Response<StartResourceOperationResponseInner> virtualMachinesExecuteStartWithRes
212216
StartResourceOperationResponseInner virtualMachinesExecuteStart(String locationparameter,
213217
ExecuteStartRequest requestBody);
214218

219+
/**
220+
* VirtualMachinesExecuteCreate: Execute create operation for a batch of virtual machines, this operation is
221+
* triggered as soon as Computeschedule receives it.
222+
*
223+
* @param locationparameter The location name.
224+
* @param requestBody The request body.
225+
* @param context The context to associate with this operation.
226+
* @throws IllegalArgumentException thrown if parameters fail the validation.
227+
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
228+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
229+
* @return the response from a create request along with {@link Response}.
230+
*/
231+
@ServiceMethod(returns = ReturnType.SINGLE)
232+
Response<CreateResourceOperationResponseInner> virtualMachinesExecuteCreateWithResponse(String locationparameter,
233+
ExecuteCreateRequest requestBody, Context context);
234+
235+
/**
236+
* VirtualMachinesExecuteCreate: Execute create operation for a batch of virtual machines, this operation is
237+
* triggered as soon as Computeschedule receives it.
238+
*
239+
* @param locationparameter The location name.
240+
* @param requestBody The request body.
241+
* @throws IllegalArgumentException thrown if parameters fail the validation.
242+
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
243+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
244+
* @return the response from a create request.
245+
*/
246+
@ServiceMethod(returns = ReturnType.SINGLE)
247+
CreateResourceOperationResponseInner virtualMachinesExecuteCreate(String locationparameter,
248+
ExecuteCreateRequest requestBody);
249+
250+
/**
251+
* VirtualMachinesExecuteCreate: Execute delete operation for a batch of virtual machines, this operation is
252+
* triggered as soon as Computeschedule receives it.
253+
*
254+
* @param locationparameter The location name.
255+
* @param requestBody The request body.
256+
* @param context The context to associate with this operation.
257+
* @throws IllegalArgumentException thrown if parameters fail the validation.
258+
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
259+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
260+
* @return the response from a delete request along with {@link Response}.
261+
*/
262+
@ServiceMethod(returns = ReturnType.SINGLE)
263+
Response<DeleteResourceOperationResponseInner> virtualMachinesExecuteDeleteWithResponse(String locationparameter,
264+
ExecuteDeleteRequest requestBody, Context context);
265+
266+
/**
267+
* VirtualMachinesExecuteCreate: Execute delete operation for a batch of virtual machines, this operation is
268+
* triggered as soon as Computeschedule receives it.
269+
*
270+
* @param locationparameter The location name.
271+
* @param requestBody The request body.
272+
* @throws IllegalArgumentException thrown if parameters fail the validation.
273+
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
274+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
275+
* @return the response from a delete request.
276+
*/
277+
@ServiceMethod(returns = ReturnType.SINGLE)
278+
DeleteResourceOperationResponseInner virtualMachinesExecuteDelete(String locationparameter,
279+
ExecuteDeleteRequest requestBody);
280+
215281
/**
216282
* VirtualMachinesGetOperationStatus: Polling endpoint to read status of operations performed on virtual machines.
217283
*
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
// Code generated by Microsoft (R) TypeSpec Code Generator.
4+
5+
package com.azure.resourcemanager.computeschedule.fluent.models;
6+
7+
import com.azure.core.annotation.Immutable;
8+
import com.azure.core.util.logging.ClientLogger;
9+
import com.azure.json.JsonReader;
10+
import com.azure.json.JsonSerializable;
11+
import com.azure.json.JsonToken;
12+
import com.azure.json.JsonWriter;
13+
import com.azure.resourcemanager.computeschedule.models.ResourceOperation;
14+
import java.io.IOException;
15+
import java.util.List;
16+
17+
/**
18+
* The response from a create request.
19+
*/
20+
@Immutable
21+
public final class CreateResourceOperationResponseInner
22+
implements JsonSerializable<CreateResourceOperationResponseInner> {
23+
/*
24+
* The description of the operation response
25+
*/
26+
private String description;
27+
28+
/*
29+
* The type of resources used in the create request eg virtual machines
30+
*/
31+
private String type;
32+
33+
/*
34+
* The location of the start request eg westus
35+
*/
36+
private String location;
37+
38+
/*
39+
* The results from the start request if no errors exist
40+
*/
41+
private List<ResourceOperation> results;
42+
43+
/**
44+
* Creates an instance of CreateResourceOperationResponseInner class.
45+
*/
46+
private CreateResourceOperationResponseInner() {
47+
}
48+
49+
/**
50+
* Get the description property: The description of the operation response.
51+
*
52+
* @return the description value.
53+
*/
54+
public String description() {
55+
return this.description;
56+
}
57+
58+
/**
59+
* Get the type property: The type of resources used in the create request eg virtual machines.
60+
*
61+
* @return the type value.
62+
*/
63+
public String type() {
64+
return this.type;
65+
}
66+
67+
/**
68+
* Get the location property: The location of the start request eg westus.
69+
*
70+
* @return the location value.
71+
*/
72+
public String location() {
73+
return this.location;
74+
}
75+
76+
/**
77+
* Get the results property: The results from the start request if no errors exist.
78+
*
79+
* @return the results value.
80+
*/
81+
public List<ResourceOperation> results() {
82+
return this.results;
83+
}
84+
85+
/**
86+
* Validates the instance.
87+
*
88+
* @throws IllegalArgumentException thrown if the instance is not valid.
89+
*/
90+
public void validate() {
91+
if (description() == null) {
92+
throw LOGGER.atError()
93+
.log(new IllegalArgumentException(
94+
"Missing required property description in model CreateResourceOperationResponseInner"));
95+
}
96+
if (type() == null) {
97+
throw LOGGER.atError()
98+
.log(new IllegalArgumentException(
99+
"Missing required property type in model CreateResourceOperationResponseInner"));
100+
}
101+
if (location() == null) {
102+
throw LOGGER.atError()
103+
.log(new IllegalArgumentException(
104+
"Missing required property location in model CreateResourceOperationResponseInner"));
105+
}
106+
if (results() != null) {
107+
results().forEach(e -> e.validate());
108+
}
109+
}
110+
111+
private static final ClientLogger LOGGER = new ClientLogger(CreateResourceOperationResponseInner.class);
112+
113+
/**
114+
* {@inheritDoc}
115+
*/
116+
@Override
117+
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
118+
jsonWriter.writeStartObject();
119+
jsonWriter.writeStringField("description", this.description);
120+
jsonWriter.writeStringField("type", this.type);
121+
jsonWriter.writeStringField("location", this.location);
122+
jsonWriter.writeArrayField("results", this.results, (writer, element) -> writer.writeJson(element));
123+
return jsonWriter.writeEndObject();
124+
}
125+
126+
/**
127+
* Reads an instance of CreateResourceOperationResponseInner from the JsonReader.
128+
*
129+
* @param jsonReader The JsonReader being read.
130+
* @return An instance of CreateResourceOperationResponseInner if the JsonReader was pointing to an instance of it,
131+
* or null if it was pointing to JSON null.
132+
* @throws IllegalStateException If the deserialized JSON object was missing any required properties.
133+
* @throws IOException If an error occurs while reading the CreateResourceOperationResponseInner.
134+
*/
135+
public static CreateResourceOperationResponseInner fromJson(JsonReader jsonReader) throws IOException {
136+
return jsonReader.readObject(reader -> {
137+
CreateResourceOperationResponseInner deserializedCreateResourceOperationResponseInner
138+
= new CreateResourceOperationResponseInner();
139+
while (reader.nextToken() != JsonToken.END_OBJECT) {
140+
String fieldName = reader.getFieldName();
141+
reader.nextToken();
142+
143+
if ("description".equals(fieldName)) {
144+
deserializedCreateResourceOperationResponseInner.description = reader.getString();
145+
} else if ("type".equals(fieldName)) {
146+
deserializedCreateResourceOperationResponseInner.type = reader.getString();
147+
} else if ("location".equals(fieldName)) {
148+
deserializedCreateResourceOperationResponseInner.location = reader.getString();
149+
} else if ("results".equals(fieldName)) {
150+
List<ResourceOperation> results = reader.readArray(reader1 -> ResourceOperation.fromJson(reader1));
151+
deserializedCreateResourceOperationResponseInner.results = results;
152+
} else {
153+
reader.skipChildren();
154+
}
155+
}
156+
157+
return deserializedCreateResourceOperationResponseInner;
158+
});
159+
}
160+
}

0 commit comments

Comments
 (0)