Skip to content
Closed
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,6 +1,8 @@
# Release History

## 1.0.0-beta.2 (Unreleased)
## 1.0.0-beta.1 (2023-05-16)

- Azure Resource Manager GraphServices client library for Java. This package contains Microsoft Azure SDK for GraphServices Management SDK. Self service experience for Microsoft Graph metered services. Package tag package-2023-04-13. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

### Features Added

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Azure Resource Manager GraphServices client library for Java.

This package contains Microsoft Azure SDK for GraphServices Management SDK. Self service experience for Microsoft Graph metered services. Package tag package-2022-09-22-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
This package contains Microsoft Azure SDK for GraphServices Management SDK. Self service experience for Microsoft Graph metered services. Package tag package-2023-04-13. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

## We'd love to hear your feedback

Expand Down Expand Up @@ -32,7 +32,7 @@ Various documentation is available to help you get started
<dependency>
<groupId>com.azure.resourcemanager</groupId>
<artifactId>azure-resourcemanager-graphservices</artifactId>
<version>1.0.0-beta.1</version>
<version>1.0.0-beta.2</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down
151 changes: 67 additions & 84 deletions sdk/graphservices/azure-resourcemanager-graphservices/SAMPLE.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,27 @@
# Code snippets and samples


## AccountOperation

