Skip to content

[AutoPR azure-resourcemanager-computeschedule] changing request byte from string and descoping submit endpoints #16078

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
# Release History

## 1.1.0-beta.1 (Unreleased)
## 1.1.0-beta.1 (2025-05-13)

- 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).

### Features Added

### Breaking Changes
* `models.ResourceProvisionPayload` was added

* `models.CreateResourceOperationResponse` was added

* `models.ExecuteDeleteRequest` was added

* `models.ExecuteCreateRequest` was added

* `models.DeleteResourceOperationResponse` was added

### Bugs Fixed
#### `models.ScheduledActions` was modified

### Other Changes
* `virtualMachinesExecuteCreate(java.lang.String,models.ExecuteCreateRequest)` was added
* `virtualMachinesExecuteCreateWithResponse(java.lang.String,models.ExecuteCreateRequest,com.azure.core.util.Context)` was added
* `virtualMachinesExecuteDelete(java.lang.String,models.ExecuteDeleteRequest)` was added
* `virtualMachinesExecuteDeleteWithResponse(java.lang.String,models.ExecuteDeleteRequest,com.azure.core.util.Context)` was added

## 1.0.0 (2025-01-22)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment
Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code:

```java
AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE);
AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD);
TokenCredential credential = new DefaultAzureCredentialBuilder()
.authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint())
.build();
ComputeScheduleManager manager = ComputeScheduleManager
.authenticate(credential, profile);
```

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

See [Authentication][authenticate] for more options.

