From cc626d49eda62b2789e4c8768d9ef21a48470113 Mon Sep 17 00:00:00 2001 From: pshao25 <97225342+pshao25@users.noreply.github.com> Date: Thu, 11 May 2023 13:30:41 +0800 Subject: [PATCH 1/5] Fix custompage issue when there are two --- .../Emitter.Csharp/src/lib/model.ts | 4 +- .../Emitter.Csharp/src/lib/utils.ts | 20 + .../Pagination-Typespec.tsp | 49 +- .../src/Generated/Docs/PaginationClient.xml | 126 +++++ .../Models/TextBlockItem.Serialization.cs | 54 ++ .../src/Generated/Models/TextBlockItem.cs | 47 ++ .../Models/TextBlocklist.Serialization.cs | 48 ++ .../src/Generated/Models/TextBlocklist.cs | 40 ++ .../src/Generated/PaginationClient.cs | 252 ++++++++++ .../src/Generated/cadl.json | 461 ++++++++++++++++-- .../Samples/Samples_PaginationClient.cs | 154 ++++++ .../Pagination-Typespec/tspconfig.yaml | 3 - 12 files changed, 1220 insertions(+), 38 deletions(-) create mode 100644 test/TestProjects/Pagination-Typespec/src/Generated/Models/TextBlockItem.Serialization.cs create mode 100644 test/TestProjects/Pagination-Typespec/src/Generated/Models/TextBlockItem.cs create mode 100644 test/TestProjects/Pagination-Typespec/src/Generated/Models/TextBlocklist.Serialization.cs create mode 100644 test/TestProjects/Pagination-Typespec/src/Generated/Models/TextBlocklist.cs diff --git a/src/CADL.Extension/Emitter.Csharp/src/lib/model.ts b/src/CADL.Extension/Emitter.Csharp/src/lib/model.ts index ea772906491..a61423000aa 100644 --- a/src/CADL.Extension/Emitter.Csharp/src/lib/model.ts +++ b/src/CADL.Extension/Emitter.Csharp/src/lib/model.ts @@ -66,7 +66,7 @@ import { getSdkSimpleType, isInternal } from "@azure-tools/typespec-client-generator-core"; -import { capitalize } from "./utils.js"; +import { capitalize, templateRename } from "./utils.js"; /** * Map calType to csharp InputTypeKind */ @@ -380,7 +380,7 @@ export function getInputType( function getInputModelForModel(m: Model): InputModelType { m = getEffectiveSchemaType(context, m) as Model; - const name = getFriendlyName(program, m) ?? m.name; + const name = getFriendlyName(program, m) ?? templateRename(m); let model = models.get(name); if (!model) { const baseModel = getInputModelBaseType(m.baseModel); diff --git a/src/CADL.Extension/Emitter.Csharp/src/lib/utils.ts b/src/CADL.Extension/Emitter.Csharp/src/lib/utils.ts index 460e6be1485..d5d34988fe0 100644 --- a/src/CADL.Extension/Emitter.Csharp/src/lib/utils.ts +++ b/src/CADL.Extension/Emitter.Csharp/src/lib/utils.ts @@ -1,3 +1,23 @@ +import { Model } from "@typespec/compiler"; + export function capitalize(str: string): string { return str.charAt(0).toUpperCase() + str.slice(1); } + +export function templateRename(model: Model): string { + if (model.name === "CustomPage") { + const itemType = model.templateMapper?.args[0]; + if (itemType === undefined) { + throw "Item type of a paged model should be Model"; + } + + const itemName = (itemType as Model).name; + if (itemName == null) { + throw "Item type of a paged model should have a name"; + } + + return `Paged${itemName}`; + } + + return model.name; +} diff --git a/test/TestProjects/Pagination-Typespec/Pagination-Typespec.tsp b/test/TestProjects/Pagination-Typespec/Pagination-Typespec.tsp index 340ca33cc77..4fc4e3a4f97 100644 --- a/test/TestProjects/Pagination-Typespec/Pagination-Typespec.tsp +++ b/test/TestProjects/Pagination-Typespec/Pagination-Typespec.tsp @@ -8,6 +8,7 @@ using TypeSpec.Http; using TypeSpec.Rest; using TypeSpec.Versioning; using Azure.Core; +using Azure.Core.Traits; using Azure.ClientGenerator.Core; // @@ -178,6 +179,39 @@ model ListLedgerEntryInput { @body bodyInput: ListLedgerEntryInputBody; } +@doc("Text Blocklist.") +@resource("text/blocklists") +model TextBlocklist { + @doc("Text blocklist name. Only supports the following characters: 0-9 A-Z a-z - . _ ~") + @key("blocklistName") + @visibility("read", "create", "query") + @maxLength(64) + blocklistName: string; + + @doc("Text blocklist description.") + @maxLength(1024) + description?: string; +} + +@doc("Item in TextBlocklist.") +@resource("blockItems") +@parentResource(TextBlocklist) +model TextBlockItem { + @doc("Block Item Id. It will be uuid.") + @key("blockItemId") + @visibility("read", "create", "query") + @maxLength(64) + blockItemId: string; + + @doc("Block item description.") + @maxLength(1024) + description?: string; + + @doc("Block item content.") + @maxLength(128) + text: string; +} + // // ** Operations ** // @@ -187,13 +221,24 @@ namespace Pagination { @summary("Gets ledger entries from a collection corresponding to a range.") @doc("A collection id may optionally be specified. Only entries in the specified (or default) collection will be returned.") - @convenientAPI(true) op ListPaginationLedgerEntries is Azure.Core.Foundations.ResourceList; } @route("/adp") interface UseFoundationsResourceList { @doc("List upload detail for the discovery resource.") - @convenientAPI(true) list is CustomResourceList; } + +interface TwoTypesItem { + @summary("Get All Text Blocklists") + @doc("Get all text blocklists details.") + listTextBlocklists is Azure.Core.ResourceList; + + @summary("Get All BlockItems By blocklistName") + @doc("Get all blockItems in a text blocklist") + listTextBlocklistItems is Azure.Core.ResourceList< + TextBlockItem, + ListQueryParametersTrait + >; +} diff --git a/test/TestProjects/Pagination-Typespec/src/Generated/Docs/PaginationClient.xml b/test/TestProjects/Pagination-Typespec/src/Generated/Docs/PaginationClient.xml index d5eb767a631..493e1ac52d7 100644 --- a/test/TestProjects/Pagination-Typespec/src/Generated/Docs/PaginationClient.xml +++ b/test/TestProjects/Pagination-Typespec/src/Generated/Docs/PaginationClient.xml @@ -139,6 +139,132 @@ foreach (var item in client.GetLedgerEntries(new RequestContext())) Console.WriteLine(result.GetProperty("transactionId").ToString()); } ]]> + + + + +This sample shows how to call GetTextBlocklistsAsync. +"); +var client = new PaginationClient(endpoint, credential); + +await foreach (var item in client.GetTextBlocklistsAsync()) +{ +} +]]> + + + + +This sample shows how to call GetTextBlocklists. +"); +var client = new PaginationClient(endpoint, credential); + +foreach (var item in client.GetTextBlocklists()) +{ +} +]]> + + + + +This sample shows how to call GetTextBlocklistsAsync with required parameters and parse the result. +"); +var client = new PaginationClient(endpoint, credential); + +await foreach (var item in client.GetTextBlocklistsAsync(new RequestContext())) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("blocklistName").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); +} +]]> + + + + +This sample shows how to call GetTextBlocklists with required parameters and parse the result. +"); +var client = new PaginationClient(endpoint, credential); + +foreach (var item in client.GetTextBlocklists(new RequestContext())) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("blocklistName").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); +} +]]> + + + + +This sample shows how to call GetTextBlocklistItemsAsync with required parameters. +"); +var client = new PaginationClient(endpoint, credential); + +await foreach (var item in client.GetTextBlocklistItemsAsync("", 1234, 1234, 1234)) +{ +} +]]> + + + + +This sample shows how to call GetTextBlocklistItems with required parameters. +"); +var client = new PaginationClient(endpoint, credential); + +foreach (var item in client.GetTextBlocklistItems("", 1234, 1234, 1234)) +{ +} +]]> + + + + +This sample shows how to call GetTextBlocklistItemsAsync with required parameters and parse the result. +"); +var client = new PaginationClient(endpoint, credential); + +await foreach (var item in client.GetTextBlocklistItemsAsync("", 1234, 1234, 1234, new RequestContext())) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("blockItemId").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("text").ToString()); +} +]]> + + + + +This sample shows how to call GetTextBlocklistItems with required parameters and parse the result. +"); +var client = new PaginationClient(endpoint, credential); + +foreach (var item in client.GetTextBlocklistItems("", 1234, 1234, 1234, new RequestContext())) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("blockItemId").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("text").ToString()); +} +]]> diff --git a/test/TestProjects/Pagination-Typespec/src/Generated/Models/TextBlockItem.Serialization.cs b/test/TestProjects/Pagination-Typespec/src/Generated/Models/TextBlockItem.Serialization.cs new file mode 100644 index 00000000000..959d10574a3 --- /dev/null +++ b/test/TestProjects/Pagination-Typespec/src/Generated/Models/TextBlockItem.Serialization.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Pagination.Models +{ + public partial class TextBlockItem + { + internal static TextBlockItem DeserializeTextBlockItem(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string blockItemId = default; + Optional description = default; + string text = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("blockItemId"u8)) + { + blockItemId = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("text"u8)) + { + text = property.Value.GetString(); + continue; + } + } + return new TextBlockItem(blockItemId, description, text); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TextBlockItem FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTextBlockItem(document.RootElement); + } + } +} diff --git a/test/TestProjects/Pagination-Typespec/src/Generated/Models/TextBlockItem.cs b/test/TestProjects/Pagination-Typespec/src/Generated/Models/TextBlockItem.cs new file mode 100644 index 00000000000..6e68285148e --- /dev/null +++ b/test/TestProjects/Pagination-Typespec/src/Generated/Models/TextBlockItem.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Pagination.Models +{ + /// Item in TextBlocklist. + public partial class TextBlockItem + { + /// Initializes a new instance of TextBlockItem. + /// Block Item Id. It will be uuid. + /// Block item content. + /// or is null. + internal TextBlockItem(string blockItemId, string text) + { + Argument.AssertNotNull(blockItemId, nameof(blockItemId)); + Argument.AssertNotNull(text, nameof(text)); + + BlockItemId = blockItemId; + Text = text; + } + + /// Initializes a new instance of TextBlockItem. + /// Block Item Id. It will be uuid. + /// Block item description. + /// Block item content. + internal TextBlockItem(string blockItemId, string description, string text) + { + BlockItemId = blockItemId; + Description = description; + Text = text; + } + + /// Block Item Id. It will be uuid. + public string BlockItemId { get; } + /// Block item description. + public string Description { get; } + /// Block item content. + public string Text { get; } + } +} diff --git a/test/TestProjects/Pagination-Typespec/src/Generated/Models/TextBlocklist.Serialization.cs b/test/TestProjects/Pagination-Typespec/src/Generated/Models/TextBlocklist.Serialization.cs new file mode 100644 index 00000000000..87d08c4295c --- /dev/null +++ b/test/TestProjects/Pagination-Typespec/src/Generated/Models/TextBlocklist.Serialization.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Pagination.Models +{ + public partial class TextBlocklist + { + internal static TextBlocklist DeserializeTextBlocklist(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string blocklistName = default; + Optional description = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("blocklistName"u8)) + { + blocklistName = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + } + return new TextBlocklist(blocklistName, description); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TextBlocklist FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTextBlocklist(document.RootElement); + } + } +} diff --git a/test/TestProjects/Pagination-Typespec/src/Generated/Models/TextBlocklist.cs b/test/TestProjects/Pagination-Typespec/src/Generated/Models/TextBlocklist.cs new file mode 100644 index 00000000000..0e76db1a30c --- /dev/null +++ b/test/TestProjects/Pagination-Typespec/src/Generated/Models/TextBlocklist.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Pagination.Models +{ + /// Text Blocklist. + public partial class TextBlocklist + { + /// Initializes a new instance of TextBlocklist. + /// Text blocklist name. Only supports the following characters: 0-9 A-Z a-z - . _ ~. + /// is null. + internal TextBlocklist(string blocklistName) + { + Argument.AssertNotNull(blocklistName, nameof(blocklistName)); + + BlocklistName = blocklistName; + } + + /// Initializes a new instance of TextBlocklist. + /// Text blocklist name. Only supports the following characters: 0-9 A-Z a-z - . _ ~. + /// Text blocklist description. + internal TextBlocklist(string blocklistName, string description) + { + BlocklistName = blocklistName; + Description = description; + } + + /// Text blocklist name. Only supports the following characters: 0-9 A-Z a-z - . _ ~. + public string BlocklistName { get; } + /// Text blocklist description. + public string Description { get; } + } +} diff --git a/test/TestProjects/Pagination-Typespec/src/Generated/PaginationClient.cs b/test/TestProjects/Pagination-Typespec/src/Generated/PaginationClient.cs index 4e189bfaa1b..532ac373811 100644 --- a/test/TestProjects/Pagination-Typespec/src/Generated/PaginationClient.cs +++ b/test/TestProjects/Pagination-Typespec/src/Generated/PaginationClient.cs @@ -229,6 +229,190 @@ public virtual Pageable GetLedgerEntries(RequestContext context) return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "PaginationClient.GetLedgerEntries", "value", "nextLink", context); } + /// Get All Text Blocklists. + /// The cancellation token to use. + /// Get all text blocklists details. + /// + public virtual AsyncPageable GetTextBlocklistsAsync(CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTextBlocklistsRequest(context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTextBlocklistsNextPageRequest(nextLink, context); + return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, TextBlocklist.DeserializeTextBlocklist, ClientDiagnostics, _pipeline, "PaginationClient.GetTextBlocklists", "value", "nextLink", context); + } + + /// Get All Text Blocklists. + /// The cancellation token to use. + /// Get all text blocklists details. + /// + public virtual Pageable GetTextBlocklists(CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTextBlocklistsRequest(context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTextBlocklistsNextPageRequest(nextLink, context); + return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, TextBlocklist.DeserializeTextBlocklist, ClientDiagnostics, _pipeline, "PaginationClient.GetTextBlocklists", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Get All Text Blocklists + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetTextBlocklistsAsync(RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTextBlocklistsRequest(context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTextBlocklistsNextPageRequest(nextLink, context); + return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "PaginationClient.GetTextBlocklists", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Get All Text Blocklists + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetTextBlocklists(RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTextBlocklistsRequest(context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTextBlocklistsNextPageRequest(nextLink, context); + return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "PaginationClient.GetTextBlocklists", "value", "nextLink", context); + } + + /// Get All BlockItems By blocklistName. + /// Text blocklist name. Only supports the following characters: 0-9 A-Z a-z - . _ ~. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Get all blockItems in a text blocklist. + /// + public virtual AsyncPageable GetTextBlocklistItemsAsync(string blocklistName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(blocklistName, nameof(blocklistName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTextBlocklistItemsRequest(blocklistName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTextBlocklistItemsNextPageRequest(nextLink, blocklistName, maxCount, skip, maxpagesize, context); + return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, TextBlockItem.DeserializeTextBlockItem, ClientDiagnostics, _pipeline, "PaginationClient.GetTextBlocklistItems", "value", "nextLink", context); + } + + /// Get All BlockItems By blocklistName. + /// Text blocklist name. Only supports the following characters: 0-9 A-Z a-z - . _ ~. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Get all blockItems in a text blocklist. + /// + public virtual Pageable GetTextBlocklistItems(string blocklistName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(blocklistName, nameof(blocklistName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTextBlocklistItemsRequest(blocklistName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTextBlocklistItemsNextPageRequest(nextLink, blocklistName, maxCount, skip, maxpagesize, context); + return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, TextBlockItem.DeserializeTextBlockItem, ClientDiagnostics, _pipeline, "PaginationClient.GetTextBlocklistItems", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Get All BlockItems By blocklistName + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Text blocklist name. Only supports the following characters: 0-9 A-Z a-z - . _ ~. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetTextBlocklistItemsAsync(string blocklistName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(blocklistName, nameof(blocklistName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTextBlocklistItemsRequest(blocklistName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTextBlocklistItemsNextPageRequest(nextLink, blocklistName, maxCount, skip, maxpagesize, context); + return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "PaginationClient.GetTextBlocklistItems", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Get All BlockItems By blocklistName + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Text blocklist name. Only supports the following characters: 0-9 A-Z a-z - . _ ~. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetTextBlocklistItems(string blocklistName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(blocklistName, nameof(blocklistName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTextBlocklistItemsRequest(blocklistName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTextBlocklistItemsNextPageRequest(nextLink, blocklistName, maxCount, skip, maxpagesize, context); + return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "PaginationClient.GetTextBlocklistItems", "value", "nextLink", context); + } + internal HttpMessage CreateGetPaginationLedgerEntriesRequest(RequestContent content, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); @@ -259,6 +443,48 @@ internal HttpMessage CreateGetLedgerEntriesRequest(RequestContext context) return message; } + internal HttpMessage CreateGetTextBlocklistsRequest(RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/app/text/blocklists", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTextBlocklistItemsRequest(string blocklistName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/app/text/blocklists/", false); + uri.AppendPath(blocklistName, true); + uri.AppendPath("/blockItems", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + internal HttpMessage CreateGetPaginationLedgerEntriesNextPageRequest(string nextLink, RequestContent content, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); @@ -285,6 +511,32 @@ internal HttpMessage CreateGetLedgerEntriesNextPageRequest(string nextLink, Requ return message; } + internal HttpMessage CreateGetTextBlocklistsNextPageRequest(string nextLink, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTextBlocklistItemsNextPageRequest(string nextLink, string blocklistName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + private static RequestContext DefaultRequestContext = new RequestContext(); internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) { diff --git a/test/TestProjects/Pagination-Typespec/src/Generated/cadl.json b/test/TestProjects/Pagination-Typespec/src/Generated/cadl.json index 07f563a778a..dc05448a869 100644 --- a/test/TestProjects/Pagination-Typespec/src/Generated/cadl.json +++ b/test/TestProjects/Pagination-Typespec/src/Generated/cadl.json @@ -183,27 +183,206 @@ "IsDiscriminator": false } ] + }, + { + "$id": "24", + "Name": "PagedTextBlocklist", + "Namespace": "Azure.Core.Foundations", + "Description": "Paged collection of TextBlocklist items", + "IsNullable": false, + "Usage": "None", + "Properties": [ + { + "$id": "25", + "Name": "value", + "SerializedName": "value", + "Description": "The TextBlocklist items on this page", + "Type": { + "$id": "26", + "Name": "Array", + "ElementType": { + "$id": "27", + "Name": "TextBlocklist", + "Namespace": "Pagination", + "Description": "Text Blocklist.", + "IsNullable": false, + "Usage": "Output", + "Properties": [ + { + "$id": "28", + "Name": "blocklistName", + "SerializedName": "blocklistName", + "Description": "Text blocklist name. Only supports the following characters: 0-9 A-Z a-z - . _ ~", + "Type": { + "$id": "29", + "Name": "string", + "Kind": "String", + "IsNullable": false + }, + "IsRequired": true, + "IsReadOnly": false, + "IsDiscriminator": false + }, + { + "$id": "30", + "Name": "description", + "SerializedName": "description", + "Description": "Text blocklist description.", + "Type": { + "$id": "31", + "Name": "string", + "Kind": "String", + "IsNullable": false + }, + "IsRequired": false, + "IsReadOnly": false, + "IsDiscriminator": false + } + ] + }, + "IsNullable": false + }, + "IsRequired": true, + "IsReadOnly": false, + "IsDiscriminator": false + }, + { + "$id": "32", + "Name": "nextLink", + "SerializedName": "nextLink", + "Description": "The link to the next page of items", + "Type": { + "$id": "33", + "Name": "ResourceLocation", + "Kind": "String", + "IsNullable": false + }, + "IsRequired": false, + "IsReadOnly": false, + "IsDiscriminator": false + } + ] + }, + { + "$ref": "27" + }, + { + "$id": "34", + "Name": "PagedTextBlockItem", + "Namespace": "Azure.Core.Foundations", + "Description": "Paged collection of TextBlockItem items", + "IsNullable": false, + "Usage": "None", + "Properties": [ + { + "$id": "35", + "Name": "value", + "SerializedName": "value", + "Description": "The TextBlockItem items on this page", + "Type": { + "$id": "36", + "Name": "Array", + "ElementType": { + "$id": "37", + "Name": "TextBlockItem", + "Namespace": "Pagination", + "Description": "Item in TextBlocklist.", + "IsNullable": false, + "Usage": "Output", + "Properties": [ + { + "$id": "38", + "Name": "blockItemId", + "SerializedName": "blockItemId", + "Description": "Block Item Id. It will be uuid.", + "Type": { + "$id": "39", + "Name": "string", + "Kind": "String", + "IsNullable": false + }, + "IsRequired": true, + "IsReadOnly": false, + "IsDiscriminator": false + }, + { + "$id": "40", + "Name": "description", + "SerializedName": "description", + "Description": "Block item description.", + "Type": { + "$id": "41", + "Name": "string", + "Kind": "String", + "IsNullable": false + }, + "IsRequired": false, + "IsReadOnly": false, + "IsDiscriminator": false + }, + { + "$id": "42", + "Name": "text", + "SerializedName": "text", + "Description": "Block item content.", + "Type": { + "$id": "43", + "Name": "string", + "Kind": "String", + "IsNullable": false + }, + "IsRequired": true, + "IsReadOnly": false, + "IsDiscriminator": false + } + ] + }, + "IsNullable": false + }, + "IsRequired": true, + "IsReadOnly": false, + "IsDiscriminator": false + }, + { + "$id": "44", + "Name": "nextLink", + "SerializedName": "nextLink", + "Description": "The link to the next page of items", + "Type": { + "$id": "45", + "Name": "ResourceLocation", + "Kind": "String", + "IsNullable": false + }, + "IsRequired": false, + "IsReadOnly": false, + "IsDiscriminator": false + } + ] + }, + { + "$ref": "37" } ], "Clients": [ { - "$id": "24", + "$id": "46", "Name": "PaginationClient", "Description": "", "Operations": [ { - "$id": "25", + "$id": "47", "Name": "ListPaginationLedgerEntries", "ResourceName": "LedgerEntry", "Summary": "Gets ledger entries from a collection corresponding to a range.", "Description": "A collection id may optionally be specified. Only entries in the specified (or default) collection will be returned.", "Parameters": [ { - "$id": "26", + "$id": "48", "Name": "pagnationUri", "NameInRequest": "pagnationUri", "Type": { - "$id": "27", + "$id": "49", "Name": "Uri", "Kind": "Uri", "IsNullable": false @@ -219,12 +398,12 @@ "Kind": "Client" }, { - "$id": "28", + "$id": "50", "Name": "apiVersion", "NameInRequest": "api-version", "Description": "", "Type": { - "$id": "29", + "$id": "51", "Name": "String", "Kind": "String", "IsNullable": false @@ -239,9 +418,9 @@ "Explode": false, "Kind": "Client", "DefaultValue": { - "$id": "30", + "$id": "52", "Type": { - "$id": "31", + "$id": "53", "Name": "String", "Kind": "String", "IsNullable": false @@ -250,7 +429,7 @@ } }, { - "$id": "32", + "$id": "54", "Name": "bodyInput", "NameInRequest": "bodyInput", "Description": "Body parameter", @@ -268,11 +447,11 @@ "Kind": "Method" }, { - "$id": "33", + "$id": "55", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "34", + "$id": "56", "Name": "String", "Kind": "String", "IsNullable": false @@ -287,19 +466,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "35", + "$id": "57", "Type": { - "$ref": "34" + "$ref": "56" }, "Value": "application/json" } }, { - "$id": "36", + "$id": "58", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "37", + "$id": "59", "Name": "String", "Kind": "String", "IsNullable": false @@ -314,9 +493,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "38", + "$id": "60", "Type": { - "$ref": "37" + "$ref": "59" }, "Value": "application/json" } @@ -324,7 +503,7 @@ ], "Responses": [ { - "$id": "39", + "$id": "61", "StatusCodes": [ 200 ], @@ -345,7 +524,7 @@ ], "BufferResponse": true, "Paging": { - "$id": "40", + "$id": "62", "NextLinkName": "customNextLink", "ItemName": "entries" }, @@ -353,23 +532,23 @@ "GenerateConvenienceMethod": true }, { - "$id": "41", + "$id": "63", "Name": "list", "ResourceName": "LedgerEntry", "Description": "List upload detail for the discovery resource.", "Parameters": [ { - "$ref": "26" + "$ref": "48" }, { - "$ref": "28" + "$ref": "50" }, { - "$id": "42", + "$id": "64", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "43", + "$id": "65", "Name": "String", "Kind": "String", "IsNullable": false @@ -384,9 +563,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "44", + "$id": "66", "Type": { - "$ref": "43" + "$ref": "65" }, "Value": "application/json" } @@ -394,7 +573,7 @@ ], "Responses": [ { - "$id": "45", + "$id": "67", "StatusCodes": [ 200 ], @@ -412,7 +591,227 @@ "Path": "/app/adp/transactions", "BufferResponse": true, "Paging": { - "$id": "46", + "$id": "68", + "NextLinkName": "nextLink", + "ItemName": "value" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true + }, + { + "$id": "69", + "Name": "listTextBlocklists", + "ResourceName": "TextBlocklist", + "Summary": "Get All Text Blocklists", + "Description": "Get all text blocklists details.", + "Parameters": [ + { + "$ref": "48" + }, + { + "$ref": "50" + }, + { + "$id": "70", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "71", + "Name": "String", + "Kind": "String", + "IsNullable": false + }, + "Location": "Header", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Constant", + "DefaultValue": { + "$id": "72", + "Type": { + "$ref": "71" + }, + "Value": "application/json" + } + } + ], + "Responses": [ + { + "$id": "73", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "24" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{pagnationUri}", + "Path": "/app/text/blocklists", + "BufferResponse": true, + "Paging": { + "$id": "74", + "NextLinkName": "nextLink", + "ItemName": "value" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true + }, + { + "$id": "75", + "Name": "listTextBlocklistItems", + "ResourceName": "TextBlockItem", + "Summary": "Get All BlockItems By blocklistName", + "Description": "Get all blockItems in a text blocklist", + "Parameters": [ + { + "$ref": "48" + }, + { + "$ref": "50" + }, + { + "$id": "76", + "Name": "blocklistName", + "NameInRequest": "blocklistName", + "Description": "Text blocklist name. Only supports the following characters: 0-9 A-Z a-z - . _ ~", + "Type": { + "$id": "77", + "Name": "string", + "Kind": "String", + "IsNullable": false + }, + "Location": "Path", + "IsRequired": true, + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Method" + }, + { + "$id": "78", + "Name": "top", + "NameInRequest": "top", + "Description": "The number of result items to return.", + "Type": { + "$id": "79", + "Name": "int32", + "Kind": "Int32", + "IsNullable": false + }, + "Location": "Query", + "IsRequired": false, + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Method" + }, + { + "$id": "80", + "Name": "skip", + "NameInRequest": "skip", + "Description": "The number of result items to skip.", + "Type": { + "$id": "81", + "Name": "int32", + "Kind": "Int32", + "IsNullable": false + }, + "Location": "Query", + "IsRequired": false, + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Method" + }, + { + "$id": "82", + "Name": "maxpagesize", + "NameInRequest": "maxpagesize", + "Description": "The maximum number of result items per page.", + "Type": { + "$id": "83", + "Name": "int32", + "Kind": "Int32", + "IsNullable": false + }, + "Location": "Query", + "IsRequired": false, + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Method" + }, + { + "$id": "84", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "85", + "Name": "String", + "Kind": "String", + "IsNullable": false + }, + "Location": "Header", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Constant", + "DefaultValue": { + "$id": "86", + "Type": { + "$ref": "85" + }, + "Value": "application/json" + } + } + ], + "Responses": [ + { + "$id": "87", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "34" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{pagnationUri}", + "Path": "/app/text/blocklists/{blocklistName}/blockItems", + "BufferResponse": true, + "Paging": { + "$id": "88", "NextLinkName": "nextLink", "ItemName": "value" }, @@ -421,15 +820,15 @@ } ], "Protocol": { - "$id": "47" + "$id": "89" }, "Creatable": true } ], "Auth": { - "$id": "48", + "$id": "90", "OAuth2": { - "$id": "49", + "$id": "91", "Scopes": [ "https://pagination.azure.com/.default" ] diff --git a/test/TestProjects/Pagination-Typespec/tests/Generated/Samples/Samples_PaginationClient.cs b/test/TestProjects/Pagination-Typespec/tests/Generated/Samples/Samples_PaginationClient.cs index 9caf91121aa..02f619801f3 100644 --- a/test/TestProjects/Pagination-Typespec/tests/Generated/Samples/Samples_PaginationClient.cs +++ b/test/TestProjects/Pagination-Typespec/tests/Generated/Samples/Samples_PaginationClient.cs @@ -206,5 +206,159 @@ public async Task Example_GetLedgerEntries_Convenience_Async() { } } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetTextBlocklists() + { + var credential = new DefaultAzureCredential(); + var endpoint = new Uri(""); + var client = new PaginationClient(endpoint, credential); + + foreach (var item in client.GetTextBlocklists(new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("blocklistName").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetTextBlocklists_AllParameters() + { + var credential = new DefaultAzureCredential(); + var endpoint = new Uri(""); + var client = new PaginationClient(endpoint, credential); + + foreach (var item in client.GetTextBlocklists(new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("blocklistName").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetTextBlocklists_Async() + { + var credential = new DefaultAzureCredential(); + var endpoint = new Uri(""); + var client = new PaginationClient(endpoint, credential); + + await foreach (var item in client.GetTextBlocklistsAsync(new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("blocklistName").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetTextBlocklists_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var endpoint = new Uri(""); + var client = new PaginationClient(endpoint, credential); + + await foreach (var item in client.GetTextBlocklistsAsync(new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("blocklistName").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetTextBlocklists_Convenience_Async() + { + var credential = new DefaultAzureCredential(); + var endpoint = new Uri(""); + var client = new PaginationClient(endpoint, credential); + + await foreach (var item in client.GetTextBlocklistsAsync()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetTextBlocklistItems() + { + var credential = new DefaultAzureCredential(); + var endpoint = new Uri(""); + var client = new PaginationClient(endpoint, credential); + + foreach (var item in client.GetTextBlocklistItems("", 1234, 1234, 1234, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("blockItemId").ToString()); + Console.WriteLine(result.GetProperty("text").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetTextBlocklistItems_AllParameters() + { + var credential = new DefaultAzureCredential(); + var endpoint = new Uri(""); + var client = new PaginationClient(endpoint, credential); + + foreach (var item in client.GetTextBlocklistItems("", 1234, 1234, 1234, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("blockItemId").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("text").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetTextBlocklistItems_Async() + { + var credential = new DefaultAzureCredential(); + var endpoint = new Uri(""); + var client = new PaginationClient(endpoint, credential); + + await foreach (var item in client.GetTextBlocklistItemsAsync("", 1234, 1234, 1234, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("blockItemId").ToString()); + Console.WriteLine(result.GetProperty("text").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetTextBlocklistItems_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var endpoint = new Uri(""); + var client = new PaginationClient(endpoint, credential); + + await foreach (var item in client.GetTextBlocklistItemsAsync("", 1234, 1234, 1234, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("blockItemId").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("text").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetTextBlocklistItems_Convenience_Async() + { + var credential = new DefaultAzureCredential(); + var endpoint = new Uri(""); + var client = new PaginationClient(endpoint, credential); + + await foreach (var item in client.GetTextBlocklistItemsAsync("", 1234, 1234, 1234)) + { + } + } } } diff --git a/test/TestProjects/Pagination-Typespec/tspconfig.yaml b/test/TestProjects/Pagination-Typespec/tspconfig.yaml index b74ff790d83..e69de29bb2d 100644 --- a/test/TestProjects/Pagination-Typespec/tspconfig.yaml +++ b/test/TestProjects/Pagination-Typespec/tspconfig.yaml @@ -1,3 +0,0 @@ -options: - "@azure-tools/typespec-csharp": - generate-convenience-methods: false From 67cdf67c4c4a772a2bd0cf17163f71cbdccc9103 Mon Sep 17 00:00:00 2001 From: pshao25 <97225342+pshao25@users.noreply.github.com> Date: Thu, 11 May 2023 15:01:48 +0800 Subject: [PATCH 2/5] Update --- .../pagination/Generated/cadl.json | 4 +- .../azure/core/basic/src/Generated/cadl.json | 290 ++++---- .../src/Generated/Docs/AuthoringClient.xml | 24 +- .../src/Generated/cadl.json | 690 ++++++++++-------- .../Samples/Samples_AuthoringClient.cs | 42 +- .../src/Generated/cadl.json | 2 +- .../Generated/Docs/RenameGetListClient.xml | 24 +- .../src/Generated/cadl.json | 142 ++-- .../Samples/Samples_RenameGetListClient.cs | 42 +- 9 files changed, 597 insertions(+), 663 deletions(-) diff --git a/src/CADL.Extension/Emitter.Csharp/test/TestProjects/pagination/Generated/cadl.json b/src/CADL.Extension/Emitter.Csharp/test/TestProjects/pagination/Generated/cadl.json index 7a5c6f7c0b6..20aa5fd3895 100644 --- a/src/CADL.Extension/Emitter.Csharp/test/TestProjects/pagination/Generated/cadl.json +++ b/src/CADL.Extension/Emitter.Csharp/test/TestProjects/pagination/Generated/cadl.json @@ -8,11 +8,11 @@ "Models": [ { "$id": "2", - "Name": "CustomPage", + "Name": "PagedLedgerEntry", "Namespace": "Azure.Core.Foundations", "Description": "Paged collection of LedgerEntry items", "IsNullable": false, - "Usage": "Output", + "Usage": "None", "Properties": [ { "$id": "3", diff --git a/test/CadlRanchProjects/azure/core/basic/src/Generated/cadl.json b/test/CadlRanchProjects/azure/core/basic/src/Generated/cadl.json index 888e80aba21..893226cf469 100644 --- a/test/CadlRanchProjects/azure/core/basic/src/Generated/cadl.json +++ b/test/CadlRanchProjects/azure/core/basic/src/Generated/cadl.json @@ -136,7 +136,7 @@ }, { "$id": "18", - "Name": "CustomPage", + "Name": "PagedUser", "Namespace": "Azure.Core.Foundations", "Description": "Paged collection of User items", "IsNullable": false, @@ -178,60 +178,18 @@ }, { "$id": "23", - "Name": "PagedUser", - "Namespace": "Azure.Core", - "Description": "Paged collection of User items", - "IsNullable": false, - "Usage": "Output", - "Properties": [ - { - "$id": "24", - "Name": "value", - "SerializedName": "value", - "Description": "The User items on this page", - "Type": { - "$id": "25", - "Name": "Array", - "ElementType": { - "$ref": "2" - }, - "IsNullable": false - }, - "IsRequired": true, - "IsReadOnly": false, - "IsDiscriminator": false - }, - { - "$id": "26", - "Name": "nextLink", - "SerializedName": "nextLink", - "Description": "The link to the next page of items", - "Type": { - "$id": "27", - "Name": "ResourceLocation", - "Kind": "String", - "IsNullable": false - }, - "IsRequired": false, - "IsReadOnly": false, - "IsDiscriminator": false - } - ] - }, - { - "$id": "28", "Name": "UserListResults", "Namespace": "_Specs_.Azure.Core.Basic", "IsNullable": false, "Usage": "Output", "Properties": [ { - "$id": "29", + "$id": "24", "Name": "items", "SerializedName": "items", "Description": "List of items.", "Type": { - "$id": "30", + "$id": "25", "Name": "Array", "ElementType": { "$ref": "2" @@ -243,12 +201,12 @@ "IsDiscriminator": false }, { - "$id": "31", + "$id": "26", "Name": "nextLink", "SerializedName": "nextLink", "Description": "Link to fetch more items.", "Type": { - "$id": "32", + "$id": "27", "Name": "string", "Kind": "String", "IsNullable": false @@ -262,24 +220,24 @@ ], "Clients": [ { - "$id": "33", + "$id": "28", "Name": "BasicClient", "Description": "Illustrates bodies templated with Azure Core", "Operations": [ { - "$id": "34", + "$id": "29", "Name": "createOrUpdate", "ResourceName": "User", "Summary": "Adds a user or updates a user's fields.", "Description": "Creates or updates a User", "Parameters": [ { - "$id": "35", + "$id": "30", "Name": "host", "NameInRequest": "host", "Description": "TestServer endpoint", "Type": { - "$id": "36", + "$id": "31", "Name": "String", "Kind": "String", "IsNullable": false @@ -294,9 +252,9 @@ "Explode": false, "Kind": "Client", "DefaultValue": { - "$id": "37", + "$id": "32", "Type": { - "$id": "38", + "$id": "33", "Name": "String", "Kind": "String", "IsNullable": false @@ -305,12 +263,12 @@ } }, { - "$id": "39", + "$id": "34", "Name": "apiVersion", "NameInRequest": "api-version", "Description": "", "Type": { - "$id": "40", + "$id": "35", "Name": "String", "Kind": "String", "IsNullable": false @@ -325,9 +283,9 @@ "Explode": false, "Kind": "Client", "DefaultValue": { - "$id": "41", + "$id": "36", "Type": { - "$id": "42", + "$id": "37", "Name": "String", "Kind": "String", "IsNullable": false @@ -336,12 +294,12 @@ } }, { - "$id": "43", + "$id": "38", "Name": "id", "NameInRequest": "id", "Description": "The user's id.", "Type": { - "$id": "44", + "$id": "39", "Name": "int32", "Kind": "Int32", "IsNullable": false @@ -357,15 +315,15 @@ "Kind": "Method" }, { - "$id": "45", + "$id": "40", "Name": "contentType", "NameInRequest": "Content-Type", "Description": "This request has a JSON Merge Patch body.", "Type": { - "$id": "46", + "$id": "41", "Name": "Literal", "LiteralValueType": { - "$id": "47", + "$id": "42", "Name": "String", "Kind": "String", "IsNullable": false @@ -375,9 +333,9 @@ }, "Location": "Header", "DefaultValue": { - "$id": "48", + "$id": "43", "Type": { - "$ref": "46" + "$ref": "41" }, "Value": "application/merge-patch+json" }, @@ -391,7 +349,7 @@ "Kind": "Constant" }, { - "$id": "49", + "$id": "44", "Name": "resource", "NameInRequest": "resource", "Description": "The resource instance.", @@ -409,11 +367,11 @@ "Kind": "Method" }, { - "$id": "50", + "$id": "45", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "51", + "$id": "46", "Name": "String", "Kind": "String", "IsNullable": false @@ -428,9 +386,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "52", + "$id": "47", "Type": { - "$ref": "51" + "$ref": "46" }, "Value": "application/json" } @@ -438,7 +396,7 @@ ], "Responses": [ { - "$id": "53", + "$id": "48", "StatusCodes": [ 200 ], @@ -450,7 +408,7 @@ "IsErrorResponse": false }, { - "$id": "54", + "$id": "49", "StatusCodes": [ 201 ], @@ -474,25 +432,25 @@ "GenerateConvenienceMethod": false }, { - "$id": "55", + "$id": "50", "Name": "createOrReplace", "ResourceName": "User", "Summary": "Adds a user or replaces a user's fields.", "Description": "Creates or replaces a User", "Parameters": [ { - "$ref": "35" + "$ref": "30" }, { - "$ref": "39" + "$ref": "34" }, { - "$id": "56", + "$id": "51", "Name": "id", "NameInRequest": "id", "Description": "The user's id.", "Type": { - "$id": "57", + "$id": "52", "Name": "int32", "Kind": "Int32", "IsNullable": false @@ -508,7 +466,7 @@ "Kind": "Method" }, { - "$id": "58", + "$id": "53", "Name": "resource", "NameInRequest": "resource", "Description": "The resource instance.", @@ -526,11 +484,11 @@ "Kind": "Method" }, { - "$id": "59", + "$id": "54", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "60", + "$id": "55", "Name": "String", "Kind": "String", "IsNullable": false @@ -545,19 +503,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "61", + "$id": "56", "Type": { - "$ref": "60" + "$ref": "55" }, "Value": "application/json" } }, { - "$id": "62", + "$id": "57", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "63", + "$id": "58", "Name": "String", "Kind": "String", "IsNullable": false @@ -572,9 +530,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "64", + "$id": "59", "Type": { - "$ref": "63" + "$ref": "58" }, "Value": "application/json" } @@ -582,7 +540,7 @@ ], "Responses": [ { - "$id": "65", + "$id": "60", "StatusCodes": [ 200 ], @@ -594,7 +552,7 @@ "IsErrorResponse": false }, { - "$id": "66", + "$id": "61", "StatusCodes": [ 201 ], @@ -618,25 +576,25 @@ "GenerateConvenienceMethod": true }, { - "$id": "67", + "$id": "62", "Name": "get", "ResourceName": "User", "Summary": "Gets a user.", "Description": "Gets a User", "Parameters": [ { - "$ref": "35" + "$ref": "30" }, { - "$ref": "39" + "$ref": "34" }, { - "$id": "68", + "$id": "63", "Name": "id", "NameInRequest": "id", "Description": "The user's id.", "Type": { - "$id": "69", + "$id": "64", "Name": "int32", "Kind": "Int32", "IsNullable": false @@ -652,11 +610,11 @@ "Kind": "Method" }, { - "$id": "70", + "$id": "65", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "71", + "$id": "66", "Name": "String", "Kind": "String", "IsNullable": false @@ -671,9 +629,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "72", + "$id": "67", "Type": { - "$ref": "71" + "$ref": "66" }, "Value": "application/json" } @@ -681,7 +639,7 @@ ], "Responses": [ { - "$id": "73", + "$id": "68", "StatusCodes": [ 200 ], @@ -702,25 +660,25 @@ "GenerateConvenienceMethod": true }, { - "$id": "74", + "$id": "69", "Name": "list", "ResourceName": "User", "Summary": "Lists all users.", "Description": "Lists all Users", "Parameters": [ { - "$ref": "35" + "$ref": "30" }, { - "$ref": "39" + "$ref": "34" }, { - "$id": "75", + "$id": "70", "Name": "top", "NameInRequest": "top", "Description": "The number of result items to return.", "Type": { - "$id": "76", + "$id": "71", "Name": "int32", "Kind": "Int32", "IsNullable": false @@ -736,12 +694,12 @@ "Kind": "Method" }, { - "$id": "77", + "$id": "72", "Name": "skip", "NameInRequest": "skip", "Description": "The number of result items to skip.", "Type": { - "$id": "78", + "$id": "73", "Name": "int32", "Kind": "Int32", "IsNullable": false @@ -757,12 +715,12 @@ "Kind": "Method" }, { - "$id": "79", + "$id": "74", "Name": "maxpagesize", "NameInRequest": "maxpagesize", "Description": "The maximum number of result items per page.", "Type": { - "$id": "80", + "$id": "75", "Name": "int32", "Kind": "Int32", "IsNullable": false @@ -778,15 +736,15 @@ "Kind": "Method" }, { - "$id": "81", + "$id": "76", "Name": "orderby", "NameInRequest": "orderby", "Description": "Expressions that specify the order of returned results.", "Type": { - "$id": "82", + "$id": "77", "Name": "Array", "ElementType": { - "$id": "83", + "$id": "78", "Name": "string", "Kind": "String", "IsNullable": false @@ -804,12 +762,12 @@ "Kind": "Method" }, { - "$id": "84", + "$id": "79", "Name": "filter", "NameInRequest": "filter", "Description": "Filter the result list using the given expression.", "Type": { - "$id": "85", + "$id": "80", "Name": "string", "Kind": "String", "IsNullable": false @@ -825,15 +783,15 @@ "Kind": "Method" }, { - "$id": "86", + "$id": "81", "Name": "select", "NameInRequest": "select", "Description": "Select the specified fields to be included in the response.", "Type": { - "$id": "87", + "$id": "82", "Name": "Array", "ElementType": { - "$id": "88", + "$id": "83", "Name": "string", "Kind": "String", "IsNullable": false @@ -851,15 +809,15 @@ "Kind": "Method" }, { - "$id": "89", + "$id": "84", "Name": "expand", "NameInRequest": "expand", "Description": "Expand the indicated resources into the response.", "Type": { - "$id": "90", + "$id": "85", "Name": "Array", "ElementType": { - "$id": "91", + "$id": "86", "Name": "string", "Kind": "String", "IsNullable": false @@ -877,11 +835,11 @@ "Kind": "Method" }, { - "$id": "92", + "$id": "87", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "93", + "$id": "88", "Name": "String", "Kind": "String", "IsNullable": false @@ -896,9 +854,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "94", + "$id": "89", "Type": { - "$ref": "93" + "$ref": "88" }, "Value": "application/json" } @@ -906,7 +864,7 @@ ], "Responses": [ { - "$id": "95", + "$id": "90", "StatusCodes": [ 200 ], @@ -924,7 +882,7 @@ "Path": "/azure/core/basic/users", "BufferResponse": true, "Paging": { - "$id": "96", + "$id": "91", "NextLinkName": "nextLink", "ItemName": "value" }, @@ -932,23 +890,23 @@ "GenerateConvenienceMethod": true }, { - "$id": "97", + "$id": "92", "Name": "listWithPage", "ResourceName": "Basic", "Description": "List with Azure.Core.Page<>.", "Parameters": [ { - "$ref": "35" + "$ref": "30" }, { - "$ref": "39" + "$ref": "34" }, { - "$id": "98", + "$id": "93", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "99", + "$id": "94", "Name": "String", "Kind": "String", "IsNullable": false @@ -963,9 +921,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "100", + "$id": "95", "Type": { - "$ref": "99" + "$ref": "94" }, "Value": "application/json" } @@ -973,12 +931,12 @@ ], "Responses": [ { - "$id": "101", + "$id": "96", "StatusCodes": [ 200 ], "BodyType": { - "$ref": "23" + "$ref": "18" }, "BodyMediaType": "Json", "Headers": [], @@ -991,7 +949,7 @@ "Path": "/azure/core/basic/page", "BufferResponse": true, "Paging": { - "$id": "102", + "$id": "97", "NextLinkName": "nextLink", "ItemName": "value" }, @@ -999,23 +957,23 @@ "GenerateConvenienceMethod": true }, { - "$id": "103", + "$id": "98", "Name": "listWithCustomPageModel", "ResourceName": "Basic", "Description": "List with custom page model.", "Parameters": [ { - "$ref": "35" + "$ref": "30" }, { - "$ref": "39" + "$ref": "34" }, { - "$id": "104", + "$id": "99", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "105", + "$id": "100", "Name": "String", "Kind": "String", "IsNullable": false @@ -1030,9 +988,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "106", + "$id": "101", "Type": { - "$ref": "105" + "$ref": "100" }, "Value": "application/json" } @@ -1040,12 +998,12 @@ ], "Responses": [ { - "$id": "107", + "$id": "102", "StatusCodes": [ 200 ], "BodyType": { - "$ref": "28" + "$ref": "23" }, "BodyMediaType": "Json", "Headers": [], @@ -1058,7 +1016,7 @@ "Path": "/azure/core/basic/custom-page", "BufferResponse": true, "Paging": { - "$id": "108", + "$id": "103", "NextLinkName": "nextLink", "ItemName": "items" }, @@ -1066,25 +1024,25 @@ "GenerateConvenienceMethod": true }, { - "$id": "109", + "$id": "104", "Name": "delete", "ResourceName": "User", "Summary": "Deletes a user.", "Description": "Deletes a User", "Parameters": [ { - "$ref": "35" + "$ref": "30" }, { - "$ref": "39" + "$ref": "34" }, { - "$id": "110", + "$id": "105", "Name": "id", "NameInRequest": "id", "Description": "The user's id.", "Type": { - "$id": "111", + "$id": "106", "Name": "int32", "Kind": "Int32", "IsNullable": false @@ -1100,11 +1058,11 @@ "Kind": "Method" }, { - "$id": "112", + "$id": "107", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "113", + "$id": "108", "Name": "String", "Kind": "String", "IsNullable": false @@ -1119,9 +1077,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "114", + "$id": "109", "Type": { - "$ref": "113" + "$ref": "108" }, "Value": "application/json" } @@ -1129,7 +1087,7 @@ ], "Responses": [ { - "$id": "115", + "$id": "110", "StatusCodes": [ 204 ], @@ -1147,25 +1105,25 @@ "GenerateConvenienceMethod": true }, { - "$id": "116", + "$id": "111", "Name": "export", "ResourceName": "Basic", "Summary": "Exports a user.", "Description": "Exports a User", "Parameters": [ { - "$ref": "35" + "$ref": "30" }, { - "$ref": "39" + "$ref": "34" }, { - "$id": "117", + "$id": "112", "Name": "id", "NameInRequest": "id", "Description": "The user's id.", "Type": { - "$id": "118", + "$id": "113", "Name": "int32", "Kind": "Int32", "IsNullable": false @@ -1181,12 +1139,12 @@ "Kind": "Method" }, { - "$id": "119", + "$id": "114", "Name": "format", "NameInRequest": "format", "Description": "The format of the data.", "Type": { - "$id": "120", + "$id": "115", "Name": "string", "Kind": "String", "IsNullable": false @@ -1202,11 +1160,11 @@ "Kind": "Method" }, { - "$id": "121", + "$id": "116", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "122", + "$id": "117", "Name": "String", "Kind": "String", "IsNullable": false @@ -1221,9 +1179,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "123", + "$id": "118", "Type": { - "$ref": "122" + "$ref": "117" }, "Value": "application/json" } @@ -1231,7 +1189,7 @@ ], "Responses": [ { - "$id": "124", + "$id": "119", "StatusCodes": [ 200 ], @@ -1253,7 +1211,7 @@ } ], "Protocol": { - "$id": "125" + "$id": "120" }, "Creatable": true } diff --git a/test/TestProjects/Authoring-Typespec/src/Generated/Docs/AuthoringClient.xml b/test/TestProjects/Authoring-Typespec/src/Generated/Docs/AuthoringClient.xml index 18e9347d525..524f06487f9 100644 --- a/test/TestProjects/Authoring-Typespec/src/Generated/Docs/AuthoringClient.xml +++ b/test/TestProjects/Authoring-Typespec/src/Generated/Docs/AuthoringClient.xml @@ -619,17 +619,7 @@ var client = new AuthoringClient(endpoint); await foreach (var item in client.GetDeploymentsAsync("", new RequestContext())) { JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("multilingual").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); } ]]> @@ -644,17 +634,7 @@ var client = new AuthoringClient(endpoint); foreach (var item in client.GetDeployments("", new RequestContext())) { JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("multilingual").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); } ]]> diff --git a/test/TestProjects/Authoring-Typespec/src/Generated/cadl.json b/test/TestProjects/Authoring-Typespec/src/Generated/cadl.json index adce1fa0c7f..5b9d8fd39cc 100644 --- a/test/TestProjects/Authoring-Typespec/src/Generated/cadl.json +++ b/test/TestProjects/Authoring-Typespec/src/Generated/cadl.json @@ -268,7 +268,7 @@ }, { "$id": "38", - "Name": "CustomPage", + "Name": "PagedProject", "Namespace": "Azure.Core.Foundations", "Description": "Paged collection of Project items", "IsNullable": false, @@ -359,18 +359,60 @@ }, { "$id": "49", + "Name": "PagedDeployment", + "Namespace": "Azure.Core.Foundations", + "Description": "Paged collection of Deployment items", + "IsNullable": false, + "Usage": "None", + "Properties": [ + { + "$id": "50", + "Name": "value", + "SerializedName": "value", + "Description": "The Deployment items on this page", + "Type": { + "$id": "51", + "Name": "Array", + "ElementType": { + "$ref": "46" + }, + "IsNullable": false + }, + "IsRequired": true, + "IsReadOnly": false, + "IsDiscriminator": false + }, + { + "$id": "52", + "Name": "nextLink", + "SerializedName": "nextLink", + "Description": "The link to the next page of items", + "Type": { + "$id": "53", + "Name": "ResourceLocation", + "Kind": "String", + "IsNullable": false + }, + "IsRequired": false, + "IsReadOnly": false, + "IsDiscriminator": false + } + ] + }, + { + "$id": "54", "Name": "SwapDeploymentsOptions", "Namespace": "Azure.Language.Authoring", "IsNullable": false, "Usage": "None", "Properties": [ { - "$id": "50", + "$id": "55", "Name": "firstDeploymentName", "SerializedName": "firstDeploymentName", "Description": "Represents the first deployment name.", "Type": { - "$id": "51", + "$id": "56", "Name": "string", "Kind": "String", "IsNullable": false @@ -380,12 +422,12 @@ "IsDiscriminator": false }, { - "$id": "52", + "$id": "57", "Name": "secondDeploymentName", "SerializedName": "secondDeploymentName", "Description": "Represents the second deployment name.", "Type": { - "$id": "53", + "$id": "58", "Name": "string", "Kind": "String", "IsNullable": false @@ -397,19 +439,19 @@ ] }, { - "$id": "54", + "$id": "59", "Name": "DeploymentJob", "Namespace": "Azure.Language.Authoring", "IsNullable": false, "Usage": "Output", "Properties": [ { - "$id": "55", + "$id": "60", "Name": "jobId", "SerializedName": "jobId", "Description": "The job ID.", "Type": { - "$id": "56", + "$id": "61", "Name": "string", "Kind": "String", "IsNullable": false @@ -419,12 +461,12 @@ "IsDiscriminator": false }, { - "$id": "57", + "$id": "62", "Name": "createdDateTime", "SerializedName": "createdDateTime", "Description": "The creation date time of the job.", "Type": { - "$id": "58", + "$id": "63", "Name": "utcDateTime", "Kind": "DateTime", "IsNullable": false @@ -434,12 +476,12 @@ "IsDiscriminator": false }, { - "$id": "59", + "$id": "64", "Name": "lastUpdatedDateTime", "SerializedName": "lastUpdatedDateTime", "Description": "The the last date time the job was updated.", "Type": { - "$id": "60", + "$id": "65", "Name": "utcDateTime", "Kind": "DateTime", "IsNullable": false @@ -449,12 +491,12 @@ "IsDiscriminator": false }, { - "$id": "61", + "$id": "66", "Name": "expirationDateTime", "SerializedName": "expirationDateTime", "Description": "The expiration date time of the job.", "Type": { - "$id": "62", + "$id": "67", "Name": "utcDateTime", "Kind": "DateTime", "IsNullable": false @@ -464,7 +506,7 @@ "IsDiscriminator": false }, { - "$id": "63", + "$id": "68", "Name": "status", "SerializedName": "status", "Description": "The job status.", @@ -476,15 +518,15 @@ "IsDiscriminator": false }, { - "$id": "64", + "$id": "69", "Name": "warnings", "SerializedName": "warnings", "Description": "The warnings that were encountered while executing the job.", "Type": { - "$id": "65", + "$id": "70", "Name": "Array", "ElementType": { - "$id": "66", + "$id": "71", "Name": "JobWarning", "Namespace": "Azure.Language.Authoring", "Description": "Represents a warning that was encountered while executing the request.", @@ -492,12 +534,12 @@ "Usage": "Output", "Properties": [ { - "$id": "67", + "$id": "72", "Name": "code", "SerializedName": "code", "Description": "The warning code.", "Type": { - "$id": "68", + "$id": "73", "Name": "string", "Kind": "String", "IsNullable": false @@ -507,12 +549,12 @@ "IsDiscriminator": false }, { - "$id": "69", + "$id": "74", "Name": "message", "SerializedName": "message", "Description": "The warning message.", "Type": { - "$id": "70", + "$id": "75", "Name": "string", "Kind": "String", "IsNullable": false @@ -530,12 +572,12 @@ "IsDiscriminator": false }, { - "$id": "71", + "$id": "76", "Name": "errors", "SerializedName": "errors", "Description": "The errors encountered while executing the job.", "Type": { - "$id": "72", + "$id": "77", "Name": "Error", "Namespace": "Azure.Core.Foundations", "Description": "The error object.", @@ -543,12 +585,12 @@ "Usage": "Output", "Properties": [ { - "$id": "73", + "$id": "78", "Name": "code", "SerializedName": "code", "Description": "One of a server-defined set of error codes.", "Type": { - "$id": "74", + "$id": "79", "Name": "string", "Kind": "String", "IsNullable": false @@ -558,12 +600,12 @@ "IsDiscriminator": false }, { - "$id": "75", + "$id": "80", "Name": "message", "SerializedName": "message", "Description": "A human-readable representation of the error.", "Type": { - "$id": "76", + "$id": "81", "Name": "string", "Kind": "String", "IsNullable": false @@ -573,12 +615,12 @@ "IsDiscriminator": false }, { - "$id": "77", + "$id": "82", "Name": "target", "SerializedName": "target", "Description": "The target of the error.", "Type": { - "$id": "78", + "$id": "83", "Name": "string", "Kind": "String", "IsNullable": false @@ -588,15 +630,15 @@ "IsDiscriminator": false }, { - "$id": "79", + "$id": "84", "Name": "details", "SerializedName": "details", "Description": "An array of details about specific errors that led to this reported error.", "Type": { - "$id": "80", + "$id": "85", "Name": "Array", "ElementType": { - "$ref": "72" + "$ref": "77" }, "IsNullable": false }, @@ -605,12 +647,12 @@ "IsDiscriminator": false }, { - "$id": "81", + "$id": "86", "Name": "innererror", "SerializedName": "innererror", "Description": "An object containing more specific information than the current object about the error.", "Type": { - "$id": "82", + "$id": "87", "Name": "InnerError", "Namespace": "Azure.Core.Foundations", "Description": "An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.", @@ -618,12 +660,12 @@ "Usage": "Output", "Properties": [ { - "$id": "83", + "$id": "88", "Name": "code", "SerializedName": "code", "Description": "One of a server-defined set of error codes.", "Type": { - "$id": "84", + "$id": "89", "Name": "string", "Kind": "String", "IsNullable": false @@ -633,12 +675,12 @@ "IsDiscriminator": false }, { - "$id": "85", + "$id": "90", "Name": "innererror", "SerializedName": "innererror", "Description": "Inner error.", "Type": { - "$ref": "82" + "$ref": "87" }, "IsRequired": false, "IsReadOnly": false, @@ -657,12 +699,12 @@ "IsDiscriminator": false }, { - "$id": "86", + "$id": "91", "Name": "id", "SerializedName": "id", "Description": "", "Type": { - "$id": "87", + "$id": "92", "Name": "string", "Kind": "String", "IsNullable": false @@ -674,28 +716,28 @@ ] }, { - "$ref": "66" + "$ref": "71" }, { - "$ref": "72" + "$ref": "77" }, { - "$ref": "82" + "$ref": "87" }, { - "$id": "88", + "$id": "93", "Name": "SwapDeploymentsJob", "Namespace": "Azure.Language.Authoring", "IsNullable": false, "Usage": "Output", "Properties": [ { - "$id": "89", + "$id": "94", "Name": "jobId", "SerializedName": "jobId", "Description": "The job ID.", "Type": { - "$id": "90", + "$id": "95", "Name": "string", "Kind": "String", "IsNullable": false @@ -705,12 +747,12 @@ "IsDiscriminator": false }, { - "$id": "91", + "$id": "96", "Name": "createdDateTime", "SerializedName": "createdDateTime", "Description": "The creation date time of the job.", "Type": { - "$id": "92", + "$id": "97", "Name": "utcDateTime", "Kind": "DateTime", "IsNullable": false @@ -720,12 +762,12 @@ "IsDiscriminator": false }, { - "$id": "93", + "$id": "98", "Name": "lastUpdatedDateTime", "SerializedName": "lastUpdatedDateTime", "Description": "The the last date time the job was updated.", "Type": { - "$id": "94", + "$id": "99", "Name": "utcDateTime", "Kind": "DateTime", "IsNullable": false @@ -735,12 +777,12 @@ "IsDiscriminator": false }, { - "$id": "95", + "$id": "100", "Name": "expirationDateTime", "SerializedName": "expirationDateTime", "Description": "The expiration date time of the job.", "Type": { - "$id": "96", + "$id": "101", "Name": "utcDateTime", "Kind": "DateTime", "IsNullable": false @@ -750,7 +792,7 @@ "IsDiscriminator": false }, { - "$id": "97", + "$id": "102", "Name": "status", "SerializedName": "status", "Description": "The job status.", @@ -762,15 +804,15 @@ "IsDiscriminator": false }, { - "$id": "98", + "$id": "103", "Name": "warnings", "SerializedName": "warnings", "Description": "The warnings that were encountered while executing the job.", "Type": { - "$id": "99", + "$id": "104", "Name": "Array", "ElementType": { - "$ref": "66" + "$ref": "71" }, "IsNullable": false }, @@ -779,24 +821,24 @@ "IsDiscriminator": false }, { - "$id": "100", + "$id": "105", "Name": "errors", "SerializedName": "errors", "Description": "The errors encountered while executing the job.", "Type": { - "$ref": "72" + "$ref": "77" }, "IsRequired": true, "IsReadOnly": false, "IsDiscriminator": false }, { - "$id": "101", + "$id": "106", "Name": "id", "SerializedName": "id", "Description": "", "Type": { - "$id": "102", + "$id": "107", "Name": "string", "Kind": "String", "IsNullable": false @@ -808,7 +850,7 @@ ] }, { - "$id": "103", + "$id": "108", "Name": "PagedSupportedLanguage", "Namespace": "Azure.Language.Authoring", "Description": "Paged collection of SupportedLanguage items", @@ -816,15 +858,15 @@ "Usage": "None", "Properties": [ { - "$id": "104", + "$id": "109", "Name": "value", "SerializedName": "value", "Description": "The SupportedLanguage items on this page", "Type": { - "$id": "105", + "$id": "110", "Name": "Array", "ElementType": { - "$id": "106", + "$id": "111", "Name": "SupportedLanguage", "Namespace": "Azure.Language.Authoring", "Description": "Represents a supported language.", @@ -832,12 +874,12 @@ "Usage": "None", "Properties": [ { - "$id": "107", + "$id": "112", "Name": "languageName", "SerializedName": "languageName", "Description": "The language name.", "Type": { - "$id": "108", + "$id": "113", "Name": "string", "Kind": "String", "IsNullable": false @@ -847,12 +889,12 @@ "IsDiscriminator": false }, { - "$id": "109", + "$id": "114", "Name": "languageCode", "SerializedName": "languageCode", "Description": "The language code. This is BCP-47 representation of a language. For example, \"en\" for English, \"en-gb\" for English (UK), \"es\" for Spanish etc.", "Type": { - "$id": "110", + "$id": "115", "Name": "string", "Kind": "String", "IsNullable": false @@ -870,12 +912,12 @@ "IsDiscriminator": false }, { - "$id": "111", + "$id": "116", "Name": "nextLink", "SerializedName": "nextLink", "Description": "The link to the next page of items", "Type": { - "$id": "112", + "$id": "117", "Name": "ResourceLocation", "Kind": "String", "IsNullable": false @@ -887,10 +929,10 @@ ] }, { - "$ref": "106" + "$ref": "111" }, { - "$id": "113", + "$id": "118", "Name": "PagedTrainingConfigVersion", "Namespace": "Azure.Language.Authoring", "Description": "Paged collection of TrainingConfigVersion items", @@ -898,15 +940,15 @@ "Usage": "None", "Properties": [ { - "$id": "114", + "$id": "119", "Name": "value", "SerializedName": "value", "Description": "The TrainingConfigVersion items on this page", "Type": { - "$id": "115", + "$id": "120", "Name": "Array", "ElementType": { - "$id": "116", + "$id": "121", "Name": "TrainingConfigVersion", "Namespace": "Azure.Language.Authoring", "Description": "Represents a training config version.", @@ -914,12 +956,12 @@ "Usage": "None", "Properties": [ { - "$id": "117", + "$id": "122", "Name": "trainingConfigVersionStr", "SerializedName": "trainingConfigVersionStr", "Description": "Represents the version of the config.", "Type": { - "$id": "118", + "$id": "123", "Name": "string", "Kind": "String", "IsNullable": false @@ -929,12 +971,12 @@ "IsDiscriminator": false }, { - "$id": "119", + "$id": "124", "Name": "modelExpirationDate", "SerializedName": "modelExpirationDate", "Description": "Represents the training config version expiration date.", "Type": { - "$id": "120", + "$id": "125", "Name": "plainDate", "Kind": "Date", "IsNullable": false @@ -952,12 +994,12 @@ "IsDiscriminator": false }, { - "$id": "121", + "$id": "126", "Name": "nextLink", "SerializedName": "nextLink", "Description": "The link to the next page of items", "Type": { - "$id": "122", + "$id": "127", "Name": "ResourceLocation", "Kind": "String", "IsNullable": false @@ -969,27 +1011,27 @@ ] }, { - "$ref": "116" + "$ref": "121" } ], "Clients": [ { - "$id": "123", + "$id": "128", "Name": "AuthoringClient", "Description": "", "Operations": [ { - "$id": "124", + "$id": "129", "Name": "createOrUpdate", "ResourceName": "Project", "Description": "Creates a new project or updates an existing one.", "Parameters": [ { - "$id": "125", + "$id": "130", "Name": "Endpoint", "NameInRequest": "Endpoint", "Type": { - "$id": "126", + "$id": "131", "Name": "Uri", "Kind": "Uri", "IsNullable": false @@ -1005,12 +1047,12 @@ "Kind": "Client" }, { - "$id": "127", + "$id": "132", "Name": "apiVersion", "NameInRequest": "api-version", "Description": "", "Type": { - "$id": "128", + "$id": "133", "Name": "String", "Kind": "String", "IsNullable": false @@ -1025,9 +1067,9 @@ "Explode": false, "Kind": "Client", "DefaultValue": { - "$id": "129", + "$id": "134", "Type": { - "$id": "130", + "$id": "135", "Name": "String", "Kind": "String", "IsNullable": false @@ -1036,11 +1078,11 @@ } }, { - "$id": "131", + "$id": "136", "Name": "projectName", "NameInRequest": "projectName", "Type": { - "$id": "132", + "$id": "137", "Name": "string", "Kind": "String", "IsNullable": false @@ -1056,15 +1098,15 @@ "Kind": "Method" }, { - "$id": "133", + "$id": "138", "Name": "contentType", "NameInRequest": "Content-Type", "Description": "This request has a JSON Merge Patch body.", "Type": { - "$id": "134", + "$id": "139", "Name": "Literal", "LiteralValueType": { - "$id": "135", + "$id": "140", "Name": "String", "Kind": "String", "IsNullable": false @@ -1074,9 +1116,9 @@ }, "Location": "Header", "DefaultValue": { - "$id": "136", + "$id": "141", "Type": { - "$ref": "134" + "$ref": "139" }, "Value": "application/merge-patch+json" }, @@ -1090,7 +1132,7 @@ "Kind": "Constant" }, { - "$id": "137", + "$id": "142", "Name": "resource", "NameInRequest": "resource", "Description": "The resource instance.", @@ -1108,11 +1150,11 @@ "Kind": "Method" }, { - "$id": "138", + "$id": "143", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "139", + "$id": "144", "Name": "String", "Kind": "String", "IsNullable": false @@ -1127,9 +1169,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "140", + "$id": "145", "Type": { - "$ref": "139" + "$ref": "144" }, "Value": "application/json" } @@ -1137,7 +1179,7 @@ ], "Responses": [ { - "$id": "141", + "$id": "146", "StatusCodes": [ 200 ], @@ -1147,12 +1189,12 @@ "BodyMediaType": "Json", "Headers": [ { - "$id": "142", + "$id": "147", "Name": "Operation-Location", "NameInResponse": "operationLocation", "Description": "The location for monitoring the operation state.", "Type": { - "$id": "143", + "$id": "148", "Name": "ResourceLocation", "Kind": "String", "IsNullable": false @@ -1162,7 +1204,7 @@ "IsErrorResponse": false }, { - "$id": "144", + "$id": "149", "StatusCodes": [ 201 ], @@ -1172,12 +1214,12 @@ "BodyMediaType": "Json", "Headers": [ { - "$id": "145", + "$id": "150", "Name": "Operation-Location", "NameInResponse": "operationLocation", "Description": "The location for monitoring the operation state.", "Type": { - "$id": "146", + "$id": "151", "Name": "ResourceLocation", "Kind": "String", "IsNullable": false @@ -1199,23 +1241,23 @@ "GenerateConvenienceMethod": false }, { - "$id": "147", + "$id": "152", "Name": "get", "ResourceName": "Project", "Description": "Gets the details of a project.", "Parameters": [ { - "$ref": "125" + "$ref": "130" }, { - "$ref": "127" + "$ref": "132" }, { - "$id": "148", + "$id": "153", "Name": "projectName", "NameInRequest": "projectName", "Type": { - "$id": "149", + "$id": "154", "Name": "string", "Kind": "String", "IsNullable": false @@ -1231,11 +1273,11 @@ "Kind": "Method" }, { - "$id": "150", + "$id": "155", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "151", + "$id": "156", "Name": "String", "Kind": "String", "IsNullable": false @@ -1250,9 +1292,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "152", + "$id": "157", "Type": { - "$ref": "151" + "$ref": "156" }, "Value": "application/json" } @@ -1260,7 +1302,7 @@ ], "Responses": [ { - "$id": "153", + "$id": "158", "StatusCodes": [ 200 ], @@ -1281,23 +1323,23 @@ "GenerateConvenienceMethod": false }, { - "$id": "154", + "$id": "159", "Name": "delete", "ResourceName": "Project", "Description": "Deletes a project.", "Parameters": [ { - "$ref": "125" + "$ref": "130" }, { - "$ref": "127" + "$ref": "132" }, { - "$id": "155", + "$id": "160", "Name": "projectName", "NameInRequest": "projectName", "Type": { - "$id": "156", + "$id": "161", "Name": "string", "Kind": "String", "IsNullable": false @@ -1313,11 +1355,11 @@ "Kind": "Method" }, { - "$id": "157", + "$id": "162", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "158", + "$id": "163", "Name": "String", "Kind": "String", "IsNullable": false @@ -1332,9 +1374,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "159", + "$id": "164", "Type": { - "$ref": "158" + "$ref": "163" }, "Value": "application/json" } @@ -1342,7 +1384,7 @@ ], "Responses": [ { - "$id": "160", + "$id": "165", "StatusCodes": [ 202 ], @@ -1352,12 +1394,12 @@ "BodyMediaType": "Json", "Headers": [ { - "$id": "161", + "$id": "166", "Name": "Operation-Location", "NameInResponse": "operationLocation", "Description": "The location for monitoring the operation state.", "Type": { - "$id": "162", + "$id": "167", "Name": "ResourceLocation", "Kind": "String", "IsNullable": false @@ -1376,23 +1418,23 @@ "GenerateConvenienceMethod": false }, { - "$id": "163", + "$id": "168", "Name": "list", "ResourceName": "Project", "Description": "Lists the existing projects.", "Parameters": [ { - "$ref": "125" + "$ref": "130" }, { - "$ref": "127" + "$ref": "132" }, { - "$id": "164", + "$id": "169", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "165", + "$id": "170", "Name": "String", "Kind": "String", "IsNullable": false @@ -1407,9 +1449,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "166", + "$id": "171", "Type": { - "$ref": "165" + "$ref": "170" }, "Value": "application/json" } @@ -1417,7 +1459,7 @@ ], "Responses": [ { - "$id": "167", + "$id": "172", "StatusCodes": [ 200 ], @@ -1435,7 +1477,7 @@ "Path": "/authoring/analyze-text/projects", "BufferResponse": true, "Paging": { - "$id": "168", + "$id": "173", "NextLinkName": "nextLink", "ItemName": "value" }, @@ -1443,23 +1485,23 @@ "GenerateConvenienceMethod": false }, { - "$id": "169", + "$id": "174", "Name": "export", "ResourceName": "Projects", "Description": "Triggers a job to export a project's data.", "Parameters": [ { - "$ref": "125" + "$ref": "130" }, { - "$ref": "127" + "$ref": "132" }, { - "$id": "170", + "$id": "175", "Name": "projectName", "NameInRequest": "projectName", "Type": { - "$id": "171", + "$id": "176", "Name": "string", "Kind": "String", "IsNullable": false @@ -1475,11 +1517,11 @@ "Kind": "Method" }, { - "$id": "172", + "$id": "177", "Name": "projectFileVersion", "NameInRequest": "projectFileVersion", "Type": { - "$id": "173", + "$id": "178", "Name": "string", "Kind": "String", "IsNullable": false @@ -1495,11 +1537,11 @@ "Kind": "Method" }, { - "$id": "174", + "$id": "179", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "175", + "$id": "180", "Name": "String", "Kind": "String", "IsNullable": false @@ -1514,9 +1556,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "176", + "$id": "181", "Type": { - "$ref": "175" + "$ref": "180" }, "Value": "application/json" } @@ -1524,19 +1566,19 @@ ], "Responses": [ { - "$id": "177", + "$id": "182", "StatusCodes": [ 202 ], "BodyMediaType": "Json", "Headers": [ { - "$id": "178", + "$id": "183", "Name": "Operation-Location", "NameInResponse": "operationLocation", "Description": "The location for monitoring the operation state.", "Type": { - "$id": "179", + "$id": "184", "Name": "ResourceLocation", "Kind": "String", "IsNullable": false @@ -1555,23 +1597,23 @@ "GenerateConvenienceMethod": false }, { - "$id": "180", + "$id": "185", "Name": "importx", "ResourceName": "Projects", "Description": "Triggers a job to export a project's data.", "Parameters": [ { - "$ref": "125" + "$ref": "130" }, { - "$ref": "127" + "$ref": "132" }, { - "$id": "181", + "$id": "186", "Name": "projectName", "NameInRequest": "projectName", "Type": { - "$id": "182", + "$id": "187", "Name": "string", "Kind": "String", "IsNullable": false @@ -1587,11 +1629,11 @@ "Kind": "Method" }, { - "$id": "183", + "$id": "188", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "184", + "$id": "189", "Name": "String", "Kind": "String", "IsNullable": false @@ -1606,9 +1648,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "185", + "$id": "190", "Type": { - "$ref": "184" + "$ref": "189" }, "Value": "application/json" } @@ -1616,19 +1658,19 @@ ], "Responses": [ { - "$id": "186", + "$id": "191", "StatusCodes": [ 202 ], "BodyMediaType": "Json", "Headers": [ { - "$id": "187", + "$id": "192", "Name": "Operation-Location", "NameInResponse": "operationLocation", "Description": "The location for monitoring the operation state.", "Type": { - "$id": "188", + "$id": "193", "Name": "ResourceLocation", "Kind": "String", "IsNullable": false @@ -1647,23 +1689,23 @@ "GenerateConvenienceMethod": false }, { - "$id": "189", + "$id": "194", "Name": "train", "ResourceName": "Projects", "Description": "Triggers a training job for a project.", "Parameters": [ { - "$ref": "125" + "$ref": "130" }, { - "$ref": "127" + "$ref": "132" }, { - "$id": "190", + "$id": "195", "Name": "projectName", "NameInRequest": "projectName", "Type": { - "$id": "191", + "$id": "196", "Name": "string", "Kind": "String", "IsNullable": false @@ -1679,7 +1721,7 @@ "Kind": "Method" }, { - "$id": "192", + "$id": "197", "Name": "body", "NameInRequest": "body", "Type": { @@ -1696,11 +1738,11 @@ "Kind": "Method" }, { - "$id": "193", + "$id": "198", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "194", + "$id": "199", "Name": "String", "Kind": "String", "IsNullable": false @@ -1715,19 +1757,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "195", + "$id": "200", "Type": { - "$ref": "194" + "$ref": "199" }, "Value": "application/json" } }, { - "$id": "196", + "$id": "201", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "197", + "$id": "202", "Name": "String", "Kind": "String", "IsNullable": false @@ -1742,9 +1784,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "198", + "$id": "203", "Type": { - "$ref": "197" + "$ref": "202" }, "Value": "application/json" } @@ -1752,19 +1794,19 @@ ], "Responses": [ { - "$id": "199", + "$id": "204", "StatusCodes": [ 202 ], "BodyMediaType": "Json", "Headers": [ { - "$id": "200", + "$id": "205", "Name": "Operation-Location", "NameInResponse": "operationLocation", "Description": "The location for monitoring the operation state.", "Type": { - "$id": "201", + "$id": "206", "Name": "ResourceLocation", "Kind": "String", "IsNullable": false @@ -1786,23 +1828,23 @@ "GenerateConvenienceMethod": false }, { - "$id": "202", + "$id": "207", "Name": "getDeployment", "ResourceName": "Deployment", "Description": "Gets the details of a deployment.", "Parameters": [ { - "$ref": "125" + "$ref": "130" }, { - "$ref": "127" + "$ref": "132" }, { - "$id": "203", + "$id": "208", "Name": "projectName", "NameInRequest": "projectName", "Type": { - "$id": "204", + "$id": "209", "Name": "string", "Kind": "String", "IsNullable": false @@ -1818,11 +1860,11 @@ "Kind": "Method" }, { - "$id": "205", + "$id": "210", "Name": "deploymentName", "NameInRequest": "deploymentName", "Type": { - "$id": "206", + "$id": "211", "Name": "string", "Kind": "String", "IsNullable": false @@ -1838,11 +1880,11 @@ "Kind": "Method" }, { - "$id": "207", + "$id": "212", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "208", + "$id": "213", "Name": "String", "Kind": "String", "IsNullable": false @@ -1857,9 +1899,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "209", + "$id": "214", "Type": { - "$ref": "208" + "$ref": "213" }, "Value": "application/json" } @@ -1867,7 +1909,7 @@ ], "Responses": [ { - "$id": "210", + "$id": "215", "StatusCodes": [ 200 ], @@ -1888,23 +1930,23 @@ "GenerateConvenienceMethod": false }, { - "$id": "211", + "$id": "216", "Name": "deployProject", "ResourceName": "Deployment", "Description": "Creates a new deployment or replaces an existing one.", "Parameters": [ { - "$ref": "125" + "$ref": "130" }, { - "$ref": "127" + "$ref": "132" }, { - "$id": "212", + "$id": "217", "Name": "projectName", "NameInRequest": "projectName", "Type": { - "$id": "213", + "$id": "218", "Name": "string", "Kind": "String", "IsNullable": false @@ -1920,11 +1962,11 @@ "Kind": "Method" }, { - "$id": "214", + "$id": "219", "Name": "deploymentName", "NameInRequest": "deploymentName", "Type": { - "$id": "215", + "$id": "220", "Name": "string", "Kind": "String", "IsNullable": false @@ -1940,7 +1982,7 @@ "Kind": "Method" }, { - "$id": "216", + "$id": "221", "Name": "resource", "NameInRequest": "resource", "Description": "The resource instance.", @@ -1958,11 +2000,11 @@ "Kind": "Method" }, { - "$id": "217", + "$id": "222", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "218", + "$id": "223", "Name": "String", "Kind": "String", "IsNullable": false @@ -1977,19 +2019,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "219", + "$id": "224", "Type": { - "$ref": "218" + "$ref": "223" }, "Value": "application/json" } }, { - "$id": "220", + "$id": "225", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "221", + "$id": "226", "Name": "String", "Kind": "String", "IsNullable": false @@ -2004,9 +2046,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "222", + "$id": "227", "Type": { - "$ref": "221" + "$ref": "226" }, "Value": "application/json" } @@ -2014,7 +2056,7 @@ ], "Responses": [ { - "$id": "223", + "$id": "228", "StatusCodes": [ 200 ], @@ -2024,12 +2066,12 @@ "BodyMediaType": "Json", "Headers": [ { - "$id": "224", + "$id": "229", "Name": "Operation-Location", "NameInResponse": "operationLocation", "Description": "The location for monitoring the operation state.", "Type": { - "$id": "225", + "$id": "230", "Name": "ResourceLocation", "Kind": "String", "IsNullable": false @@ -2039,7 +2081,7 @@ "IsErrorResponse": false }, { - "$id": "226", + "$id": "231", "StatusCodes": [ 201 ], @@ -2049,12 +2091,12 @@ "BodyMediaType": "Json", "Headers": [ { - "$id": "227", + "$id": "232", "Name": "Operation-Location", "NameInResponse": "operationLocation", "Description": "The location for monitoring the operation state.", "Type": { - "$id": "228", + "$id": "233", "Name": "ResourceLocation", "Kind": "String", "IsNullable": false @@ -2076,23 +2118,23 @@ "GenerateConvenienceMethod": false }, { - "$id": "229", + "$id": "234", "Name": "deleteDeployment", "ResourceName": "Deployment", "Description": "Deletes a project deployment.", "Parameters": [ { - "$ref": "125" + "$ref": "130" }, { - "$ref": "127" + "$ref": "132" }, { - "$id": "230", + "$id": "235", "Name": "projectName", "NameInRequest": "projectName", "Type": { - "$id": "231", + "$id": "236", "Name": "string", "Kind": "String", "IsNullable": false @@ -2108,11 +2150,11 @@ "Kind": "Method" }, { - "$id": "232", + "$id": "237", "Name": "deploymentName", "NameInRequest": "deploymentName", "Type": { - "$id": "233", + "$id": "238", "Name": "string", "Kind": "String", "IsNullable": false @@ -2128,11 +2170,11 @@ "Kind": "Method" }, { - "$id": "234", + "$id": "239", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "235", + "$id": "240", "Name": "String", "Kind": "String", "IsNullable": false @@ -2147,9 +2189,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "236", + "$id": "241", "Type": { - "$ref": "235" + "$ref": "240" }, "Value": "application/json" } @@ -2157,7 +2199,7 @@ ], "Responses": [ { - "$id": "237", + "$id": "242", "StatusCodes": [ 202 ], @@ -2167,12 +2209,12 @@ "BodyMediaType": "Json", "Headers": [ { - "$id": "238", + "$id": "243", "Name": "Operation-Location", "NameInResponse": "operationLocation", "Description": "The location for monitoring the operation state.", "Type": { - "$id": "239", + "$id": "244", "Name": "ResourceLocation", "Kind": "String", "IsNullable": false @@ -2191,23 +2233,23 @@ "GenerateConvenienceMethod": false }, { - "$id": "240", + "$id": "245", "Name": "list", "ResourceName": "Deployment", "Description": "Lists the existing deployments.", "Parameters": [ { - "$ref": "125" + "$ref": "130" }, { - "$ref": "127" + "$ref": "132" }, { - "$id": "241", + "$id": "246", "Name": "projectName", "NameInRequest": "projectName", "Type": { - "$id": "242", + "$id": "247", "Name": "string", "Kind": "String", "IsNullable": false @@ -2223,11 +2265,11 @@ "Kind": "Method" }, { - "$id": "243", + "$id": "248", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "244", + "$id": "249", "Name": "String", "Kind": "String", "IsNullable": false @@ -2242,9 +2284,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "245", + "$id": "250", "Type": { - "$ref": "244" + "$ref": "249" }, "Value": "application/json" } @@ -2252,12 +2294,12 @@ ], "Responses": [ { - "$id": "246", + "$id": "251", "StatusCodes": [ 200 ], "BodyType": { - "$ref": "38" + "$ref": "49" }, "BodyMediaType": "Json", "Headers": [], @@ -2270,7 +2312,7 @@ "Path": "/authoring/analyze-text/projects/{projectName}/deployments", "BufferResponse": true, "Paging": { - "$id": "247", + "$id": "252", "NextLinkName": "nextLink", "ItemName": "value" }, @@ -2278,23 +2320,23 @@ "GenerateConvenienceMethod": false }, { - "$id": "248", + "$id": "253", "Name": "swapDeployments", "ResourceName": "Deployments", "Description": "Swaps two existing deployments with each other.", "Parameters": [ { - "$ref": "125" + "$ref": "130" }, { - "$ref": "127" + "$ref": "132" }, { - "$id": "249", + "$id": "254", "Name": "projectName", "NameInRequest": "projectName", "Type": { - "$id": "250", + "$id": "255", "Name": "string", "Kind": "String", "IsNullable": false @@ -2310,12 +2352,12 @@ "Kind": "Method" }, { - "$id": "251", + "$id": "256", "Name": "body", "NameInRequest": "body", "Description": "The body schema of the operation.", "Type": { - "$ref": "49" + "$ref": "54" }, "Location": "Body", "IsRequired": true, @@ -2328,11 +2370,11 @@ "Kind": "Method" }, { - "$id": "252", + "$id": "257", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "253", + "$id": "258", "Name": "String", "Kind": "String", "IsNullable": false @@ -2347,19 +2389,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "254", + "$id": "259", "Type": { - "$ref": "253" + "$ref": "258" }, "Value": "application/json" } }, { - "$id": "255", + "$id": "260", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "256", + "$id": "261", "Name": "String", "Kind": "String", "IsNullable": false @@ -2374,9 +2416,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "257", + "$id": "262", "Type": { - "$ref": "256" + "$ref": "261" }, "Value": "application/json" } @@ -2384,19 +2426,19 @@ ], "Responses": [ { - "$id": "258", + "$id": "263", "StatusCodes": [ 202 ], "BodyMediaType": "Json", "Headers": [ { - "$id": "259", + "$id": "264", "Name": "Operation-Location", "NameInResponse": "operationLocation", "Description": "The location for monitoring the operation state.", "Type": { - "$id": "260", + "$id": "265", "Name": "ResourceLocation", "Kind": "String", "IsNullable": false @@ -2418,23 +2460,23 @@ "GenerateConvenienceMethod": false }, { - "$id": "261", + "$id": "266", "Name": "getDeploymentStatus", "ResourceName": "DeploymentJob", "Description": "Gets the status of an existing deployment job.", "Parameters": [ { - "$ref": "125" + "$ref": "130" }, { - "$ref": "127" + "$ref": "132" }, { - "$id": "262", + "$id": "267", "Name": "projectName", "NameInRequest": "projectName", "Type": { - "$id": "263", + "$id": "268", "Name": "string", "Kind": "String", "IsNullable": false @@ -2450,11 +2492,11 @@ "Kind": "Method" }, { - "$id": "264", + "$id": "269", "Name": "deploymentName", "NameInRequest": "deploymentName", "Type": { - "$id": "265", + "$id": "270", "Name": "string", "Kind": "String", "IsNullable": false @@ -2470,11 +2512,11 @@ "Kind": "Method" }, { - "$id": "266", + "$id": "271", "Name": "jobId", "NameInRequest": "jobId", "Type": { - "$id": "267", + "$id": "272", "Name": "string", "Kind": "String", "IsNullable": false @@ -2490,11 +2532,11 @@ "Kind": "Method" }, { - "$id": "268", + "$id": "273", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "269", + "$id": "274", "Name": "String", "Kind": "String", "IsNullable": false @@ -2509,9 +2551,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "270", + "$id": "275", "Type": { - "$ref": "269" + "$ref": "274" }, "Value": "application/json" } @@ -2519,12 +2561,12 @@ ], "Responses": [ { - "$id": "271", + "$id": "276", "StatusCodes": [ 200 ], "BodyType": { - "$ref": "54" + "$ref": "59" }, "BodyMediaType": "Json", "Headers": [], @@ -2540,23 +2582,23 @@ "GenerateConvenienceMethod": true }, { - "$id": "272", + "$id": "277", "Name": "getSwapDeploymentsStatus", "ResourceName": "SwapDeploymentsJob", "Description": "Gets the status of an existing swap deployment job.", "Parameters": [ { - "$ref": "125" + "$ref": "130" }, { - "$ref": "127" + "$ref": "132" }, { - "$id": "273", + "$id": "278", "Name": "projectName", "NameInRequest": "projectName", "Type": { - "$id": "274", + "$id": "279", "Name": "string", "Kind": "String", "IsNullable": false @@ -2572,11 +2614,11 @@ "Kind": "Method" }, { - "$id": "275", + "$id": "280", "Name": "deploymentName", "NameInRequest": "deploymentName", "Type": { - "$id": "276", + "$id": "281", "Name": "string", "Kind": "String", "IsNullable": false @@ -2592,11 +2634,11 @@ "Kind": "Method" }, { - "$id": "277", + "$id": "282", "Name": "jobId", "NameInRequest": "jobId", "Type": { - "$id": "278", + "$id": "283", "Name": "string", "Kind": "String", "IsNullable": false @@ -2612,11 +2654,11 @@ "Kind": "Method" }, { - "$id": "279", + "$id": "284", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "280", + "$id": "285", "Name": "String", "Kind": "String", "IsNullable": false @@ -2631,9 +2673,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "281", + "$id": "286", "Type": { - "$ref": "280" + "$ref": "285" }, "Value": "application/json" } @@ -2641,12 +2683,12 @@ ], "Responses": [ { - "$id": "282", + "$id": "287", "StatusCodes": [ 200 ], "BodyType": { - "$ref": "88" + "$ref": "93" }, "BodyMediaType": "Json", "Headers": [], @@ -2662,19 +2704,19 @@ "GenerateConvenienceMethod": true }, { - "$id": "283", + "$id": "288", "Name": "getSupportedLanguages", "ResourceName": "Global", "Parameters": [ { - "$ref": "125" + "$ref": "130" }, { - "$id": "284", + "$id": "289", "Name": "top", "NameInRequest": "top", "Type": { - "$id": "285", + "$id": "290", "Name": "int32", "Kind": "Int32", "IsNullable": false @@ -2690,11 +2732,11 @@ "Kind": "Method" }, { - "$id": "286", + "$id": "291", "Name": "skip", "NameInRequest": "skip", "Type": { - "$id": "287", + "$id": "292", "Name": "int32", "Kind": "Int32", "IsNullable": false @@ -2710,11 +2752,11 @@ "Kind": "Method" }, { - "$id": "288", + "$id": "293", "Name": "maxpagesize", "NameInRequest": "maxpagesize", "Type": { - "$id": "289", + "$id": "294", "Name": "int32", "Kind": "Int32", "IsNullable": false @@ -2730,14 +2772,14 @@ "Kind": "Method" }, { - "$ref": "127" + "$ref": "132" }, { - "$id": "290", + "$id": "295", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "291", + "$id": "296", "Name": "String", "Kind": "String", "IsNullable": false @@ -2752,9 +2794,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "292", + "$id": "297", "Type": { - "$ref": "291" + "$ref": "296" }, "Value": "application/json" } @@ -2762,12 +2804,12 @@ ], "Responses": [ { - "$id": "293", + "$id": "298", "StatusCodes": [ 200 ], "BodyType": { - "$ref": "103" + "$ref": "108" }, "BodyMediaType": "Json", "Headers": [], @@ -2780,7 +2822,7 @@ "Path": "/authoring/analyze-text/projects/global/languages", "BufferResponse": true, "Paging": { - "$id": "294", + "$id": "299", "NextLinkName": "nextLink", "ItemName": "value" }, @@ -2788,19 +2830,19 @@ "GenerateConvenienceMethod": false }, { - "$id": "295", + "$id": "300", "Name": "listTrainingConfigVersions", "ResourceName": "Global", "Parameters": [ { - "$ref": "125" + "$ref": "130" }, { - "$id": "296", + "$id": "301", "Name": "top", "NameInRequest": "top", "Type": { - "$id": "297", + "$id": "302", "Name": "int32", "Kind": "Int32", "IsNullable": false @@ -2816,11 +2858,11 @@ "Kind": "Method" }, { - "$id": "298", + "$id": "303", "Name": "skip", "NameInRequest": "skip", "Type": { - "$id": "299", + "$id": "304", "Name": "int32", "Kind": "Int32", "IsNullable": false @@ -2836,11 +2878,11 @@ "Kind": "Method" }, { - "$id": "300", + "$id": "305", "Name": "maxpagesize", "NameInRequest": "maxpagesize", "Type": { - "$id": "301", + "$id": "306", "Name": "int32", "Kind": "Int32", "IsNullable": false @@ -2856,14 +2898,14 @@ "Kind": "Method" }, { - "$ref": "127" + "$ref": "132" }, { - "$id": "302", + "$id": "307", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "303", + "$id": "308", "Name": "String", "Kind": "String", "IsNullable": false @@ -2878,9 +2920,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "304", + "$id": "309", "Type": { - "$ref": "303" + "$ref": "308" }, "Value": "application/json" } @@ -2888,12 +2930,12 @@ ], "Responses": [ { - "$id": "305", + "$id": "310", "StatusCodes": [ 200 ], "BodyType": { - "$ref": "113" + "$ref": "118" }, "BodyMediaType": "Json", "Headers": [], @@ -2906,7 +2948,7 @@ "Path": "/authoring/analyze-text/projects/global/training-config-versions", "BufferResponse": true, "Paging": { - "$id": "306", + "$id": "311", "NextLinkName": "nextLink", "ItemName": "value" }, @@ -2915,7 +2957,7 @@ } ], "Protocol": { - "$id": "307" + "$id": "312" }, "Creatable": true } diff --git a/test/TestProjects/Authoring-Typespec/tests/Generated/Samples/Samples_AuthoringClient.cs b/test/TestProjects/Authoring-Typespec/tests/Generated/Samples/Samples_AuthoringClient.cs index 9534bff06a6..38c3ec59967 100644 --- a/test/TestProjects/Authoring-Typespec/tests/Generated/Samples/Samples_AuthoringClient.cs +++ b/test/TestProjects/Authoring-Typespec/tests/Generated/Samples/Samples_AuthoringClient.cs @@ -1006,14 +1006,7 @@ public void Example_GetDeployments() foreach (var item in client.GetDeployments("")) { JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); } } @@ -1027,17 +1020,7 @@ public void Example_GetDeployments_AllParameters() foreach (var item in client.GetDeployments("", new RequestContext())) { JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("multilingual").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); } } @@ -1051,14 +1034,7 @@ public async Task Example_GetDeployments_Async() await foreach (var item in client.GetDeploymentsAsync("")) { JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); } } @@ -1072,17 +1048,7 @@ public async Task Example_GetDeployments_AllParameters_Async() await foreach (var item in client.GetDeploymentsAsync("", new RequestContext())) { JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("multilingual").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); } } diff --git a/test/TestProjects/MixAPIVersion-Typespec/src/Generated/cadl.json b/test/TestProjects/MixAPIVersion-Typespec/src/Generated/cadl.json index 38d859541c1..4f7debf2ae1 100644 --- a/test/TestProjects/MixAPIVersion-Typespec/src/Generated/cadl.json +++ b/test/TestProjects/MixAPIVersion-Typespec/src/Generated/cadl.json @@ -64,7 +64,7 @@ }, { "$id": "9", - "Name": "CustomPage", + "Name": "PagedToy", "Namespace": "Azure.Core.Foundations", "Description": "Paged collection of Toy items", "IsNullable": false, diff --git a/test/TestProjects/RenameGetList-Typespec/src/Generated/Docs/RenameGetListClient.xml b/test/TestProjects/RenameGetList-Typespec/src/Generated/Docs/RenameGetListClient.xml index a6cf319106c..32d619f54d8 100644 --- a/test/TestProjects/RenameGetList-Typespec/src/Generated/Docs/RenameGetListClient.xml +++ b/test/TestProjects/RenameGetList-Typespec/src/Generated/Docs/RenameGetListClient.xml @@ -137,17 +137,7 @@ var client = new RenameGetListClient(endpoint); await foreach (var item in client.GetDeploymentsAsync("", new RequestContext())) { JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("multilingual").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); } ]]> @@ -162,17 +152,7 @@ var client = new RenameGetListClient(endpoint); foreach (var item in client.GetDeployments("", new RequestContext())) { JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("multilingual").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); } ]]> diff --git a/test/TestProjects/RenameGetList-Typespec/src/Generated/cadl.json b/test/TestProjects/RenameGetList-Typespec/src/Generated/cadl.json index bb062bd28ab..174040331c5 100644 --- a/test/TestProjects/RenameGetList-Typespec/src/Generated/cadl.json +++ b/test/TestProjects/RenameGetList-Typespec/src/Generated/cadl.json @@ -221,7 +221,7 @@ }, { "$id": "30", - "Name": "CustomPage", + "Name": "PagedProject", "Namespace": "Azure.Core.Foundations", "Description": "Paged collection of Project items", "IsNullable": false, @@ -284,26 +284,68 @@ "IsDiscriminator": false } ] + }, + { + "$id": "38", + "Name": "PagedDeployment", + "Namespace": "Azure.Core.Foundations", + "Description": "Paged collection of Deployment items", + "IsNullable": false, + "Usage": "None", + "Properties": [ + { + "$id": "39", + "Name": "value", + "SerializedName": "value", + "Description": "The Deployment items on this page", + "Type": { + "$id": "40", + "Name": "Array", + "ElementType": { + "$ref": "35" + }, + "IsNullable": false + }, + "IsRequired": true, + "IsReadOnly": false, + "IsDiscriminator": false + }, + { + "$id": "41", + "Name": "nextLink", + "SerializedName": "nextLink", + "Description": "The link to the next page of items", + "Type": { + "$id": "42", + "Name": "ResourceLocation", + "Kind": "String", + "IsNullable": false + }, + "IsRequired": false, + "IsReadOnly": false, + "IsDiscriminator": false + } + ] } ], "Clients": [ { - "$id": "38", + "$id": "43", "Name": "RenameGetListClient", "Description": "", "Operations": [ { - "$id": "39", + "$id": "44", "Name": "get", "ResourceName": "Project", "Description": "Gets the details of a project.", "Parameters": [ { - "$id": "40", + "$id": "45", "Name": "Endpoint", "NameInRequest": "Endpoint", "Type": { - "$id": "41", + "$id": "46", "Name": "Uri", "Kind": "Uri", "IsNullable": false @@ -319,12 +361,12 @@ "Kind": "Client" }, { - "$id": "42", + "$id": "47", "Name": "apiVersion", "NameInRequest": "api-version", "Description": "", "Type": { - "$id": "43", + "$id": "48", "Name": "String", "Kind": "String", "IsNullable": false @@ -339,9 +381,9 @@ "Explode": false, "Kind": "Client", "DefaultValue": { - "$id": "44", + "$id": "49", "Type": { - "$id": "45", + "$id": "50", "Name": "String", "Kind": "String", "IsNullable": false @@ -350,11 +392,11 @@ } }, { - "$id": "46", + "$id": "51", "Name": "projectName", "NameInRequest": "projectName", "Type": { - "$id": "47", + "$id": "52", "Name": "string", "Kind": "String", "IsNullable": false @@ -370,11 +412,11 @@ "Kind": "Method" }, { - "$id": "48", + "$id": "53", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "49", + "$id": "54", "Name": "String", "Kind": "String", "IsNullable": false @@ -389,9 +431,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "50", + "$id": "55", "Type": { - "$ref": "49" + "$ref": "54" }, "Value": "application/json" } @@ -399,7 +441,7 @@ ], "Responses": [ { - "$id": "51", + "$id": "56", "StatusCodes": [ 200 ], @@ -420,23 +462,23 @@ "GenerateConvenienceMethod": false }, { - "$id": "52", + "$id": "57", "Name": "list", "ResourceName": "Project", "Description": "Lists the existing projects.", "Parameters": [ { - "$ref": "40" + "$ref": "45" }, { - "$ref": "42" + "$ref": "47" }, { - "$id": "53", + "$id": "58", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "54", + "$id": "59", "Name": "String", "Kind": "String", "IsNullable": false @@ -451,9 +493,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "55", + "$id": "60", "Type": { - "$ref": "54" + "$ref": "59" }, "Value": "application/json" } @@ -461,7 +503,7 @@ ], "Responses": [ { - "$id": "56", + "$id": "61", "StatusCodes": [ 200 ], @@ -479,7 +521,7 @@ "Path": "/authoring/analyze-text/projects", "BufferResponse": true, "Paging": { - "$id": "57", + "$id": "62", "NextLinkName": "nextLink", "ItemName": "value" }, @@ -487,23 +529,23 @@ "GenerateConvenienceMethod": false }, { - "$id": "58", + "$id": "63", "Name": "get", "ResourceName": "Deployment", "Description": "Gets the details of a deployment.", "Parameters": [ { - "$ref": "40" + "$ref": "45" }, { - "$ref": "42" + "$ref": "47" }, { - "$id": "59", + "$id": "64", "Name": "projectName", "NameInRequest": "projectName", "Type": { - "$id": "60", + "$id": "65", "Name": "string", "Kind": "String", "IsNullable": false @@ -519,11 +561,11 @@ "Kind": "Method" }, { - "$id": "61", + "$id": "66", "Name": "deploymentName", "NameInRequest": "deploymentName", "Type": { - "$id": "62", + "$id": "67", "Name": "string", "Kind": "String", "IsNullable": false @@ -539,11 +581,11 @@ "Kind": "Method" }, { - "$id": "63", + "$id": "68", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "64", + "$id": "69", "Name": "String", "Kind": "String", "IsNullable": false @@ -558,9 +600,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "65", + "$id": "70", "Type": { - "$ref": "64" + "$ref": "69" }, "Value": "application/json" } @@ -568,7 +610,7 @@ ], "Responses": [ { - "$id": "66", + "$id": "71", "StatusCodes": [ 200 ], @@ -589,23 +631,23 @@ "GenerateConvenienceMethod": false }, { - "$id": "67", + "$id": "72", "Name": "list", "ResourceName": "Deployment", "Description": "Lists the existing deployments.", "Parameters": [ { - "$ref": "40" + "$ref": "45" }, { - "$ref": "42" + "$ref": "47" }, { - "$id": "68", + "$id": "73", "Name": "projectName", "NameInRequest": "projectName", "Type": { - "$id": "69", + "$id": "74", "Name": "string", "Kind": "String", "IsNullable": false @@ -621,11 +663,11 @@ "Kind": "Method" }, { - "$id": "70", + "$id": "75", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "71", + "$id": "76", "Name": "String", "Kind": "String", "IsNullable": false @@ -640,9 +682,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "72", + "$id": "77", "Type": { - "$ref": "71" + "$ref": "76" }, "Value": "application/json" } @@ -650,12 +692,12 @@ ], "Responses": [ { - "$id": "73", + "$id": "78", "StatusCodes": [ 200 ], "BodyType": { - "$ref": "30" + "$ref": "38" }, "BodyMediaType": "Json", "Headers": [], @@ -668,7 +710,7 @@ "Path": "/authoring/analyze-text/projects/{projectName}/deployments", "BufferResponse": true, "Paging": { - "$id": "74", + "$id": "79", "NextLinkName": "nextLink", "ItemName": "value" }, @@ -677,7 +719,7 @@ } ], "Protocol": { - "$id": "75" + "$id": "80" }, "Creatable": true } diff --git a/test/TestProjects/RenameGetList-Typespec/tests/Generated/Samples/Samples_RenameGetListClient.cs b/test/TestProjects/RenameGetList-Typespec/tests/Generated/Samples/Samples_RenameGetListClient.cs index ce0e9e114a8..54e697027b8 100644 --- a/test/TestProjects/RenameGetList-Typespec/tests/Generated/Samples/Samples_RenameGetListClient.cs +++ b/test/TestProjects/RenameGetList-Typespec/tests/Generated/Samples/Samples_RenameGetListClient.cs @@ -257,14 +257,7 @@ public void Example_GetDeployments() foreach (var item in client.GetDeployments("")) { JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); } } @@ -278,17 +271,7 @@ public void Example_GetDeployments_AllParameters() foreach (var item in client.GetDeployments("", new RequestContext())) { JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("multilingual").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); } } @@ -302,14 +285,7 @@ public async Task Example_GetDeployments_Async() await foreach (var item in client.GetDeploymentsAsync("")) { JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); } } @@ -323,17 +299,7 @@ public async Task Example_GetDeployments_AllParameters_Async() await foreach (var item in client.GetDeploymentsAsync("", new RequestContext())) { JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("multilingual").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); } } } From c40cb178990a97123febb2702fa36a51e9dc0954 Mon Sep 17 00:00:00 2001 From: pshao25 <97225342+pshao25@users.noreply.github.com> Date: Thu, 11 May 2023 16:11:39 +0800 Subject: [PATCH 3/5] update --- .../Emitter.Csharp/src/lib/model.ts | 4 ++-- .../Emitter.Csharp/src/lib/utils.ts | 20 +++++-------------- .../pagination/Generated/cadl.json | 2 +- .../src/Generated/cadl.json | 4 ++-- .../src/Generated/cadl.json | 2 +- .../src/Generated/cadl.json | 4 ++-- .../src/Generated/cadl.json | 4 ++-- 7 files changed, 15 insertions(+), 25 deletions(-) diff --git a/src/CADL.Extension/Emitter.Csharp/src/lib/model.ts b/src/CADL.Extension/Emitter.Csharp/src/lib/model.ts index a61423000aa..978d785ee5f 100644 --- a/src/CADL.Extension/Emitter.Csharp/src/lib/model.ts +++ b/src/CADL.Extension/Emitter.Csharp/src/lib/model.ts @@ -66,7 +66,7 @@ import { getSdkSimpleType, isInternal } from "@azure-tools/typespec-client-generator-core"; -import { capitalize, templateRename } from "./utils.js"; +import { capitalize, getNameForTemplate } from "./utils.js"; /** * Map calType to csharp InputTypeKind */ @@ -380,7 +380,7 @@ export function getInputType( function getInputModelForModel(m: Model): InputModelType { m = getEffectiveSchemaType(context, m) as Model; - const name = getFriendlyName(program, m) ?? templateRename(m); + const name = getFriendlyName(program, m) ?? getNameForTemplate(m); let model = models.get(name); if (!model) { const baseModel = getInputModelBaseType(m.baseModel); diff --git a/src/CADL.Extension/Emitter.Csharp/src/lib/utils.ts b/src/CADL.Extension/Emitter.Csharp/src/lib/utils.ts index d5d34988fe0..f0c374df938 100644 --- a/src/CADL.Extension/Emitter.Csharp/src/lib/utils.ts +++ b/src/CADL.Extension/Emitter.Csharp/src/lib/utils.ts @@ -4,20 +4,10 @@ export function capitalize(str: string): string { return str.charAt(0).toUpperCase() + str.slice(1); } -export function templateRename(model: Model): string { - if (model.name === "CustomPage") { - const itemType = model.templateMapper?.args[0]; - if (itemType === undefined) { - throw "Item type of a paged model should be Model"; - } - - const itemName = (itemType as Model).name; - if (itemName == null) { - throw "Item type of a paged model should have a name"; - } - - return `Paged${itemName}`; +export function getNameForTemplate(model: Model): string { + if (model.templateMapper && model.templateMapper.args) { + return model.name + model.templateMapper.args.map(it => (it as Model).name).join(""); } - + return model.name; -} +} \ No newline at end of file diff --git a/src/CADL.Extension/Emitter.Csharp/test/TestProjects/pagination/Generated/cadl.json b/src/CADL.Extension/Emitter.Csharp/test/TestProjects/pagination/Generated/cadl.json index 20aa5fd3895..c484d82f2aa 100644 --- a/src/CADL.Extension/Emitter.Csharp/test/TestProjects/pagination/Generated/cadl.json +++ b/src/CADL.Extension/Emitter.Csharp/test/TestProjects/pagination/Generated/cadl.json @@ -8,7 +8,7 @@ "Models": [ { "$id": "2", - "Name": "PagedLedgerEntry", + "Name": "CustomPageLedgerEntry", "Namespace": "Azure.Core.Foundations", "Description": "Paged collection of LedgerEntry items", "IsNullable": false, diff --git a/test/TestProjects/Authoring-Typespec/src/Generated/cadl.json b/test/TestProjects/Authoring-Typespec/src/Generated/cadl.json index 5b9d8fd39cc..a1feabf278e 100644 --- a/test/TestProjects/Authoring-Typespec/src/Generated/cadl.json +++ b/test/TestProjects/Authoring-Typespec/src/Generated/cadl.json @@ -268,7 +268,7 @@ }, { "$id": "38", - "Name": "PagedProject", + "Name": "CustomPageProject", "Namespace": "Azure.Core.Foundations", "Description": "Paged collection of Project items", "IsNullable": false, @@ -359,7 +359,7 @@ }, { "$id": "49", - "Name": "PagedDeployment", + "Name": "CustomPageDeployment", "Namespace": "Azure.Core.Foundations", "Description": "Paged collection of Deployment items", "IsNullable": false, diff --git a/test/TestProjects/MixAPIVersion-Typespec/src/Generated/cadl.json b/test/TestProjects/MixAPIVersion-Typespec/src/Generated/cadl.json index 4f7debf2ae1..5d21fb1958d 100644 --- a/test/TestProjects/MixAPIVersion-Typespec/src/Generated/cadl.json +++ b/test/TestProjects/MixAPIVersion-Typespec/src/Generated/cadl.json @@ -64,7 +64,7 @@ }, { "$id": "9", - "Name": "PagedToy", + "Name": "CustomPageToy", "Namespace": "Azure.Core.Foundations", "Description": "Paged collection of Toy items", "IsNullable": false, diff --git a/test/TestProjects/Pagination-Typespec/src/Generated/cadl.json b/test/TestProjects/Pagination-Typespec/src/Generated/cadl.json index dc05448a869..615f9add172 100644 --- a/test/TestProjects/Pagination-Typespec/src/Generated/cadl.json +++ b/test/TestProjects/Pagination-Typespec/src/Generated/cadl.json @@ -186,7 +186,7 @@ }, { "$id": "24", - "Name": "PagedTextBlocklist", + "Name": "CustomPageTextBlocklist", "Namespace": "Azure.Core.Foundations", "Description": "Paged collection of TextBlocklist items", "IsNullable": false, @@ -268,7 +268,7 @@ }, { "$id": "34", - "Name": "PagedTextBlockItem", + "Name": "CustomPageTextBlockItem", "Namespace": "Azure.Core.Foundations", "Description": "Paged collection of TextBlockItem items", "IsNullable": false, diff --git a/test/TestProjects/RenameGetList-Typespec/src/Generated/cadl.json b/test/TestProjects/RenameGetList-Typespec/src/Generated/cadl.json index 174040331c5..46607af817a 100644 --- a/test/TestProjects/RenameGetList-Typespec/src/Generated/cadl.json +++ b/test/TestProjects/RenameGetList-Typespec/src/Generated/cadl.json @@ -221,7 +221,7 @@ }, { "$id": "30", - "Name": "PagedProject", + "Name": "CustomPageProject", "Namespace": "Azure.Core.Foundations", "Description": "Paged collection of Project items", "IsNullable": false, @@ -287,7 +287,7 @@ }, { "$id": "38", - "Name": "PagedDeployment", + "Name": "CustomPageDeployment", "Namespace": "Azure.Core.Foundations", "Description": "Paged collection of Deployment items", "IsNullable": false, From 265c0bb729837ce501b07ea5f61462023b052ff9 Mon Sep 17 00:00:00 2001 From: pshao25 <97225342+pshao25@users.noreply.github.com> Date: Thu, 11 May 2023 17:01:52 +0800 Subject: [PATCH 4/5] Update --- .../Emitter.Csharp/src/lib/utils.ts | 9 +- .../azure/core/basic/src/Generated/cadl.json | 292 ++++++++++-------- 2 files changed, 173 insertions(+), 128 deletions(-) diff --git a/src/CADL.Extension/Emitter.Csharp/src/lib/utils.ts b/src/CADL.Extension/Emitter.Csharp/src/lib/utils.ts index f0c374df938..bef4425cdbc 100644 --- a/src/CADL.Extension/Emitter.Csharp/src/lib/utils.ts +++ b/src/CADL.Extension/Emitter.Csharp/src/lib/utils.ts @@ -6,8 +6,11 @@ export function capitalize(str: string): string { export function getNameForTemplate(model: Model): string { if (model.templateMapper && model.templateMapper.args) { - return model.name + model.templateMapper.args.map(it => (it as Model).name).join(""); + return ( + model.name + + model.templateMapper.args.map((it) => (it as Model).name).join("") + ); } - + return model.name; -} \ No newline at end of file +} diff --git a/test/CadlRanchProjects/azure/core/basic/src/Generated/cadl.json b/test/CadlRanchProjects/azure/core/basic/src/Generated/cadl.json index 893226cf469..7b2d0352b59 100644 --- a/test/CadlRanchProjects/azure/core/basic/src/Generated/cadl.json +++ b/test/CadlRanchProjects/azure/core/basic/src/Generated/cadl.json @@ -136,11 +136,11 @@ }, { "$id": "18", - "Name": "PagedUser", + "Name": "CustomPageUser", "Namespace": "Azure.Core.Foundations", "Description": "Paged collection of User items", "IsNullable": false, - "Usage": "Output", + "Usage": "None", "Properties": [ { "$id": "19", @@ -178,18 +178,60 @@ }, { "$id": "23", + "Name": "PagedUser", + "Namespace": "Azure.Core", + "Description": "Paged collection of User items", + "IsNullable": false, + "Usage": "Output", + "Properties": [ + { + "$id": "24", + "Name": "value", + "SerializedName": "value", + "Description": "The User items on this page", + "Type": { + "$id": "25", + "Name": "Array", + "ElementType": { + "$ref": "2" + }, + "IsNullable": false + }, + "IsRequired": true, + "IsReadOnly": false, + "IsDiscriminator": false + }, + { + "$id": "26", + "Name": "nextLink", + "SerializedName": "nextLink", + "Description": "The link to the next page of items", + "Type": { + "$id": "27", + "Name": "ResourceLocation", + "Kind": "String", + "IsNullable": false + }, + "IsRequired": false, + "IsReadOnly": false, + "IsDiscriminator": false + } + ] + }, + { + "$id": "28", "Name": "UserListResults", "Namespace": "_Specs_.Azure.Core.Basic", "IsNullable": false, "Usage": "Output", "Properties": [ { - "$id": "24", + "$id": "29", "Name": "items", "SerializedName": "items", "Description": "List of items.", "Type": { - "$id": "25", + "$id": "30", "Name": "Array", "ElementType": { "$ref": "2" @@ -201,12 +243,12 @@ "IsDiscriminator": false }, { - "$id": "26", + "$id": "31", "Name": "nextLink", "SerializedName": "nextLink", "Description": "Link to fetch more items.", "Type": { - "$id": "27", + "$id": "32", "Name": "string", "Kind": "String", "IsNullable": false @@ -220,24 +262,24 @@ ], "Clients": [ { - "$id": "28", + "$id": "33", "Name": "BasicClient", "Description": "Illustrates bodies templated with Azure Core", "Operations": [ { - "$id": "29", + "$id": "34", "Name": "createOrUpdate", "ResourceName": "User", "Summary": "Adds a user or updates a user's fields.", "Description": "Creates or updates a User", "Parameters": [ { - "$id": "30", + "$id": "35", "Name": "host", "NameInRequest": "host", "Description": "TestServer endpoint", "Type": { - "$id": "31", + "$id": "36", "Name": "String", "Kind": "String", "IsNullable": false @@ -252,9 +294,9 @@ "Explode": false, "Kind": "Client", "DefaultValue": { - "$id": "32", + "$id": "37", "Type": { - "$id": "33", + "$id": "38", "Name": "String", "Kind": "String", "IsNullable": false @@ -263,12 +305,12 @@ } }, { - "$id": "34", + "$id": "39", "Name": "apiVersion", "NameInRequest": "api-version", "Description": "", "Type": { - "$id": "35", + "$id": "40", "Name": "String", "Kind": "String", "IsNullable": false @@ -283,9 +325,9 @@ "Explode": false, "Kind": "Client", "DefaultValue": { - "$id": "36", + "$id": "41", "Type": { - "$id": "37", + "$id": "42", "Name": "String", "Kind": "String", "IsNullable": false @@ -294,12 +336,12 @@ } }, { - "$id": "38", + "$id": "43", "Name": "id", "NameInRequest": "id", "Description": "The user's id.", "Type": { - "$id": "39", + "$id": "44", "Name": "int32", "Kind": "Int32", "IsNullable": false @@ -315,15 +357,15 @@ "Kind": "Method" }, { - "$id": "40", + "$id": "45", "Name": "contentType", "NameInRequest": "Content-Type", "Description": "This request has a JSON Merge Patch body.", "Type": { - "$id": "41", + "$id": "46", "Name": "Literal", "LiteralValueType": { - "$id": "42", + "$id": "47", "Name": "String", "Kind": "String", "IsNullable": false @@ -333,9 +375,9 @@ }, "Location": "Header", "DefaultValue": { - "$id": "43", + "$id": "48", "Type": { - "$ref": "41" + "$ref": "46" }, "Value": "application/merge-patch+json" }, @@ -349,7 +391,7 @@ "Kind": "Constant" }, { - "$id": "44", + "$id": "49", "Name": "resource", "NameInRequest": "resource", "Description": "The resource instance.", @@ -367,11 +409,11 @@ "Kind": "Method" }, { - "$id": "45", + "$id": "50", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "46", + "$id": "51", "Name": "String", "Kind": "String", "IsNullable": false @@ -386,9 +428,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "47", + "$id": "52", "Type": { - "$ref": "46" + "$ref": "51" }, "Value": "application/json" } @@ -396,7 +438,7 @@ ], "Responses": [ { - "$id": "48", + "$id": "53", "StatusCodes": [ 200 ], @@ -408,7 +450,7 @@ "IsErrorResponse": false }, { - "$id": "49", + "$id": "54", "StatusCodes": [ 201 ], @@ -432,25 +474,25 @@ "GenerateConvenienceMethod": false }, { - "$id": "50", + "$id": "55", "Name": "createOrReplace", "ResourceName": "User", "Summary": "Adds a user or replaces a user's fields.", "Description": "Creates or replaces a User", "Parameters": [ { - "$ref": "30" + "$ref": "35" }, { - "$ref": "34" + "$ref": "39" }, { - "$id": "51", + "$id": "56", "Name": "id", "NameInRequest": "id", "Description": "The user's id.", "Type": { - "$id": "52", + "$id": "57", "Name": "int32", "Kind": "Int32", "IsNullable": false @@ -466,7 +508,7 @@ "Kind": "Method" }, { - "$id": "53", + "$id": "58", "Name": "resource", "NameInRequest": "resource", "Description": "The resource instance.", @@ -484,11 +526,11 @@ "Kind": "Method" }, { - "$id": "54", + "$id": "59", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "55", + "$id": "60", "Name": "String", "Kind": "String", "IsNullable": false @@ -503,19 +545,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "56", + "$id": "61", "Type": { - "$ref": "55" + "$ref": "60" }, "Value": "application/json" } }, { - "$id": "57", + "$id": "62", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "58", + "$id": "63", "Name": "String", "Kind": "String", "IsNullable": false @@ -530,9 +572,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "59", + "$id": "64", "Type": { - "$ref": "58" + "$ref": "63" }, "Value": "application/json" } @@ -540,7 +582,7 @@ ], "Responses": [ { - "$id": "60", + "$id": "65", "StatusCodes": [ 200 ], @@ -552,7 +594,7 @@ "IsErrorResponse": false }, { - "$id": "61", + "$id": "66", "StatusCodes": [ 201 ], @@ -576,25 +618,25 @@ "GenerateConvenienceMethod": true }, { - "$id": "62", + "$id": "67", "Name": "get", "ResourceName": "User", "Summary": "Gets a user.", "Description": "Gets a User", "Parameters": [ { - "$ref": "30" + "$ref": "35" }, { - "$ref": "34" + "$ref": "39" }, { - "$id": "63", + "$id": "68", "Name": "id", "NameInRequest": "id", "Description": "The user's id.", "Type": { - "$id": "64", + "$id": "69", "Name": "int32", "Kind": "Int32", "IsNullable": false @@ -610,11 +652,11 @@ "Kind": "Method" }, { - "$id": "65", + "$id": "70", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "66", + "$id": "71", "Name": "String", "Kind": "String", "IsNullable": false @@ -629,9 +671,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "67", + "$id": "72", "Type": { - "$ref": "66" + "$ref": "71" }, "Value": "application/json" } @@ -639,7 +681,7 @@ ], "Responses": [ { - "$id": "68", + "$id": "73", "StatusCodes": [ 200 ], @@ -660,25 +702,25 @@ "GenerateConvenienceMethod": true }, { - "$id": "69", + "$id": "74", "Name": "list", "ResourceName": "User", "Summary": "Lists all users.", "Description": "Lists all Users", "Parameters": [ { - "$ref": "30" + "$ref": "35" }, { - "$ref": "34" + "$ref": "39" }, { - "$id": "70", + "$id": "75", "Name": "top", "NameInRequest": "top", "Description": "The number of result items to return.", "Type": { - "$id": "71", + "$id": "76", "Name": "int32", "Kind": "Int32", "IsNullable": false @@ -694,12 +736,12 @@ "Kind": "Method" }, { - "$id": "72", + "$id": "77", "Name": "skip", "NameInRequest": "skip", "Description": "The number of result items to skip.", "Type": { - "$id": "73", + "$id": "78", "Name": "int32", "Kind": "Int32", "IsNullable": false @@ -715,12 +757,12 @@ "Kind": "Method" }, { - "$id": "74", + "$id": "79", "Name": "maxpagesize", "NameInRequest": "maxpagesize", "Description": "The maximum number of result items per page.", "Type": { - "$id": "75", + "$id": "80", "Name": "int32", "Kind": "Int32", "IsNullable": false @@ -736,15 +778,15 @@ "Kind": "Method" }, { - "$id": "76", + "$id": "81", "Name": "orderby", "NameInRequest": "orderby", "Description": "Expressions that specify the order of returned results.", "Type": { - "$id": "77", + "$id": "82", "Name": "Array", "ElementType": { - "$id": "78", + "$id": "83", "Name": "string", "Kind": "String", "IsNullable": false @@ -762,12 +804,12 @@ "Kind": "Method" }, { - "$id": "79", + "$id": "84", "Name": "filter", "NameInRequest": "filter", "Description": "Filter the result list using the given expression.", "Type": { - "$id": "80", + "$id": "85", "Name": "string", "Kind": "String", "IsNullable": false @@ -783,15 +825,15 @@ "Kind": "Method" }, { - "$id": "81", + "$id": "86", "Name": "select", "NameInRequest": "select", "Description": "Select the specified fields to be included in the response.", "Type": { - "$id": "82", + "$id": "87", "Name": "Array", "ElementType": { - "$id": "83", + "$id": "88", "Name": "string", "Kind": "String", "IsNullable": false @@ -809,15 +851,15 @@ "Kind": "Method" }, { - "$id": "84", + "$id": "89", "Name": "expand", "NameInRequest": "expand", "Description": "Expand the indicated resources into the response.", "Type": { - "$id": "85", + "$id": "90", "Name": "Array", "ElementType": { - "$id": "86", + "$id": "91", "Name": "string", "Kind": "String", "IsNullable": false @@ -835,11 +877,11 @@ "Kind": "Method" }, { - "$id": "87", + "$id": "92", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "88", + "$id": "93", "Name": "String", "Kind": "String", "IsNullable": false @@ -854,9 +896,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "89", + "$id": "94", "Type": { - "$ref": "88" + "$ref": "93" }, "Value": "application/json" } @@ -864,7 +906,7 @@ ], "Responses": [ { - "$id": "90", + "$id": "95", "StatusCodes": [ 200 ], @@ -882,7 +924,7 @@ "Path": "/azure/core/basic/users", "BufferResponse": true, "Paging": { - "$id": "91", + "$id": "96", "NextLinkName": "nextLink", "ItemName": "value" }, @@ -890,23 +932,23 @@ "GenerateConvenienceMethod": true }, { - "$id": "92", + "$id": "97", "Name": "listWithPage", "ResourceName": "Basic", "Description": "List with Azure.Core.Page<>.", "Parameters": [ { - "$ref": "30" + "$ref": "35" }, { - "$ref": "34" + "$ref": "39" }, { - "$id": "93", + "$id": "98", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "94", + "$id": "99", "Name": "String", "Kind": "String", "IsNullable": false @@ -921,9 +963,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "95", + "$id": "100", "Type": { - "$ref": "94" + "$ref": "99" }, "Value": "application/json" } @@ -931,12 +973,12 @@ ], "Responses": [ { - "$id": "96", + "$id": "101", "StatusCodes": [ 200 ], "BodyType": { - "$ref": "18" + "$ref": "23" }, "BodyMediaType": "Json", "Headers": [], @@ -949,7 +991,7 @@ "Path": "/azure/core/basic/page", "BufferResponse": true, "Paging": { - "$id": "97", + "$id": "102", "NextLinkName": "nextLink", "ItemName": "value" }, @@ -957,23 +999,23 @@ "GenerateConvenienceMethod": true }, { - "$id": "98", + "$id": "103", "Name": "listWithCustomPageModel", "ResourceName": "Basic", "Description": "List with custom page model.", "Parameters": [ { - "$ref": "30" + "$ref": "35" }, { - "$ref": "34" + "$ref": "39" }, { - "$id": "99", + "$id": "104", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "100", + "$id": "105", "Name": "String", "Kind": "String", "IsNullable": false @@ -988,9 +1030,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "101", + "$id": "106", "Type": { - "$ref": "100" + "$ref": "105" }, "Value": "application/json" } @@ -998,12 +1040,12 @@ ], "Responses": [ { - "$id": "102", + "$id": "107", "StatusCodes": [ 200 ], "BodyType": { - "$ref": "23" + "$ref": "28" }, "BodyMediaType": "Json", "Headers": [], @@ -1016,7 +1058,7 @@ "Path": "/azure/core/basic/custom-page", "BufferResponse": true, "Paging": { - "$id": "103", + "$id": "108", "NextLinkName": "nextLink", "ItemName": "items" }, @@ -1024,25 +1066,25 @@ "GenerateConvenienceMethod": true }, { - "$id": "104", + "$id": "109", "Name": "delete", "ResourceName": "User", "Summary": "Deletes a user.", "Description": "Deletes a User", "Parameters": [ { - "$ref": "30" + "$ref": "35" }, { - "$ref": "34" + "$ref": "39" }, { - "$id": "105", + "$id": "110", "Name": "id", "NameInRequest": "id", "Description": "The user's id.", "Type": { - "$id": "106", + "$id": "111", "Name": "int32", "Kind": "Int32", "IsNullable": false @@ -1058,11 +1100,11 @@ "Kind": "Method" }, { - "$id": "107", + "$id": "112", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "108", + "$id": "113", "Name": "String", "Kind": "String", "IsNullable": false @@ -1077,9 +1119,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "109", + "$id": "114", "Type": { - "$ref": "108" + "$ref": "113" }, "Value": "application/json" } @@ -1087,7 +1129,7 @@ ], "Responses": [ { - "$id": "110", + "$id": "115", "StatusCodes": [ 204 ], @@ -1105,25 +1147,25 @@ "GenerateConvenienceMethod": true }, { - "$id": "111", + "$id": "116", "Name": "export", "ResourceName": "Basic", "Summary": "Exports a user.", "Description": "Exports a User", "Parameters": [ { - "$ref": "30" + "$ref": "35" }, { - "$ref": "34" + "$ref": "39" }, { - "$id": "112", + "$id": "117", "Name": "id", "NameInRequest": "id", "Description": "The user's id.", "Type": { - "$id": "113", + "$id": "118", "Name": "int32", "Kind": "Int32", "IsNullable": false @@ -1139,12 +1181,12 @@ "Kind": "Method" }, { - "$id": "114", + "$id": "119", "Name": "format", "NameInRequest": "format", "Description": "The format of the data.", "Type": { - "$id": "115", + "$id": "120", "Name": "string", "Kind": "String", "IsNullable": false @@ -1160,11 +1202,11 @@ "Kind": "Method" }, { - "$id": "116", + "$id": "121", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "117", + "$id": "122", "Name": "String", "Kind": "String", "IsNullable": false @@ -1179,9 +1221,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "118", + "$id": "123", "Type": { - "$ref": "117" + "$ref": "122" }, "Value": "application/json" } @@ -1189,7 +1231,7 @@ ], "Responses": [ { - "$id": "119", + "$id": "124", "StatusCodes": [ 200 ], @@ -1211,7 +1253,7 @@ } ], "Protocol": { - "$id": "120" + "$id": "125" }, "Creatable": true } From 3e07041b202ea494c68de944d5184229f4d9b772 Mon Sep 17 00:00:00 2001 From: m-nash Date: Fri, 12 May 2023 11:02:35 -0700 Subject: [PATCH 5/5] comment out shared source check until 3392 gets merged --- eng/SharedCodeCheck.ps1 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/eng/SharedCodeCheck.ps1 b/eng/SharedCodeCheck.ps1 index 77c53548dbc..a06928aec69 100644 --- a/eng/SharedCodeCheck.ps1 +++ b/eng/SharedCodeCheck.ps1 @@ -3,9 +3,10 @@ $ErrorActionPreference = 'Stop' Set-StrictMode -Version 1 -Write-Host 'Downloading shared source files...' -& (Join-Path $PSScriptRoot 'DownloadSharedSource.ps1') -Write-Host 'Shared source files are downloaded' +#uncomment when this is fixed https://github.com/Azure/autorest.csharp/pull/3392 +#Write-Host 'Downloading shared source files...' +#& (Join-Path $PSScriptRoot 'DownloadSharedSource.ps1') +#Write-Host 'Shared source files are downloaded' Write-Host 'Checking file difference...' git -c core.safecrlf=false diff --ignore-space-at-eol --exit-code