Skip to content

Commit

Permalink
CodeGen from PR 31901 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 7872738dcd94d14e069a499b4336d9293386d3e2 into 17dbd6e760c42aeacf1db39381fc26e30dda72ca
  • Loading branch information
SDKAuto committed Dec 17, 2024
1 parent d5391c9 commit 7a0aff1
Show file tree
Hide file tree
Showing 99 changed files with 1,969 additions and 879 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release History

## 1.0.0-beta.1 (2024-12-17)

- Azure Resource Manager Workloads Sap Virtual Instance client library for Java. This package contains Microsoft Azure SDK for Workloads Sap Virtual Instance Management SDK. Workloads client provides access to various workload operations. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

## 1.0.0 (2024-10-23)

- Azure Resource Manager Workloads Sap Virtual Instance client library for Java. This package contains Microsoft Azure SDK for Workloads Sap Virtual Instance Management SDK. Workloads client provides access to various workload operations. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Code snippets and samples


## Operations

- [List](#operations_list)

## SapApplicationServerInstances

- [Create](#sapapplicationserverinstances_create)
Expand Down Expand Up @@ -45,6 +49,28 @@
- [Start](#sapvirtualinstances_start)
- [Stop](#sapvirtualinstances_stop)
- [Update](#sapvirtualinstances_update)
### Operations_List

```java
/**
* Samples for Operations List.
*/
public final class OperationsListSamples {
/*
* x-ms-original-file: 2024-09-01/Operations_List.json
*/
/**
* Sample code: List the operations for the provider.
*
* @param manager Entry point to WorkloadsSapVirtualInstanceManager.
*/
public static void listTheOperationsForTheProvider(
com.azure.resourcemanager.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceManager manager) {
manager.operations().list(com.azure.core.util.Context.NONE);
}
}
```

### SapApplicationServerInstances_Create

```java
Expand Down Expand Up @@ -3497,8 +3523,8 @@ public final class SapVirtualInstancesStopSamples {

```java
import com.azure.resourcemanager.workloadssapvirtualinstance.models.ManagedResourcesNetworkAccessType;
import com.azure.resourcemanager.workloadssapvirtualinstance.models.ManagedServiceIdentity;
import com.azure.resourcemanager.workloadssapvirtualinstance.models.ManagedServiceIdentityType;
import com.azure.resourcemanager.workloadssapvirtualinstance.models.SAPVirtualInstanceIdentity;
import com.azure.resourcemanager.workloadssapvirtualinstance.models.SAPVirtualInstanceIdentityType;
import com.azure.resourcemanager.workloadssapvirtualinstance.models.SapVirtualInstance;
import com.azure.resourcemanager.workloadssapvirtualinstance.models.UpdateSapVirtualInstanceProperties;
import java.util.HashMap;
Expand All @@ -3523,7 +3549,7 @@ public final class SapVirtualInstancesUpdateSamples {
.getValue();
resource.update()
.withTags(mapOf("key1", "fakeTokenPlaceholder"))
.withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE))
.withIdentity(new SAPVirtualInstanceIdentity().withType(SAPVirtualInstanceIdentityType.NONE))
.withProperties(new UpdateSapVirtualInstanceProperties())
.apply();
}
Expand All @@ -3543,7 +3569,7 @@ public final class SapVirtualInstancesUpdateSamples {
.getValue();
resource.update()
.withTags(mapOf("key1", "fakeTokenPlaceholder"))
.withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE))
.withIdentity(new SAPVirtualInstanceIdentity().withType(SAPVirtualInstanceIdentityType.NONE))
.withProperties(new UpdateSapVirtualInstanceProperties()
.withManagedResourcesNetworkAccessType(ManagedResourcesNetworkAccessType.PRIVATE))
.apply();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
<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 @@ -24,11 +24,13 @@
import com.azure.core.util.Configuration;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.workloadssapvirtualinstance.fluent.WorkloadsSapVirtualInstanceMgmtClient;
import com.azure.resourcemanager.workloadssapvirtualinstance.implementation.OperationsImpl;
import com.azure.resourcemanager.workloadssapvirtualinstance.implementation.SapApplicationServerInstancesImpl;
import com.azure.resourcemanager.workloadssapvirtualinstance.implementation.SapCentralServerInstancesImpl;
import com.azure.resourcemanager.workloadssapvirtualinstance.implementation.SapDatabaseInstancesImpl;
import com.azure.resourcemanager.workloadssapvirtualinstance.implementation.SapVirtualInstancesImpl;
import com.azure.resourcemanager.workloadssapvirtualinstance.implementation.WorkloadsSapVirtualInstanceMgmtClientBuilder;
import com.azure.resourcemanager.workloadssapvirtualinstance.models.Operations;
import com.azure.resourcemanager.workloadssapvirtualinstance.models.SapApplicationServerInstances;
import com.azure.resourcemanager.workloadssapvirtualinstance.models.SapCentralServerInstances;
import com.azure.resourcemanager.workloadssapvirtualinstance.models.SapDatabaseInstances;
Expand All @@ -45,6 +47,8 @@
* Workloads client provides access to various workload operations.
*/
public final class WorkloadsSapVirtualInstanceManager {
private Operations operations;

private SapVirtualInstances sapVirtualInstances;

private SapCentralServerInstances sapCentralServerInstances;
Expand Down Expand Up @@ -265,6 +269,18 @@ public WorkloadsSapVirtualInstanceManager authenticate(TokenCredential credentia
}
}

/**
* Gets the resource collection API of Operations.
*
* @return Resource collection API of Operations.
*/
public Operations operations() {
if (this.operations == null) {
this.operations = new OperationsImpl(clientObject.getOperations(), this);
}
return operations;
}

/**
* Gets the resource collection API of SapVirtualInstances. It manages SapVirtualInstance.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.

package com.azure.resourcemanager.workloadssapvirtualinstance.fluent;

import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.util.Context;
import com.azure.resourcemanager.workloadssapvirtualinstance.fluent.models.OperationInner;

/**
* An instance of this class provides access to all the operations defined in OperationsClient.
*/
public interface OperationsClient {
/**
* List the operations for the provider.
*
* @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 a list of REST API operations supported by an Azure Resource Provider as paginated response with
* {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<OperationInner> list();

/**
* List the operations for the provider.
*
* @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 a list of REST API operations supported by an Azure Resource Provider as paginated response with
* {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<OperationInner> list(Context context);
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ public interface WorkloadsSapVirtualInstanceMgmtClient {
*/
Duration getDefaultPollInterval();

/**
* Gets the OperationsClient object to access its operations.
*
* @return the OperationsClient object.
*/
OperationsClient getOperations();

/**
* Gets the SapVirtualInstancesClient object to access its operations.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.

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

import com.azure.core.annotation.Immutable;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.workloadssapvirtualinstance.models.ActionType;
import com.azure.resourcemanager.workloadssapvirtualinstance.models.OperationDisplay;
import com.azure.resourcemanager.workloadssapvirtualinstance.models.Origin;
import java.io.IOException;

/**
* Details of a REST API operation, returned from the Resource Provider Operations API.
*/
@Immutable
public final class OperationInner implements JsonSerializable<OperationInner> {
/*
* The name of the operation, as per Resource-Based Access Control (RBAC). Examples:
* "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action"
*/
private String name;

/*
* Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure
* Resource Manager/control-plane operations.
*/
private Boolean isDataAction;

/*
* Localized display information for this particular operation.
*/
private OperationDisplay display;

/*
* The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default
* value is "user,system"
*/
private Origin origin;

/*
* Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
*/
private ActionType actionType;

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

/**
* Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples:
* "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action".
*
* @return the name value.
*/
public String name() {
return this.name;
}

/**
* Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane
* operations and "false" for Azure Resource Manager/control-plane operations.
*
* @return the isDataAction value.
*/
public Boolean isDataAction() {
return this.isDataAction;
}

/**
* Get the display property: Localized display information for this particular operation.
*
* @return the display value.
*/
public OperationDisplay display() {
return this.display;
}

/**
* Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and
* audit logs UX. Default value is "user,system".
*
* @return the origin value.
*/
public Origin origin() {
return this.origin;
}

/**
* Get the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are
* for internal only APIs.
*
* @return the actionType value.
*/
public ActionType actionType() {
return this.actionType;
}

/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (display() != null) {
display().validate();
}
}

/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeJsonField("display", this.display);
return jsonWriter.writeEndObject();
}

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

if ("name".equals(fieldName)) {
deserializedOperationInner.name = reader.getString();
} else if ("isDataAction".equals(fieldName)) {
deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean);
} else if ("display".equals(fieldName)) {
deserializedOperationInner.display = OperationDisplay.fromJson(reader);
} else if ("origin".equals(fieldName)) {
deserializedOperationInner.origin = Origin.fromString(reader.getString());
} else if ("actionType".equals(fieldName)) {
deserializedOperationInner.actionType = ActionType.fromString(reader.getString());
} else {
reader.skipChildren();
}
}