Expand Down Expand Up @@ -100,5 +100,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m
[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/


594 changes: 475 additions & 119 deletions sdk/computeschedule/azure-resourcemanager-computeschedule/SAMPLE.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
<jacoco.min.linecoverage>0</jacoco.min.linecoverage>
<jacoco.min.branchcoverage>0</jacoco.min.branchcoverage>
<revapi.skip>true</revapi.skip>
<spotless.skip>false</spotless.skip>
</properties>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@
import com.azure.core.http.rest.Response;
import com.azure.core.util.Context;
import com.azure.resourcemanager.computeschedule.fluent.models.CancelOperationsResponseInner;
import com.azure.resourcemanager.computeschedule.fluent.models.CreateResourceOperationResponseInner;
import com.azure.resourcemanager.computeschedule.fluent.models.DeallocateResourceOperationResponseInner;
import com.azure.resourcemanager.computeschedule.fluent.models.DeleteResourceOperationResponseInner;
import com.azure.resourcemanager.computeschedule.fluent.models.GetOperationErrorsResponseInner;
import com.azure.resourcemanager.computeschedule.fluent.models.GetOperationStatusResponseInner;
import com.azure.resourcemanager.computeschedule.fluent.models.HibernateResourceOperationResponseInner;
import com.azure.resourcemanager.computeschedule.fluent.models.StartResourceOperationResponseInner;
import com.azure.resourcemanager.computeschedule.models.CancelOperationsRequest;
import com.azure.resourcemanager.computeschedule.models.ExecuteCreateRequest;
import com.azure.resourcemanager.computeschedule.models.ExecuteDeallocateRequest;
import com.azure.resourcemanager.computeschedule.models.ExecuteDeleteRequest;
import com.azure.resourcemanager.computeschedule.models.ExecuteHibernateRequest;
import com.azure.resourcemanager.computeschedule.models.ExecuteStartRequest;
import com.azure.resourcemanager.computeschedule.models.GetOperationErrorsRequest;
Expand Down Expand Up @@ -212,6 +216,68 @@ Response<StartResourceOperationResponseInner> virtualMachinesExecuteStartWithRes
StartResourceOperationResponseInner virtualMachinesExecuteStart(String locationparameter,
ExecuteStartRequest requestBody);

/**
* VirtualMachinesExecuteCreate: Execute create operation for a batch of virtual machines, this operation is
* triggered as soon as Computeschedule receives it.
*
* @param locationparameter The location name.
* @param requestBody The request body.
* @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 response from a create request along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<CreateResourceOperationResponseInner> virtualMachinesExecuteCreateWithResponse(String locationparameter,
ExecuteCreateRequest requestBody, Context context);

/**
* VirtualMachinesExecuteCreate: Execute create operation for a batch of virtual machines, this operation is
* triggered as soon as Computeschedule receives it.
*
* @param locationparameter The location name.
* @param requestBody The request body.
* @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 response from a create request.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
CreateResourceOperationResponseInner virtualMachinesExecuteCreate(String locationparameter,
ExecuteCreateRequest requestBody);

/**
* VirtualMachinesExecuteDelete: Execute delete operation for a batch of virtual machines, this operation is
* triggered as soon as Computeschedule receives it.
*
* @param locationparameter The location name.
* @param requestBody The request body.
* @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 response from a delete request along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<DeleteResourceOperationResponseInner> virtualMachinesExecuteDeleteWithResponse(String locationparameter,
ExecuteDeleteRequest requestBody, Context context);

/**
* VirtualMachinesExecuteDelete: Execute delete operation for a batch of virtual machines, this operation is
* triggered as soon as Computeschedule receives it.
*
* @param locationparameter The location name.
* @param requestBody The request body.
* @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 response from a delete request.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
DeleteResourceOperationResponseInner virtualMachinesExecuteDelete(String locationparameter,
ExecuteDeleteRequest requestBody);

/**
* VirtualMachinesGetOperationStatus: Polling endpoint to read status of operations performed on virtual machines.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.

package com.azure.resourcemanager.computeschedule.fluent.models;

import com.azure.core.annotation.Immutable;
import com.azure.core.util.logging.ClientLogger;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.computeschedule.models.ResourceOperation;
import java.io.IOException;
import java.util.List;

/**
* The response from a create request.
*/
@Immutable
public final class CreateResourceOperationResponseInner
implements JsonSerializable<CreateResourceOperationResponseInner> {
/*
* The description of the operation response
*/
private String description;

/*
* The type of resources used in the create request eg virtual machines
*/
private String type;

/*
* The location of the start request eg westus
*/
private String location;

/*
* The results from the start request if no errors exist
*/
private List<ResourceOperation> results;

/**
* Creates an instance of CreateResourceOperationResponseInner class.
*/
private CreateResourceOperationResponseInner() {
}

/**
* Get the description property: The description of the operation response.
*
* @return the description value.
*/
public String description() {
return this.description;
}

/**
* Get the type property: The type of resources used in the create request eg virtual machines.
*
* @return the type value.
*/
public String type() {
return this.type;
}

/**
* Get the location property: The location of the start request eg westus.
*
* @return the location value.
*/
public String location() {
return this.location;
}

/**
* Get the results property: The results from the start request if no errors exist.
*
* @return the results value.
*/
public List<ResourceOperation> results() {
return this.results;
}

/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (description() == null) {
throw LOGGER.atError()
.log(new IllegalArgumentException(
"Missing required property description in model CreateResourceOperationResponseInner"));
}
if (type() == null) {
throw LOGGER.atError()
.log(new IllegalArgumentException(
"Missing required property type in model CreateResourceOperationResponseInner"));
}
if (location() == null) {
throw LOGGER.atError()
.log(new IllegalArgumentException(
"Missing required property location in model CreateResourceOperationResponseInner"));
}
if (results() != null) {
results().forEach(e -> e.validate());
}
}

private static final ClientLogger LOGGER = new ClientLogger(CreateResourceOperationResponseInner.class);

/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("description", this.description);
jsonWriter.writeStringField("type", this.type);
jsonWriter.writeStringField("location", this.location);
jsonWriter.writeArrayField("results", this.results, (writer, element) -> writer.writeJson(element));
return jsonWriter.writeEndObject();
}

/**
* Reads an instance of CreateResourceOperationResponseInner from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of CreateResourceOperationResponseInner if the JsonReader was pointing to an instance of it,
* or null if it was pointing to JSON null.
* @throws IllegalStateException If the deserialized JSON object was missing any required properties.
* @throws IOException If an error occurs while reading the CreateResourceOperationResponseInner.
*/
public static CreateResourceOperationResponseInner fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
CreateResourceOperationResponseInner deserializedCreateResourceOperationResponseInner
= new CreateResourceOperationResponseInner();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();

if ("description".equals(fieldName)) {
deserializedCreateResourceOperationResponseInner.description = reader.getString();
} else if ("type".equals(fieldName)) {
deserializedCreateResourceOperationResponseInner.type = reader.getString();
} else if ("location".equals(fieldName)) {
deserializedCreateResourceOperationResponseInner.location = reader.getString();
} else if ("results".equals(fieldName)) {
List<ResourceOperation> results = reader.readArray(reader1 -> ResourceOperation.fromJson(reader1));
deserializedCreateResourceOperationResponseInner.results = results;
} else {
reader.skipChildren();
}
}

return deserializedCreateResourceOperationResponseInner;
});
}
}
Loading