Skip to content

Commit b6e9975

Browse files
Fix name casing for TraceState and TraceParent in Digital twin options classes (Azure#16154)
Also rename UpdateModelOptions to DecomissionModelOptions as per API review with Azure SDK board
1 parent 5e79cd7 commit b6e9975

File tree

58 files changed

+419
-347
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+419
-347
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
- Regenerate protocol layer from service API version 2020-10-31
66
- Update service API version to use service API version 2020-10-31 by default
7-
- Add optional parameters for traceparent and tracestate to all service request APIs to support distributed tracing
7+
- Add optional parameters for TraceParent and TraceState to all service request APIs to support distributed tracing
88
- Renamed model type "ModelData" to "DigitalTwinsModelData" to make type less generic, and less likely to conflict with other libraries
99
- Renamed model type "RequestOptions" to "DigitalTwinsRequestOptions" to make type less generic, and less likely to conflict with other libraries
1010

sdk/digitaltwins/Azure.DigitalTwins.Core/api/Azure.DigitalTwins.Core.netstandard2.0.cs

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -3,52 +3,58 @@ namespace Azure.DigitalTwins.Core
33
public partial class CreateDigitalTwinOptions
44
{
55
public CreateDigitalTwinOptions() { }
6-
public string Traceparent { get { throw null; } set { } }
7-
public string Tracestate { get { throw null; } set { } }
6+
public string TraceParent { get { throw null; } set { } }
7+
public string TraceState { get { throw null; } set { } }
88
}
99
public partial class CreateEventRouteOptions
1010
{
1111
public CreateEventRouteOptions() { }
12-
public string Traceparent { get { throw null; } set { } }
13-
public string Tracestate { get { throw null; } set { } }
12+
public string TraceParent { get { throw null; } set { } }
13+
public string TraceState { get { throw null; } set { } }
1414
}
1515
public partial class CreateModelsOptions
1616
{
1717
public CreateModelsOptions() { }
18-
public string Traceparent { get { throw null; } set { } }
19-
public string Tracestate { get { throw null; } set { } }
18+
public string TraceParent { get { throw null; } set { } }
19+
public string TraceState { get { throw null; } set { } }
2020
}
2121
public partial class CreateRelationshipOptions
2222
{
2323
public CreateRelationshipOptions() { }
24-
public string Traceparent { get { throw null; } set { } }
25-
public string Tracestate { get { throw null; } set { } }
24+
public string TraceParent { get { throw null; } set { } }
25+
public string TraceState { get { throw null; } set { } }
26+
}
27+
public partial class DecomissionModelOptions
28+
{
29+
public DecomissionModelOptions() { }
30+
public string TraceParent { get { throw null; } set { } }
31+
public string TraceState { get { throw null; } set { } }
2632
}
2733
public partial class DeleteDigitalTwinOptions
2834
{
2935
public DeleteDigitalTwinOptions() { }
3036
public string IfMatch { get { throw null; } set { } }
31-
public string Traceparent { get { throw null; } set { } }
32-
public string Tracestate { get { throw null; } set { } }
37+
public string TraceParent { get { throw null; } set { } }
38+
public string TraceState { get { throw null; } set { } }
3339
}
3440
public partial class DeleteEventRouteOptions
3541
{
3642
public DeleteEventRouteOptions() { }
37-
public string Traceparent { get { throw null; } set { } }
38-
public string Tracestate { get { throw null; } set { } }
43+
public string TraceParent { get { throw null; } set { } }
44+
public string TraceState { get { throw null; } set { } }
3945
}
4046
public partial class DeleteModelOptions
4147
{
4248
public DeleteModelOptions() { }
43-
public string Traceparent { get { throw null; } set { } }
44-
public string Tracestate { get { throw null; } set { } }
49+
public string TraceParent { get { throw null; } set { } }
50+
public string TraceState { get { throw null; } set { } }
4551
}
4652
public partial class DeleteRelationshipOptions
4753
{
4854
public DeleteRelationshipOptions() { }
4955
public string IfMatch { get { throw null; } set { } }
50-
public string Traceparent { get { throw null; } set { } }
51-
public string Tracestate { get { throw null; } set { } }
56+
public string TraceParent { get { throw null; } set { } }
57+
public string TraceState { get { throw null; } set { } }
5258
}
5359
public partial class DigitalTwinsClient
5460
{
@@ -63,8 +69,8 @@ public DigitalTwinsClient(System.Uri endpoint, Azure.Core.TokenCredential creden
6369
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.DigitalTwins.Core.DigitalTwinsModelData[]>> CreateModelsAsync(System.Collections.Generic.IEnumerable<string> models, Azure.DigitalTwins.Core.CreateModelsOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
6470
public virtual Azure.Response<string> CreateRelationship(string digitalTwinId, string relationshipId, string relationship, Azure.DigitalTwins.Core.CreateRelationshipOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
6571
public virtual System.Threading.Tasks.Task<Azure.Response<string>> CreateRelationshipAsync(string digitalTwinId, string relationshipId, string relationship, Azure.DigitalTwins.Core.CreateRelationshipOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
66-
public virtual Azure.Response DecommissionModel(string modelId, Azure.DigitalTwins.Core.UpdateModelOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
67-
public virtual System.Threading.Tasks.Task<Azure.Response> DecommissionModelAsync(string modelId, Azure.DigitalTwins.Core.UpdateModelOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
72+
public virtual Azure.Response DecommissionModel(string modelId, Azure.DigitalTwins.Core.DecomissionModelOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
73+
public virtual System.Threading.Tasks.Task<Azure.Response> DecommissionModelAsync(string modelId, Azure.DigitalTwins.Core.DecomissionModelOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
6874
public virtual Azure.Response DeleteDigitalTwin(string digitalTwinId, Azure.DigitalTwins.Core.DeleteDigitalTwinOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
6975
public virtual System.Threading.Tasks.Task<Azure.Response> DeleteDigitalTwinAsync(string digitalTwinId, Azure.DigitalTwins.Core.DeleteDigitalTwinOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
7076
public virtual Azure.Response DeleteEventRoute(string eventRouteId, Azure.DigitalTwins.Core.DeleteEventRouteOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
@@ -134,60 +140,60 @@ public EventRoute(string endpointName, string filter) { }
134140
public partial class GetComponentOptions
135141
{
136142
public GetComponentOptions() { }
137-
public string Traceparent { get { throw null; } set { } }
138-
public string Tracestate { get { throw null; } set { } }
143+
public string TraceParent { get { throw null; } set { } }
144+
public string TraceState { get { throw null; } set { } }
139145
}
140146
public partial class GetDigitalTwinOptions
141147
{
142148
public GetDigitalTwinOptions() { }
143-
public string Traceparent { get { throw null; } set { } }
144-
public string Tracestate { get { throw null; } set { } }
149+
public string TraceParent { get { throw null; } set { } }
150+
public string TraceState { get { throw null; } set { } }
145151
}
146152
public partial class GetEventRouteOptions
147153
{
148154
public GetEventRouteOptions() { }
149-
public string Traceparent { get { throw null; } set { } }
150-
public string Tracestate { get { throw null; } set { } }
155+
public string TraceParent { get { throw null; } set { } }
156+
public string TraceState { get { throw null; } set { } }
151157
}
152158
public partial class GetEventRoutesOptions
153159
{
154160
public GetEventRoutesOptions() { }
155161
public int? MaxItemsPerPage { get { throw null; } set { } }
156-
public string Traceparent { get { throw null; } set { } }
157-
public string Tracestate { get { throw null; } set { } }
162+
public string TraceParent { get { throw null; } set { } }
163+
public string TraceState { get { throw null; } set { } }
158164
}
159165
public partial class GetIncomingRelationshipsOptions
160166
{
161167
public GetIncomingRelationshipsOptions() { }
162-
public string Traceparent { get { throw null; } set { } }
163-
public string Tracestate { get { throw null; } set { } }
168+
public string TraceParent { get { throw null; } set { } }
169+
public string TraceState { get { throw null; } set { } }
164170
}
165171
public partial class GetModelOptions
166172
{
167173
public GetModelOptions() { }
168-
public string Traceparent { get { throw null; } set { } }
169-
public string Tracestate { get { throw null; } set { } }
174+
public string TraceParent { get { throw null; } set { } }
175+
public string TraceState { get { throw null; } set { } }
170176
}
171177
public partial class GetModelsOptions
172178
{
173179
public GetModelsOptions() { }
174180
public System.Collections.Generic.IEnumerable<string> DependenciesFor { get { throw null; } set { } }
175181
public bool IncludeModelDefinition { get { throw null; } set { } }
176182
public int? MaxItemsPerPage { get { throw null; } set { } }
177-
public string Traceparent { get { throw null; } set { } }
178-
public string Tracestate { get { throw null; } set { } }
183+
public string TraceParent { get { throw null; } set { } }
184+
public string TraceState { get { throw null; } set { } }
179185
}
180186
public partial class GetRelationshipOptions
181187
{
182188
public GetRelationshipOptions() { }
183-
public string Traceparent { get { throw null; } set { } }
184-
public string Tracestate { get { throw null; } set { } }
189+
public string TraceParent { get { throw null; } set { } }
190+
public string TraceState { get { throw null; } set { } }
185191
}
186192
public partial class GetRelationshipsOptions
187193
{
188194
public GetRelationshipsOptions() { }
189-
public string Traceparent { get { throw null; } set { } }
190-
public string Tracestate { get { throw null; } set { } }
195+
public string TraceParent { get { throw null; } set { } }
196+
public string TraceState { get { throw null; } set { } }
191197
}
192198
public partial class IncomingRelationship
193199
{
@@ -201,15 +207,15 @@ public partial class PublishComponentTelemetryOptions
201207
{
202208
public PublishComponentTelemetryOptions() { }
203209
public System.DateTimeOffset TimeStamp { get { throw null; } set { } }
204-
public string Traceparent { get { throw null; } set { } }
205-
public string Tracestate { get { throw null; } set { } }
210+
public string TraceParent { get { throw null; } set { } }
211+
public string TraceState { get { throw null; } set { } }
206212
}
207213
public partial class PublishTelemetryOptions
208214
{
209215
public PublishTelemetryOptions() { }
210216
public System.DateTimeOffset TimeStamp { get { throw null; } set { } }
211-
public string Traceparent { get { throw null; } set { } }
212-
public string Tracestate { get { throw null; } set { } }
217+
public string TraceParent { get { throw null; } set { } }
218+
public string TraceState { get { throw null; } set { } }
213219
}
214220
public static partial class QueryChargeHelper
215221
{
@@ -219,35 +225,29 @@ public partial class QueryOptions
219225
{
220226
public QueryOptions() { }
221227
public int? MaxItemsPerPage { get { throw null; } set { } }
222-
public string Traceparent { get { throw null; } set { } }
223-
public string Tracestate { get { throw null; } set { } }
228+
public string TraceParent { get { throw null; } set { } }
229+
public string TraceState { get { throw null; } set { } }
224230
}
225231
public partial class UpdateComponentOptions
226232
{
227233
public UpdateComponentOptions() { }
228234
public string IfMatch { get { throw null; } set { } }
229-
public string Traceparent { get { throw null; } set { } }
230-
public string Tracestate { get { throw null; } set { } }
235+
public string TraceParent { get { throw null; } set { } }
236+
public string TraceState { get { throw null; } set { } }
231237
}
232238
public partial class UpdateDigitalTwinOptions
233239
{
234240
public UpdateDigitalTwinOptions() { }
235241
public string IfMatch { get { throw null; } set { } }
236-
public string Traceparent { get { throw null; } set { } }
237-
public string Tracestate { get { throw null; } set { } }
238-
}
239-
public partial class UpdateModelOptions
240-
{
241-
public UpdateModelOptions() { }
242-
public string Traceparent { get { throw null; } set { } }
243-
public string Tracestate { get { throw null; } set { } }
242+
public string TraceParent { get { throw null; } set { } }
243+
public string TraceState { get { throw null; } set { } }
244244
}
245245
public partial class UpdateRelationshipOptions
246246
{
247247
public UpdateRelationshipOptions() { }
248248
public string IfMatch { get { throw null; } set { } }
249-
public string Traceparent { get { throw null; } set { } }
250-
public string Tracestate { get { throw null; } set { } }
249+
public string TraceParent { get { throw null; } set { } }
250+
public string TraceState { get { throw null; } set { } }
251251
}
252252
}
253253
namespace Azure.DigitalTwins.Core.Serialization

sdk/digitaltwins/Azure.DigitalTwins.Core/src/Customized/DigitalTwinModelsRestClient.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ internal Response<IReadOnlyList<DigitalTwinsModelData>> Add(IEnumerable<string>
8888

8989
// The modelUpdates parameter needs to be changed from IEnumerable<object> to IEnumerable<string>
9090
// and not parsed like a json object.
91-
internal async Task<Response> UpdateAsync(string id, IEnumerable<string> modelUpdates, UpdateModelOptions digitalTwinModelsUpdateOptions = null, CancellationToken cancellationToken = default)
91+
internal async Task<Response> UpdateAsync(string id, IEnumerable<string> modelUpdates, DecomissionModelOptions digitalTwinModelsUpdateOptions = null, CancellationToken cancellationToken = default)
9292
{
9393
if (id == null)
9494
{
@@ -120,7 +120,7 @@ internal async Task<Response> UpdateAsync(string id, IEnumerable<string> modelUp
120120

121121
// The modelUpdates parameter needs to be changed from IEnumerable<object> to IEnumerable<string>
122122
// and not parsed like a json object.
123-
internal Response Update(string id, IEnumerable<string> modelUpdates, UpdateModelOptions digitalTwinModelsUpdateOptions = null, CancellationToken cancellationToken = default)
123+
internal Response Update(string id, IEnumerable<string> modelUpdates, DecomissionModelOptions digitalTwinModelsUpdateOptions = null, CancellationToken cancellationToken = default)
124124
{
125125
if (id == null)
126126
{
@@ -162,13 +162,13 @@ private HttpMessage CreateAddRequest(IEnumerable<string> models, CreateModelsOpt
162162
uri.AppendPath("/models", false);
163163
uri.AppendQuery("api-version", apiVersion, true);
164164
request.Uri = uri;
165-
if (digitalTwinModelsAddOptions?.Traceparent != null)
165+
if (digitalTwinModelsAddOptions?.TraceParent != null)
166166
{
167-
request.Headers.Add("traceparent", digitalTwinModelsAddOptions.Traceparent);
167+
request.Headers.Add("TraceParent", digitalTwinModelsAddOptions.TraceParent);
168168
}
169-
if (digitalTwinModelsAddOptions?.Tracestate != null)
169+
if (digitalTwinModelsAddOptions?.TraceState != null)
170170
{
171-
request.Headers.Add("tracestate", digitalTwinModelsAddOptions.Tracestate);
171+
request.Headers.Add("TraceState", digitalTwinModelsAddOptions.TraceState);
172172
}
173173
request.Headers.Add("Content-Type", "application/json");
174174
request.Headers.Add("Accept", "application/json");
@@ -182,7 +182,7 @@ private HttpMessage CreateAddRequest(IEnumerable<string> models, CreateModelsOpt
182182

183183
// The strings are already json, so we do not want them to be serialized.
184184
// Instead, the payloads need to be concatenated into a json array.
185-
private HttpMessage CreateUpdateRequest(string id, IEnumerable<string> modelUpdates, UpdateModelOptions digitalTwinModelsUpdateOptions)
185+
private HttpMessage CreateUpdateRequest(string id, IEnumerable<string> modelUpdates, DecomissionModelOptions digitalTwinModelsUpdateOptions)
186186
{
187187
var message = _pipeline.CreateMessage();
188188
var request = message.Request;
@@ -193,13 +193,13 @@ private HttpMessage CreateUpdateRequest(string id, IEnumerable<string> modelUpda
193193
uri.AppendPath(id, true);
194194
uri.AppendQuery("api-version", apiVersion, true);
195195
request.Uri = uri;
196-
if (digitalTwinModelsUpdateOptions?.Traceparent != null)
196+
if (digitalTwinModelsUpdateOptions?.TraceParent != null)
197197
{
198-
request.Headers.Add("traceparent", digitalTwinModelsUpdateOptions.Traceparent);
198+
request.Headers.Add("TraceParent", digitalTwinModelsUpdateOptions.TraceParent);
199199
}
200-
if (digitalTwinModelsUpdateOptions?.Tracestate != null)
200+
if (digitalTwinModelsUpdateOptions?.TraceState != null)
201201
{
202-
request.Headers.Add("tracestate", digitalTwinModelsUpdateOptions.Tracestate);
202+
request.Headers.Add("TraceState", digitalTwinModelsUpdateOptions.TraceState);
203203
}
204204
request.Headers.Add("Content-Type", "application/json-patch+json");
205205
request.Headers.Add("Accept", "application/json");

0 commit comments

Comments
 (0)