return deserializedOperationInner;
});
}
}
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.workloadssapvirtualinstance.models.ManagedServiceIdentity;
import com.azure.resourcemanager.workloadssapvirtualinstance.models.SAPVirtualInstanceIdentity;
import com.azure.resourcemanager.workloadssapvirtualinstance.models.SapVirtualInstanceProperties;
import java.io.IOException;
import java.util.Map;
Expand All @@ -28,7 +28,7 @@ public final class SapVirtualInstanceInner extends Resource {
/*
* The managed service identities assigned to this resource.
*/
private ManagedServiceIdentity identity;
private SAPVirtualInstanceIdentity identity;

/*
* Azure Resource Manager metadata containing createdBy and modifiedBy information.
Expand Down Expand Up @@ -81,7 +81,7 @@ public SapVirtualInstanceInner withProperties(SapVirtualInstanceProperties prope
*
* @return the identity value.
*/
public ManagedServiceIdentity identity() {
public SAPVirtualInstanceIdentity identity() {
return this.identity;
}

Expand All @@ -91,7 +91,7 @@ public ManagedServiceIdentity identity() {
* @param identity the identity value to set.
* @return the SapVirtualInstanceInner object itself.
*/
public SapVirtualInstanceInner withIdentity(ManagedServiceIdentity identity) {
public SapVirtualInstanceInner withIdentity(SAPVirtualInstanceIdentity identity) {
this.identity = identity;
return this;
}
Expand Down Expand Up @@ -210,7 +210,7 @@ public static SapVirtualInstanceInner fromJson(JsonReader jsonReader) throws IOE
} else if ("properties".equals(fieldName)) {
deserializedSapVirtualInstanceInner.properties = SapVirtualInstanceProperties.fromJson(reader);
} else if ("identity".equals(fieldName)) {
deserializedSapVirtualInstanceInner.identity = ManagedServiceIdentity.fromJson(reader);
deserializedSapVirtualInstanceInner.identity = SAPVirtualInstanceIdentity.fromJson(reader);
} else if ("systemData".equals(fieldName)) {
deserializedSapVirtualInstanceInner.systemData = SystemData.fromJson(reader);
} else {
Expand Down
Loading

0 comments on commit 7a0aff1

Please sign in to comment.