|
| 1 | +# Code snippets and samples |
| 2 | + |
| 3 | + |
| 4 | +## EnergyServices |
| 5 | + |
| 6 | +- [Create](#energyservices_create) |
| 7 | +- [Delete](#energyservices_delete) |
| 8 | +- [GetByResourceGroup](#energyservices_getbyresourcegroup) |
| 9 | +- [List](#energyservices_list) |
| 10 | +- [ListByResourceGroup](#energyservices_listbyresourcegroup) |
| 11 | +- [Update](#energyservices_update) |
| 12 | + |
| 13 | +## Locations |
| 14 | + |
| 15 | +- [CheckNameAvailability](#locations_checknameavailability) |
| 16 | + |
| 17 | +## Operations |
| 18 | + |
| 19 | +- [List](#operations_list) |
| 20 | +### EnergyServices_Create |
| 21 | + |
| 22 | +```java |
| 23 | +/** Samples for EnergyServices Create. */ |
| 24 | +public final class EnergyServicesCreateSamples { |
| 25 | + /* |
| 26 | + * x-ms-original-file: specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/OepResource_Create.json |
| 27 | + */ |
| 28 | + /** |
| 29 | + * Sample code: OepResource_Create. |
| 30 | + * |
| 31 | + * @param manager Entry point to OepManager. |
| 32 | + */ |
| 33 | + public static void oepResourceCreate(com.azure.resourcemanager.oep.OepManager manager) { |
| 34 | + manager |
| 35 | + .energyServices() |
| 36 | + .define("DummyResourceName") |
| 37 | + .withRegion((String) null) |
| 38 | + .withExistingResourceGroup("DummyResourceGroupName") |
| 39 | + .create(); |
| 40 | + } |
| 41 | +} |
| 42 | +``` |
| 43 | + |
| 44 | +### EnergyServices_Delete |
| 45 | + |
| 46 | +```java |
| 47 | +import com.azure.core.util.Context; |
| 48 | + |
| 49 | +/** Samples for EnergyServices Delete. */ |
| 50 | +public final class EnergyServicesDeleteSamples { |
| 51 | + /* |
| 52 | + * x-ms-original-file: specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/OepResource_Delete.json |
| 53 | + */ |
| 54 | + /** |
| 55 | + * Sample code: OepResource_Delete. |
| 56 | + * |
| 57 | + * @param manager Entry point to OepManager. |
| 58 | + */ |
| 59 | + public static void oepResourceDelete(com.azure.resourcemanager.oep.OepManager manager) { |
| 60 | + manager.energyServices().delete("DummyResourceGroupName", "DummyResourceName", Context.NONE); |
| 61 | + } |
| 62 | +} |
| 63 | +``` |
| 64 | + |
| 65 | +### EnergyServices_GetByResourceGroup |
| 66 | + |
| 67 | +```java |
| 68 | +import com.azure.core.util.Context; |
| 69 | + |
| 70 | +/** Samples for EnergyServices GetByResourceGroup. */ |
| 71 | +public final class EnergyServicesGetByResourceGroupSamples { |
| 72 | + /* |
| 73 | + * x-ms-original-file: specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/OepResource_Get.json |
| 74 | + */ |
| 75 | + /** |
| 76 | + * Sample code: OepResource_Get. |
| 77 | + * |
| 78 | + * @param manager Entry point to OepManager. |
| 79 | + */ |
| 80 | + public static void oepResourceGet(com.azure.resourcemanager.oep.OepManager manager) { |
| 81 | + manager |
| 82 | + .energyServices() |
| 83 | + .getByResourceGroupWithResponse("DummyResourceGroupName", "DummyResourceName", Context.NONE); |
| 84 | + } |
| 85 | +} |
| 86 | +``` |
| 87 | + |
| 88 | +### EnergyServices_List |
| 89 | + |
| 90 | +```java |
| 91 | +import com.azure.core.util.Context; |
| 92 | + |
| 93 | +/** Samples for EnergyServices List. */ |
| 94 | +public final class EnergyServicesListSamples { |
| 95 | + /* |
| 96 | + * x-ms-original-file: specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/OepResource_ListBySubscriptionId.json |
| 97 | + */ |
| 98 | + /** |
| 99 | + * Sample code: OepResource_ListBySubscriptionId. |
| 100 | + * |
| 101 | + * @param manager Entry point to OepManager. |
| 102 | + */ |
| 103 | + public static void oepResourceListBySubscriptionId(com.azure.resourcemanager.oep.OepManager manager) { |
| 104 | + manager.energyServices().list(Context.NONE); |
| 105 | + } |
| 106 | +} |
| 107 | +``` |
| 108 | + |
| 109 | +### EnergyServices_ListByResourceGroup |
| 110 | + |
| 111 | +```java |
| 112 | +import com.azure.core.util.Context; |
| 113 | + |
| 114 | +/** Samples for EnergyServices ListByResourceGroup. */ |
| 115 | +public final class EnergyServicesListByResourceGroupSamples { |
| 116 | + /* |
| 117 | + * x-ms-original-file: specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/OepResource_ListByResourceGroup.json |
| 118 | + */ |
| 119 | + /** |
| 120 | + * Sample code: OepResource_ListByResourceGroup. |
| 121 | + * |
| 122 | + * @param manager Entry point to OepManager. |
| 123 | + */ |
| 124 | + public static void oepResourceListByResourceGroup(com.azure.resourcemanager.oep.OepManager manager) { |
| 125 | + manager.energyServices().listByResourceGroup("DummyResourceGroupName", Context.NONE); |
| 126 | + } |
| 127 | +} |
| 128 | +``` |
| 129 | + |
| 130 | +### EnergyServices_Update |
| 131 | + |
| 132 | +```java |
| 133 | +import com.azure.core.util.Context; |
| 134 | +import com.azure.resourcemanager.oep.models.EnergyService; |
| 135 | + |
| 136 | +/** Samples for EnergyServices Update. */ |
| 137 | +public final class EnergyServicesUpdateSamples { |
| 138 | + /* |
| 139 | + * x-ms-original-file: specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/OepResource_Update.json |
| 140 | + */ |
| 141 | + /** |
| 142 | + * Sample code: OepResource_Update. |
| 143 | + * |
| 144 | + * @param manager Entry point to OepManager. |
| 145 | + */ |
| 146 | + public static void oepResourceUpdate(com.azure.resourcemanager.oep.OepManager manager) { |
| 147 | + EnergyService resource = |
| 148 | + manager |
| 149 | + .energyServices() |
| 150 | + .getByResourceGroupWithResponse("DummyResourceGroupName", "DummyResourceName", Context.NONE) |
| 151 | + .getValue(); |
| 152 | + resource.update().apply(); |
| 153 | + } |
| 154 | +} |
| 155 | +``` |
| 156 | + |
| 157 | +### Locations_CheckNameAvailability |
| 158 | + |
| 159 | +```java |
| 160 | +import com.azure.core.util.Context; |
| 161 | +import com.azure.resourcemanager.oep.models.CheckNameAvailabilityRequest; |
| 162 | + |
| 163 | +/** Samples for Locations CheckNameAvailability. */ |
| 164 | +public final class LocationsCheckNameAvailabilitySamples { |
| 165 | + /* |
| 166 | + * x-ms-original-file: specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/Locations_CheckNameAvailability.json |
| 167 | + */ |
| 168 | + /** |
| 169 | + * Sample code: Locations_CheckNameAvailability. |
| 170 | + * |
| 171 | + * @param manager Entry point to OepManager. |
| 172 | + */ |
| 173 | + public static void locationsCheckNameAvailability(com.azure.resourcemanager.oep.OepManager manager) { |
| 174 | + manager |
| 175 | + .locations() |
| 176 | + .checkNameAvailabilityWithResponse( |
| 177 | + new CheckNameAvailabilityRequest().withName("sample-name").withType("Microsoft.OEP/oepResource"), |
| 178 | + Context.NONE); |
| 179 | + } |
| 180 | +} |
| 181 | +``` |
| 182 | + |
| 183 | +### Operations_List |
| 184 | + |
| 185 | +```java |
| 186 | +import com.azure.core.util.Context; |
| 187 | + |
| 188 | +/** Samples for Operations List. */ |
| 189 | +public final class OperationsListSamples { |
| 190 | + /* |
| 191 | + * x-ms-original-file: specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/Operations_List.json |
| 192 | + */ |
| 193 | + /** |
| 194 | + * Sample code: Operations_List. |
| 195 | + * |
| 196 | + * @param manager Entry point to OepManager. |
| 197 | + */ |
| 198 | + public static void operationsList(com.azure.resourcemanager.oep.OepManager manager) { |
| 199 | + manager.operations().listWithResponse(Context.NONE); |
| 200 | + } |
| 201 | +} |
| 202 | +``` |
| 203 | + |
0 commit comments