Skip to content

Commit 23497cc

Browse files
author
David R. Williamson
authored
adt(doc): specify code snippet language (Azure#20395)
1 parent c1c8140 commit 23497cc

File tree

5 files changed

+31
-27
lines changed

5 files changed

+31
-27
lines changed

sdk/digitaltwins/Azure.DigitalTwins.Core/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Release History
22

3+
## 1.3.0-beta.1 (Unreleased)
4+
5+
36
## 1.2.2 (2021-04-12)
47

58
### Fixes and improvements

sdk/digitaltwins/Azure.DigitalTwins.Core/src/DigitalTwinsClient.cs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public class DigitalTwinsClient
5353
/// For more samples, see <see href="https://github.com/Azure/azure-sdk-for-net/tree/master/sdk/digitaltwins/Azure.DigitalTwins.Core/samples">our repo samples</see>.
5454
/// </remarks>
5555
/// <example>
56-
/// <code snippet="Snippet:DigitalTwinsSampleCreateServiceClientWithClientSecret">
56+
/// <code snippet="Snippet:DigitalTwinsSampleCreateServiceClientWithClientSecret" language="csharp">
5757
/// // DefaultAzureCredential supports different authentication mechanisms and determines the appropriate credential type based of the environment it is executing in.
5858
/// // It attempts to use multiple credential types in an order until it finds a working credential.
5959
/// TokenCredential tokenCredential = new DefaultAzureCredential();
@@ -138,7 +138,7 @@ protected DigitalTwinsClient()
138138
/// <example>
139139
/// This sample demonstrates getting and deserializing a digital twin into a custom data type.
140140
///
141-
/// <code snippet="Snippet:DigitalTwinsSampleGetCustomDigitalTwin">
141+
/// <code snippet="Snippet:DigitalTwinsSampleGetCustomDigitalTwin" language="csharp">
142142
/// Response&lt;CustomDigitalTwin&gt; getCustomDtResponse = await client.GetDigitalTwinAsync&lt;CustomDigitalTwin&gt;(customDtId);
143143
/// CustomDigitalTwin customDt = getCustomDtResponse.Value;
144144
/// Console.WriteLine($&quot;Retrieved and deserialized digital twin {customDt.Id}:\n\t&quot; +
@@ -255,7 +255,7 @@ public virtual Response<T> GetDigitalTwin<T>(string digitalTwinId, CancellationT
255255
/// The exception is thrown when <paramref name="digitalTwinId"/> or <paramref name="digitalTwin"/> is <c>null</c>.
256256
/// </exception>
257257
/// <example>
258-
/// <code snippet="Snippet:DigitalTwinsSampleCreateCustomTwin">
258+
/// <code snippet="Snippet:DigitalTwinsSampleCreateCustomTwin" language="csharp">
259259
/// var customTwin = new CustomDigitalTwin
260260
/// {
261261
/// Id = customDtId,
@@ -393,7 +393,7 @@ public virtual Response<T> CreateOrReplaceDigitalTwin<T>(
393393
/// To delete a digital twin, any relationships referencing it must be deleted first.
394394
/// </remarks>
395395
/// <example>
396-
/// <code snippet="Snippet:DigitalTwinsSampleDeleteTwin">
396+
/// <code snippet="Snippet:DigitalTwinsSampleDeleteTwin" language="csharp">
397397
/// await client.DeleteDigitalTwinAsync(digitalTwinId);
398398
/// Console.WriteLine($&quot;Deleted digital twin &apos;{digitalTwinId}&apos;.&quot;);
399399
/// </code>
@@ -558,7 +558,7 @@ public virtual Response UpdateDigitalTwin(string digitalTwinId, JsonPatchDocumen
558558
/// The exception is thrown when <paramref name="digitalTwinId"/> or <paramref name="componentName"/> is <c>null</c>.
559559
/// </exception>
560560
/// <example>
561-
/// <code snippet="Snippet:DigitalTwinsSampleGetComponent">
561+
/// <code snippet="Snippet:DigitalTwinsSampleGetComponent" language="csharp">
562562
/// await client.GetComponentAsync&lt;MyCustomComponent&gt;(basicDtId, SamplesConstants.ComponentName);
563563
/// Console.WriteLine($&quot;Retrieved component for digital twin &apos;{basicDtId}&apos;.&quot;);
564564
/// </code>
@@ -653,7 +653,7 @@ public virtual Response<T> GetComponent<T>(string digitalTwinId, string componen
653653
/// <exception cref="ArgumentNullException">
654654
/// The exception is thrown when <paramref name="digitalTwinId"/> or <paramref name="componentName"/> is <c>null</c>.
655655
/// </exception>
656-
/// <code snippet="Snippet:DigitalTwinsSampleUpdateComponent">
656+
/// <code snippet="Snippet:DigitalTwinsSampleUpdateComponent" language="csharp">
657657
/// // Update Component1 by replacing the property ComponentProp1 value,
658658
/// // using an optional utility to build the payload.
659659
/// var componentJsonPatchDocument = new JsonPatchDocument();
@@ -770,7 +770,7 @@ public virtual Response UpdateComponent(
770770
/// </exception>
771771
/// <example>
772772
/// This sample demonstrates iterating over outgoing relationships and deserializing relationship strings into BasicRelationship objects.
773-
/// <code snippet="Snippet:DigitalTwinsSampleGetAllRelationships">
773+
/// <code snippet="Snippet:DigitalTwinsSampleGetAllRelationships" language="csharp">
774774
/// AsyncPageable&lt;BasicRelationship&gt; relationships = client.GetRelationshipsAsync&lt;BasicRelationship&gt;(&quot;buildingTwinId&quot;);
775775
/// await foreach (BasicRelationship relationship in relationships)
776776
/// {
@@ -936,7 +936,7 @@ Page<T> NextPageFunc(string nextLink, int? pageSizeHint)
936936
/// The exception is thrown when <paramref name="digitalTwinId"/> is <c>null</c>.
937937
/// </exception>
938938
/// <example>
939-
/// <code snippet="Snippet:DigitalTwinsSampleGetIncomingRelationships">
939+
/// <code snippet="Snippet:DigitalTwinsSampleGetIncomingRelationships" language="csharp">
940940
/// AsyncPageable&lt;IncomingRelationship&gt; incomingRelationships = client.GetIncomingRelationshipsAsync(&quot;buildingTwinId&quot;);
941941
///
942942
/// await foreach (IncomingRelationship incomingRelationship in incomingRelationships)
@@ -1086,7 +1086,7 @@ Page<IncomingRelationship> NextPageFunc(string nextLink, int? pageSizeHint)
10861086
/// </exception>
10871087
/// <example>
10881088
/// This sample demonstrates getting and deserializing a digital twin relationship into a custom data type.
1089-
/// <code snippet="Snippet:DigitalTwinsSampleGetCustomRelationship">
1089+
/// <code snippet="Snippet:DigitalTwinsSampleGetCustomRelationship" language="csharp">
10901090
/// Response&lt;CustomRelationship&gt; getCustomRelationshipResponse = await client.GetRelationshipAsync&lt;CustomRelationship&gt;(
10911091
/// &quot;floorTwinId&quot;,
10921092
/// &quot;floorBuildingRelationshipId&quot;);
@@ -1285,7 +1285,7 @@ public virtual Response DeleteRelationship(string digitalTwinId, string relation
12851285
/// The exception is thrown when <paramref name="digitalTwinId"/> or <paramref name="relationshipId"/> is <c>null</c>.
12861286
/// </exception>
12871287
/// <example>
1288-
/// <code snippet="Snippet:DigitalTwinsSampleCreateCustomRelationship">
1288+
/// <code snippet="Snippet:DigitalTwinsSampleCreateCustomRelationship" language="csharp">
12891289
/// var floorBuildingRelationshipPayload = new CustomRelationship
12901290
/// {
12911291
/// Id = &quot;floorBuildingRelationshipId&quot;,
@@ -1529,7 +1529,7 @@ public virtual Response UpdateRelationship(
15291529
/// The exception that captures the errors from the service. Check the <see cref="RequestFailedException.ErrorCode"/> and <see cref="RequestFailedException.Status"/> properties for more details.
15301530
/// </exception>
15311531
/// <example>
1532-
/// <code snippet="Snippet:DigitalTwinsSampleGetModels">
1532+
/// <code snippet="Snippet:DigitalTwinsSampleGetModels" language="csharp">
15331533
/// AsyncPageable&lt;DigitalTwinsModelData&gt; allModels = client.GetModelsAsync();
15341534
/// await foreach (DigitalTwinsModelData model in allModels)
15351535
/// {
@@ -1689,7 +1689,7 @@ Page<DigitalTwinsModelData> NextPageFunc(string nextLink, int? pageSizeHint)
16891689
/// The exception is thrown when <paramref name="modelId"/> is <c>null</c>.
16901690
/// </exception>
16911691
/// <example>
1692-
/// <code snippet="Snippet:DigitalTwinsSampleGetModel">
1692+
/// <code snippet="Snippet:DigitalTwinsSampleGetModel" language="csharp">
16931693
/// Response&lt;DigitalTwinsModelData&gt; sampleModelResponse = await client.GetModelAsync(sampleModelId);
16941694
/// Console.WriteLine($&quot;Retrieved model &apos;{sampleModelResponse.Value.Id}&apos;.&quot;);
16951695
/// </code>
@@ -1771,7 +1771,7 @@ public virtual Response<DigitalTwinsModelData> GetModel(string modelId, Cancella
17711771
/// The exception is thrown when <paramref name="modelId"/> is <c>null</c>.
17721772
/// </exception>
17731773
/// <example>
1774-
/// <code snippet="Snippet:DigitalTwinsSampleDecommisionModel">
1774+
/// <code snippet="Snippet:DigitalTwinsSampleDecommisionModel" language="csharp">
17751775
/// try
17761776
/// {
17771777
/// await client.DecommissionModelAsync(sampleModelId);
@@ -1866,7 +1866,7 @@ public virtual Response DecommissionModel(string modelId, CancellationToken canc
18661866
/// </remarks>
18671867
/// <seealso href="https://docs.microsoft.com/en-us/azure/digital-twins/concepts-models" />
18681868
/// <example>
1869-
/// <code snippet="Snippet:DigitalTwinsSampleCreateModels">
1869+
/// <code snippet="Snippet:DigitalTwinsSampleCreateModels" language="csharp">
18701870
/// await client.CreateModelsAsync(new[] { newComponentModelPayload, newModelPayload });
18711871
/// Console.WriteLine($&quot;Created models &apos;{componentModelId}&apos; and &apos;{sampleModelId}&apos;.&quot;);
18721872
/// </code>
@@ -1967,7 +1967,7 @@ public virtual Response<DigitalTwinsModelData[]> CreateModels(IEnumerable<string
19671967
/// The exception is thrown when <paramref name="modelId"/> is <c>null</c>.
19681968
/// </exception>
19691969
/// <example>
1970-
/// <code snippet="Snippet:DigitalTwinsSampleDeleteModel">
1970+
/// <code snippet="Snippet:DigitalTwinsSampleDeleteModel" language="csharp">
19711971
/// try
19721972
/// {
19731973
/// await client.DeleteModelAsync(sampleModelId);
@@ -2058,7 +2058,7 @@ public virtual Response DeleteModel(string modelId, CancellationToken cancellati
20582058
/// The exception that captures the errors from the service. Check the <see cref="RequestFailedException.ErrorCode"/> and <see cref="RequestFailedException.Status"/> properties for more details.
20592059
/// </exception>
20602060
/// <example>
2061-
/// <code snippet="Snippet:DigitalTwinsSampleQueryTwins">
2061+
/// <code snippet="Snippet:DigitalTwinsSampleQueryTwins" language="csharp">
20622062
/// // This code snippet demonstrates the simplest way to iterate over the digital twin results, where paging
20632063
/// // happens under the covers.
20642064
/// AsyncPageable&lt;BasicDigitalTwin&gt; asyncPageableResponse = client.QueryAsync&lt;BasicDigitalTwin&gt;(&quot;SELECT * FROM digitaltwins&quot;);
@@ -2277,7 +2277,7 @@ Page<T> NextPageFunc(string nextLink, int? pageSizeHint)
22772277
/// The exception that captures the errors from the service. Check the <see cref="RequestFailedException.ErrorCode"/> and <see cref="RequestFailedException.Status"/> properties for more details.
22782278
/// </exception>
22792279
/// <example>
2280-
/// <code snippet="Snippet:DigitalTwinsSampleGetEventRoutes">
2280+
/// <code snippet="Snippet:DigitalTwinsSampleGetEventRoutes" language="csharp">
22812281
/// AsyncPageable&lt;DigitalTwinsEventRoute&gt; response = client.GetEventRoutesAsync();
22822282
/// await foreach (DigitalTwinsEventRoute er in response)
22832283
/// {
@@ -2509,7 +2509,7 @@ public virtual Response<DigitalTwinsEventRoute> GetEventRoute(string eventRouteI
25092509
/// The exception is thrown when <paramref name="eventRouteId"/> is <c>null</c>.
25102510
/// </exception>
25112511
/// <example>
2512-
/// <code snippet="Snippet:DigitalTwinsSampleCreateEventRoute">
2512+
/// <code snippet="Snippet:DigitalTwinsSampleCreateEventRoute" language="csharp">
25132513
/// string eventFilter = &quot;$eventType = &apos;DigitalTwinTelemetryMessages&apos; or $eventType = &apos;DigitalTwinLifecycleNotification&apos;&quot;;
25142514
/// var eventRoute = new DigitalTwinsEventRoute(eventhubEndpointName, eventFilter);
25152515
///
@@ -2587,7 +2587,7 @@ public virtual Response CreateOrReplaceEventRoute(string eventRouteId, DigitalTw
25872587
/// The exception is thrown when <paramref name="eventRouteId"/> is <c>null</c>.
25882588
/// </exception>
25892589
/// <example>
2590-
/// <code snippet="Snippet:DigitalTwinsSampleDeleteEventRoute">
2590+
/// <code snippet="Snippet:DigitalTwinsSampleDeleteEventRoute" language="csharp">
25912591
/// await client.DeleteEventRouteAsync(_eventRouteId);
25922592
/// Console.WriteLine($&quot;Deleted event route &apos;{_eventRouteId}&apos;.&quot;);
25932593
/// </code>
@@ -2665,7 +2665,7 @@ public virtual Response DeleteEventRoute(string eventRouteId, CancellationToken
26652665
/// The exception is thrown when <paramref name="digitalTwinId"/> or <paramref name="payload"/> is <c>null</c>.
26662666
/// </exception>
26672667
/// <example>
2668-
/// <code snippet="Snippet:DigitalTwinsSamplePublishTelemetry">
2668+
/// <code snippet="Snippet:DigitalTwinsSamplePublishTelemetry" language="csharp">
26692669
/// // construct your json telemetry payload by hand.
26702670
/// await client.PublishTelemetryAsync(twinId, Guid.NewGuid().ToString(), &quot;{\&quot;Telemetry1\&quot;: 5}&quot;);
26712671
/// Console.WriteLine($&quot;Published telemetry message to twin &apos;{twinId}&apos;.&quot;);
@@ -2788,7 +2788,7 @@ public virtual Response PublishTelemetry(
27882788
/// The exception is thrown when <paramref name="digitalTwinId"/> or <paramref name="componentName"/> or <paramref name="payload"/> is <c>null</c>.
27892789
/// </exception>
27902790
/// <example>
2791-
/// <code snippet="Snippet:DigitalTwinsSamplePublishComponentTelemetry">
2791+
/// <code snippet="Snippet:DigitalTwinsSamplePublishComponentTelemetry" language="csharp">
27922792
/// // construct your json telemetry payload by serializing a dictionary.
27932793
/// var telemetryPayload = new Dictionary&lt;string, int&gt;
27942794
/// {

sdk/digitaltwins/Azure.DigitalTwins.Core/src/Models/BasicDigitalTwin.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace Azure.DigitalTwins.Core
2020
/// <example>
2121
/// Here's an example of how to use the BasicDigitalTwin helper class to serialize and create a digital twin.
2222
///
23-
/// <code snippet="Snippet:DigitalTwinsSampleCreateBasicTwin">
23+
/// <code snippet="Snippet:DigitalTwinsSampleCreateBasicTwin" language="csharp">
2424
/// // Create digital twin with component payload using the BasicDigitalTwin serialization helper
2525
///
2626
/// var basicTwin = new BasicDigitalTwin
@@ -55,7 +55,7 @@ namespace Azure.DigitalTwins.Core
5555
///
5656
/// Here's an example of how to use the BasicDigitalTwin helper class to get and deserialize a digital twin.
5757
///
58-
/// <code snippet="Snippet:DigitalTwinsSampleGetBasicDigitalTwin">
58+
/// <code snippet="Snippet:DigitalTwinsSampleGetBasicDigitalTwin" language="csharp">
5959
/// Response&lt;BasicDigitalTwin&gt; getBasicDtResponse = await client.GetDigitalTwinAsync&lt;BasicDigitalTwin&gt;(basicDtId);
6060
/// BasicDigitalTwin basicDt = getBasicDtResponse.Value;
6161
///
@@ -101,7 +101,7 @@ public class BasicDigitalTwin
101101
/// If the property is a component, use the <see cref="BasicDigitalTwinComponent"/> class to deserialize the payload.
102102
/// </remarks>
103103
/// <example>
104-
/// <code snippet="Snippet:DigitalTwinsSampleGetBasicDigitalTwin">
104+
/// <code snippet="Snippet:DigitalTwinsSampleGetBasicDigitalTwin" language="csharp">
105105
/// Response&lt;BasicDigitalTwin&gt; getBasicDtResponse = await client.GetDigitalTwinAsync&lt;BasicDigitalTwin&gt;(basicDtId);
106106
/// BasicDigitalTwin basicDt = getBasicDtResponse.Value;
107107
///

sdk/digitaltwins/Azure.DigitalTwins.Core/src/Models/BasicRelationship.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace Azure.DigitalTwins.Core
2323
/// <example>
2424
/// Here's an example of how to use the BasicRelationship helper class to serialize and create a relationship from a building digital twin to a floor digital twin.
2525
///
26-
/// <code snippet="Snippet:DigitalTwinsSampleCreateBasicRelationship">
26+
/// <code snippet="Snippet:DigitalTwinsSampleCreateBasicRelationship" language="csharp">
2727
/// var buildingFloorRelationshipPayload = new BasicRelationship
2828
/// {
2929
/// Id = &quot;buildingFloorRelationshipId&quot;,
@@ -45,7 +45,7 @@ namespace Azure.DigitalTwins.Core
4545
///
4646
/// Here's an example of how to use the BasicRelationship helper class to get and deserialize a relationship.
4747
///
48-
/// <code snippet="Snippet:DigitalTwinsSampleGetBasicRelationship">
48+
/// <code snippet="Snippet:DigitalTwinsSampleGetBasicRelationship" language="csharp">
4949
/// Response&lt;BasicRelationship&gt; getBasicRelationshipResponse = await client.GetRelationshipAsync&lt;BasicRelationship&gt;(
5050
/// &quot;buildingTwinId&quot;,
5151
/// &quot;buildingFloorRelationshipId&quot;);
@@ -98,6 +98,7 @@ public class BasicRelationship
9898
[JsonExtensionData]
9999
#pragma warning disable CA2227 // Collection properties should be readonly
100100
public IDictionary<string, object> Properties { get; set; } = new Dictionary<string, object>();
101+
101102
#pragma warning restore CA2227 // Collection properties should be readonly
102103
}
103104
}

sdk/digitaltwins/Azure.DigitalTwins.Core/src/Queries/QueryChargeHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public static class QueryChargeHelper
2424
/// <remarks>
2525
/// For more samples, see <see href="https://github.com/Azure/azure-sdk-for-net/tree/master/sdk/digitaltwins/Azure.DigitalTwins.Core/samples">our repo samples</see>.
2626
/// </remarks>
27-
/// <code snippet="Snippet:DigitalTwinsSampleQueryTwinsWithQueryCharge">
27+
/// <code snippet="Snippet:DigitalTwinsSampleQueryTwinsWithQueryCharge" language="csharp">
2828
/// // This code snippet demonstrates how you could extract the query charges incurred when calling
2929
/// // the query API. It iterates over the response pages first to access to the query-charge header,
3030
/// // and then the digital twin results within each page.

0 commit comments

Comments
 (0)