[Automation] Collect examples from azure-sdk-for-java#azure-resourcemanager-digitaltwins_1.2.0

Co-authored-by: azure-sdk <azuresdk@microsoft.com>
This commit is contained in:
Azure-Fluent 2023-03-25 08:05:48 +08:00 коммит произвёл GitHub
Родитель c5f263222c
Коммит 2bc538596d
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
70 изменённых файлов: 839 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,19 @@
import com.azure.resourcemanager.digitaltwins.models.CheckNameRequest;
/** Samples for DigitalTwins CheckNameAvailability. */
public final class Main {
/*
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsCheckNameAvailability_example.json
*/
/**
* Sample code: Check name Availability.
*
* @param manager Entry point to AzureDigitalTwinsManager.
*/
public static void checkNameAvailability(com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) {
manager
.digitalTwins()
.checkNameAvailabilityWithResponse(
"WestUS2", new CheckNameRequest().withName("myadtinstance"), com.azure.core.util.Context.NONE);
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-digitaltwins_1.2.0/sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,15 @@
/** Samples for DigitalTwins Delete. */
public final class Main {
/*
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsDelete_WithIdentity_example.json
*/
/**
* Sample code: Delete a DigitalTwinsInstance resource with identity.
*
* @param manager Entry point to AzureDigitalTwinsManager.
*/
public static void deleteADigitalTwinsInstanceResourceWithIdentity(
com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) {
manager.digitalTwins().delete("resRg", "myDigitalTwinsService", com.azure.core.util.Context.NONE);
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-digitaltwins_1.2.0/sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,15 @@
/** Samples for DigitalTwins Delete. */
public final class Main {
/*
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsDelete_example.json
*/
/**
* Sample code: Delete a DigitalTwinsInstance resource.
*
* @param manager Entry point to AzureDigitalTwinsManager.
*/
public static void deleteADigitalTwinsInstanceResource(
com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) {
manager.digitalTwins().delete("resRg", "myDigitalTwinsService", com.azure.core.util.Context.NONE);
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-digitaltwins_1.2.0/sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,17 @@
/** Samples for DigitalTwinsEndpoint Delete. */
public final class Main {
/*
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsEndpointDelete_WithIdentity_example.json
*/
/**
* Sample code: Delete a DigitalTwinsInstance endpoint with identity.
*
* @param manager Entry point to AzureDigitalTwinsManager.
*/
public static void deleteADigitalTwinsInstanceEndpointWithIdentity(
com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) {
manager
.digitalTwinsEndpoints()
.delete("resRg", "myDigitalTwinsService", "myendpoint", com.azure.core.util.Context.NONE);
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-digitaltwins_1.2.0/sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,17 @@
/** Samples for DigitalTwinsEndpoint Delete. */
public final class Main {
/*
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsEndpointDelete_example.json
*/
/**
* Sample code: Delete a DigitalTwinsInstance endpoint.
*
* @param manager Entry point to AzureDigitalTwinsManager.
*/
public static void deleteADigitalTwinsInstanceEndpoint(
com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) {
manager
.digitalTwinsEndpoints()
.delete("resRg", "myDigitalTwinsService", "myendpoint", com.azure.core.util.Context.NONE);
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-digitaltwins_1.2.0/sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,17 @@
/** Samples for DigitalTwinsEndpoint Get. */
public final class Main {
/*
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsEndpointGet_WithIdentity_example.json
*/
/**
* Sample code: Get a DigitalTwinsInstance endpoint with identity.
*
* @param manager Entry point to AzureDigitalTwinsManager.
*/
public static void getADigitalTwinsInstanceEndpointWithIdentity(
com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) {
manager
.digitalTwinsEndpoints()
.getWithResponse("resRg", "myDigitalTwinsService", "myServiceBus", com.azure.core.util.Context.NONE);
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-digitaltwins_1.2.0/sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,17 @@
/** Samples for DigitalTwinsEndpoint Get. */
public final class Main {
/*
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsEndpointGet_example.json
*/
/**
* Sample code: Get a DigitalTwinsInstance endpoint.
*
* @param manager Entry point to AzureDigitalTwinsManager.
*/
public static void getADigitalTwinsInstanceEndpoint(
com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) {
manager
.digitalTwinsEndpoints()
.getWithResponse("resRg", "myDigitalTwinsService", "myServiceBus", com.azure.core.util.Context.NONE);
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-digitaltwins_1.2.0/sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,27 @@
import com.azure.resourcemanager.digitaltwins.models.AuthenticationType;
import com.azure.resourcemanager.digitaltwins.models.ServiceBus;
/** Samples for DigitalTwinsEndpoint CreateOrUpdate. */
public final class Main {
/*
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsEndpointPut_WithIdentity_example.json
*/
/**
* Sample code: Put a DigitalTwinsEndpoint resource with identity.
*
* @param manager Entry point to AzureDigitalTwinsManager.
*/
public static void putADigitalTwinsEndpointResourceWithIdentity(
com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) {
manager
.digitalTwinsEndpoints()
.define("myServiceBus")
.withExistingDigitalTwinsInstance("resRg", "myDigitalTwinsService")
.withProperties(
new ServiceBus()
.withAuthenticationType(AuthenticationType.IDENTITY_BASED)
.withEndpointUri("sb://mysb.servicebus.windows.net/")
.withEntityPath("mysbtopic"))
.create();
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-digitaltwins_1.2.0/sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
import com.azure.resourcemanager.digitaltwins.models.AuthenticationType;
import com.azure.resourcemanager.digitaltwins.models.IdentityType;
import com.azure.resourcemanager.digitaltwins.models.ManagedIdentityReference;
import com.azure.resourcemanager.digitaltwins.models.ServiceBus;
/** Samples for DigitalTwinsEndpoint CreateOrUpdate. */
public final class Main {
/*
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsEndpointPut_WithUserIdentity_example.json
*/
/**
* Sample code: Put a DigitalTwinsEndpoint resource with user assigned identity.
*
* @param manager Entry point to AzureDigitalTwinsManager.
*/
public static void putADigitalTwinsEndpointResourceWithUserAssignedIdentity(
com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) {
manager
.digitalTwinsEndpoints()
.define("myServiceBus")
.withExistingDigitalTwinsInstance("resRg", "myDigitalTwinsService")
.withProperties(
new ServiceBus()
.withAuthenticationType(AuthenticationType.IDENTITY_BASED)
.withIdentity(
new ManagedIdentityReference()
.withType(IdentityType.USER_ASSIGNED)
.withUserAssignedIdentity(
"/subscriptions/50016170-c839-41ba-a724-51e9df440b9e/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity"))
.withEndpointUri("sb://mysb.servicebus.windows.net/")
.withEntityPath("mysbtopic"))
.create();
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-digitaltwins_1.2.0/sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,29 @@
import com.azure.resourcemanager.digitaltwins.models.AuthenticationType;
import com.azure.resourcemanager.digitaltwins.models.ServiceBus;
/** Samples for DigitalTwinsEndpoint CreateOrUpdate. */
public final class Main {
/*
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsEndpointPut_example.json
*/
/**
* Sample code: Put a DigitalTwinsEndpoint resource.
*
* @param manager Entry point to AzureDigitalTwinsManager.
*/
public static void putADigitalTwinsEndpointResource(
com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) {
manager
.digitalTwinsEndpoints()
.define("myServiceBus")
.withExistingDigitalTwinsInstance("resRg", "myDigitalTwinsService")
.withProperties(
new ServiceBus()
.withAuthenticationType(AuthenticationType.KEY_BASED)
.withPrimaryConnectionString(
"Endpoint=sb://mysb.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=xyzxyzoX4=;EntityPath=abcabc")
.withSecondaryConnectionString(
"Endpoint=sb://mysb.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=xyzxyzoX4=;EntityPath=abcabc"))
.create();
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-digitaltwins_1.2.0/sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,15 @@
/** Samples for DigitalTwinsEndpoint List. */
public final class Main {
/*
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsEndpointsGet_WithIdentity_example.json
*/
/**
* Sample code: Get a DigitalTwinsInstance endpoints with identity.
*
* @param manager Entry point to AzureDigitalTwinsManager.
*/
public static void getADigitalTwinsInstanceEndpointsWithIdentity(
com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) {
manager.digitalTwinsEndpoints().list("resRg", "myDigitalTwinsService", com.azure.core.util.Context.NONE);
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-digitaltwins_1.2.0/sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,15 @@
/** Samples for DigitalTwinsEndpoint List. */
public final class Main {
/*
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsEndpointsGet_example.json
*/
/**
* Sample code: Get a DigitalTwinsInstance endpoints.
*
* @param manager Entry point to AzureDigitalTwinsManager.
*/
public static void getADigitalTwinsInstanceEndpoints(
com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) {
manager.digitalTwinsEndpoints().list("resRg", "myDigitalTwinsService", com.azure.core.util.Context.NONE);
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-digitaltwins_1.2.0/sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,17 @@
/** Samples for DigitalTwins GetByResourceGroup. */
public final class Main {
/*
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsGet_WithIdentity_example.json
*/
/**
* Sample code: Get a DigitalTwinsInstance resource with identity.
*
* @param manager Entry point to AzureDigitalTwinsManager.
*/
public static void getADigitalTwinsInstanceResourceWithIdentity(
com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) {
manager
.digitalTwins()
.getByResourceGroupWithResponse("resRg", "myDigitalTwinsService", com.azure.core.util.Context.NONE);
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-digitaltwins_1.2.0/sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,17 @@
/** Samples for DigitalTwins GetByResourceGroup. */
public final class Main {
/*
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsGet_WithPrivateEndpointConnection_example.json
*/
/**
* Sample code: Get a DigitalTwinsInstance resource with a private endpoint connection.
*
* @param manager Entry point to AzureDigitalTwinsManager.
*/
public static void getADigitalTwinsInstanceResourceWithAPrivateEndpointConnection(
com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) {
manager
.digitalTwins()
.getByResourceGroupWithResponse("resRg", "myDigitalTwinsService", com.azure.core.util.Context.NONE);
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-digitaltwins_1.2.0/sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,17 @@
/** Samples for DigitalTwins GetByResourceGroup. */
public final class Main {
/*
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsGet_example.json
*/
/**
* Sample code: Get a DigitalTwinsInstance resource.
*
* @param manager Entry point to AzureDigitalTwinsManager.
*/
public static void getADigitalTwinsInstanceResource(
com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) {
manager
.digitalTwins()
.getByResourceGroupWithResponse("resRg", "myDigitalTwinsService", com.azure.core.util.Context.NONE);
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-digitaltwins_1.2.0/sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,15 @@
/** Samples for DigitalTwins ListByResourceGroup. */
public final class Main {
/*
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsListByResourceGroup_example.json
*/
/**
* Sample code: Get DigitalTwinsInstance resources by resource group.
*
* @param manager Entry point to AzureDigitalTwinsManager.
*/
public static void getDigitalTwinsInstanceResourcesByResourceGroup(
com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) {
manager.digitalTwins().listByResourceGroup("resRg", com.azure.core.util.Context.NONE);
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-digitaltwins_1.2.0/sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,15 @@
/** Samples for DigitalTwins List. */
public final class Main {
/*
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsList_example.json
*/
/**
* Sample code: Get DigitalTwinsInstance resources by subscription.
*
* @param manager Entry point to AzureDigitalTwinsManager.
*/
public static void getDigitalTwinsInstanceResourcesBySubscription(
com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) {
manager.digitalTwins().list(com.azure.core.util.Context.NONE);
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-digitaltwins_1.2.0/sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,14 @@
/** Samples for Operations List. */
public final class Main {
/*
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsOperationsList_example.json
*/
/**
* Sample code: Get available operations.
*
* @param manager Entry point to AzureDigitalTwinsManager.
*/
public static void getAvailableOperations(com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) {
manager.operations().list(com.azure.core.util.Context.NONE);
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-digitaltwins_1.2.0/sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,37 @@
import com.azure.resourcemanager.digitaltwins.models.DigitalTwinsDescription;
import com.azure.resourcemanager.digitaltwins.models.DigitalTwinsIdentity;
import com.azure.resourcemanager.digitaltwins.models.DigitalTwinsIdentityType;
import java.util.HashMap;
import java.util.Map;
/** Samples for DigitalTwins Update. */
public final class Main {
/*
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsPatch_WithIdentity_example.json
*/
/**
* Sample code: Patch a DigitalTwinsInstance resource with identity.
*
* @param manager Entry point to AzureDigitalTwinsManager.
*/
public static void patchADigitalTwinsInstanceResourceWithIdentity(
com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) {
DigitalTwinsDescription resource =
manager
.digitalTwins()
.getByResourceGroupWithResponse("resRg", "myDigitalTwinsService", com.azure.core.util.Context.NONE)
.getValue();
resource.update().withIdentity(new DigitalTwinsIdentity().withType(DigitalTwinsIdentityType.NONE)).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;
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-digitaltwins_1.2.0/sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,40 @@
import com.azure.resourcemanager.digitaltwins.models.DigitalTwinsDescription;
import com.azure.resourcemanager.digitaltwins.models.DigitalTwinsPatchProperties;
import com.azure.resourcemanager.digitaltwins.models.PublicNetworkAccess;
import java.util.HashMap;
import java.util.Map;
/** Samples for DigitalTwins Update. */
public final class Main {
/*
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsPatch_WithPublicNetworkAccess.json
*/
/**
* Sample code: Patch a DigitalTwinsInstance resource with publicNetworkAccess property.
*
* @param manager Entry point to AzureDigitalTwinsManager.
*/
public static void patchADigitalTwinsInstanceResourceWithPublicNetworkAccessProperty(
com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) {
DigitalTwinsDescription resource =
manager
.digitalTwins()
.getByResourceGroupWithResponse("resRg", "myDigitalTwinsService", com.azure.core.util.Context.NONE)
.getValue();
resource
.update()
.withProperties(new DigitalTwinsPatchProperties().withPublicNetworkAccess(PublicNetworkAccess.DISABLED))
.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;
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-digitaltwins_1.2.0/sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,35 @@
import com.azure.resourcemanager.digitaltwins.models.DigitalTwinsDescription;
import java.util.HashMap;
import java.util.Map;
/** Samples for DigitalTwins Update. */
public final class Main {
/*
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsPatch_example.json
*/
/**
* Sample code: Patch a DigitalTwinsInstance resource.
*
* @param manager Entry point to AzureDigitalTwinsManager.
*/
public static void patchADigitalTwinsInstanceResource(
com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) {
DigitalTwinsDescription resource =
manager
.digitalTwins()
.getByResourceGroupWithResponse("resRg", "myDigitalTwinsService", com.azure.core.util.Context.NONE)
.getValue();
resource.update().withTags(mapOf("purpose", "dev")).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;
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-digitaltwins_1.2.0/sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,44 @@
import com.azure.resourcemanager.digitaltwins.models.DigitalTwinsIdentity;
import com.azure.resourcemanager.digitaltwins.models.DigitalTwinsIdentityType;
import com.azure.resourcemanager.digitaltwins.models.UserAssignedIdentity;
import java.util.HashMap;
import java.util.Map;
/** Samples for DigitalTwins CreateOrUpdate. */
public final class Main {
/*
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsPut_WithIdentity_example.json
*/
/**
* Sample code: Put a DigitalTwinsInstance resource with identity.
*
* @param manager Entry point to AzureDigitalTwinsManager.
*/
public static void putADigitalTwinsInstanceResourceWithIdentity(
com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) {
manager
.digitalTwins()
.define("myDigitalTwinsService")
.withRegion("WestUS2")
.withExistingResourceGroup("resRg")
.withIdentity(
new DigitalTwinsIdentity()
.withType(DigitalTwinsIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED)
.withUserAssignedIdentities(
mapOf(
"/subscriptions/50016170-c839-41ba-a724-51e9df440b9e/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity",
new UserAssignedIdentity())))
.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;
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-digitaltwins_1.2.0/sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,36 @@
import com.azure.resourcemanager.digitaltwins.models.PublicNetworkAccess;
import java.util.HashMap;
import java.util.Map;
/** Samples for DigitalTwins CreateOrUpdate. */
public final class Main {
/*
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsPut_WithPublicNetworkAccess.json
*/
/**
* Sample code: Put a DigitalTwinsInstance resource with publicNetworkAccess property.
*
* @param manager Entry point to AzureDigitalTwinsManager.
*/
public static void putADigitalTwinsInstanceResourceWithPublicNetworkAccessProperty(
com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) {
manager
.digitalTwins()
.define("myDigitalTwinsService")
.withRegion("WestUS2")
.withExistingResourceGroup("resRg")
.withPublicNetworkAccess(PublicNetworkAccess.ENABLED)
.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;
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-digitaltwins_1.2.0/sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
import java.util.HashMap;
import java.util.Map;
/** Samples for DigitalTwins CreateOrUpdate. */
public final class Main {
/*
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsPut_example.json
*/
/**
* Sample code: Put a DigitalTwinsInstance resource.
*
* @param manager Entry point to AzureDigitalTwinsManager.
*/
public static void putADigitalTwinsInstanceResource(
com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) {
manager
.digitalTwins()
.define("myDigitalTwinsService")
.withRegion("WestUS2")
.withExistingResourceGroup("resRg")
.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;
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-digitaltwins_1.2.0/sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,17 @@
/** Samples for PrivateEndpointConnections Get. */
public final class Main {
/*
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/PrivateEndpointConnectionByConnectionName_example.json
*/
/**
* Sample code: Get private endpoint connection properties for the given private endpoint.
*
* @param manager Entry point to AzureDigitalTwinsManager.
*/
public static void getPrivateEndpointConnectionPropertiesForTheGivenPrivateEndpoint(
com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) {
manager
.privateEndpointConnections()
.getWithResponse("resRg", "myDigitalTwinsService", "myPrivateConnection", com.azure.core.util.Context.NONE);
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-digitaltwins_1.2.0/sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,17 @@
/** Samples for PrivateEndpointConnections Delete. */
public final class Main {
/*
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/PrivateEndpointConnectionDelete_example.json
*/
/**
* Sample code: Delete private endpoint connection with the specified name.
*
* @param manager Entry point to AzureDigitalTwinsManager.
*/
public static void deletePrivateEndpointConnectionWithTheSpecifiedName(
com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) {
manager
.privateEndpointConnections()
.delete("resRg", "myDigitalTwinsService", "myPrivateConnection", com.azure.core.util.Context.NONE);
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-digitaltwins_1.2.0/sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
import com.azure.resourcemanager.digitaltwins.models.ConnectionProperties;
import com.azure.resourcemanager.digitaltwins.models.ConnectionPropertiesPrivateLinkServiceConnectionState;
import com.azure.resourcemanager.digitaltwins.models.PrivateEndpointConnection;
import com.azure.resourcemanager.digitaltwins.models.PrivateLinkServiceConnectionStatus;
/** Samples for PrivateEndpointConnections CreateOrUpdate. */
public final class Main {
/*
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/PrivateEndpointConnectionPut_example.json
*/
/**
* Sample code: Update the status of a private endpoint connection with the given name.
*
* @param manager Entry point to AzureDigitalTwinsManager.
*/
public static void updateTheStatusOfAPrivateEndpointConnectionWithTheGivenName(
com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) {
PrivateEndpointConnection resource =
manager
.privateEndpointConnections()
.getWithResponse(
"resRg", "myDigitalTwinsService", "myPrivateConnection", com.azure.core.util.Context.NONE)
.getValue();
resource
.update()
.withProperties(
new ConnectionProperties()
.withPrivateLinkServiceConnectionState(
new ConnectionPropertiesPrivateLinkServiceConnectionState()
.withStatus(PrivateLinkServiceConnectionStatus.APPROVED)
.withDescription("Approved by johndoe@company.com.")))
.apply();
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-digitaltwins_1.2.0/sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,17 @@
/** Samples for PrivateEndpointConnections List. */
public final class Main {
/*
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/PrivateEndpointConnectionsList_example.json
*/
/**
* Sample code: List private endpoint connection properties.
*
* @param manager Entry point to AzureDigitalTwinsManager.
*/
public static void listPrivateEndpointConnectionProperties(
com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) {
manager
.privateEndpointConnections()
.listWithResponse("resRg", "myDigitalTwinsService", com.azure.core.util.Context.NONE);
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-digitaltwins_1.2.0/sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,17 @@
/** Samples for PrivateLinkResources Get. */
public final class Main {
/*
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/PrivateLinkResourcesByGroupId_example.json
*/
/**
* Sample code: Get the specified private link resource for the given Digital Twin.
*
* @param manager Entry point to AzureDigitalTwinsManager.
*/
public static void getTheSpecifiedPrivateLinkResourceForTheGivenDigitalTwin(
com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) {
manager
.privateLinkResources()
.getWithResponse("resRg", "myDigitalTwinsService", "subResource", com.azure.core.util.Context.NONE);
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-digitaltwins_1.2.0/sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,17 @@
/** Samples for PrivateLinkResources List. */
public final class Main {
/*
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/PrivateLinkResourcesList_example.json
*/
/**
* Sample code: List private link resources for given Digital Twin.
*
* @param manager Entry point to AzureDigitalTwinsManager.
*/
public static void listPrivateLinkResourcesForGivenDigitalTwin(
com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) {
manager
.privateLinkResources()
.listWithResponse("resRg", "myDigitalTwinsService", com.azure.core.util.Context.NONE);
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-digitaltwins_1.2.0/sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,17 @@
/** Samples for TimeSeriesDatabaseConnections Delete. */
public final class Main {
/*
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/TimeSeriesDatabaseConnectionsDelete_example.json
*/
/**
* Sample code: Delete a time series database connection for a DigitalTwins instance.
*
* @param manager Entry point to AzureDigitalTwinsManager.
*/
public static void deleteATimeSeriesDatabaseConnectionForADigitalTwinsInstance(
com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) {
manager
.timeSeriesDatabaseConnections()
.delete("resRg", "myDigitalTwinsService", "myConnection", null, com.azure.core.util.Context.NONE);
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-digitaltwins_1.2.0/sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,17 @@
/** Samples for TimeSeriesDatabaseConnections Get. */
public final class Main {
/*
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/TimeSeriesDatabaseConnectionsGet_example.json
*/
/**
* Sample code: Get time series database connection for a DigitalTwins instance.
*
* @param manager Entry point to AzureDigitalTwinsManager.
*/
public static void getTimeSeriesDatabaseConnectionForADigitalTwinsInstance(
com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) {
manager
.timeSeriesDatabaseConnections()
.getWithResponse("resRg", "myDigitalTwinsService", "myConnection", com.azure.core.util.Context.NONE);
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-digitaltwins_1.2.0/sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,17 @@
/** Samples for TimeSeriesDatabaseConnections List. */
public final class Main {
/*
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/TimeSeriesDatabaseConnectionsList_example.json
*/
/**
* Sample code: List time series database connections for a DigitalTwins instance.
*
* @param manager Entry point to AzureDigitalTwinsManager.
*/
public static void listTimeSeriesDatabaseConnectionsForADigitalTwinsInstance(
com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) {
manager
.timeSeriesDatabaseConnections()
.list("resRg", "myDigitalTwinsService", com.azure.core.util.Context.NONE);
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-digitaltwins_1.2.0/sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,40 @@
import com.azure.resourcemanager.digitaltwins.models.AzureDataExplorerConnectionProperties;
import com.azure.resourcemanager.digitaltwins.models.IdentityType;
import com.azure.resourcemanager.digitaltwins.models.ManagedIdentityReference;
/** Samples for TimeSeriesDatabaseConnections CreateOrUpdate. */
public final class Main {
/*
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/TimeSeriesDatabaseConnectionsPut_WithUserIdentity_example.json
*/
/**
* Sample code: Create or replace a time series database connection for a DigitalTwins instance with user assigned
* identity.
*
* @param manager Entry point to AzureDigitalTwinsManager.
*/
public static void createOrReplaceATimeSeriesDatabaseConnectionForADigitalTwinsInstanceWithUserAssignedIdentity(
com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) {
manager
.timeSeriesDatabaseConnections()
.define("myConnection")
.withExistingDigitalTwinsInstance("resRg", "myDigitalTwinsService")
.withProperties(
new AzureDataExplorerConnectionProperties()
.withIdentity(
new ManagedIdentityReference()
.withType(IdentityType.USER_ASSIGNED)
.withUserAssignedIdentity(
"/subscriptions/50016170-c839-41ba-a724-51e9df440b9e/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity"))
.withAdxResourceId(
"/subscriptions/c493073e-2460-45ba-a403-f3e0df1e9feg/resourceGroups/testrg/providers/Microsoft.Kusto/clusters/mycluster")
.withAdxEndpointUri("https://mycluster.kusto.windows.net")
.withAdxDatabaseName("myDatabase")
.withAdxTableName("myTable")
.withEventHubEndpointUri("sb://myeh.servicebus.windows.net/")
.withEventHubEntityPath("myeh")
.withEventHubNamespaceResourceId(
"/subscriptions/c493073e-2460-45ba-a403-f3e0df1e9feg/resourceGroups/testrg/providers/Microsoft.EventHub/namespaces/myeh"))
.create();
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-digitaltwins_1.2.0/sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,36 @@
import com.azure.resourcemanager.digitaltwins.models.AzureDataExplorerConnectionProperties;
import com.azure.resourcemanager.digitaltwins.models.RecordPropertyAndItemRemovals;
/** Samples for TimeSeriesDatabaseConnections CreateOrUpdate. */
public final class Main {
/*
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/TimeSeriesDatabaseConnectionsPut_example.json
*/
/**
* Sample code: Create or replace a time series database connection for a DigitalTwins instance.
*
* @param manager Entry point to AzureDigitalTwinsManager.
*/
public static void createOrReplaceATimeSeriesDatabaseConnectionForADigitalTwinsInstance(
com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) {
manager
.timeSeriesDatabaseConnections()
.define("myConnection")
.withExistingDigitalTwinsInstance("resRg", "myDigitalTwinsService")
.withProperties(
new AzureDataExplorerConnectionProperties()
.withAdxResourceId(
"/subscriptions/c493073e-2460-45ba-a403-f3e0df1e9feg/resourceGroups/testrg/providers/Microsoft.Kusto/clusters/mycluster")
.withAdxEndpointUri("https://mycluster.kusto.windows.net")
.withAdxDatabaseName("myDatabase")
.withAdxTableName("myPropertyUpdatesTable")
.withAdxTwinLifecycleEventsTableName("myTwinLifecycleEventsTable")
.withAdxRelationshipLifecycleEventsTableName("myRelationshipLifecycleEventsTable")
.withEventHubEndpointUri("sb://myeh.servicebus.windows.net/")
.withEventHubEntityPath("myeh")
.withEventHubNamespaceResourceId(
"/subscriptions/c493073e-2460-45ba-a403-f3e0df1e9feg/resourceGroups/testrg/providers/Microsoft.EventHub/namespaces/myeh")
.withRecordPropertyAndItemRemovals(RecordPropertyAndItemRemovals.TRUE))
.create();
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-digitaltwins_1.2.0/sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md"}