Skip to content
Open
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
8 changes: 4 additions & 4 deletions doc/GeneratorMigration/Library_Inventory.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@
- Old TypeSpec: 41
- Data Plane (DPG): 169
- Autorest/Swagger: 86
- New Emitter (TypeSpec): 18
- Old TypeSpec: 16
- New Emitter (TypeSpec): 19
- Old TypeSpec: 15
- No generator: 49


## Data Plane Libraries (DPG) - Migrated to New Emitter

Libraries that provide client APIs for Azure services and have been migrated to the new TypeSpec emitter.

**Migration Status**: 18 / 34 (52.9%)
**Migration Status**: 19 / 34 (55.9%)

| Service | Library | New Emitter |
| ------- | ------- | ----------- |
Expand Down Expand Up @@ -60,7 +60,7 @@ Libraries that provide client APIs for Azure services and have been migrated to
| monitor | Azure.Monitor.Query.Metrics | ✅ |
| onlineexperimentation | Azure.Analytics.OnlineExperimentation | |
| openai | Azure.AI.OpenAI | ✅ |
| purview | Azure.Analytics.Purview.DataMap | |
| purview | Azure.Analytics.Purview.DataMap | |
| schemaregistry | Azure.Data.SchemaRegistry | ✅ |
| template | Azure.Template | ✅ |
| translation | Azure.AI.Translation.Document | |
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@
<TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks>
<NoWarn>$(NoWarn);AZC0012;AZC0030;AZC0034</NoWarn>
<IncludeOperationsSharedSource>true</IncludeOperationsSharedSource>
<IncludeAutorestDependency>true</IncludeAutorestDependency>
</PropertyGroup>

<ItemGroup>
<Compile Include="$(AzureCoreSharedSources)AzureResourceProviderNamespaceAttribute.cs" LinkBase="Shared/Core" />
<Compile Include="$(AzureCoreSharedSources)Multipart\MultipartContent.cs" LinkBase="Shared" />
<Compile Include="$(AzureCoreSharedSources)Multipart\MultipartFormDataContent.cs" LinkBase="Shared" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
using System.Collections.Generic;
using Azure.Core;

namespace Azure.Analytics.Purview.DataMap;

[CodeGenType("PurviewDataMapModelFactory")]
public partial class AnalyticsPurviewDataMapModelFactory
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ public partial class BusinessMetadataOptions

internal virtual RequestContent ToRequestContent()
{
MultipartFormDataContent content = new MultipartFormDataContent();
content.Add(MultipartContent.Create(File), "file", "file.csv", null);
MultiPartFormDataBinaryContent content = new MultiPartFormDataBinaryContent();
content.Add(File, "file", "file.csv", "text/csv");
return content;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#nullable disable

using System;
using System.ClientModel.Primitives;
using System.Collections.Generic;
using System.Text.Json;
using System.Threading;
Expand All @@ -19,24 +20,6 @@ public partial class Entity
// CUSTOM CODE NOTE:
// This file is the central hub of .NET client customization for Purview DataMap.

internal HttpMessage CreateImportBusinessMetadataRequest(RequestContent content, RequestContext context)
{
var message = _pipeline.CreateMessage(context, ResponseClassifier200);
var request = message.Request;
request.Method = RequestMethod.Post;
var uri = new RawRequestUriBuilder();
uri.Reset(_endpoint);
uri.AppendRaw("/datamap/api", false);
uri.AppendPath("/atlas/v2/entity/businessmetadata/import", false);
uri.AppendQuery("api-version", _apiVersion, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
request.Headers.Add("content-type", "multipart/form-data");
request.Content = content;
(content as MultipartFormDataContent).ApplyToRequest(request);
return message;
}

/// <summary> Upload the file for creating Business Metadata in BULK. </summary>
/// <param name="file"> InputStream of file. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
Expand All @@ -45,10 +28,10 @@ public virtual Response<BulkImportResult> ImportBusinessMetadata(BinaryData file
{
Argument.AssertNotNull(file, nameof(file));

RequestContext context = FromCancellationToken(cancellationToken);
BusinessMetadataOptions businessMetadataOptions = new BusinessMetadataOptions(file.ToStream());
using MultipartFormDataRequestContent content = businessMetadataOptions.ToMultipartRequestContent();
RequestContext context = new RequestContext { CancellationToken = cancellationToken };
BusinessMetadataOptions businessMetadataOptions = new BusinessMetadataOptions(file);
using MultiPartFormDataBinaryContent content = (MultiPartFormDataBinaryContent)businessMetadataOptions.ToRequestContent();
Response response = ImportBusinessMetadata(content, content.ContentType, context);
return Response.FromValue(BulkImportResult.FromResponse(response), response);
return Response.FromValue(BulkImportResult.DeserializeBulkImportResult(JsonDocument.Parse(response.Content).RootElement, new ModelReaderWriterOptions("W")), response);
}
}
Loading
Loading