-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
333ff05
commit 083f7ca
Showing
12 changed files
with
416 additions
and
0 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
...resourcemanager/deviceregistry/generated/AssetEndpointProfilesCreateOrReplaceSamples.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
// Code generated by Microsoft (R) TypeSpec Code Generator. | ||
|
||
package com.azure.resourcemanager.deviceregistry.generated; | ||
|
||
import com.azure.resourcemanager.deviceregistry.models.AssetEndpointProfileProperties; | ||
import com.azure.resourcemanager.deviceregistry.models.ExtendedLocation; | ||
import com.azure.resourcemanager.deviceregistry.models.UserAuthentication; | ||
import com.azure.resourcemanager.deviceregistry.models.UserAuthenticationMode; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
/** | ||
* Samples for AssetEndpointProfiles CreateOrReplace. | ||
*/ | ||
public final class AssetEndpointProfilesCreateOrReplaceSamples { | ||
/** | ||
* Sample code: Create_AssetEndpointProfile. | ||
* | ||
* @param manager Entry point to DeviceRegistryManager. | ||
*/ | ||
public static void | ||
createAssetEndpointProfile(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { | ||
manager.assetEndpointProfiles() | ||
.define("my-assetendpointprofile") | ||
.withRegion("West Europe") | ||
.withExistingResourceGroup("myResourceGroup") | ||
.withExtendedLocation(new ExtendedLocation().withType("CustomLocation") | ||
.withName( | ||
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1")) | ||
.withTags(mapOf("site", "building-1")) | ||
.withProperties( | ||
new AssetEndpointProfileProperties().withTargetAddress("https://www.example.com/myTargetAddress") | ||
.withUserAuthentication(new UserAuthentication().withMode(UserAuthenticationMode.ANONYMOUS))) | ||
.create(); | ||
} | ||
|
||
// Use "Map.of" if available | ||
@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; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...om/azure/resourcemanager/deviceregistry/generated/AssetEndpointProfilesDeleteSamples.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
// Code generated by Microsoft (R) TypeSpec Code Generator. | ||
|
||
package com.azure.resourcemanager.deviceregistry.generated; | ||
|
||
/** | ||
* Samples for AssetEndpointProfiles Delete. | ||
*/ | ||
public final class AssetEndpointProfilesDeleteSamples { | ||
/** | ||
* Sample code: Delete_AssetEndpointProfile. | ||
* | ||
* @param manager Entry point to DeviceRegistryManager. | ||
*/ | ||
public static void | ||
deleteAssetEndpointProfile(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { | ||
manager.assetEndpointProfiles() | ||
.delete("myResourceGroup", "my-assetendpointprofile", com.azure.core.util.Context.NONE); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...ourcemanager/deviceregistry/generated/AssetEndpointProfilesGetByResourceGroupSamples.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
// Code generated by Microsoft (R) TypeSpec Code Generator. | ||
|
||
package com.azure.resourcemanager.deviceregistry.generated; | ||
|
||
/** | ||
* Samples for AssetEndpointProfiles GetByResourceGroup. | ||
*/ | ||
public final class AssetEndpointProfilesGetByResourceGroupSamples { | ||
/** | ||
* Sample code: Get_AssetEndpointProfile. | ||
* | ||
* @param manager Entry point to DeviceRegistryManager. | ||
*/ | ||
public static void getAssetEndpointProfile(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { | ||
manager.assetEndpointProfiles() | ||
.getByResourceGroupWithResponse("myResourceGroup", "my-assetendpointprofile", | ||
com.azure.core.util.Context.NONE); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
...om/azure/resourcemanager/deviceregistry/generated/AssetEndpointProfilesUpdateSamples.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
// Code generated by Microsoft (R) TypeSpec Code Generator. | ||
|
||
package com.azure.resourcemanager.deviceregistry.generated; | ||
|
||
import com.azure.resourcemanager.deviceregistry.models.AssetEndpointProfile; | ||
import com.azure.resourcemanager.deviceregistry.models.AssetEndpointProfileUpdateProperties; | ||
|
||
/** | ||
* Samples for AssetEndpointProfiles Update. | ||
*/ | ||
public final class AssetEndpointProfilesUpdateSamples { | ||
/** | ||
* Sample code: Update_AssetEndpointProfile. | ||
* | ||
* @param manager Entry point to DeviceRegistryManager. | ||
*/ | ||
public static void | ||
updateAssetEndpointProfile(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { | ||
AssetEndpointProfile resource = manager.assetEndpointProfiles() | ||
.getByResourceGroupWithResponse("myResourceGroup", "my-assetendpointprofile", | ||
com.azure.core.util.Context.NONE) | ||
.getValue(); | ||
resource.update() | ||
.withProperties( | ||
new AssetEndpointProfileUpdateProperties().withTargetAddress("https://www.example.com/myTargetAddress")) | ||
.apply(); | ||
} | ||
} |
86 changes: 86 additions & 0 deletions
86
...java/com/azure/resourcemanager/deviceregistry/generated/AssetsCreateOrReplaceSamples.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
// Code generated by Microsoft (R) TypeSpec Code Generator. | ||
|
||
package com.azure.resourcemanager.deviceregistry.generated; | ||
|
||
import com.azure.resourcemanager.deviceregistry.models.AssetProperties; | ||
import com.azure.resourcemanager.deviceregistry.models.DataPoint; | ||
import com.azure.resourcemanager.deviceregistry.models.DataPointsObservabilityMode; | ||
import com.azure.resourcemanager.deviceregistry.models.Event; | ||
import com.azure.resourcemanager.deviceregistry.models.EventsObservabilityMode; | ||
import com.azure.resourcemanager.deviceregistry.models.ExtendedLocation; | ||
import java.util.Arrays; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
/** | ||
* Samples for Assets CreateOrReplace. | ||
*/ | ||
public final class AssetsCreateOrReplaceSamples { | ||
/** | ||
* Sample code: Create_Asset_Without_DisplayName. | ||
* | ||
* @param manager Entry point to DeviceRegistryManager. | ||
*/ | ||
public static void | ||
createAssetWithoutDisplayName(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { | ||
manager.assets() | ||
.define("my-asset") | ||
.withRegion("West Europe") | ||
.withExistingResourceGroup("myResourceGroup") | ||
.withExtendedLocation(new ExtendedLocation().withType("CustomLocation") | ||
.withName( | ||
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1")) | ||
.withTags(mapOf("site", "building-1")) | ||
.withProperties(new AssetProperties().withAssetType("MyAssetType") | ||
.withEnabled(true) | ||
.withExternalAssetId("8ZBA6LRHU0A458969") | ||
.withDescription("This is a sample Asset") | ||
.withAssetEndpointProfileUri("https://www.example.com/myAssetEndpointProfile") | ||
.withManufacturer("Contoso") | ||
.withManufacturerUri("https://www.contoso.com/manufacturerUri") | ||
.withModel("ContosoModel") | ||
.withProductCode("fakeTokenPlaceholder") | ||
.withHardwareRevision("1.0") | ||
.withSoftwareRevision("2.0") | ||
.withDocumentationUri("https://www.example.com/manual") | ||
.withSerialNumber("64-103816-519918-8") | ||
.withDefaultDataPointsConfiguration( | ||
"{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}") | ||
.withDefaultEventsConfiguration("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}") | ||
.withDataPoints(Arrays.asList( | ||
new DataPoint().withDataSource("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1") | ||
.withCapabilityId("dtmi:com:example:Thermostat:__temperature;1") | ||
.withObservabilityMode(DataPointsObservabilityMode.COUNTER) | ||
.withDataPointConfiguration( | ||
"{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}"), | ||
new DataPoint().withDataSource("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2") | ||
.withCapabilityId("dtmi:com:example:Thermostat:__pressure;1") | ||
.withObservabilityMode(DataPointsObservabilityMode.NONE) | ||
.withDataPointConfiguration( | ||
"{\"publishingInterval\":4,\"samplingInterval\":4,\"queueSize\":7}"))) | ||
.withEvents(Arrays.asList( | ||
new Event().withEventNotifier("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3") | ||
.withCapabilityId("dtmi:com:example:Thermostat:__temperature;1") | ||
.withObservabilityMode(EventsObservabilityMode.NONE) | ||
.withEventConfiguration("{\"publishingInterval\":7,\"samplingInterval\":1,\"queueSize\":8}"), | ||
new Event().withEventNotifier("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4") | ||
.withCapabilityId("dtmi:com:example:Thermostat:__pressure;1") | ||
.withObservabilityMode(EventsObservabilityMode.LOG) | ||
.withEventConfiguration("{\"publishingInterval\":7,\"samplingInterval\":8,\"queueSize\":4}")))) | ||
.create(); | ||
} | ||
|
||
// Use "Map.of" if available | ||
@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; | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
.../samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetsDeleteSamples.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
// Code generated by Microsoft (R) TypeSpec Code Generator. | ||
|
||
package com.azure.resourcemanager.deviceregistry.generated; | ||
|
||
/** | ||
* Samples for Assets Delete. | ||
*/ | ||
public final class AssetsDeleteSamples { | ||
/** | ||
* Sample code: Delete_Asset. | ||
* | ||
* @param manager Entry point to DeviceRegistryManager. | ||
*/ | ||
public static void deleteAsset(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { | ||
manager.assets().delete("myResourceGroup", "my-asset", com.azure.core.util.Context.NONE); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...a/com/azure/resourcemanager/deviceregistry/generated/AssetsGetByResourceGroupSamples.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
// Code generated by Microsoft (R) TypeSpec Code Generator. | ||
|
||
package com.azure.resourcemanager.deviceregistry.generated; | ||
|
||
/** | ||
* Samples for Assets GetByResourceGroup. | ||
*/ | ||
public final class AssetsGetByResourceGroupSamples { | ||
/** | ||
* Sample code: Get_Asset. | ||
* | ||
* @param manager Entry point to DeviceRegistryManager. | ||
*/ | ||
public static void getAsset(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { | ||
manager.assets() | ||
.getByResourceGroupWithResponse("myResourceGroup", "my-asset", com.azure.core.util.Context.NONE); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
.../samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetsUpdateSamples.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
// Code generated by Microsoft (R) TypeSpec Code Generator. | ||
|
||
package com.azure.resourcemanager.deviceregistry.generated; | ||
|
||
import com.azure.resourcemanager.deviceregistry.models.Asset; | ||
import com.azure.resourcemanager.deviceregistry.models.AssetUpdateProperties; | ||
|
||
/** | ||
* Samples for Assets Update. | ||
*/ | ||
public final class AssetsUpdateSamples { | ||
/** | ||
* Sample code: Update_Asset. | ||
* | ||
* @param manager Entry point to DeviceRegistryManager. | ||
*/ | ||
public static void updateAsset(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { | ||
Asset resource = manager.assets() | ||
.getByResourceGroupWithResponse("myResourceGroup", "my-asset", com.azure.core.util.Context.NONE) | ||
.getValue(); | ||
resource.update() | ||
.withProperties(new AssetUpdateProperties().withEnabled(false).withDisplayName("NewAssetDisplayName")) | ||
.apply(); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...es/java/com/azure/resourcemanager/deviceregistry/generated/OperationStatusGetSamples.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
// Code generated by Microsoft (R) TypeSpec Code Generator. | ||
|
||
package com.azure.resourcemanager.deviceregistry.generated; | ||
|
||
/** | ||
* Samples for OperationStatus Get. | ||
*/ | ||
public final class OperationStatusGetSamples { | ||
/** | ||
* Sample code: Get_OperationStatus. | ||
* | ||
* @param manager Entry point to DeviceRegistryManager. | ||
*/ | ||
public static void getOperationStatus(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { | ||
manager.operationStatus() | ||
.getWithResponse("testLocation", "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", com.azure.core.util.Context.NONE); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...amples/java/com/azure/resourcemanager/deviceregistry/generated/OperationsListSamples.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
// Code generated by Microsoft (R) TypeSpec Code Generator. | ||
|
||
package com.azure.resourcemanager.deviceregistry.generated; | ||
|
||
/** | ||
* Samples for Operations List. | ||
*/ | ||
public final class OperationsListSamples { | ||
/** | ||
* Sample code: List_Operations. | ||
* | ||
* @param manager Entry point to DeviceRegistryManager. | ||
*/ | ||
public static void listOperations(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { | ||
manager.operations().list(com.azure.core.util.Context.NONE); | ||
} | ||
} |
Oops, something went wrong.