Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sdk/digitaltwins/Azure.DigitalTwins.Core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,52 +3,58 @@ namespace Azure.DigitalTwins.Core
public partial class CreateDigitalTwinOptions
{
public CreateDigitalTwinOptions() { }
public string Traceparent { get { throw null; } set { } }
public string Tracestate { get { throw null; } set { } }
public string TraceParent { get { throw null; } set { } }
public string TraceState { get { throw null; } set { } }
}
public partial class CreateEventRouteOptions
{
public CreateEventRouteOptions() { }
public string Traceparent { get { throw null; } set { } }
public string Tracestate { get { throw null; } set { } }
public string TraceParent { get { throw null; } set { } }
public string TraceState { get { throw null; } set { } }
}
public partial class CreateModelsOptions
{
public CreateModelsOptions() { }
public string Traceparent { get { throw null; } set { } }
public string Tracestate { get { throw null; } set { } }
public string TraceParent { get { throw null; } set { } }
public string TraceState { get { throw null; } set { } }
}
public partial class CreateRelationshipOptions
{
public CreateRelationshipOptions() { }
public string Traceparent { get { throw null; } set { } }
public string Tracestate { get { throw null; } set { } }
public string TraceParent { get { throw null; } set { } }
public string TraceState { get { throw null; } set { } }
}
public partial class DecomissionModelOptions
{
public DecomissionModelOptions() { }
public string TraceParent { get { throw null; } set { } }
public string TraceState { get { throw null; } set { } }
}
public partial class DeleteDigitalTwinOptions
{
public DeleteDigitalTwinOptions() { }
public string IfMatch { get { throw null; } set { } }
public string Traceparent { get { throw null; } set { } }
public string Tracestate { get { throw null; } set { } }
public string TraceParent { get { throw null; } set { } }
public string TraceState { get { throw null; } set { } }
}
public partial class DeleteEventRouteOptions
{
public DeleteEventRouteOptions() { }
public string Traceparent { get { throw null; } set { } }
public string Tracestate { get { throw null; } set { } }
public string TraceParent { get { throw null; } set { } }
public string TraceState { get { throw null; } set { } }
}
public partial class DeleteModelOptions
{
public DeleteModelOptions() { }
public string Traceparent { get { throw null; } set { } }
public string Tracestate { get { throw null; } set { } }
public string TraceParent { get { throw null; } set { } }
public string TraceState { get { throw null; } set { } }
}
public partial class DeleteRelationshipOptions
{
public DeleteRelationshipOptions() { }
public string IfMatch { get { throw null; } set { } }
public string Traceparent { get { throw null; } set { } }
public string Tracestate { get { throw null; } set { } }
public string TraceParent { get { throw null; } set { } }
public string TraceState { get { throw null; } set { } }
}
public partial class DigitalTwinsClient
{
Expand All @@ -63,8 +69,8 @@ public DigitalTwinsClient(System.Uri endpoint, Azure.Core.TokenCredential creden
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; }
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; }
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; }
public virtual Azure.Response DecommissionModel(string modelId, Azure.DigitalTwins.Core.UpdateModelOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
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; }
public virtual Azure.Response DecommissionModel(string modelId, Azure.DigitalTwins.Core.DecomissionModelOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
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; }
public virtual Azure.Response DeleteDigitalTwin(string digitalTwinId, Azure.DigitalTwins.Core.DeleteDigitalTwinOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
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; }
public virtual Azure.Response DeleteEventRoute(string eventRouteId, Azure.DigitalTwins.Core.DeleteEventRouteOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
Expand Down Expand Up @@ -134,60 +140,60 @@ public EventRoute(string endpointName, string filter) { }
public partial class GetComponentOptions
{
public GetComponentOptions() { }
public string Traceparent { get { throw null; } set { } }
public string Tracestate { get { throw null; } set { } }
public string TraceParent { get { throw null; } set { } }
public string TraceState { get { throw null; } set { } }
}
public partial class GetDigitalTwinOptions
{
public GetDigitalTwinOptions() { }
public string Traceparent { get { throw null; } set { } }
public string Tracestate { get { throw null; } set { } }
public string TraceParent { get { throw null; } set { } }
public string TraceState { get { throw null; } set { } }
}
public partial class GetEventRouteOptions
{
public GetEventRouteOptions() { }
public string Traceparent { get { throw null; } set { } }
public string Tracestate { get { throw null; } set { } }
public string TraceParent { get { throw null; } set { } }
public string TraceState { get { throw null; } set { } }
}
public partial class GetEventRoutesOptions
{
public GetEventRoutesOptions() { }
public int? MaxItemsPerPage { get { throw null; } set { } }
public string Traceparent { get { throw null; } set { } }
public string Tracestate { get { throw null; } set { } }
public string TraceParent { get { throw null; } set { } }
public string TraceState { get { throw null; } set { } }
}
public partial class GetIncomingRelationshipsOptions
{
public GetIncomingRelationshipsOptions() { }
public string Traceparent { get { throw null; } set { } }
public string Tracestate { get { throw null; } set { } }
public string TraceParent { get { throw null; } set { } }
public string TraceState { get { throw null; } set { } }
}
public partial class GetModelOptions
{
public GetModelOptions() { }
public string Traceparent { get { throw null; } set { } }
public string Tracestate { get { throw null; } set { } }
public string TraceParent { get { throw null; } set { } }
public string TraceState { get { throw null; } set { } }
}
public partial class GetModelsOptions
{
public GetModelsOptions() { }
public System.Collections.Generic.IEnumerable<string> DependenciesFor { get { throw null; } set { } }
public bool IncludeModelDefinition { get { throw null; } set { } }
public int? MaxItemsPerPage { get { throw null; } set { } }
public string Traceparent { get { throw null; } set { } }
public string Tracestate { get { throw null; } set { } }
public string TraceParent { get { throw null; } set { } }
public string TraceState { get { throw null; } set { } }
}
public partial class GetRelationshipOptions
{
public GetRelationshipOptions() { }
public string Traceparent { get { throw null; } set { } }
public string Tracestate { get { throw null; } set { } }
public string TraceParent { get { throw null; } set { } }
public string TraceState { get { throw null; } set { } }
}
public partial class GetRelationshipsOptions
{
public GetRelationshipsOptions() { }
public string Traceparent { get { throw null; } set { } }
public string Tracestate { get { throw null; } set { } }
public string TraceParent { get { throw null; } set { } }
public string TraceState { get { throw null; } set { } }
}
public partial class IncomingRelationship
{
Expand All @@ -201,15 +207,15 @@ public partial class PublishComponentTelemetryOptions
{
public PublishComponentTelemetryOptions() { }
public System.DateTimeOffset TimeStamp { get { throw null; } set { } }
public string Traceparent { get { throw null; } set { } }
public string Tracestate { get { throw null; } set { } }
public string TraceParent { get { throw null; } set { } }
public string TraceState { get { throw null; } set { } }
}
public partial class PublishTelemetryOptions
{
public PublishTelemetryOptions() { }
public System.DateTimeOffset TimeStamp { get { throw null; } set { } }
public string Traceparent { get { throw null; } set { } }
public string Tracestate { get { throw null; } set { } }
public string TraceParent { get { throw null; } set { } }
public string TraceState { get { throw null; } set { } }
}
public static partial class QueryChargeHelper
{
Expand All @@ -219,35 +225,29 @@ public partial class QueryOptions
{
public QueryOptions() { }
public int? MaxItemsPerPage { get { throw null; } set { } }
public string Traceparent { get { throw null; } set { } }
public string Tracestate { get { throw null; } set { } }
public string TraceParent { get { throw null; } set { } }
public string TraceState { get { throw null; } set { } }
}
public partial class UpdateComponentOptions
{
public UpdateComponentOptions() { }
public string IfMatch { get { throw null; } set { } }
public string Traceparent { get { throw null; } set { } }
public string Tracestate { get { throw null; } set { } }
public string TraceParent { get { throw null; } set { } }
public string TraceState { get { throw null; } set { } }
}
public partial class UpdateDigitalTwinOptions
{
public UpdateDigitalTwinOptions() { }
public string IfMatch { get { throw null; } set { } }
public string Traceparent { get { throw null; } set { } }
public string Tracestate { get { throw null; } set { } }
}
public partial class UpdateModelOptions
{
public UpdateModelOptions() { }
public string Traceparent { get { throw null; } set { } }
public string Tracestate { get { throw null; } set { } }
public string TraceParent { get { throw null; } set { } }
public string TraceState { get { throw null; } set { } }
}
public partial class UpdateRelationshipOptions
{
public UpdateRelationshipOptions() { }
public string IfMatch { get { throw null; } set { } }
public string Traceparent { get { throw null; } set { } }
public string Tracestate { get { throw null; } set { } }
public string TraceParent { get { throw null; } set { } }
public string TraceState { get { throw null; } set { } }
}
}
namespace Azure.DigitalTwins.Core.Serialization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ internal Response<IReadOnlyList<DigitalTwinsModelData>> Add(IEnumerable<string>

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

// The modelUpdates parameter needs to be changed from IEnumerable<object> to IEnumerable<string>
// and not parsed like a json object.
internal Response Update(string id, IEnumerable<string> modelUpdates, UpdateModelOptions digitalTwinModelsUpdateOptions = null, CancellationToken cancellationToken = default)
internal Response Update(string id, IEnumerable<string> modelUpdates, DecomissionModelOptions digitalTwinModelsUpdateOptions = null, CancellationToken cancellationToken = default)
{
if (id == null)
{
Expand Down Expand Up @@ -162,13 +162,13 @@ private HttpMessage CreateAddRequest(IEnumerable<string> models, CreateModelsOpt
uri.AppendPath("/models", false);
uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
if (digitalTwinModelsAddOptions?.Traceparent != null)
if (digitalTwinModelsAddOptions?.TraceParent != null)
{
request.Headers.Add("traceparent", digitalTwinModelsAddOptions.Traceparent);
request.Headers.Add("TraceParent", digitalTwinModelsAddOptions.TraceParent);
}
if (digitalTwinModelsAddOptions?.Tracestate != null)
if (digitalTwinModelsAddOptions?.TraceState != null)
{
request.Headers.Add("tracestate", digitalTwinModelsAddOptions.Tracestate);
request.Headers.Add("TraceState", digitalTwinModelsAddOptions.TraceState);
}
request.Headers.Add("Content-Type", "application/json");
request.Headers.Add("Accept", "application/json");
Expand All @@ -182,7 +182,7 @@ private HttpMessage CreateAddRequest(IEnumerable<string> models, CreateModelsOpt

// The strings are already json, so we do not want them to be serialized.
// Instead, the payloads need to be concatenated into a json array.
private HttpMessage CreateUpdateRequest(string id, IEnumerable<string> modelUpdates, UpdateModelOptions digitalTwinModelsUpdateOptions)
private HttpMessage CreateUpdateRequest(string id, IEnumerable<string> modelUpdates, DecomissionModelOptions digitalTwinModelsUpdateOptions)
{
var message = _pipeline.CreateMessage();
var request = message.Request;
Expand All @@ -193,13 +193,13 @@ private HttpMessage CreateUpdateRequest(string id, IEnumerable<string> modelUpda
uri.AppendPath(id, true);
uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
if (digitalTwinModelsUpdateOptions?.Traceparent != null)
if (digitalTwinModelsUpdateOptions?.TraceParent != null)
{
request.Headers.Add("traceparent", digitalTwinModelsUpdateOptions.Traceparent);
request.Headers.Add("TraceParent", digitalTwinModelsUpdateOptions.TraceParent);
}
if (digitalTwinModelsUpdateOptions?.Tracestate != null)
if (digitalTwinModelsUpdateOptions?.TraceState != null)
{
request.Headers.Add("tracestate", digitalTwinModelsUpdateOptions.Tracestate);
request.Headers.Add("TraceState", digitalTwinModelsUpdateOptions.TraceState);
}
request.Headers.Add("Content-Type", "application/json-patch+json");
request.Headers.Add("Accept", "application/json");
Expand Down
Loading