Skip to content

Commit

Permalink
Update to new api version 2023-06-30 (#36997)
Browse files Browse the repository at this point in the history
* added changes for 2023-06-30 api release

* updated generated files

* fixed formatting in changelog

* Updated method names and property types per previous review comments

* Updated changelog to remove references to beta

* Set InnerError to be internal Class

* Fixed error related to changelog versions

* Removed the ability to publicly set error in the import job model

* Updated session records

* Updated Apis

---------

Co-authored-by: Austin Lynch <austinlynch@microsoft.com>
  • Loading branch information
arlynch and Austin Lynch authored Sep 7, 2023
1 parent 3325d44 commit 28668aa
Show file tree
Hide file tree
Showing 54 changed files with 2,403 additions and 276 deletions.
12 changes: 6 additions & 6 deletions sdk/digitaltwins/Azure.DigitalTwins.Core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Release History

## 1.5.0-beta.1 (Unreleased)

### Features Added
## 1.5.0 (2023-07-26)

### Breaking Changes
### New Features
- Updated service API version to use API version 2023-06-30 by default.
- Added support for the new import job. You can now use a blob file in your storage account to import multiple models, twins and relationships at once.

### Bugs Fixed
## 1.5.0-beta.1 (Unreleased)

### Other Changes
### New Features

## 1.4.0 (2022-06-30)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ public partial class DigitalTwinsClient
protected DigitalTwinsClient() { }
public DigitalTwinsClient(System.Uri endpoint, Azure.Core.TokenCredential credential) { }
public DigitalTwinsClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.DigitalTwins.Core.DigitalTwinsClientOptions options) { }
public virtual Azure.Response<Azure.DigitalTwins.Core.ImportJob> CancelImportJob(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.DigitalTwins.Core.ImportJob>> CancelImportJobAsync(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<Azure.DigitalTwins.Core.DigitalTwinsModelData[]> CreateModels(System.Collections.Generic.IEnumerable<string> dtdlModels, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.DigitalTwins.Core.DigitalTwinsModelData[]>> CreateModelsAsync(System.Collections.Generic.IEnumerable<string> dtdlModels, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<T>> CreateOrReplaceDigitalTwinAsync<T>(string digitalTwinId, T digitalTwin, Azure.ETag? ifNoneMatch = default(Azure.ETag?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
Expand All @@ -74,6 +76,8 @@ public DigitalTwinsClient(System.Uri endpoint, Azure.Core.TokenCredential creden
public virtual System.Threading.Tasks.Task<Azure.Response> DeleteDigitalTwinAsync(string digitalTwinId, Azure.ETag? ifMatch = default(Azure.ETag?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response DeleteEventRoute(string eventRouteId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response> DeleteEventRouteAsync(string eventRouteId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response DeleteImportJob(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response> DeleteImportJobAsync(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response DeleteModel(string modelId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response> DeleteModelAsync(string modelId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response DeleteRelationship(string digitalTwinId, string relationshipId, Azure.ETag? ifMatch = default(Azure.ETag?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
Expand All @@ -86,6 +90,10 @@ public DigitalTwinsClient(System.Uri endpoint, Azure.Core.TokenCredential creden
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.DigitalTwins.Core.DigitalTwinsEventRoute>> GetEventRouteAsync(string eventRouteId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Pageable<Azure.DigitalTwins.Core.DigitalTwinsEventRoute> GetEventRoutes(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.AsyncPageable<Azure.DigitalTwins.Core.DigitalTwinsEventRoute> GetEventRoutesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<Azure.DigitalTwins.Core.ImportJob> GetImportJob(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.DigitalTwins.Core.ImportJob>> GetImportJobAsync(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Pageable<Azure.DigitalTwins.Core.ImportJob> GetImportJobs(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.AsyncPageable<Azure.DigitalTwins.Core.ImportJob> GetImportJobsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Pageable<Azure.DigitalTwins.Core.IncomingRelationship> GetIncomingRelationships(string digitalTwinId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.AsyncPageable<Azure.DigitalTwins.Core.IncomingRelationship> GetIncomingRelationshipsAsync(string digitalTwinId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<Azure.DigitalTwins.Core.DigitalTwinsModelData> GetModel(string modelId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
Expand All @@ -96,6 +104,8 @@ public DigitalTwinsClient(System.Uri endpoint, Azure.Core.TokenCredential creden
public virtual Azure.AsyncPageable<T> GetRelationshipsAsync<T>(string digitalTwinId, string relationshipName = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Pageable<T> GetRelationships<T>(string digitalTwinId, string relationshipName = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<T> GetRelationship<T>(string digitalTwinId, string relationshipId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<Azure.DigitalTwins.Core.ImportJob> ImportGraph(string jobId, Azure.DigitalTwins.Core.ImportJob importJob, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.DigitalTwins.Core.ImportJob>> ImportGraphAsync(string jobId, Azure.DigitalTwins.Core.ImportJob importJob, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response PublishComponentTelemetry(string digitalTwinId, string componentName, string messageId, string payload, System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response> PublishComponentTelemetryAsync(string digitalTwinId, string componentName, string messageId, string payload, System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response PublishTelemetry(string digitalTwinId, string messageId, string payload, System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
Expand All @@ -111,13 +121,14 @@ public DigitalTwinsClient(System.Uri endpoint, Azure.Core.TokenCredential creden
}
public partial class DigitalTwinsClientOptions : Azure.Core.ClientOptions
{
public DigitalTwinsClientOptions(Azure.DigitalTwins.Core.DigitalTwinsClientOptions.ServiceVersion version = Azure.DigitalTwins.Core.DigitalTwinsClientOptions.ServiceVersion.V2022_05_31) { }
public DigitalTwinsClientOptions(Azure.DigitalTwins.Core.DigitalTwinsClientOptions.ServiceVersion version = Azure.DigitalTwins.Core.DigitalTwinsClientOptions.ServiceVersion.V2023_06_30) { }
public Azure.Core.Serialization.ObjectSerializer Serializer { get { throw null; } set { } }
public Azure.DigitalTwins.Core.DigitalTwinsClientOptions.ServiceVersion Version { get { throw null; } }
public enum ServiceVersion
{
V2020_10_31 = 1,
V2022_05_31 = 2,
V2023_06_30 = 3,
}
}
public partial class DigitalTwinsEventRoute
Expand Down Expand Up @@ -155,6 +166,7 @@ public static partial class DigitalTwinsModelFactory
{
public static Azure.DigitalTwins.Core.DigitalTwinsEventRoute DigitalTwinsEventRoute(string id = null, string endpointName = null, string filter = null) { throw null; }
public static Azure.DigitalTwins.Core.DigitalTwinsModelData DigitalTwinsModelData(System.Collections.Generic.IReadOnlyDictionary<string, string> languageDisplayNames = null, System.Collections.Generic.IReadOnlyDictionary<string, string> languageDescriptions = null, string id = null, System.DateTimeOffset? uploadedOn = default(System.DateTimeOffset?), bool? decommissioned = default(bool?), string dtdlModel = null) { throw null; }
public static Azure.DigitalTwins.Core.ImportJob ImportJob(string id = null, System.Uri inputBlobUri = null, System.Uri outputBlobUri = null, Azure.DigitalTwins.Core.ImportJobStatus? status = default(Azure.DigitalTwins.Core.ImportJobStatus?), System.DateTimeOffset? createdDateTime = default(System.DateTimeOffset?), System.DateTimeOffset? lastActionDateTime = default(System.DateTimeOffset?), System.DateTimeOffset? finishedDateTime = default(System.DateTimeOffset?), System.DateTimeOffset? purgeDateTime = default(System.DateTimeOffset?), Azure.ResponseError error = null) { throw null; }
public static Azure.DigitalTwins.Core.IncomingRelationship IncomingRelationship(string relationshipId = null, string sourceId = null, string relationshipName = null, string relationshipLink = null) { throw null; }
}
public partial class GetModelsOptions
Expand All @@ -163,6 +175,41 @@ public GetModelsOptions() { }
public System.Collections.Generic.IEnumerable<string> DependenciesFor { get { throw null; } set { } }
public bool IncludeModelDefinition { get { throw null; } set { } }
}
public partial class ImportJob
{
public ImportJob(System.Uri inputBlobUri, System.Uri outputBlobUri) { }
public System.DateTimeOffset? CreatedDateTime { get { throw null; } }
public Azure.ResponseError Error { get { throw null; } }
public System.DateTimeOffset? FinishedDateTime { get { throw null; } }
public string Id { get { throw null; } }
public System.Uri InputBlobUri { get { throw null; } set { } }
public System.DateTimeOffset? LastActionDateTime { get { throw null; } }
public System.Uri OutputBlobUri { get { throw null; } set { } }
public System.DateTimeOffset? PurgeDateTime { get { throw null; } }
public Azure.DigitalTwins.Core.ImportJobStatus? Status { get { throw null; } }
}
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public readonly partial struct ImportJobStatus : System.IEquatable<Azure.DigitalTwins.Core.ImportJobStatus>
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public ImportJobStatus(string value) { throw null; }
public static Azure.DigitalTwins.Core.ImportJobStatus Cancelled { get { throw null; } }
public static Azure.DigitalTwins.Core.ImportJobStatus Cancelling { get { throw null; } }
public static Azure.DigitalTwins.Core.ImportJobStatus Failed { get { throw null; } }
public static Azure.DigitalTwins.Core.ImportJobStatus Notstarted { get { throw null; } }
public static Azure.DigitalTwins.Core.ImportJobStatus Running { get { throw null; } }
public static Azure.DigitalTwins.Core.ImportJobStatus Succeeded { get { throw null; } }
public bool Equals(Azure.DigitalTwins.Core.ImportJobStatus other) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public override bool Equals(object obj) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public override int GetHashCode() { throw null; }
public static bool operator ==(Azure.DigitalTwins.Core.ImportJobStatus left, Azure.DigitalTwins.Core.ImportJobStatus right) { throw null; }
public static implicit operator Azure.DigitalTwins.Core.ImportJobStatus (string value) { throw null; }
public static bool operator !=(Azure.DigitalTwins.Core.ImportJobStatus left, Azure.DigitalTwins.Core.ImportJobStatus right) { throw null; }
public override string ToString() { throw null; }
}
public partial class IncomingRelationship
{
internal IncomingRelationship() { }
Expand Down
2 changes: 1 addition & 1 deletion sdk/digitaltwins/Azure.DigitalTwins.Core/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "net",
"TagPrefix": "net/digitaltwins/Azure.DigitalTwins.Core",
"Tag": "net/digitaltwins/Azure.DigitalTwins.Core_d08fcbb313"
"Tag": "net/digitaltwins/Azure.DigitalTwins.Core_5eb875c5df"
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<!--using the preview version of Azure.Identity to have access to KnownAuthorityHosts static class.-->
<PackageReference Include="Azure.Identity" Version="1.2.1" />
<PackageReference Include="CommandLineParser" Version="2.7.82" />
<PackageReference Include="Azure.Storage.Blobs" Version="12.16.0" />

<PackageReference Include="System.Text.Json" Version="4.7.2" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using System;
using System.Threading.Tasks;
using Azure.Identity;
using Azure.Storage.Blobs;

namespace Azure.DigitalTwins.Core.Samples
{
internal class ImportJobHelper
{
/// <summary>
/// Loads input blob into existing storage account
/// </summary>
/// <param name="options">reference to options passed in by user</param>
/// <returns>true/false representing status of upload</returns>
public static async Task<bool> UploadInputBlobToStorageContainerAsync(Options options)
{
string filename = "sampleInputBlob.ndjson";
try
{
BlobUriBuilder blobUriBuilder = new BlobUriBuilder(new Uri(options.StorageAccountContainerEndpoint));
BlobServiceClient serviceClient = new BlobServiceClient(blobUriBuilder.ToUri(), new DefaultAzureCredential());
BlobContainerClient containerClient = serviceClient.GetBlobContainerClient(blobUriBuilder.BlobContainerName);
BlobClient blobClient = containerClient.GetBlobClient(filename);

string localFilePath = "./" + filename;

// upload the input blob file. overwrite if it already exists
await blobClient.UploadAsync(localFilePath, overwrite: true);

return true;
}
catch (Exception ex)
{
Console.WriteLine($"Error when uploading input blob to storage container due to: {ex}", ConsoleColor.Red);
Environment.Exit(0);
return false;
}
}
}
}
Loading

0 comments on commit 28668aa

Please sign in to comment.