- [CreateAndUpdate](#accountoperation_createandupdate)
- [Delete](#accountoperation_delete)
- [GetByResourceGroup](#accountoperation_getbyresourcegroup)
- [Update](#accountoperation_update)

## Accounts

- [CreateAndUpdate](#accounts_createandupdate)
- [Delete](#accounts_delete)
- [GetByResourceGroup](#accounts_getbyresourcegroup)
- [List](#accounts_list)
- [ListByResourceGroup](#accounts_listbyresourcegroup)
- [Update](#accounts_update)

## Operation
## Operations

- [List](#operation_list)
### AccountOperation_CreateAndUpdate
- [List](#operations_list)
### Accounts_CreateAndUpdate

```java
import com.azure.resourcemanager.graphservices.models.AccountResourceProperties;
import java.util.HashMap;
import java.util.Map;

/** Samples for AccountOperation CreateAndUpdate. */
public final class AccountOperationCreateAndUpdateSamples {
/** Samples for Accounts CreateAndUpdate. */
public final class AccountsCreateAndUpdateSamples {
/*
* x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Create.json
* x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/stable/2023-04-13/examples/Accounts_Create.json
*/
/**
* Sample code: Create Account resource.
Expand All @@ -35,35 +30,23 @@ public final class AccountOperationCreateAndUpdateSamples {
*/
public static void createAccountResource(com.azure.resourcemanager.graphservices.GraphServicesManager manager) {
manager
.accountOperations()
.accounts()
.define("11111111-aaaa-1111-bbbb-1111111111111")
.withRegion((String) null)
.withExistingResourceGroup("testResourceGroupGRAM")
.withProperties(new AccountResourceProperties().withAppId("11111111-aaaa-1111-bbbb-111111111111"))
.withTags(mapOf("tag1", "value1", "tag2", "value2"))
.create();
}

@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
```

### AccountOperation_Delete
### Accounts_Delete

```java
/** Samples for AccountOperation Delete. */
public final class AccountOperationDeleteSamples {
/** Samples for Accounts Delete. */
public final class AccountsDeleteSamples {
/*
* x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Delete.json
* x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/stable/2023-04-13/examples/Accounts_Delete.json
*/
/**
* Sample code: Delete account resource.
Expand All @@ -72,20 +55,20 @@ public final class AccountOperationDeleteSamples {
*/
public static void deleteAccountResource(com.azure.resourcemanager.graphservices.GraphServicesManager manager) {
manager
.accountOperations()
.accounts()
.deleteByResourceGroupWithResponse(
"testResourceGroupGRAM", "11111111-aaaa-1111-bbbb-111111111111", com.azure.core.util.Context.NONE);
}
}
```

### AccountOperation_GetByResourceGroup
### Accounts_GetByResourceGroup

```java
/** Samples for AccountOperation GetByResourceGroup. */
public final class AccountOperationGetByResourceGroupSamples {
/** Samples for Accounts GetByResourceGroup. */
public final class AccountsGetByResourceGroupSamples {
/*
* x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Get.json
* x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/stable/2023-04-13/examples/Accounts_Get.json
*/
/**
* Sample code: Get accounts.
Expand All @@ -94,60 +77,20 @@ public final class AccountOperationGetByResourceGroupSamples {
*/
public static void getAccounts(com.azure.resourcemanager.graphservices.GraphServicesManager manager) {
manager
.accountOperations()
.accounts()
.getByResourceGroupWithResponse(
"testResourceGroupGRAM", "11111111-aaaa-1111-bbbb-111111111111", com.azure.core.util.Context.NONE);
}
}
```

### AccountOperation_Update

```java
import com.azure.resourcemanager.graphservices.models.AccountResource;
import java.util.HashMap;
import java.util.Map;

/** Samples for AccountOperation Update. */
public final class AccountOperationUpdateSamples {
/*
* x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Update.json
*/
/**
* Sample code: Update account resource.
*
* @param manager Entry point to GraphServicesManager.
*/
public static void updateAccountResource(com.azure.resourcemanager.graphservices.GraphServicesManager manager) {
AccountResource resource =
manager
.accountOperations()
.getByResourceGroupWithResponse(
"testResourceGroupGRAM", "11111111-aaaa-1111-bbbb-111111111111", com.azure.core.util.Context.NONE)
.getValue();
resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply();
}

@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
```

### Accounts_List

```java
/** Samples for Accounts List. */
public final class AccountsListSamples {
/*
* x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_List_Sub.json
* x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/stable/2023-04-13/examples/Accounts_List_Sub.json
*/
/**
* Sample code: Get list of accounts by subscription.
Expand All @@ -167,7 +110,7 @@ public final class AccountsListSamples {
/** Samples for Accounts ListByResourceGroup. */
public final class AccountsListByResourceGroupSamples {
/*
* x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_List.json
* x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/stable/2023-04-13/examples/Accounts_List.json
*/
/**
* Sample code: Create or update account resource.
Expand All @@ -181,13 +124,53 @@ public final class AccountsListByResourceGroupSamples {
}
```

### Operation_List
### Accounts_Update

```java
import com.azure.resourcemanager.graphservices.models.AccountResource;
import java.util.HashMap;
import java.util.Map;

/** Samples for Accounts Update. */
public final class AccountsUpdateSamples {
/*
* x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/stable/2023-04-13/examples/Accounts_Update.json
*/
/**
* Sample code: Update account resource.
*
* @param manager Entry point to GraphServicesManager.
*/
public static void updateAccountResource(com.azure.resourcemanager.graphservices.GraphServicesManager manager) {
AccountResource resource =
manager
.accounts()
.getByResourceGroupWithResponse(
"testResourceGroupGRAM", "11111111-aaaa-1111-bbbb-111111111111", com.azure.core.util.Context.NONE)
.getValue();
resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply();
}

@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
```

### Operations_List

```java
/** Samples for Operation List. */
public final class OperationListSamples {
/** Samples for Operations List. */
public final class OperationsListSamples {
/*
* x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Operations_List.json
* x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/stable/2023-04-13/examples/Operations_List.json
*/
/**
* Sample code: Get list of operations.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<packaging>jar</packaging>

<name>Microsoft Azure SDK for GraphServices Management</name>
<description>This package contains Microsoft Azure SDK for GraphServices Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Self service experience for Microsoft Graph metered services. Package tag package-2022-09-22-preview.</description>
<description>This package contains Microsoft Azure SDK for GraphServices Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Self service experience for Microsoft Graph metered services. Package tag package-2023-04-13.</description>
<url>https://github.com/Azure/azure-sdk-for-java</url>

<licenses>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,9 @@
import com.azure.core.util.Configuration;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.graphservices.fluent.GraphServices;
import com.azure.resourcemanager.graphservices.implementation.AccountOperationsImpl;
import com.azure.resourcemanager.graphservices.implementation.AccountsImpl;
import com.azure.resourcemanager.graphservices.implementation.GraphServicesBuilder;
import com.azure.resourcemanager.graphservices.implementation.OperationsImpl;
import com.azure.resourcemanager.graphservices.models.AccountOperations;
import com.azure.resourcemanager.graphservices.models.Accounts;
import com.azure.resourcemanager.graphservices.models.Operations;
import java.time.Duration;
Expand All @@ -42,8 +40,6 @@
public final class GraphServicesManager {
private Accounts accounts;

private AccountOperations accountOperations;

private Operations operations;

private final GraphServices clientObject;
Expand Down Expand Up @@ -269,7 +265,7 @@ public GraphServicesManager authenticate(TokenCredential credential, AzureProfil
}

/**
* Gets the resource collection API of Accounts.
* Gets the resource collection API of Accounts. It manages AccountResource.
*
* @return Resource collection API of Accounts.
*/
Expand All @@ -280,18 +276,6 @@ public Accounts accounts() {
return accounts;
}

/**
* Gets the resource collection API of AccountOperations. It manages AccountResource.
*
* @return Resource collection API of AccountOperations.
*/
public AccountOperations accountOperations() {
if (this.accountOperations == null) {
this.accountOperations = new AccountOperationsImpl(clientObject.getAccountOperations(), this);
}
return accountOperations;
}

/**
* Gets the resource collection API of Operations.
*
Expand Down
Loading