Skip to content
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,18 @@
# Release History

## 1.2.0-beta.2 (Unreleased)
## 1.2.0-beta.2 (2025-09-17)

### Features Added
- 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. Package api-version 2025-04-15-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

### Breaking Changes

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

* `models.ScheduledActionProperties properties()` -> `models.ScheduledActionsExtensionProperties properties()`

### Features Added

### Other Changes
* `models.ScheduledActionsExtensionProperties` was added

## 1.2.0-beta.1 (2025-07-24)

Expand Down
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-computeschedule</artifactId>
<version>1.2.0-beta.1</version>
<version>1.2.0-beta.2</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.computeschedule.models.ScheduledActionProperties;
import com.azure.resourcemanager.computeschedule.models.ScheduledActionsExtensionProperties;
import java.io.IOException;

/**
Expand All @@ -21,7 +21,7 @@ public final class ScheduledActionResourcesInner extends ProxyResource {
/*
* The resource-specific properties for this resource.
*/
private ScheduledActionProperties properties;
private ScheduledActionsExtensionProperties properties;

/*
* Azure Resource Manager metadata containing createdBy and modifiedBy information.
Expand Down Expand Up @@ -54,7 +54,7 @@ private ScheduledActionResourcesInner() {
*
* @return the properties value.
*/
public ScheduledActionProperties properties() {
public ScheduledActionsExtensionProperties properties() {
return this.properties;
}

Expand Down Expand Up @@ -142,7 +142,8 @@ public static ScheduledActionResourcesInner fromJson(JsonReader jsonReader) thro
} else if ("type".equals(fieldName)) {
deserializedScheduledActionResourcesInner.type = reader.getString();
} else if ("properties".equals(fieldName)) {
deserializedScheduledActionResourcesInner.properties = ScheduledActionProperties.fromJson(reader);
deserializedScheduledActionResourcesInner.properties
= ScheduledActionsExtensionProperties.fromJson(reader);
} else if ("systemData".equals(fieldName)) {
deserializedScheduledActionResourcesInner.systemData = SystemData.fromJson(reader);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

import com.azure.core.management.SystemData;
import com.azure.resourcemanager.computeschedule.fluent.models.ScheduledActionResourcesInner;
import com.azure.resourcemanager.computeschedule.models.ScheduledActionProperties;
import com.azure.resourcemanager.computeschedule.models.ScheduledActionResources;
import com.azure.resourcemanager.computeschedule.models.ScheduledActionsExtensionProperties;

public final class ScheduledActionResourcesImpl implements ScheduledActionResources {
private ScheduledActionResourcesInner innerObject;
Expand All @@ -32,7 +32,7 @@ public String type() {
return this.innerModel().type();
}

public ScheduledActionProperties properties() {
public ScheduledActionsExtensionProperties properties() {
return this.innerModel().properties();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public interface ScheduledActionResources {
*
* @return the properties value.
*/
ScheduledActionProperties properties();
ScheduledActionsExtensionProperties properties();

/**
* Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,276 @@
// 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.models;

import com.azure.core.annotation.Immutable;
import com.azure.core.util.CoreUtils;
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 java.io.IOException;
import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;

/**
* Scheduled action extension properties.
*/
@Immutable
public final class ScheduledActionsExtensionProperties
implements JsonSerializable<ScheduledActionsExtensionProperties> {
/*
* The type of resource the scheduled action is targeting
*/
private ResourceType resourceType;

/*
* The action the scheduled action should perform in the resources
*/
private ScheduledActionType actionType;

/*
* The time which the scheduled action is supposed to start running
*/
private OffsetDateTime startTime;

/*
* The time when the scheduled action is supposed to stop scheduling
*/
private OffsetDateTime endTime;

/*
* The schedule the scheduled action is supposed to follow
*/
private ScheduledActionsSchedule schedule;

/*
* The notification settings for the scheduled action
*/
private List<NotificationProperties> notificationSettings;

/*
* Tell if the scheduled action is disabled or not
*/
private Boolean disabled;

/*
* The status of the last provisioning operation performed on the resource.
*/
private ProvisioningState provisioningState;

/*
* The notification settings for the scheduled action at a resource level. Resource level notification settings are
* scope to specific resources only and submitted through attach requests.
*/
private List<NotificationProperties> resourceNotificationSettings;

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

/**
* Get the resourceType property: The type of resource the scheduled action is targeting.
*
* @return the resourceType value.
*/
public ResourceType resourceType() {
return this.resourceType;
}

/**
* Get the actionType property: The action the scheduled action should perform in the resources.
*
* @return the actionType value.
*/
public ScheduledActionType actionType() {
return this.actionType;
}

/**
* Get the startTime property: The time which the scheduled action is supposed to start running.
*
* @return the startTime value.
*/
public OffsetDateTime startTime() {
return this.startTime;
}

/**
* Get the endTime property: The time when the scheduled action is supposed to stop scheduling.
*
* @return the endTime value.
*/
public OffsetDateTime endTime() {
return this.endTime;
}

/**
* Get the schedule property: The schedule the scheduled action is supposed to follow.
*
* @return the schedule value.
*/
public ScheduledActionsSchedule schedule() {
return this.schedule;
}

/**
* Get the notificationSettings property: The notification settings for the scheduled action.
*
* @return the notificationSettings value.
*/
public List<NotificationProperties> notificationSettings() {
return this.notificationSettings;
}

/**
* Get the disabled property: Tell if the scheduled action is disabled or not.
*
* @return the disabled value.
*/
public Boolean disabled() {
return this.disabled;
}

/**
* Get the provisioningState property: The status of the last provisioning operation performed on the resource.
*
* @return the provisioningState value.
*/
public ProvisioningState provisioningState() {
return this.provisioningState;
}

/**
* Get the resourceNotificationSettings property: The notification settings for the scheduled action at a resource
* level. Resource level notification settings are scope to specific resources only and submitted through attach
* requests.
*
* @return the resourceNotificationSettings value.
*/
public List<NotificationProperties> resourceNotificationSettings() {
return this.resourceNotificationSettings;
}

/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (resourceType() == null) {
throw LOGGER.atError()
.log(new IllegalArgumentException(
"Missing required property resourceType in model ScheduledActionsExtensionProperties"));
}
if (actionType() == null) {
throw LOGGER.atError()
.log(new IllegalArgumentException(
"Missing required property actionType in model ScheduledActionsExtensionProperties"));
}
if (startTime() == null) {
throw LOGGER.atError()
.log(new IllegalArgumentException(
"Missing required property startTime in model ScheduledActionsExtensionProperties"));
}
if (schedule() == null) {
throw LOGGER.atError()
.log(new IllegalArgumentException(
"Missing required property schedule in model ScheduledActionsExtensionProperties"));
} else {
schedule().validate();
}
if (notificationSettings() == null) {
throw LOGGER.atError()
.log(new IllegalArgumentException(
"Missing required property notificationSettings in model ScheduledActionsExtensionProperties"));
} else {
notificationSettings().forEach(e -> e.validate());
}
if (resourceNotificationSettings() != null) {
resourceNotificationSettings().forEach(e -> e.validate());
}
}

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

/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("resourceType", this.resourceType == null ? null : this.resourceType.toString());
jsonWriter.writeStringField("actionType", this.actionType == null ? null : this.actionType.toString());
jsonWriter.writeStringField("startTime",
this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime));
jsonWriter.writeJsonField("schedule", this.schedule);
jsonWriter.writeArrayField("notificationSettings", this.notificationSettings,
(writer, element) -> writer.writeJson(element));
jsonWriter.writeStringField("endTime",
this.endTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTime));
jsonWriter.writeBooleanField("disabled", this.disabled);
return jsonWriter.writeEndObject();
}

/**
* Reads an instance of ScheduledActionsExtensionProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of ScheduledActionsExtensionProperties 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 ScheduledActionsExtensionProperties.
*/
public static ScheduledActionsExtensionProperties fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
ScheduledActionsExtensionProperties deserializedScheduledActionsExtensionProperties
= new ScheduledActionsExtensionProperties();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();

if ("resourceType".equals(fieldName)) {
deserializedScheduledActionsExtensionProperties.resourceType
= ResourceType.fromString(reader.getString());
} else if ("actionType".equals(fieldName)) {
deserializedScheduledActionsExtensionProperties.actionType
= ScheduledActionType.fromString(reader.getString());
} else if ("startTime".equals(fieldName)) {
deserializedScheduledActionsExtensionProperties.startTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("schedule".equals(fieldName)) {
deserializedScheduledActionsExtensionProperties.schedule
= ScheduledActionsSchedule.fromJson(reader);
} else if ("notificationSettings".equals(fieldName)) {
List<NotificationProperties> notificationSettings
= reader.readArray(reader1 -> NotificationProperties.fromJson(reader1));
deserializedScheduledActionsExtensionProperties.notificationSettings = notificationSettings;
} else if ("endTime".equals(fieldName)) {
deserializedScheduledActionsExtensionProperties.endTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("disabled".equals(fieldName)) {
deserializedScheduledActionsExtensionProperties.disabled
= reader.getNullable(JsonReader::getBoolean);
} else if ("provisioningState".equals(fieldName)) {
deserializedScheduledActionsExtensionProperties.provisioningState
= ProvisioningState.fromString(reader.getString());
} else if ("resourceNotificationSettings".equals(fieldName)) {
List<NotificationProperties> resourceNotificationSettings
= reader.readArray(reader1 -> NotificationProperties.fromJson(reader1));
deserializedScheduledActionsExtensionProperties.resourceNotificationSettings
= resourceNotificationSettings;
} else {
reader.skipChildren();
}
}

return deserializedScheduledActionsExtensionProperties;
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
"com.azure.resourcemanager.computeschedule.models.ScheduledActionType": "Microsoft.ComputeSchedule.ActionType",
"com.azure.resourcemanager.computeschedule.models.ScheduledActionUpdate": "Azure.ResourceManager.Foundations.ResourceUpdateModel",
"com.azure.resourcemanager.computeschedule.models.ScheduledActionUpdateProperties": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties",
"com.azure.resourcemanager.computeschedule.models.ScheduledActionsExtensionProperties": "Microsoft.ComputeSchedule.ScheduledActionsExtensionProperties",
"com.azure.resourcemanager.computeschedule.models.ScheduledActionsSchedule": "Microsoft.ComputeSchedule.ScheduledActionsSchedule",
"com.azure.resourcemanager.computeschedule.models.SubmitDeallocateRequest": "Microsoft.ComputeSchedule.SubmitDeallocateRequest",
"com.azure.resourcemanager.computeschedule.models.SubmitHibernateRequest": "Microsoft.ComputeSchedule.SubmitHibernateRequest",
Expand Down

Large diffs are not rendered by default.

Loading