diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/api/Azure.AI.DocumentIntelligence.netstandard2.0.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/api/Azure.AI.DocumentIntelligence.netstandard2.0.cs index e52d486aea6c..da1ba23d9c2e 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/api/Azure.AI.DocumentIntelligence.netstandard2.0.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/api/Azure.AI.DocumentIntelligence.netstandard2.0.cs @@ -24,18 +24,16 @@ public static partial class AIDocumentIntelligenceModelFactory public static Azure.AI.DocumentIntelligence.AnalyzedDocument AnalyzedDocument(string docType = null, System.Collections.Generic.IEnumerable boundingRegions = null, System.Collections.Generic.IEnumerable spans = null, System.Collections.Generic.IReadOnlyDictionary fields = null, float confidence = 0f) { throw null; } public static Azure.AI.DocumentIntelligence.AnalyzeResult AnalyzeResult(string apiVersion = null, string modelId = null, Azure.AI.DocumentIntelligence.StringIndexType stringIndexType = default(Azure.AI.DocumentIntelligence.StringIndexType), Azure.AI.DocumentIntelligence.ContentFormat? contentFormat = default(Azure.AI.DocumentIntelligence.ContentFormat?), string content = null, System.Collections.Generic.IEnumerable pages = null, System.Collections.Generic.IEnumerable paragraphs = null, System.Collections.Generic.IEnumerable tables = null, System.Collections.Generic.IEnumerable figures = null, System.Collections.Generic.IEnumerable lists = null, System.Collections.Generic.IEnumerable sections = null, System.Collections.Generic.IEnumerable keyValuePairs = null, System.Collections.Generic.IEnumerable styles = null, System.Collections.Generic.IEnumerable languages = null, System.Collections.Generic.IEnumerable documents = null) { throw null; } public static Azure.AI.DocumentIntelligence.BoundingRegion BoundingRegion(int pageNumber = 0, System.Collections.Generic.IEnumerable polygon = null) { throw null; } - public static Azure.AI.DocumentIntelligence.ChatIndexBuildOperationDetails ChatIndexBuildOperationDetails(System.Guid operationId = default(System.Guid), Azure.AI.DocumentIntelligence.OperationStatus status = default(Azure.AI.DocumentIntelligence.OperationStatus), int? percentCompleted = default(int?), System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.Uri resourceLocation = null, string apiVersion = null, System.Collections.Generic.IReadOnlyDictionary tags = null, Azure.AI.DocumentIntelligence.DocumentIntelligenceError error = null, Azure.AI.DocumentIntelligence.ChatIndexDetails result = null) { throw null; } - public static Azure.AI.DocumentIntelligence.ChatIndexDetails ChatIndexDetails(string chatId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset expirationDateTime = default(System.DateTimeOffset), string apiVersion = null) { throw null; } public static Azure.AI.DocumentIntelligence.CurrencyValue CurrencyValue(double amount = 0, string currencySymbol = null, string currencyCode = null) { throw null; } public static Azure.AI.DocumentIntelligence.CustomDocumentModelsDetails CustomDocumentModelsDetails(int count = 0, int limit = 0) { throw null; } public static Azure.AI.DocumentIntelligence.DocumentBarcode DocumentBarcode(Azure.AI.DocumentIntelligence.DocumentBarcodeKind kind = default(Azure.AI.DocumentIntelligence.DocumentBarcodeKind), string value = null, System.Collections.Generic.IEnumerable polygon = null, Azure.AI.DocumentIntelligence.DocumentSpan span = null, float confidence = 0f) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentCaption DocumentCaption(string content = null, System.Collections.Generic.IEnumerable boundingRegions = null, System.Collections.Generic.IEnumerable spans = null, System.Collections.Generic.IEnumerable elements = null) { throw null; } + public static Azure.AI.DocumentIntelligence.DocumentCaption DocumentCaption(string content = null, System.Collections.Generic.IEnumerable boundingRegions = null, System.Collections.Generic.IEnumerable spans = null, System.Collections.Generic.IEnumerable elements = null) { throw null; } public static Azure.AI.DocumentIntelligence.DocumentClassifierBuildOperationDetails DocumentClassifierBuildOperationDetails(System.Guid operationId = default(System.Guid), Azure.AI.DocumentIntelligence.OperationStatus status = default(Azure.AI.DocumentIntelligence.OperationStatus), int? percentCompleted = default(int?), System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.Uri resourceLocation = null, string apiVersion = null, System.Collections.Generic.IReadOnlyDictionary tags = null, Azure.AI.DocumentIntelligence.DocumentIntelligenceError error = null, Azure.AI.DocumentIntelligence.DocumentClassifierDetails result = null) { throw null; } public static Azure.AI.DocumentIntelligence.DocumentClassifierDetails DocumentClassifierDetails(string classifierId = null, string description = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), string apiVersion = null, System.Collections.Generic.IReadOnlyDictionary docTypes = null) { throw null; } public static Azure.AI.DocumentIntelligence.DocumentField DocumentField(Azure.AI.DocumentIntelligence.DocumentFieldType type = default(Azure.AI.DocumentIntelligence.DocumentFieldType), string valueString = null, System.DateTimeOffset? valueDate = default(System.DateTimeOffset?), System.TimeSpan? valueTime = default(System.TimeSpan?), string valuePhoneNumber = null, double? valueNumber = default(double?), long? valueInteger = default(long?), Azure.AI.DocumentIntelligence.DocumentSelectionMarkState? valueSelectionMark = default(Azure.AI.DocumentIntelligence.DocumentSelectionMarkState?), Azure.AI.DocumentIntelligence.DocumentSignatureType? valueSignature = default(Azure.AI.DocumentIntelligence.DocumentSignatureType?), string valueCountryRegion = null, System.Collections.Generic.IEnumerable valueArray = null, System.Collections.Generic.IReadOnlyDictionary valueObject = null, Azure.AI.DocumentIntelligence.CurrencyValue valueCurrency = null, Azure.AI.DocumentIntelligence.AddressValue valueAddress = null, bool? valueBoolean = default(bool?), string content = null, System.Collections.Generic.IEnumerable boundingRegions = null, System.Collections.Generic.IEnumerable spans = null, float? confidence = default(float?)) { throw null; } public static Azure.AI.DocumentIntelligence.DocumentFieldSchema DocumentFieldSchema(Azure.AI.DocumentIntelligence.DocumentFieldType type = default(Azure.AI.DocumentIntelligence.DocumentFieldType), string description = null, string example = null, Azure.AI.DocumentIntelligence.DocumentFieldSchema items = null, System.Collections.Generic.IReadOnlyDictionary properties = null) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentFigure DocumentFigure(System.Collections.Generic.IEnumerable boundingRegions = null, System.Collections.Generic.IEnumerable spans = null, System.Collections.Generic.IEnumerable elements = null, Azure.AI.DocumentIntelligence.DocumentCaption caption = null, System.Collections.Generic.IEnumerable footnotes = null) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentFootnote DocumentFootnote(string content = null, System.Collections.Generic.IEnumerable boundingRegions = null, System.Collections.Generic.IEnumerable spans = null, System.Collections.Generic.IEnumerable elements = null) { throw null; } + public static Azure.AI.DocumentIntelligence.DocumentFigure DocumentFigure(System.Collections.Generic.IEnumerable boundingRegions = null, System.Collections.Generic.IEnumerable spans = null, System.Collections.Generic.IEnumerable elements = null, Azure.AI.DocumentIntelligence.DocumentCaption caption = null, System.Collections.Generic.IEnumerable footnotes = null) { throw null; } + public static Azure.AI.DocumentIntelligence.DocumentFootnote DocumentFootnote(string content = null, System.Collections.Generic.IEnumerable boundingRegions = null, System.Collections.Generic.IEnumerable spans = null, System.Collections.Generic.IEnumerable elements = null) { throw null; } public static Azure.AI.DocumentIntelligence.DocumentFormula DocumentFormula(Azure.AI.DocumentIntelligence.DocumentFormulaKind kind = default(Azure.AI.DocumentIntelligence.DocumentFormulaKind), string value = null, System.Collections.Generic.IEnumerable polygon = null, Azure.AI.DocumentIntelligence.DocumentSpan span = null, float confidence = 0f) { throw null; } public static Azure.AI.DocumentIntelligence.DocumentIntelligenceError DocumentIntelligenceError(string code = null, string message = null, string target = null, System.Collections.Generic.IEnumerable details = null, Azure.AI.DocumentIntelligence.InnerError innererror = null) { throw null; } public static Azure.AI.DocumentIntelligence.DocumentKeyValueElement DocumentKeyValueElement(string content = null, System.Collections.Generic.IEnumerable boundingRegions = null, System.Collections.Generic.IEnumerable spans = null) { throw null; } @@ -43,25 +41,23 @@ public static partial class AIDocumentIntelligenceModelFactory public static Azure.AI.DocumentIntelligence.DocumentLanguage DocumentLanguage(string locale = null, System.Collections.Generic.IEnumerable spans = null, float confidence = 0f) { throw null; } public static Azure.AI.DocumentIntelligence.DocumentLine DocumentLine(string content = null, System.Collections.Generic.IEnumerable polygon = null, System.Collections.Generic.IEnumerable spans = null) { throw null; } public static Azure.AI.DocumentIntelligence.DocumentList DocumentList(System.Collections.Generic.IEnumerable spans = null, System.Collections.Generic.IEnumerable items = null) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentListItem DocumentListItem(int level = 0, string content = null, System.Collections.Generic.IEnumerable boundingRegions = null, System.Collections.Generic.IEnumerable spans = null, System.Collections.Generic.IEnumerable elements = null) { throw null; } + public static Azure.AI.DocumentIntelligence.DocumentListItem DocumentListItem(int level = 0, string content = null, System.Collections.Generic.IEnumerable boundingRegions = null, System.Collections.Generic.IEnumerable spans = null, System.Collections.Generic.IEnumerable elements = null) { throw null; } public static Azure.AI.DocumentIntelligence.DocumentModelBuildOperationDetails DocumentModelBuildOperationDetails(System.Guid operationId = default(System.Guid), Azure.AI.DocumentIntelligence.OperationStatus status = default(Azure.AI.DocumentIntelligence.OperationStatus), int? percentCompleted = default(int?), System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.Uri resourceLocation = null, string apiVersion = null, System.Collections.Generic.IReadOnlyDictionary tags = null, Azure.AI.DocumentIntelligence.DocumentIntelligenceError error = null, Azure.AI.DocumentIntelligence.DocumentModelDetails result = null) { throw null; } public static Azure.AI.DocumentIntelligence.DocumentModelComposeOperationDetails DocumentModelComposeOperationDetails(System.Guid operationId = default(System.Guid), Azure.AI.DocumentIntelligence.OperationStatus status = default(Azure.AI.DocumentIntelligence.OperationStatus), int? percentCompleted = default(int?), System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.Uri resourceLocation = null, string apiVersion = null, System.Collections.Generic.IReadOnlyDictionary tags = null, Azure.AI.DocumentIntelligence.DocumentIntelligenceError error = null, Azure.AI.DocumentIntelligence.DocumentModelDetails result = null) { throw null; } public static Azure.AI.DocumentIntelligence.DocumentModelCopyToOperationDetails DocumentModelCopyToOperationDetails(System.Guid operationId = default(System.Guid), Azure.AI.DocumentIntelligence.OperationStatus status = default(Azure.AI.DocumentIntelligence.OperationStatus), int? percentCompleted = default(int?), System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.Uri resourceLocation = null, string apiVersion = null, System.Collections.Generic.IReadOnlyDictionary tags = null, Azure.AI.DocumentIntelligence.DocumentIntelligenceError error = null, Azure.AI.DocumentIntelligence.DocumentModelDetails result = null) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentModelDetails DocumentModelDetails(string modelId = null, string description = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), string apiVersion = null, System.Collections.Generic.IReadOnlyDictionary tags = null, Azure.AI.DocumentIntelligence.DocumentBuildMode buildMode = default(Azure.AI.DocumentIntelligence.DocumentBuildMode), Azure.AI.DocumentIntelligence.AzureBlobContentSource azureBlobSource = null, Azure.AI.DocumentIntelligence.AzureBlobFileListContentSource azureBlobFileListSource = null, System.Collections.Generic.IReadOnlyDictionary docTypes = null) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentModelSummary DocumentModelSummary(string modelId = null, string description = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), string apiVersion = null, System.Collections.Generic.IReadOnlyDictionary tags = null) { throw null; } + public static Azure.AI.DocumentIntelligence.DocumentModelDetails DocumentModelDetails(string modelId = null, string description = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), string apiVersion = null, System.Collections.Generic.IReadOnlyDictionary tags = null, Azure.AI.DocumentIntelligence.DocumentBuildMode? buildMode = default(Azure.AI.DocumentIntelligence.DocumentBuildMode?), Azure.AI.DocumentIntelligence.AzureBlobContentSource azureBlobSource = null, Azure.AI.DocumentIntelligence.AzureBlobFileListContentSource azureBlobFileListSource = null, System.Collections.Generic.IReadOnlyDictionary docTypes = null) { throw null; } public static Azure.AI.DocumentIntelligence.DocumentPage DocumentPage(int pageNumber = 0, float? angle = default(float?), float? width = default(float?), float? height = default(float?), Azure.AI.DocumentIntelligence.LengthUnit? unit = default(Azure.AI.DocumentIntelligence.LengthUnit?), System.Collections.Generic.IEnumerable spans = null, System.Collections.Generic.IEnumerable words = null, System.Collections.Generic.IEnumerable selectionMarks = null, System.Collections.Generic.IEnumerable lines = null, System.Collections.Generic.IEnumerable barcodes = null, System.Collections.Generic.IEnumerable formulas = null) { throw null; } public static Azure.AI.DocumentIntelligence.DocumentParagraph DocumentParagraph(Azure.AI.DocumentIntelligence.ParagraphRole? role = default(Azure.AI.DocumentIntelligence.ParagraphRole?), string content = null, System.Collections.Generic.IEnumerable boundingRegions = null, System.Collections.Generic.IEnumerable spans = null) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentSection DocumentSection(System.Collections.Generic.IEnumerable spans = null, System.Collections.Generic.IEnumerable elements = null) { throw null; } + public static Azure.AI.DocumentIntelligence.DocumentSection DocumentSection(System.Collections.Generic.IEnumerable spans = null, System.Collections.Generic.IEnumerable elements = null) { throw null; } public static Azure.AI.DocumentIntelligence.DocumentSelectionMark DocumentSelectionMark(Azure.AI.DocumentIntelligence.DocumentSelectionMarkState state = default(Azure.AI.DocumentIntelligence.DocumentSelectionMarkState), System.Collections.Generic.IEnumerable polygon = null, Azure.AI.DocumentIntelligence.DocumentSpan span = null, float confidence = 0f) { throw null; } public static Azure.AI.DocumentIntelligence.DocumentSpan DocumentSpan(int offset = 0, int length = 0) { throw null; } public static Azure.AI.DocumentIntelligence.DocumentStyle DocumentStyle(bool? isHandwritten = default(bool?), string similarFontFamily = null, Azure.AI.DocumentIntelligence.FontStyle? fontStyle = default(Azure.AI.DocumentIntelligence.FontStyle?), Azure.AI.DocumentIntelligence.FontWeight? fontWeight = default(Azure.AI.DocumentIntelligence.FontWeight?), string color = null, string backgroundColor = null, System.Collections.Generic.IEnumerable spans = null, float confidence = 0f) { throw null; } public static Azure.AI.DocumentIntelligence.DocumentTable DocumentTable(int rowCount = 0, int columnCount = 0, System.Collections.Generic.IEnumerable cells = null, System.Collections.Generic.IEnumerable boundingRegions = null, System.Collections.Generic.IEnumerable spans = null, Azure.AI.DocumentIntelligence.DocumentCaption caption = null, System.Collections.Generic.IEnumerable footnotes = null) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentTableCell DocumentTableCell(Azure.AI.DocumentIntelligence.DocumentTableCellKind? kind = default(Azure.AI.DocumentIntelligence.DocumentTableCellKind?), int rowIndex = 0, int columnIndex = 0, int? rowSpan = default(int?), int? columnSpan = default(int?), string content = null, System.Collections.Generic.IEnumerable boundingRegions = null, System.Collections.Generic.IEnumerable spans = null, System.Collections.Generic.IEnumerable elements = null) { throw null; } + public static Azure.AI.DocumentIntelligence.DocumentTableCell DocumentTableCell(Azure.AI.DocumentIntelligence.DocumentTableCellKind? kind = default(Azure.AI.DocumentIntelligence.DocumentTableCellKind?), int rowIndex = 0, int columnIndex = 0, int? rowSpan = default(int?), int? columnSpan = default(int?), string content = null, System.Collections.Generic.IEnumerable boundingRegions = null, System.Collections.Generic.IEnumerable spans = null, System.Collections.Generic.IEnumerable elements = null) { throw null; } public static Azure.AI.DocumentIntelligence.DocumentTypeDetails DocumentTypeDetails(string description = null, Azure.AI.DocumentIntelligence.DocumentBuildMode? buildMode = default(Azure.AI.DocumentIntelligence.DocumentBuildMode?), System.Collections.Generic.IReadOnlyDictionary fieldSchema = null, System.Collections.Generic.IReadOnlyDictionary fieldConfidence = null) { throw null; } public static Azure.AI.DocumentIntelligence.DocumentWord DocumentWord(string content = null, System.Collections.Generic.IEnumerable polygon = null, Azure.AI.DocumentIntelligence.DocumentSpan span = null, float confidence = 0f) { throw null; } - public static Azure.AI.DocumentIntelligence.InnerError InnerError(string code = null, string message = null, Azure.AI.DocumentIntelligence.InnerError innererror = null) { throw null; } + public static Azure.AI.DocumentIntelligence.InnerError InnerError(string code = null, string message = null, Azure.AI.DocumentIntelligence.InnerError innerErrorObject = null) { throw null; } public static Azure.AI.DocumentIntelligence.OperationDetails OperationDetails(System.Guid operationId = default(System.Guid), Azure.AI.DocumentIntelligence.OperationStatus status = default(Azure.AI.DocumentIntelligence.OperationStatus), int? percentCompleted = default(int?), System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), string kind = "Unknown", System.Uri resourceLocation = null, string apiVersion = null, System.Collections.Generic.IReadOnlyDictionary tags = null, Azure.AI.DocumentIntelligence.DocumentIntelligenceError error = null) { throw null; } - public static Azure.AI.DocumentIntelligence.OperationSummary OperationSummary(System.Guid operationId = default(System.Guid), Azure.AI.DocumentIntelligence.OperationStatus status = default(Azure.AI.DocumentIntelligence.OperationStatus), int? percentCompleted = default(int?), System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), Azure.AI.DocumentIntelligence.OperationKind kind = default(Azure.AI.DocumentIntelligence.OperationKind), System.Uri resourceLocation = null, string apiVersion = null, System.Collections.Generic.IReadOnlyDictionary tags = null) { throw null; } public static Azure.AI.DocumentIntelligence.QuotaDetails QuotaDetails(int used = 0, int quota = 0, System.DateTimeOffset quotaResetDateTime = default(System.DateTimeOffset)) { throw null; } public static Azure.AI.DocumentIntelligence.ResourceDetails ResourceDetails(Azure.AI.DocumentIntelligence.CustomDocumentModelsDetails customDocumentModels = null, Azure.AI.DocumentIntelligence.QuotaDetails customNeuralDocumentModelBuilds = null) { throw null; } } @@ -111,9 +107,7 @@ public partial class AzureAIDocumentIntelligenceClientOptions : Azure.Core.Clien public AzureAIDocumentIntelligenceClientOptions(Azure.AI.DocumentIntelligence.AzureAIDocumentIntelligenceClientOptions.ServiceVersion version = Azure.AI.DocumentIntelligence.AzureAIDocumentIntelligenceClientOptions.ServiceVersion.V2023_10_31_Preview) { } public enum ServiceVersion { - V2022_08_31 = 1, - V2023_07_31 = 2, - V2023_10_31_Preview = 3, + V2023_10_31_Preview = 1, } } public partial class AzureBlobContentSource @@ -151,23 +145,6 @@ public BuildDocumentModelRequest(string modelId, Azure.AI.DocumentIntelligence.D public string ModelId { get { throw null; } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } } - public partial class ChatIndexBuildOperationDetails : Azure.AI.DocumentIntelligence.OperationDetails - { - internal ChatIndexBuildOperationDetails() : base (default(Azure.AI.DocumentIntelligence.OperationStatus), default(System.DateTimeOffset), default(System.DateTimeOffset), default(System.Uri)) { } - public Azure.AI.DocumentIntelligence.ChatIndexDetails Result { get { throw null; } } - } - public partial class ChatIndexDetails : Azure.AI.DocumentIntelligence.ChatIndexSummary - { - internal ChatIndexDetails() { } - } - public partial class ChatIndexSummary - { - internal ChatIndexSummary() { } - public string ApiVersion { get { throw null; } } - public string ChatId { get { throw null; } } - public System.DateTimeOffset CreatedDateTime { get { throw null; } } - public System.DateTimeOffset ExpirationDateTime { get { throw null; } } - } public partial class ClassifierDocumentTypeDetails { public ClassifierDocumentTypeDetails() { } @@ -260,6 +237,8 @@ public partial class DocumentAnalysisClient protected DocumentAnalysisClient() { } public DocumentAnalysisClient(System.Uri endpoint, Azure.AzureKeyCredential credential) { } public DocumentAnalysisClient(System.Uri endpoint, Azure.AzureKeyCredential credential, Azure.AI.DocumentIntelligence.AzureAIDocumentIntelligenceClientOptions options) { } + public DocumentAnalysisClient(System.Uri endpoint, Azure.Core.TokenCredential credential) { } + public DocumentAnalysisClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.AI.DocumentIntelligence.AzureAIDocumentIntelligenceClientOptions options) { } public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } public virtual Azure.Operation AnalyzeDocument(Azure.WaitUntil waitUntil, string modelId, Azure.AI.DocumentIntelligence.AnalyzeDocumentRequest analyzeRequest = null, string pages = null, string locale = null, Azure.AI.DocumentIntelligence.StringIndexType? stringIndexType = default(Azure.AI.DocumentIntelligence.StringIndexType?), System.Collections.Generic.IEnumerable features = null, System.Collections.Generic.IEnumerable queryFields = null, Azure.AI.DocumentIntelligence.ContentFormat? outputContentFormat = default(Azure.AI.DocumentIntelligence.ContentFormat?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Operation AnalyzeDocument(Azure.WaitUntil waitUntil, string modelId, Azure.Core.RequestContent content, string pages = null, string locale = null, string stringIndexType = null, System.Collections.Generic.IEnumerable features = null, System.Collections.Generic.IEnumerable queryFields = null, string outputContentFormat = null, Azure.RequestContext context = null) { throw null; } @@ -358,12 +337,12 @@ public partial class DocumentCaption internal DocumentCaption() { } public System.Collections.Generic.IReadOnlyList BoundingRegions { get { throw null; } } public string Content { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Elements { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Elements { get { throw null; } } public System.Collections.Generic.IReadOnlyList Spans { get { throw null; } } } public partial class DocumentClassifierBuildOperationDetails : Azure.AI.DocumentIntelligence.OperationDetails { - internal DocumentClassifierBuildOperationDetails() : base (default(Azure.AI.DocumentIntelligence.OperationStatus), default(System.DateTimeOffset), default(System.DateTimeOffset), default(System.Uri)) { } + internal DocumentClassifierBuildOperationDetails() : base (default(System.Guid), default(Azure.AI.DocumentIntelligence.OperationStatus), default(System.DateTimeOffset), default(System.DateTimeOffset), default(System.Uri)) { } public Azure.AI.DocumentIntelligence.DocumentClassifierDetails Result { get { throw null; } } } public partial class DocumentClassifierDetails @@ -443,7 +422,7 @@ public partial class DocumentFigure internal DocumentFigure() { } public System.Collections.Generic.IReadOnlyList BoundingRegions { get { throw null; } } public Azure.AI.DocumentIntelligence.DocumentCaption Caption { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Elements { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Elements { get { throw null; } } public System.Collections.Generic.IReadOnlyList Footnotes { get { throw null; } } public System.Collections.Generic.IReadOnlyList Spans { get { throw null; } } } @@ -452,7 +431,7 @@ public partial class DocumentFootnote internal DocumentFootnote() { } public System.Collections.Generic.IReadOnlyList BoundingRegions { get { throw null; } } public string Content { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Elements { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Elements { get { throw null; } } public System.Collections.Generic.IReadOnlyList Spans { get { throw null; } } } public partial class DocumentFormula @@ -530,7 +509,7 @@ public partial class DocumentListItem internal DocumentListItem() { } public System.Collections.Generic.IReadOnlyList BoundingRegions { get { throw null; } } public string Content { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Elements { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Elements { get { throw null; } } public int Level { get { throw null; } } public System.Collections.Generic.IReadOnlyList Spans { get { throw null; } } } @@ -539,6 +518,8 @@ public partial class DocumentModelAdministrationClient protected DocumentModelAdministrationClient() { } public DocumentModelAdministrationClient(System.Uri endpoint, Azure.AzureKeyCredential credential) { } public DocumentModelAdministrationClient(System.Uri endpoint, Azure.AzureKeyCredential credential, Azure.AI.DocumentIntelligence.AzureAIDocumentIntelligenceClientOptions options) { } + public DocumentModelAdministrationClient(System.Uri endpoint, Azure.Core.TokenCredential credential) { } + public DocumentModelAdministrationClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.AI.DocumentIntelligence.AzureAIDocumentIntelligenceClientOptions options) { } public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } public virtual Azure.Response AuthorizeModelCopy(Azure.AI.DocumentIntelligence.AuthorizeCopyRequest authorizeCopyRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response AuthorizeModelCopy(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } @@ -548,10 +529,10 @@ public DocumentModelAdministrationClient(System.Uri endpoint, Azure.AzureKeyCred public virtual Azure.Operation BuildClassifier(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task> BuildClassifierAsync(Azure.WaitUntil waitUntil, Azure.AI.DocumentIntelligence.BuildDocumentClassifierRequest buildRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> BuildClassifierAsync(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Operation BuildDocument(Azure.WaitUntil waitUntil, Azure.AI.DocumentIntelligence.BuildDocumentModelRequest buildRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Operation BuildDocument(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> BuildDocumentAsync(Azure.WaitUntil waitUntil, Azure.AI.DocumentIntelligence.BuildDocumentModelRequest buildRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> BuildDocumentAsync(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation BuildDocumentModel(Azure.WaitUntil waitUntil, Azure.AI.DocumentIntelligence.BuildDocumentModelRequest buildRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation BuildDocumentModel(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> BuildDocumentModelAsync(Azure.WaitUntil waitUntil, Azure.AI.DocumentIntelligence.BuildDocumentModelRequest buildRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> BuildDocumentModelAsync(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual Azure.Operation ComposeModel(Azure.WaitUntil waitUntil, Azure.AI.DocumentIntelligence.ComposeDocumentModelRequest composeRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Operation ComposeModel(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task> ComposeModelAsync(Azure.WaitUntil waitUntil, Azure.AI.DocumentIntelligence.ComposeDocumentModelRequest composeRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -577,17 +558,17 @@ public DocumentModelAdministrationClient(System.Uri endpoint, Azure.AzureKeyCred public virtual System.Threading.Tasks.Task GetModelAsync(string modelId, Azure.RequestContext context) { throw null; } public virtual System.Threading.Tasks.Task> GetModelAsync(string modelId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetModels(Azure.RequestContext context) { throw null; } - public virtual Azure.Pageable GetModels(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetModels(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetModelsAsync(Azure.RequestContext context) { throw null; } - public virtual Azure.AsyncPageable GetModelsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetModelsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetOperation(System.Guid operationId, Azure.RequestContext context) { throw null; } public virtual Azure.Response GetOperation(System.Guid operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task GetOperationAsync(System.Guid operationId, Azure.RequestContext context) { throw null; } public virtual System.Threading.Tasks.Task> GetOperationAsync(System.Guid operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetOperations(Azure.RequestContext context) { throw null; } - public virtual Azure.Pageable GetOperations(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetOperations(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetOperationsAsync(Azure.RequestContext context) { throw null; } - public virtual Azure.AsyncPageable GetOperationsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetOperationsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetResourceInfo(Azure.RequestContext context) { throw null; } public virtual Azure.Response GetResourceInfo(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task GetResourceInfoAsync(Azure.RequestContext context) { throw null; } @@ -595,33 +576,29 @@ public DocumentModelAdministrationClient(System.Uri endpoint, Azure.AzureKeyCred } public partial class DocumentModelBuildOperationDetails : Azure.AI.DocumentIntelligence.OperationDetails { - internal DocumentModelBuildOperationDetails() : base (default(Azure.AI.DocumentIntelligence.OperationStatus), default(System.DateTimeOffset), default(System.DateTimeOffset), default(System.Uri)) { } + internal DocumentModelBuildOperationDetails() : base (default(System.Guid), default(Azure.AI.DocumentIntelligence.OperationStatus), default(System.DateTimeOffset), default(System.DateTimeOffset), default(System.Uri)) { } public Azure.AI.DocumentIntelligence.DocumentModelDetails Result { get { throw null; } } } public partial class DocumentModelComposeOperationDetails : Azure.AI.DocumentIntelligence.OperationDetails { - internal DocumentModelComposeOperationDetails() : base (default(Azure.AI.DocumentIntelligence.OperationStatus), default(System.DateTimeOffset), default(System.DateTimeOffset), default(System.Uri)) { } + internal DocumentModelComposeOperationDetails() : base (default(System.Guid), default(Azure.AI.DocumentIntelligence.OperationStatus), default(System.DateTimeOffset), default(System.DateTimeOffset), default(System.Uri)) { } public Azure.AI.DocumentIntelligence.DocumentModelDetails Result { get { throw null; } } } public partial class DocumentModelCopyToOperationDetails : Azure.AI.DocumentIntelligence.OperationDetails { - internal DocumentModelCopyToOperationDetails() : base (default(Azure.AI.DocumentIntelligence.OperationStatus), default(System.DateTimeOffset), default(System.DateTimeOffset), default(System.Uri)) { } + internal DocumentModelCopyToOperationDetails() : base (default(System.Guid), default(Azure.AI.DocumentIntelligence.OperationStatus), default(System.DateTimeOffset), default(System.DateTimeOffset), default(System.Uri)) { } public Azure.AI.DocumentIntelligence.DocumentModelDetails Result { get { throw null; } } } - public partial class DocumentModelDetails : Azure.AI.DocumentIntelligence.DocumentModelSummary + public partial class DocumentModelDetails { internal DocumentModelDetails() { } + public string ApiVersion { get { throw null; } } public Azure.AI.DocumentIntelligence.AzureBlobFileListContentSource AzureBlobFileListSource { get { throw null; } } public Azure.AI.DocumentIntelligence.AzureBlobContentSource AzureBlobSource { get { throw null; } } - public Azure.AI.DocumentIntelligence.DocumentBuildMode BuildMode { get { throw null; } } - public System.Collections.Generic.IReadOnlyDictionary DocTypes { get { throw null; } } - } - public partial class DocumentModelSummary - { - internal DocumentModelSummary() { } - public string ApiVersion { get { throw null; } } + public Azure.AI.DocumentIntelligence.DocumentBuildMode? BuildMode { get { throw null; } } public System.DateTimeOffset CreatedDateTime { get { throw null; } } public string Description { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary DocTypes { get { throw null; } } public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } public string ModelId { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Tags { get { throw null; } } @@ -652,7 +629,7 @@ internal DocumentParagraph() { } public partial class DocumentSection { internal DocumentSection() { } - public System.Collections.Generic.IReadOnlyList Elements { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Elements { get { throw null; } } public System.Collections.Generic.IReadOnlyList Spans { get { throw null; } } } public partial class DocumentSelectionMark @@ -735,7 +712,7 @@ internal DocumentTableCell() { } public int ColumnIndex { get { throw null; } } public int? ColumnSpan { get { throw null; } } public string Content { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Elements { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Elements { get { throw null; } } public Azure.AI.DocumentIntelligence.DocumentTableCellKind? Kind { get { throw null; } } public int RowIndex { get { throw null; } } public int? RowSpan { get { throw null; } } @@ -818,7 +795,7 @@ public partial class InnerError { internal InnerError() { } public string Code { get { throw null; } } - public Azure.AI.DocumentIntelligence.InnerError Innererror { get { throw null; } } + public Azure.AI.DocumentIntelligence.InnerError InnerErrorObject { get { throw null; } } public string Message { get { throw null; } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] @@ -841,7 +818,7 @@ internal InnerError() { } } public abstract partial class OperationDetails { - protected OperationDetails(Azure.AI.DocumentIntelligence.OperationStatus status, System.DateTimeOffset createdDateTime, System.DateTimeOffset lastUpdatedDateTime, System.Uri resourceLocation) { } + protected OperationDetails(System.Guid operationId, Azure.AI.DocumentIntelligence.OperationStatus status, System.DateTimeOffset createdDateTime, System.DateTimeOffset lastUpdatedDateTime, System.Uri resourceLocation) { } public string ApiVersion { get { throw null; } } public System.DateTimeOffset CreatedDateTime { get { throw null; } } public Azure.AI.DocumentIntelligence.DocumentIntelligenceError Error { get { throw null; } } @@ -853,27 +830,6 @@ protected OperationDetails(Azure.AI.DocumentIntelligence.OperationStatus status, public System.Collections.Generic.IReadOnlyDictionary Tags { get { throw null; } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct OperationKind : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public OperationKind(string value) { throw null; } - public static Azure.AI.DocumentIntelligence.OperationKind ChatBuild { get { throw null; } } - public static Azure.AI.DocumentIntelligence.OperationKind DocumentClassifierBuild { get { throw null; } } - public static Azure.AI.DocumentIntelligence.OperationKind DocumentModelBuild { get { throw null; } } - public static Azure.AI.DocumentIntelligence.OperationKind DocumentModelCompose { get { throw null; } } - public static Azure.AI.DocumentIntelligence.OperationKind DocumentModelCopyTo { get { throw null; } } - public bool Equals(Azure.AI.DocumentIntelligence.OperationKind other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.AI.DocumentIntelligence.OperationKind left, Azure.AI.DocumentIntelligence.OperationKind right) { throw null; } - public static implicit operator Azure.AI.DocumentIntelligence.OperationKind (string value) { throw null; } - public static bool operator !=(Azure.AI.DocumentIntelligence.OperationKind left, Azure.AI.DocumentIntelligence.OperationKind right) { throw null; } - public override string ToString() { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct OperationStatus : System.IEquatable { private readonly object _dummy; @@ -894,19 +850,6 @@ protected OperationDetails(Azure.AI.DocumentIntelligence.OperationStatus status, public static bool operator !=(Azure.AI.DocumentIntelligence.OperationStatus left, Azure.AI.DocumentIntelligence.OperationStatus right) { throw null; } public override string ToString() { throw null; } } - public partial class OperationSummary - { - internal OperationSummary() { } - public string ApiVersion { get { throw null; } } - public System.DateTimeOffset CreatedDateTime { get { throw null; } } - public Azure.AI.DocumentIntelligence.OperationKind Kind { get { throw null; } } - public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } - public System.Guid OperationId { get { throw null; } } - public int? PercentCompleted { get { throw null; } } - public System.Uri ResourceLocation { get { throw null; } } - public Azure.AI.DocumentIntelligence.OperationStatus Status { get { throw null; } } - public System.Collections.Generic.IReadOnlyDictionary Tags { get { throw null; } } - } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ParagraphRole : System.IEquatable { @@ -986,8 +929,10 @@ namespace Microsoft.Extensions.Azure { public static partial class AIDocumentIntelligenceClientBuilderExtensions { + public static Azure.Core.Extensions.IAzureClientBuilder AddDocumentAnalysisClient(this TBuilder builder, System.Uri endpoint) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithCredential { throw null; } public static Azure.Core.Extensions.IAzureClientBuilder AddDocumentAnalysisClient(this TBuilder builder, System.Uri endpoint, Azure.AzureKeyCredential credential) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilder { throw null; } public static Azure.Core.Extensions.IAzureClientBuilder AddDocumentAnalysisClient(this TBuilder builder, TConfiguration configuration) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithConfiguration { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddDocumentModelAdministrationClient(this TBuilder builder, System.Uri endpoint) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithCredential { throw null; } public static Azure.Core.Extensions.IAzureClientBuilder AddDocumentModelAdministrationClient(this TBuilder builder, System.Uri endpoint, Azure.AzureKeyCredential credential) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilder { throw null; } public static Azure.Core.Extensions.IAzureClientBuilder AddDocumentModelAdministrationClient(this TBuilder builder, TConfiguration configuration) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithConfiguration { throw null; } } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/assets.json b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/assets.json new file mode 100644 index 000000000000..f723b071ebfa --- /dev/null +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/assets.json @@ -0,0 +1,6 @@ +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "net", + "TagPrefix": "net/documentintelligence/Azure.AI.DocumentIntelligence", + "Tag": "net/documentintelligence/Azure.AI.DocumentIntelligence_f6b061e70f" +} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/DocumentModelDetails.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/DocumentModelDetails.Serialization.cs index af4316336885..73668f2cde96 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/DocumentModelDetails.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/DocumentModelDetails.Serialization.cs @@ -7,7 +7,7 @@ public partial class DocumentModelDetails { /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static new DocumentModelDetails FromResponse(Response response) + internal static DocumentModelDetails FromResponse(Response response) { return DeserializationHelpers.FromOperationResponse(response, DeserializeDocumentModelDetails, "result"); } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AIDocumentIntelligenceClientBuilderExtensions.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AIDocumentIntelligenceClientBuilderExtensions.cs index e96573066650..da4454841db7 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AIDocumentIntelligenceClientBuilderExtensions.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AIDocumentIntelligenceClientBuilderExtensions.cs @@ -25,6 +25,15 @@ public static IAzureClientBuilder((options) => new DocumentAnalysisClient(endpoint, credential, options)); } + /// Registers a instance. + /// The builder to register with. + /// The Document Intelligence service endpoint. + public static IAzureClientBuilder AddDocumentAnalysisClient(this TBuilder builder, Uri endpoint) + where TBuilder : IAzureClientFactoryBuilderWithCredential + { + return builder.RegisterClientFactory((options, cred) => new DocumentAnalysisClient(endpoint, cred, options)); + } + /// Registers a instance. /// The builder to register with. /// The Document Intelligence service endpoint. @@ -35,6 +44,15 @@ public static IAzureClientBuilder((options) => new DocumentModelAdministrationClient(endpoint, credential, options)); } + /// Registers a instance. + /// The builder to register with. + /// The Document Intelligence service endpoint. + public static IAzureClientBuilder AddDocumentModelAdministrationClient(this TBuilder builder, Uri endpoint) + where TBuilder : IAzureClientFactoryBuilderWithCredential + { + return builder.RegisterClientFactory((options, cred) => new DocumentModelAdministrationClient(endpoint, cred, options)); + } + /// Registers a instance. /// The builder to register with. /// The configuration values. diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AIDocumentIntelligenceModelFactory.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AIDocumentIntelligenceModelFactory.cs index bb71a5d7c0f0..b67ed9604540 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AIDocumentIntelligenceModelFactory.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AIDocumentIntelligenceModelFactory.cs @@ -245,11 +245,11 @@ public static DocumentTable DocumentTable(int rowCount = default, int columnCoun /// Location of the table cell in the reading order concatenated content. /// Child elements of the table cell. /// A new instance for mocking. - public static DocumentTableCell DocumentTableCell(DocumentTableCellKind? kind = null, int rowIndex = default, int columnIndex = default, int? rowSpan = null, int? columnSpan = null, string content = null, IEnumerable boundingRegions = null, IEnumerable spans = null, IEnumerable elements = null) + public static DocumentTableCell DocumentTableCell(DocumentTableCellKind? kind = null, int rowIndex = default, int columnIndex = default, int? rowSpan = null, int? columnSpan = null, string content = null, IEnumerable boundingRegions = null, IEnumerable spans = null, IEnumerable elements = null) { boundingRegions ??= new List(); spans ??= new List(); - elements ??= new List(); + elements ??= new List(); return new DocumentTableCell(kind, rowIndex, columnIndex, rowSpan, columnSpan, content, boundingRegions?.ToList(), spans?.ToList(), elements?.ToList()); } @@ -260,11 +260,11 @@ public static DocumentTableCell DocumentTableCell(DocumentTableCellKind? kind = /// Location of the caption in the reading order concatenated content. /// Child elements of the caption. /// A new instance for mocking. - public static DocumentCaption DocumentCaption(string content = null, IEnumerable boundingRegions = null, IEnumerable spans = null, IEnumerable elements = null) + public static DocumentCaption DocumentCaption(string content = null, IEnumerable boundingRegions = null, IEnumerable spans = null, IEnumerable elements = null) { boundingRegions ??= new List(); spans ??= new List(); - elements ??= new List(); + elements ??= new List(); return new DocumentCaption(content, boundingRegions?.ToList(), spans?.ToList(), elements?.ToList()); } @@ -275,11 +275,11 @@ public static DocumentCaption DocumentCaption(string content = null, IEnumerable /// Location of the footnote in the reading order concatenated content. /// Child elements of the footnote. /// A new instance for mocking. - public static DocumentFootnote DocumentFootnote(string content = null, IEnumerable boundingRegions = null, IEnumerable spans = null, IEnumerable elements = null) + public static DocumentFootnote DocumentFootnote(string content = null, IEnumerable boundingRegions = null, IEnumerable spans = null, IEnumerable elements = null) { boundingRegions ??= new List(); spans ??= new List(); - elements ??= new List(); + elements ??= new List(); return new DocumentFootnote(content, boundingRegions?.ToList(), spans?.ToList(), elements?.ToList()); } @@ -291,11 +291,11 @@ public static DocumentFootnote DocumentFootnote(string content = null, IEnumerab /// Caption associated with the figure. /// List of footnotes associated with the figure. /// A new instance for mocking. - public static DocumentFigure DocumentFigure(IEnumerable boundingRegions = null, IEnumerable spans = null, IEnumerable elements = null, DocumentCaption caption = null, IEnumerable footnotes = null) + public static DocumentFigure DocumentFigure(IEnumerable boundingRegions = null, IEnumerable spans = null, IEnumerable elements = null, DocumentCaption caption = null, IEnumerable footnotes = null) { boundingRegions ??= new List(); spans ??= new List(); - elements ??= new List(); + elements ??= new List(); footnotes ??= new List(); return new DocumentFigure(boundingRegions?.ToList(), spans?.ToList(), elements?.ToList(), caption, footnotes?.ToList()); @@ -320,11 +320,11 @@ public static DocumentList DocumentList(IEnumerable spans = null, /// Location of the list item in the reading order concatenated content. /// Child elements of the list item. /// A new instance for mocking. - public static DocumentListItem DocumentListItem(int level = default, string content = null, IEnumerable boundingRegions = null, IEnumerable spans = null, IEnumerable elements = null) + public static DocumentListItem DocumentListItem(int level = default, string content = null, IEnumerable boundingRegions = null, IEnumerable spans = null, IEnumerable elements = null) { boundingRegions ??= new List(); spans ??= new List(); - elements ??= new List(); + elements ??= new List(); return new DocumentListItem(level, content, boundingRegions?.ToList(), spans?.ToList(), elements?.ToList()); } @@ -333,10 +333,10 @@ public static DocumentListItem DocumentListItem(int level = default, string cont /// Location of the section in the reading order concatenated content. /// Child elements of the section. /// A new instance for mocking. - public static DocumentSection DocumentSection(IEnumerable spans = null, IEnumerable elements = null) + public static DocumentSection DocumentSection(IEnumerable spans = null, IEnumerable elements = null) { spans ??= new List(); - elements ??= new List(); + elements ??= new List(); return new DocumentSection(spans?.ToList(), elements?.ToList()); } @@ -483,21 +483,6 @@ public static AddressValue AddressValue(string houseNumber = null, string poBox return new AddressValue(houseNumber, poBox, road, city, state, postalCode, countryRegion, streetAddress, unit, cityDistrict, stateDistrict, suburb, house, level); } - /// Initializes a new instance of DocumentModelSummary. - /// Unique document model name. - /// Document model description. - /// Date and time (UTC) when the document model was created. - /// Date and time (UTC) when the document model will expire. - /// API version used to create this document model. - /// List of key-value tag attributes associated with the document model. - /// A new instance for mocking. - public static DocumentModelSummary DocumentModelSummary(string modelId = null, string description = null, DateTimeOffset createdDateTime = default, DateTimeOffset? expirationDateTime = null, string apiVersion = null, IReadOnlyDictionary tags = null) - { - tags ??= new Dictionary(); - - return new DocumentModelSummary(modelId, description, createdDateTime, expirationDateTime, apiVersion, tags); - } - /// Initializes a new instance of DocumentModelDetails. /// Unique document model name. /// Document model description. @@ -516,7 +501,7 @@ public static DocumentModelSummary DocumentModelSummary(string modelId = null, s /// /// Supported document types. /// A new instance for mocking. - public static DocumentModelDetails DocumentModelDetails(string modelId = null, string description = null, DateTimeOffset createdDateTime = default, DateTimeOffset? expirationDateTime = null, string apiVersion = null, IReadOnlyDictionary tags = null, DocumentBuildMode buildMode = default, AzureBlobContentSource azureBlobSource = null, AzureBlobFileListContentSource azureBlobFileListSource = null, IReadOnlyDictionary docTypes = null) + public static DocumentModelDetails DocumentModelDetails(string modelId = null, string description = null, DateTimeOffset createdDateTime = default, DateTimeOffset? expirationDateTime = null, string apiVersion = null, IReadOnlyDictionary tags = null, DocumentBuildMode? buildMode = null, AzureBlobContentSource azureBlobSource = null, AzureBlobFileListContentSource azureBlobFileListSource = null, IReadOnlyDictionary docTypes = null) { tags ??= new Dictionary(); docTypes ??= new Dictionary(); @@ -610,11 +595,11 @@ public static OperationDetails OperationDetails(Guid operationId = default, Oper } /// Initializes a new instance of DocumentIntelligenceError. - /// Error code. - /// Error message. - /// Target of the error. - /// List of detailed errors. - /// Detailed error. + /// One of a server-defined set of error codes. + /// A human-readable representation of the error. + /// The target of the error. + /// An array of details about specific errors that led to this reported error. + /// An object containing more specific information than the current object about the error. /// A new instance for mocking. public static DocumentIntelligenceError DocumentIntelligenceError(string code = null, string message = null, string target = null, IEnumerable details = null, InnerError innererror = null) { @@ -624,13 +609,13 @@ public static DocumentIntelligenceError DocumentIntelligenceError(string code = } /// Initializes a new instance of InnerError. - /// Error code. - /// Error message. - /// Detailed error. + /// One of a server-defined set of error codes. + /// A human-readable representation of the error. + /// Inner error. /// A new instance for mocking. - public static InnerError InnerError(string code = null, string message = null, InnerError innererror = null) + public static InnerError InnerError(string code = null, string message = null, InnerError innerErrorObject = null) { - return new InnerError(code, message, innererror); + return new InnerError(code, message, innerErrorObject); } /// Initializes a new instance of DocumentModelBuildOperationDetails. @@ -723,63 +708,5 @@ public static DocumentClassifierDetails DocumentClassifierDetails(string classif return new DocumentClassifierDetails(classifierId, description, createdDateTime, expirationDateTime, apiVersion, docTypes); } - - /// Initializes a new instance of ChatIndexBuildOperationDetails. - /// Operation ID. - /// Operation status. - /// Operation progress (0-100). - /// Date and time (UTC) when the operation was created. - /// Date and time (UTC) when the status was last updated. - /// URL of the resource targeted by this operation. - /// API version used to create this operation. - /// List of key-value tag attributes associated with the document model. - /// Encountered error. - /// Operation result upon success. - /// A new instance for mocking. - public static ChatIndexBuildOperationDetails ChatIndexBuildOperationDetails(Guid operationId = default, OperationStatus status = default, int? percentCompleted = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, Uri resourceLocation = null, string apiVersion = null, IReadOnlyDictionary tags = null, DocumentIntelligenceError error = null, ChatIndexDetails result = null) - { - tags ??= new Dictionary(); - - return new ChatIndexBuildOperationDetails(operationId, status, percentCompleted, createdDateTime, lastUpdatedDateTime, OperationKind.ChatBuild, resourceLocation, apiVersion, tags, error, result); - } - - /// Initializes a new instance of ChatIndexDetails. - /// Chat index ID. - /// Date and time (UTC) when the index was created. - /// Date and time (UTC) when the index will expire. - /// API version used to create this index. - /// or is null. - /// A new instance for mocking. - public static ChatIndexDetails ChatIndexDetails(string chatId = null, DateTimeOffset createdDateTime = default, DateTimeOffset expirationDateTime = default, string apiVersion = null) - { - if (chatId == null) - { - throw new ArgumentNullException(nameof(chatId)); - } - if (apiVersion == null) - { - throw new ArgumentNullException(nameof(apiVersion)); - } - - return new ChatIndexDetails(chatId, createdDateTime, expirationDateTime, apiVersion); - } - - /// Initializes a new instance of OperationSummary. - /// Operation ID. - /// Operation status. - /// Operation progress (0-100). - /// Date and time (UTC) when the operation was created. - /// Date and time (UTC) when the status was last updated. - /// Type of operation. - /// URL of the resource targeted by this operation. - /// API version used to create this operation. - /// List of key-value tag attributes associated with the document model. - /// A new instance for mocking. - public static OperationSummary OperationSummary(Guid operationId = default, OperationStatus status = default, int? percentCompleted = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, OperationKind kind = default, Uri resourceLocation = null, string apiVersion = null, IReadOnlyDictionary tags = null) - { - tags ??= new Dictionary(); - - return new OperationSummary(operationId, status, percentCompleted, createdDateTime, lastUpdatedDateTime, kind, resourceLocation, apiVersion, tags); - } } } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AzureAIDocumentIntelligenceClientOptions.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AzureAIDocumentIntelligenceClientOptions.cs index ae5d4d3636be..85b93e9d46bf 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AzureAIDocumentIntelligenceClientOptions.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AzureAIDocumentIntelligenceClientOptions.cs @@ -18,12 +18,8 @@ public partial class AzureAIDocumentIntelligenceClientOptions : ClientOptions /// The version of the service to use. public enum ServiceVersion { - /// Service version "2022-08-31". - V2022_08_31 = 1, - /// Service version "2023-07-31". - V2023_07_31 = 2, /// Service version "2023-10-31-preview". - V2023_10_31_Preview = 3, + V2023_10_31_Preview = 1, } internal string Version { get; } @@ -33,8 +29,6 @@ public AzureAIDocumentIntelligenceClientOptions(ServiceVersion version = LatestV { Version = version switch { - ServiceVersion.V2022_08_31 => "2022-08-31", - ServiceVersion.V2023_07_31 => "2023-07-31", ServiceVersion.V2023_10_31_Preview => "2023-10-31-preview", _ => throw new NotSupportedException() }; diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ChatIndexBuildOperationDetails.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ChatIndexBuildOperationDetails.Serialization.cs deleted file mode 100644 index 944e58948351..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ChatIndexBuildOperationDetails.Serialization.cs +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class ChatIndexBuildOperationDetails - { - internal static ChatIndexBuildOperationDetails DeserializeChatIndexBuildOperationDetails(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional result = default; - Guid operationId = default; - OperationStatus status = default; - Optional percentCompleted = default; - DateTimeOffset createdDateTime = default; - DateTimeOffset lastUpdatedDateTime = default; - OperationKind kind = default; - Uri resourceLocation = default; - Optional apiVersion = default; - Optional> tags = default; - Optional error = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("result"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - result = ChatIndexDetails.DeserializeChatIndexDetails(property.Value); - continue; - } - if (property.NameEquals("operationId"u8)) - { - operationId = property.Value.GetGuid(); - continue; - } - if (property.NameEquals("status"u8)) - { - status = new OperationStatus(property.Value.GetString()); - continue; - } - if (property.NameEquals("percentCompleted"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - percentCompleted = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("createdDateTime"u8)) - { - createdDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("lastUpdatedDateTime"u8)) - { - lastUpdatedDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("kind"u8)) - { - kind = new OperationKind(property.Value.GetString()); - continue; - } - if (property.NameEquals("resourceLocation"u8)) - { - resourceLocation = new Uri(property.Value.GetString()); - continue; - } - if (property.NameEquals("apiVersion"u8)) - { - apiVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("error"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - error = DocumentIntelligenceError.DeserializeDocumentIntelligenceError(property.Value); - continue; - } - } - return new ChatIndexBuildOperationDetails(operationId, status, Optional.ToNullable(percentCompleted), createdDateTime, lastUpdatedDateTime, kind, resourceLocation, apiVersion.Value, Optional.ToDictionary(tags), error.Value, result.Value); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new ChatIndexBuildOperationDetails FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeChatIndexBuildOperationDetails(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ChatIndexBuildOperationDetails.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ChatIndexBuildOperationDetails.cs deleted file mode 100644 index 709e818e6678..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ChatIndexBuildOperationDetails.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// Get Operation response object. - public partial class ChatIndexBuildOperationDetails : OperationDetails - { - /// Initializes a new instance of ChatIndexBuildOperationDetails. - /// Operation status. - /// Date and time (UTC) when the operation was created. - /// Date and time (UTC) when the status was last updated. - /// URL of the resource targeted by this operation. - /// is null. - internal ChatIndexBuildOperationDetails(OperationStatus status, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, Uri resourceLocation) : base(status, createdDateTime, lastUpdatedDateTime, resourceLocation) - { - Argument.AssertNotNull(resourceLocation, nameof(resourceLocation)); - - Kind = OperationKind.ChatBuild; - } - - /// Initializes a new instance of ChatIndexBuildOperationDetails. - /// Operation ID. - /// Operation status. - /// Operation progress (0-100). - /// Date and time (UTC) when the operation was created. - /// Date and time (UTC) when the status was last updated. - /// Type of operation. - /// URL of the resource targeted by this operation. - /// API version used to create this operation. - /// List of key-value tag attributes associated with the document model. - /// Encountered error. - /// Operation result upon success. - internal ChatIndexBuildOperationDetails(Guid operationId, OperationStatus status, int? percentCompleted, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, OperationKind kind, Uri resourceLocation, string apiVersion, IReadOnlyDictionary tags, DocumentIntelligenceError error, ChatIndexDetails result) : base(operationId, status, percentCompleted, createdDateTime, lastUpdatedDateTime, kind, resourceLocation, apiVersion, tags, error) - { - Result = result; - } - - /// Operation result upon success. - public ChatIndexDetails Result { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ChatIndexDetails.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ChatIndexDetails.Serialization.cs deleted file mode 100644 index 289c6b61164f..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ChatIndexDetails.Serialization.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class ChatIndexDetails - { - internal static ChatIndexDetails DeserializeChatIndexDetails(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string chatId = default; - DateTimeOffset createdDateTime = default; - DateTimeOffset expirationDateTime = default; - string apiVersion = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("chatId"u8)) - { - chatId = property.Value.GetString(); - continue; - } - if (property.NameEquals("createdDateTime"u8)) - { - createdDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("expirationDateTime"u8)) - { - expirationDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("apiVersion"u8)) - { - apiVersion = property.Value.GetString(); - continue; - } - } - return new ChatIndexDetails(chatId, createdDateTime, expirationDateTime, apiVersion); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ChatIndexDetails FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeChatIndexDetails(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ChatIndexDetails.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ChatIndexDetails.cs deleted file mode 100644 index 25556d2ecbc3..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ChatIndexDetails.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// Detailed chat index info. - public partial class ChatIndexDetails : ChatIndexSummary - { - /// Initializes a new instance of ChatIndexDetails. - /// Chat index ID. - /// Date and time (UTC) when the index was created. - /// Date and time (UTC) when the index will expire. - /// API version used to create this index. - /// or is null. - internal ChatIndexDetails(string chatId, DateTimeOffset createdDateTime, DateTimeOffset expirationDateTime, string apiVersion) : base(chatId, createdDateTime, expirationDateTime, apiVersion) - { - Argument.AssertNotNull(chatId, nameof(chatId)); - Argument.AssertNotNull(apiVersion, nameof(apiVersion)); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ChatIndexSummary.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ChatIndexSummary.cs deleted file mode 100644 index 663c1a5ddd31..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ChatIndexSummary.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// Chat index info. - public partial class ChatIndexSummary - { - /// Initializes a new instance of ChatIndexSummary. - /// Chat index ID. - /// Date and time (UTC) when the index was created. - /// Date and time (UTC) when the index will expire. - /// API version used to create this index. - /// or is null. - internal ChatIndexSummary(string chatId, DateTimeOffset createdDateTime, DateTimeOffset expirationDateTime, string apiVersion) - { - Argument.AssertNotNull(chatId, nameof(chatId)); - Argument.AssertNotNull(apiVersion, nameof(apiVersion)); - - ChatId = chatId; - CreatedDateTime = createdDateTime; - ExpirationDateTime = expirationDateTime; - ApiVersion = apiVersion; - } - - /// Chat index ID. - public string ChatId { get; } - /// Date and time (UTC) when the index was created. - public DateTimeOffset CreatedDateTime { get; } - /// Date and time (UTC) when the index will expire. - public DateTimeOffset ExpirationDateTime { get; } - /// API version used to create this index. - public string ApiVersion { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/Docs/DocumentModelAdministrationClient.xml b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/Docs/DocumentModelAdministrationClient.xml index 4f1b593fe761..27718aeb4c58 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/Docs/DocumentModelAdministrationClient.xml +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/Docs/DocumentModelAdministrationClient.xml @@ -202,7 +202,6 @@ DocumentModelAdministrationClient client = new DocumentModelAdministrationClient Response response = await client.GetModelAsync("", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("buildMode").ToString()); Console.WriteLine(result.GetProperty("modelId").ToString()); Console.WriteLine(result.GetProperty("createdDateTime").ToString()); ]]> @@ -215,6 +214,12 @@ DocumentModelAdministrationClient client = new DocumentModelAdministrationClient Response response = await client.GetModelAsync("", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("apiVersion").ToString()); +Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); Console.WriteLine(result.GetProperty("buildMode").ToString()); Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); @@ -229,12 +234,6 @@ Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetPropert Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("apiVersion").ToString()); -Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); ]]> @@ -248,7 +247,6 @@ DocumentModelAdministrationClient client = new DocumentModelAdministrationClient Response response = client.GetModel("", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("buildMode").ToString()); Console.WriteLine(result.GetProperty("modelId").ToString()); Console.WriteLine(result.GetProperty("createdDateTime").ToString()); ]]> @@ -261,6 +259,12 @@ DocumentModelAdministrationClient client = new DocumentModelAdministrationClient Response response = client.GetModel("", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("apiVersion").ToString()); +Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); Console.WriteLine(result.GetProperty("buildMode").ToString()); Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); @@ -275,12 +279,6 @@ Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetPropert Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("apiVersion").ToString()); -Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); ]]> @@ -723,7 +721,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); -await foreach (DocumentModelSummary item in client.GetModelsAsync()) +await foreach (DocumentModelDetails item in client.GetModelsAsync()) { } ]]> @@ -733,7 +731,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); -await foreach (DocumentModelSummary item in client.GetModelsAsync()) +await foreach (DocumentModelDetails item in client.GetModelsAsync()) { } ]]> @@ -746,7 +744,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); -foreach (DocumentModelSummary item in client.GetModels()) +foreach (DocumentModelDetails item in client.GetModels()) { } ]]> @@ -756,7 +754,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); -foreach (DocumentModelSummary item in client.GetModels()) +foreach (DocumentModelDetails item in client.GetModels()) { } ]]> @@ -791,6 +789,20 @@ await foreach (BinaryData item in client.GetModelsAsync(null)) Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); Console.WriteLine(result.GetProperty("apiVersion").ToString()); Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("buildMode").ToString()); + Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); + Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); + Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("containerUrl").ToString()); + Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("fileList").ToString()); + Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("buildMode").ToString()); + Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("example").ToString()); + Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); + Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); } ]]> @@ -824,6 +836,20 @@ foreach (BinaryData item in client.GetModels(null)) Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); Console.WriteLine(result.GetProperty("apiVersion").ToString()); Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("buildMode").ToString()); + Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); + Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); + Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("containerUrl").ToString()); + Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("fileList").ToString()); + Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("buildMode").ToString()); + Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("example").ToString()); + Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); + Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); } ]]> @@ -835,7 +861,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); -await foreach (OperationSummary item in client.GetOperationsAsync()) +await foreach (OperationDetails item in client.GetOperationsAsync()) { } ]]> @@ -845,7 +871,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); -await foreach (OperationSummary item in client.GetOperationsAsync()) +await foreach (OperationDetails item in client.GetOperationsAsync()) { } ]]> @@ -858,7 +884,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); -foreach (OperationSummary item in client.GetOperations()) +foreach (OperationDetails item in client.GetOperations()) { } ]]> @@ -868,7 +894,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); -foreach (OperationSummary item in client.GetOperations()) +foreach (OperationDetails item in client.GetOperations()) { } ]]> @@ -910,6 +936,11 @@ await foreach (BinaryData item in client.GetOperationsAsync(null)) Console.WriteLine(result.GetProperty("resourceLocation").ToString()); Console.WriteLine(result.GetProperty("apiVersion").ToString()); Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("message").ToString()); } ]]> @@ -950,6 +981,11 @@ foreach (BinaryData item in client.GetOperations(null)) Console.WriteLine(result.GetProperty("resourceLocation").ToString()); Console.WriteLine(result.GetProperty("apiVersion").ToString()); Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("message").ToString()); } ]]> @@ -1077,19 +1113,19 @@ foreach (BinaryData item in client.GetClassifiers(null)) } ]]> - + -This sample shows how to call BuildDocumentAsync. +This sample shows how to call BuildDocumentModelAsync. "); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); BuildDocumentModelRequest buildRequest = new BuildDocumentModelRequest("", DocumentBuildMode.Template); -Operation operation = await client.BuildDocumentAsync(WaitUntil.Completed, buildRequest); +Operation operation = await client.BuildDocumentModelAsync(WaitUntil.Completed, buildRequest); DocumentModelDetails responseData = operation.Value; ]]> -This sample shows how to call BuildDocumentAsync with all parameters. +This sample shows how to call BuildDocumentModelAsync with all parameters. "); AzureKeyCredential credential = new AzureKeyCredential(""); @@ -1108,23 +1144,23 @@ BuildDocumentModelRequest buildRequest = new BuildDocumentModelRequest(" operation = await client.BuildDocumentAsync(WaitUntil.Completed, buildRequest); +Operation operation = await client.BuildDocumentModelAsync(WaitUntil.Completed, buildRequest); DocumentModelDetails responseData = operation.Value; ]]> - + -This sample shows how to call BuildDocument. +This sample shows how to call BuildDocumentModel. "); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); BuildDocumentModelRequest buildRequest = new BuildDocumentModelRequest("", DocumentBuildMode.Template); -Operation operation = client.BuildDocument(WaitUntil.Completed, buildRequest); +Operation operation = client.BuildDocumentModel(WaitUntil.Completed, buildRequest); DocumentModelDetails responseData = operation.Value; ]]> -This sample shows how to call BuildDocument with all parameters. +This sample shows how to call BuildDocumentModel with all parameters. "); AzureKeyCredential credential = new AzureKeyCredential(""); @@ -1143,13 +1179,13 @@ BuildDocumentModelRequest buildRequest = new BuildDocumentModelRequest(" operation = client.BuildDocument(WaitUntil.Completed, buildRequest); +Operation operation = client.BuildDocumentModel(WaitUntil.Completed, buildRequest); DocumentModelDetails responseData = operation.Value; ]]> - + -This sample shows how to call BuildDocumentAsync and parse the result. +This sample shows how to call BuildDocumentModelAsync and parse the result. "); AzureKeyCredential credential = new AzureKeyCredential(""); @@ -1160,15 +1196,14 @@ using RequestContent content = RequestContent.Create(new modelId = "", buildMode = "template", }); -Operation operation = await client.BuildDocumentAsync(WaitUntil.Completed, content); +Operation operation = await client.BuildDocumentModelAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("buildMode").ToString()); Console.WriteLine(result.GetProperty("modelId").ToString()); Console.WriteLine(result.GetProperty("createdDateTime").ToString()); ]]> -This sample shows how to call BuildDocumentAsync with all parameters and request content and parse the result. +This sample shows how to call BuildDocumentModelAsync with all parameters and request content and parse the result. "); AzureKeyCredential credential = new AzureKeyCredential(""); @@ -1194,10 +1229,16 @@ using RequestContent content = RequestContent.Create(new key = "", }, }); -Operation operation = await client.BuildDocumentAsync(WaitUntil.Completed, content); +Operation operation = await client.BuildDocumentModelAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("apiVersion").ToString()); +Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); Console.WriteLine(result.GetProperty("buildMode").ToString()); Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); @@ -1212,17 +1253,11 @@ Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetPropert Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("apiVersion").ToString()); -Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); ]]> - + -This sample shows how to call BuildDocument and parse the result. +This sample shows how to call BuildDocumentModel and parse the result. "); AzureKeyCredential credential = new AzureKeyCredential(""); @@ -1233,15 +1268,14 @@ using RequestContent content = RequestContent.Create(new modelId = "", buildMode = "template", }); -Operation operation = client.BuildDocument(WaitUntil.Completed, content); +Operation operation = client.BuildDocumentModel(WaitUntil.Completed, content); BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("buildMode").ToString()); Console.WriteLine(result.GetProperty("modelId").ToString()); Console.WriteLine(result.GetProperty("createdDateTime").ToString()); ]]> -This sample shows how to call BuildDocument with all parameters and request content and parse the result. +This sample shows how to call BuildDocumentModel with all parameters and request content and parse the result. "); AzureKeyCredential credential = new AzureKeyCredential(""); @@ -1267,10 +1301,16 @@ using RequestContent content = RequestContent.Create(new key = "", }, }); -Operation operation = client.BuildDocument(WaitUntil.Completed, content); +Operation operation = client.BuildDocumentModel(WaitUntil.Completed, content); BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("apiVersion").ToString()); +Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); Console.WriteLine(result.GetProperty("buildMode").ToString()); Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); @@ -1285,12 +1325,6 @@ Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetPropert Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("apiVersion").ToString()); -Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); ]]> @@ -1388,7 +1422,6 @@ Operation operation = await client.ComposeModelAsync(WaitUntil.Compl BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("buildMode").ToString()); Console.WriteLine(result.GetProperty("modelId").ToString()); Console.WriteLine(result.GetProperty("createdDateTime").ToString()); ]]> @@ -1418,6 +1451,12 @@ Operation operation = await client.ComposeModelAsync(WaitUntil.Compl BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("apiVersion").ToString()); +Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); Console.WriteLine(result.GetProperty("buildMode").ToString()); Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); @@ -1432,12 +1471,6 @@ Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetPropert Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("apiVersion").ToString()); -Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); ]]> @@ -1463,7 +1496,6 @@ Operation operation = client.ComposeModel(WaitUntil.Completed, conte BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("buildMode").ToString()); Console.WriteLine(result.GetProperty("modelId").ToString()); Console.WriteLine(result.GetProperty("createdDateTime").ToString()); ]]> @@ -1493,6 +1525,12 @@ Operation operation = client.ComposeModel(WaitUntil.Completed, conte BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("apiVersion").ToString()); +Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); Console.WriteLine(result.GetProperty("buildMode").ToString()); Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); @@ -1507,12 +1545,6 @@ Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetPropert Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("apiVersion").ToString()); -Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); ]]> @@ -1582,7 +1614,6 @@ Operation operation = await client.CopyModelToAsync(WaitUntil.Comple BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("buildMode").ToString()); Console.WriteLine(result.GetProperty("modelId").ToString()); Console.WriteLine(result.GetProperty("createdDateTime").ToString()); ]]> @@ -1605,6 +1636,12 @@ Operation operation = await client.CopyModelToAsync(WaitUntil.Comple BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("apiVersion").ToString()); +Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); Console.WriteLine(result.GetProperty("buildMode").ToString()); Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); @@ -1619,12 +1656,6 @@ Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetPropert Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("apiVersion").ToString()); -Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); ]]> @@ -1648,7 +1679,6 @@ Operation operation = client.CopyModelTo(WaitUntil.Completed, " @@ -1671,6 +1701,12 @@ Operation operation = client.CopyModelTo(WaitUntil.Completed, "").ToString()); Console.WriteLine(result.GetProperty("buildMode").ToString()); Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); @@ -1685,12 +1721,6 @@ Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetPropert Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("apiVersion").ToString()); -Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); ]]> diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentAnalysisClient.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentAnalysisClient.cs index f080b774f643..345898891d9b 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentAnalysisClient.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentAnalysisClient.cs @@ -21,6 +21,8 @@ public partial class DocumentAnalysisClient { private const string AuthorizationHeader = "Ocp-Apim-Subscription-Key"; private readonly AzureKeyCredential _keyCredential; + private static readonly string[] AuthorizationScopes = new string[] { "https://cognitiveservices.azure.com/.default" }; + private readonly TokenCredential _tokenCredential; private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; @@ -44,6 +46,14 @@ protected DocumentAnalysisClient() { } + /// Initializes a new instance of DocumentAnalysisClient. + /// The Document Intelligence service endpoint. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public DocumentAnalysisClient(Uri endpoint, TokenCredential credential) : this(endpoint, credential, new AzureAIDocumentIntelligenceClientOptions()) + { + } + /// Initializes a new instance of DocumentAnalysisClient. /// The Document Intelligence service endpoint. /// A credential used to authenticate to an Azure Service. @@ -62,6 +72,24 @@ public DocumentAnalysisClient(Uri endpoint, AzureKeyCredential credential, Azure _apiVersion = options.Version; } + /// Initializes a new instance of DocumentAnalysisClient. + /// The Document Intelligence service endpoint. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public DocumentAnalysisClient(Uri endpoint, TokenCredential credential, AzureAIDocumentIntelligenceClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new AzureAIDocumentIntelligenceClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _tokenCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); + _endpoint = endpoint; + _apiVersion = options.Version; + } + /// Analyzes document with document model. /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// Unique document model name. diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentCaption.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentCaption.Serialization.cs index 5960afa82cee..c061a2510a6d 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentCaption.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentCaption.Serialization.cs @@ -23,7 +23,7 @@ internal static DocumentCaption DeserializeDocumentCaption(JsonElement element) string content = default; Optional> boundingRegions = default; IReadOnlyList spans = default; - Optional> elements = default; + Optional> elements = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("content"u8)) @@ -61,17 +61,10 @@ internal static DocumentCaption DeserializeDocumentCaption(JsonElement element) { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - if (item.ValueKind == JsonValueKind.Null) - { - array.Add(null); - } - else - { - array.Add(item.GetObject()); - } + array.Add(item.GetString()); } elements = array; continue; diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentCaption.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentCaption.cs index bfb6f53e36f8..365b0a0eafec 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentCaption.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentCaption.cs @@ -27,7 +27,7 @@ internal DocumentCaption(string content, IEnumerable spans) Content = content; BoundingRegions = new ChangeTrackingList(); Spans = spans.ToList(); - Elements = new ChangeTrackingList(); + Elements = new ChangeTrackingList(); } /// Initializes a new instance of DocumentCaption. @@ -35,7 +35,7 @@ internal DocumentCaption(string content, IEnumerable spans) /// Bounding regions covering the caption. /// Location of the caption in the reading order concatenated content. /// Child elements of the caption. - internal DocumentCaption(string content, IReadOnlyList boundingRegions, IReadOnlyList spans, IReadOnlyList elements) + internal DocumentCaption(string content, IReadOnlyList boundingRegions, IReadOnlyList spans, IReadOnlyList elements) { Content = content; BoundingRegions = boundingRegions; @@ -50,6 +50,6 @@ internal DocumentCaption(string content, IReadOnlyList boundingR /// Location of the caption in the reading order concatenated content. public IReadOnlyList Spans { get; } /// Child elements of the caption. - public IReadOnlyList Elements { get; } + public IReadOnlyList Elements { get; } } } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierBuildOperationDetails.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierBuildOperationDetails.cs index 273322f83e98..4e7234633ea0 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierBuildOperationDetails.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierBuildOperationDetails.cs @@ -15,12 +15,13 @@ namespace Azure.AI.DocumentIntelligence public partial class DocumentClassifierBuildOperationDetails : OperationDetails { /// Initializes a new instance of DocumentClassifierBuildOperationDetails. + /// Operation ID. /// Operation status. /// Date and time (UTC) when the operation was created. /// Date and time (UTC) when the status was last updated. /// URL of the resource targeted by this operation. /// is null. - internal DocumentClassifierBuildOperationDetails(OperationStatus status, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, Uri resourceLocation) : base(status, createdDateTime, lastUpdatedDateTime, resourceLocation) + internal DocumentClassifierBuildOperationDetails(Guid operationId, OperationStatus status, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, Uri resourceLocation) : base(operationId, status, createdDateTime, lastUpdatedDateTime, resourceLocation) { Argument.AssertNotNull(resourceLocation, nameof(resourceLocation)); diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFigure.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFigure.Serialization.cs index fafa8207b23c..5dec9412f9d8 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFigure.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFigure.Serialization.cs @@ -22,7 +22,7 @@ internal static DocumentFigure DeserializeDocumentFigure(JsonElement element) } Optional> boundingRegions = default; IReadOnlyList spans = default; - Optional> elements = default; + Optional> elements = default; Optional caption = default; Optional> footnotes = default; foreach (var property in element.EnumerateObject()) @@ -57,17 +57,10 @@ internal static DocumentFigure DeserializeDocumentFigure(JsonElement element) { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - if (item.ValueKind == JsonValueKind.Null) - { - array.Add(null); - } - else - { - array.Add(item.GetObject()); - } + array.Add(item.GetString()); } elements = array; continue; diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFigure.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFigure.cs index bd66de21908e..d9deb591430e 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFigure.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFigure.cs @@ -24,7 +24,7 @@ internal DocumentFigure(IEnumerable spans) BoundingRegions = new ChangeTrackingList(); Spans = spans.ToList(); - Elements = new ChangeTrackingList(); + Elements = new ChangeTrackingList(); Footnotes = new ChangeTrackingList(); } @@ -34,7 +34,7 @@ internal DocumentFigure(IEnumerable spans) /// Child elements of the figure, excluding any caption or footnotes. /// Caption associated with the figure. /// List of footnotes associated with the figure. - internal DocumentFigure(IReadOnlyList boundingRegions, IReadOnlyList spans, IReadOnlyList elements, DocumentCaption caption, IReadOnlyList footnotes) + internal DocumentFigure(IReadOnlyList boundingRegions, IReadOnlyList spans, IReadOnlyList elements, DocumentCaption caption, IReadOnlyList footnotes) { BoundingRegions = boundingRegions; Spans = spans; @@ -48,7 +48,7 @@ internal DocumentFigure(IReadOnlyList boundingRegions, IReadOnly /// Location of the figure in the reading order concatenated content. public IReadOnlyList Spans { get; } /// Child elements of the figure, excluding any caption or footnotes. - public IReadOnlyList Elements { get; } + public IReadOnlyList Elements { get; } /// Caption associated with the figure. public DocumentCaption Caption { get; } /// List of footnotes associated with the figure. diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFootnote.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFootnote.Serialization.cs index 4267184bc617..782dd75e6736 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFootnote.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFootnote.Serialization.cs @@ -23,7 +23,7 @@ internal static DocumentFootnote DeserializeDocumentFootnote(JsonElement element string content = default; Optional> boundingRegions = default; IReadOnlyList spans = default; - Optional> elements = default; + Optional> elements = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("content"u8)) @@ -61,17 +61,10 @@ internal static DocumentFootnote DeserializeDocumentFootnote(JsonElement element { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - if (item.ValueKind == JsonValueKind.Null) - { - array.Add(null); - } - else - { - array.Add(item.GetObject()); - } + array.Add(item.GetString()); } elements = array; continue; diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFootnote.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFootnote.cs index a6d2f9dc45fc..ae279afe002b 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFootnote.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFootnote.cs @@ -27,7 +27,7 @@ internal DocumentFootnote(string content, IEnumerable spans) Content = content; BoundingRegions = new ChangeTrackingList(); Spans = spans.ToList(); - Elements = new ChangeTrackingList(); + Elements = new ChangeTrackingList(); } /// Initializes a new instance of DocumentFootnote. @@ -35,7 +35,7 @@ internal DocumentFootnote(string content, IEnumerable spans) /// Bounding regions covering the footnote. /// Location of the footnote in the reading order concatenated content. /// Child elements of the footnote. - internal DocumentFootnote(string content, IReadOnlyList boundingRegions, IReadOnlyList spans, IReadOnlyList elements) + internal DocumentFootnote(string content, IReadOnlyList boundingRegions, IReadOnlyList spans, IReadOnlyList elements) { Content = content; BoundingRegions = boundingRegions; @@ -50,6 +50,6 @@ internal DocumentFootnote(string content, IReadOnlyList bounding /// Location of the footnote in the reading order concatenated content. public IReadOnlyList Spans { get; } /// Child elements of the footnote. - public IReadOnlyList Elements { get; } + public IReadOnlyList Elements { get; } } } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceError.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceError.cs index 64c7ce696d4a..275af9294ea8 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceError.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceError.cs @@ -11,12 +11,12 @@ namespace Azure.AI.DocumentIntelligence { - /// Error info. + /// The error object. public partial class DocumentIntelligenceError { /// Initializes a new instance of DocumentIntelligenceError. - /// Error code. - /// Error message. + /// One of a server-defined set of error codes. + /// A human-readable representation of the error. /// or is null. internal DocumentIntelligenceError(string code, string message) { @@ -29,11 +29,11 @@ internal DocumentIntelligenceError(string code, string message) } /// Initializes a new instance of DocumentIntelligenceError. - /// Error code. - /// Error message. - /// Target of the error. - /// List of detailed errors. - /// Detailed error. + /// One of a server-defined set of error codes. + /// A human-readable representation of the error. + /// The target of the error. + /// An array of details about specific errors that led to this reported error. + /// An object containing more specific information than the current object about the error. internal DocumentIntelligenceError(string code, string message, string target, IReadOnlyList details, InnerError innererror) { Code = code; @@ -43,15 +43,15 @@ internal DocumentIntelligenceError(string code, string message, string target, I Innererror = innererror; } - /// Error code. + /// One of a server-defined set of error codes. public string Code { get; } - /// Error message. + /// A human-readable representation of the error. public string Message { get; } - /// Target of the error. + /// The target of the error. public string Target { get; } - /// List of detailed errors. + /// An array of details about specific errors that led to this reported error. public IReadOnlyList Details { get; } - /// Detailed error. + /// An object containing more specific information than the current object about the error. public InnerError Innererror { get; } } } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentListItem.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentListItem.Serialization.cs index 1c9eae7f7125..da789023a2ee 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentListItem.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentListItem.Serialization.cs @@ -24,7 +24,7 @@ internal static DocumentListItem DeserializeDocumentListItem(JsonElement element string content = default; Optional> boundingRegions = default; IReadOnlyList spans = default; - Optional> elements = default; + Optional> elements = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("level"u8)) @@ -67,17 +67,10 @@ internal static DocumentListItem DeserializeDocumentListItem(JsonElement element { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - if (item.ValueKind == JsonValueKind.Null) - { - array.Add(null); - } - else - { - array.Add(item.GetObject()); - } + array.Add(item.GetString()); } elements = array; continue; diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentListItem.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentListItem.cs index be172243cc98..17562c824bc0 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentListItem.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentListItem.cs @@ -29,7 +29,7 @@ internal DocumentListItem(int level, string content, IEnumerable s Content = content; BoundingRegions = new ChangeTrackingList(); Spans = spans.ToList(); - Elements = new ChangeTrackingList(); + Elements = new ChangeTrackingList(); } /// Initializes a new instance of DocumentListItem. @@ -38,7 +38,7 @@ internal DocumentListItem(int level, string content, IEnumerable s /// Bounding regions covering the list item. /// Location of the list item in the reading order concatenated content. /// Child elements of the list item. - internal DocumentListItem(int level, string content, IReadOnlyList boundingRegions, IReadOnlyList spans, IReadOnlyList elements) + internal DocumentListItem(int level, string content, IReadOnlyList boundingRegions, IReadOnlyList spans, IReadOnlyList elements) { Level = level; Content = content; @@ -56,6 +56,6 @@ internal DocumentListItem(int level, string content, IReadOnlyList Location of the list item in the reading order concatenated content. public IReadOnlyList Spans { get; } /// Child elements of the list item. - public IReadOnlyList Elements { get; } + public IReadOnlyList Elements { get; } } } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelAdministrationClient.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelAdministrationClient.cs index 34f71bef4021..049ec5651758 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelAdministrationClient.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelAdministrationClient.cs @@ -21,6 +21,8 @@ public partial class DocumentModelAdministrationClient { private const string AuthorizationHeader = "Ocp-Apim-Subscription-Key"; private readonly AzureKeyCredential _keyCredential; + private static readonly string[] AuthorizationScopes = new string[] { "https://cognitiveservices.azure.com/.default" }; + private readonly TokenCredential _tokenCredential; private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; @@ -44,6 +46,14 @@ protected DocumentModelAdministrationClient() { } + /// Initializes a new instance of DocumentModelAdministrationClient. + /// The Document Intelligence service endpoint. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public DocumentModelAdministrationClient(Uri endpoint, TokenCredential credential) : this(endpoint, credential, new AzureAIDocumentIntelligenceClientOptions()) + { + } + /// Initializes a new instance of DocumentModelAdministrationClient. /// The Document Intelligence service endpoint. /// A credential used to authenticate to an Azure Service. @@ -62,6 +72,24 @@ public DocumentModelAdministrationClient(Uri endpoint, AzureKeyCredential creden _apiVersion = options.Version; } + /// Initializes a new instance of DocumentModelAdministrationClient. + /// The Document Intelligence service endpoint. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public DocumentModelAdministrationClient(Uri endpoint, TokenCredential credential, AzureAIDocumentIntelligenceClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new AzureAIDocumentIntelligenceClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _tokenCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); + _endpoint = endpoint; + _apiVersion = options.Version; + } + /// /// Generates authorization to copy a document model to this location with /// specified modelId and optional description. @@ -729,23 +757,23 @@ public virtual Response DeleteClassifier(string classifierId, RequestContext con /// List all document models. /// The cancellation token to use. /// - public virtual AsyncPageable GetModelsAsync(CancellationToken cancellationToken = default) + public virtual AsyncPageable GetModelsAsync(CancellationToken cancellationToken = default) { RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetModelsRequest(context); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetModelsNextPageRequest(nextLink, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, DocumentModelSummary.DeserializeDocumentModelSummary, ClientDiagnostics, _pipeline, "DocumentModelAdministrationClient.GetModels", "value", "nextLink", context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, DocumentModelDetails.DeserializeDocumentModelDetails, ClientDiagnostics, _pipeline, "DocumentModelAdministrationClient.GetModels", "value", "nextLink", context); } /// List all document models. /// The cancellation token to use. /// - public virtual Pageable GetModels(CancellationToken cancellationToken = default) + public virtual Pageable GetModels(CancellationToken cancellationToken = default) { RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetModelsRequest(context); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetModelsNextPageRequest(nextLink, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, DocumentModelSummary.DeserializeDocumentModelSummary, ClientDiagnostics, _pipeline, "DocumentModelAdministrationClient.GetModels", "value", "nextLink", context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, DocumentModelDetails.DeserializeDocumentModelDetails, ClientDiagnostics, _pipeline, "DocumentModelAdministrationClient.GetModels", "value", "nextLink", context); } /// @@ -803,23 +831,23 @@ public virtual Pageable GetModels(RequestContext context) /// Lists all operations. /// The cancellation token to use. /// - public virtual AsyncPageable GetOperationsAsync(CancellationToken cancellationToken = default) + public virtual AsyncPageable GetOperationsAsync(CancellationToken cancellationToken = default) { RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetOperationsRequest(context); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetOperationsNextPageRequest(nextLink, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, OperationSummary.DeserializeOperationSummary, ClientDiagnostics, _pipeline, "DocumentModelAdministrationClient.GetOperations", "value", "nextLink", context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, OperationDetails.DeserializeOperationDetails, ClientDiagnostics, _pipeline, "DocumentModelAdministrationClient.GetOperations", "value", "nextLink", context); } /// Lists all operations. /// The cancellation token to use. /// - public virtual Pageable GetOperations(CancellationToken cancellationToken = default) + public virtual Pageable GetOperations(CancellationToken cancellationToken = default) { RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetOperationsRequest(context); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetOperationsNextPageRequest(nextLink, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, OperationSummary.DeserializeOperationSummary, ClientDiagnostics, _pipeline, "DocumentModelAdministrationClient.GetOperations", "value", "nextLink", context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, OperationDetails.DeserializeOperationDetails, ClientDiagnostics, _pipeline, "DocumentModelAdministrationClient.GetOperations", "value", "nextLink", context); } /// @@ -953,15 +981,15 @@ public virtual Pageable GetClassifiers(RequestContext context) /// Build request parameters. /// The cancellation token to use. /// is null. - /// - public virtual async Task> BuildDocumentAsync(WaitUntil waitUntil, BuildDocumentModelRequest buildRequest, CancellationToken cancellationToken = default) + /// + public virtual async Task> BuildDocumentModelAsync(WaitUntil waitUntil, BuildDocumentModelRequest buildRequest, CancellationToken cancellationToken = default) { Argument.AssertNotNull(buildRequest, nameof(buildRequest)); RequestContext context = FromCancellationToken(cancellationToken); using RequestContent content = buildRequest.ToRequestContent(); - Operation response = await BuildDocumentAsync(waitUntil, content, context).ConfigureAwait(false); - return ProtocolOperationHelpers.Convert(response, DocumentModelDetails.FromResponse, ClientDiagnostics, "DocumentModelAdministrationClient.BuildDocument"); + Operation response = await BuildDocumentModelAsync(waitUntil, content, context).ConfigureAwait(false); + return ProtocolOperationHelpers.Convert(response, DocumentModelDetails.FromResponse, ClientDiagnostics, "DocumentModelAdministrationClient.BuildDocumentModel"); } /// Builds a custom document analysis model. @@ -969,15 +997,15 @@ public virtual async Task> BuildDocumentAsync(Wa /// Build request parameters. /// The cancellation token to use. /// is null. - /// - public virtual Operation BuildDocument(WaitUntil waitUntil, BuildDocumentModelRequest buildRequest, CancellationToken cancellationToken = default) + /// + public virtual Operation BuildDocumentModel(WaitUntil waitUntil, BuildDocumentModelRequest buildRequest, CancellationToken cancellationToken = default) { Argument.AssertNotNull(buildRequest, nameof(buildRequest)); RequestContext context = FromCancellationToken(cancellationToken); using RequestContent content = buildRequest.ToRequestContent(); - Operation response = BuildDocument(waitUntil, content, context); - return ProtocolOperationHelpers.Convert(response, DocumentModelDetails.FromResponse, ClientDiagnostics, "DocumentModelAdministrationClient.BuildDocument"); + Operation response = BuildDocumentModel(waitUntil, content, context); + return ProtocolOperationHelpers.Convert(response, DocumentModelDetails.FromResponse, ClientDiagnostics, "DocumentModelAdministrationClient.BuildDocumentModel"); } /// @@ -990,7 +1018,7 @@ public virtual Operation BuildDocument(WaitUntil waitUntil /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -1001,17 +1029,17 @@ public virtual Operation BuildDocument(WaitUntil waitUntil /// is null. /// Service returned a non-success status code. /// The representing an asynchronous operation on the service. - /// - public virtual async Task> BuildDocumentAsync(WaitUntil waitUntil, RequestContent content, RequestContext context = null) + /// + public virtual async Task> BuildDocumentModelAsync(WaitUntil waitUntil, RequestContent content, RequestContext context = null) { Argument.AssertNotNull(content, nameof(content)); - using var scope = ClientDiagnostics.CreateScope("DocumentModelAdministrationClient.BuildDocument"); + using var scope = ClientDiagnostics.CreateScope("DocumentModelAdministrationClient.BuildDocumentModel"); scope.Start(); try { - using HttpMessage message = CreateBuildDocumentRequest(content, context); - return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "DocumentModelAdministrationClient.BuildDocument", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + using HttpMessage message = CreateBuildDocumentModelRequest(content, context); + return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "DocumentModelAdministrationClient.BuildDocumentModel", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); } catch (Exception e) { @@ -1030,7 +1058,7 @@ public virtual async Task> BuildDocumentAsync(WaitUntil wa /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -1041,17 +1069,17 @@ public virtual async Task> BuildDocumentAsync(WaitUntil wa /// is null. /// Service returned a non-success status code. /// The representing an asynchronous operation on the service. - /// - public virtual Operation BuildDocument(WaitUntil waitUntil, RequestContent content, RequestContext context = null) + /// + public virtual Operation BuildDocumentModel(WaitUntil waitUntil, RequestContent content, RequestContext context = null) { Argument.AssertNotNull(content, nameof(content)); - using var scope = ClientDiagnostics.CreateScope("DocumentModelAdministrationClient.BuildDocument"); + using var scope = ClientDiagnostics.CreateScope("DocumentModelAdministrationClient.BuildDocumentModel"); scope.Start(); try { - using HttpMessage message = CreateBuildDocumentRequest(content, context); - return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "DocumentModelAdministrationClient.BuildDocument", OperationFinalStateVia.OperationLocation, context, waitUntil); + using HttpMessage message = CreateBuildDocumentModelRequest(content, context); + return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "DocumentModelAdministrationClient.BuildDocumentModel", OperationFinalStateVia.OperationLocation, context, waitUntil); } catch (Exception e) { @@ -1408,7 +1436,7 @@ public virtual Operation BuildClassifier(WaitUntil waitUntil, Reques } } - internal HttpMessage CreateBuildDocumentRequest(RequestContent content, RequestContext context) + internal HttpMessage CreateBuildDocumentModelRequest(RequestContent content, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier202); var request = message.Request; diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelBuildOperationDetails.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelBuildOperationDetails.cs index bf5b8a5a85a0..8e9173833baf 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelBuildOperationDetails.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelBuildOperationDetails.cs @@ -15,12 +15,13 @@ namespace Azure.AI.DocumentIntelligence public partial class DocumentModelBuildOperationDetails : OperationDetails { /// Initializes a new instance of DocumentModelBuildOperationDetails. + /// Operation ID. /// Operation status. /// Date and time (UTC) when the operation was created. /// Date and time (UTC) when the status was last updated. /// URL of the resource targeted by this operation. /// is null. - internal DocumentModelBuildOperationDetails(OperationStatus status, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, Uri resourceLocation) : base(status, createdDateTime, lastUpdatedDateTime, resourceLocation) + internal DocumentModelBuildOperationDetails(Guid operationId, OperationStatus status, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, Uri resourceLocation) : base(operationId, status, createdDateTime, lastUpdatedDateTime, resourceLocation) { Argument.AssertNotNull(resourceLocation, nameof(resourceLocation)); diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelComposeOperationDetails.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelComposeOperationDetails.cs index 69272c3a04d7..dcec84ca7ca2 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelComposeOperationDetails.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelComposeOperationDetails.cs @@ -15,12 +15,13 @@ namespace Azure.AI.DocumentIntelligence public partial class DocumentModelComposeOperationDetails : OperationDetails { /// Initializes a new instance of DocumentModelComposeOperationDetails. + /// Operation ID. /// Operation status. /// Date and time (UTC) when the operation was created. /// Date and time (UTC) when the status was last updated. /// URL of the resource targeted by this operation. /// is null. - internal DocumentModelComposeOperationDetails(OperationStatus status, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, Uri resourceLocation) : base(status, createdDateTime, lastUpdatedDateTime, resourceLocation) + internal DocumentModelComposeOperationDetails(Guid operationId, OperationStatus status, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, Uri resourceLocation) : base(operationId, status, createdDateTime, lastUpdatedDateTime, resourceLocation) { Argument.AssertNotNull(resourceLocation, nameof(resourceLocation)); diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelCopyToOperationDetails.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelCopyToOperationDetails.cs index 5b63c1607dbc..b44fcd7e2035 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelCopyToOperationDetails.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelCopyToOperationDetails.cs @@ -15,12 +15,13 @@ namespace Azure.AI.DocumentIntelligence public partial class DocumentModelCopyToOperationDetails : OperationDetails { /// Initializes a new instance of DocumentModelCopyToOperationDetails. + /// Operation ID. /// Operation status. /// Date and time (UTC) when the operation was created. /// Date and time (UTC) when the status was last updated. /// URL of the resource targeted by this operation. /// is null. - internal DocumentModelCopyToOperationDetails(OperationStatus status, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, Uri resourceLocation) : base(status, createdDateTime, lastUpdatedDateTime, resourceLocation) + internal DocumentModelCopyToOperationDetails(Guid operationId, OperationStatus status, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, Uri resourceLocation) : base(operationId, status, createdDateTime, lastUpdatedDateTime, resourceLocation) { Argument.AssertNotNull(resourceLocation, nameof(resourceLocation)); diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelDetails.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelDetails.Serialization.cs index d327c8371ee9..8d9364462c21 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelDetails.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelDetails.Serialization.cs @@ -21,100 +21,104 @@ internal static DocumentModelDetails DeserializeDocumentModelDetails(JsonElement { return null; } - DocumentBuildMode buildMode = default; - Optional azureBlobSource = default; - Optional azureBlobFileListSource = default; - Optional> docTypes = default; string modelId = default; Optional description = default; DateTimeOffset createdDateTime = default; Optional expirationDateTime = default; Optional apiVersion = default; Optional> tags = default; + Optional buildMode = default; + Optional azureBlobSource = default; + Optional azureBlobFileListSource = default; + Optional> docTypes = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("buildMode"u8)) + if (property.NameEquals("modelId"u8)) { - buildMode = new DocumentBuildMode(property.Value.GetString()); + modelId = property.Value.GetString(); continue; } - if (property.NameEquals("azureBlobSource"u8)) + if (property.NameEquals("description"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - azureBlobSource = AzureBlobContentSource.DeserializeAzureBlobContentSource(property.Value); + description = property.Value.GetString(); continue; } - if (property.NameEquals("azureBlobFileListSource"u8)) + if (property.NameEquals("createdDateTime"u8)) + { + createdDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("expirationDateTime"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - azureBlobFileListSource = AzureBlobFileListContentSource.DeserializeAzureBlobFileListContentSource(property.Value); + expirationDateTime = property.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("docTypes"u8)) + if (property.NameEquals("apiVersion"u8)) + { + apiVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - Dictionary dictionary = new Dictionary(); + Dictionary dictionary = new Dictionary(); foreach (var property0 in property.Value.EnumerateObject()) { - dictionary.Add(property0.Name, DocumentTypeDetails.DeserializeDocumentTypeDetails(property0.Value)); + dictionary.Add(property0.Name, property0.Value.GetString()); } - docTypes = dictionary; - continue; - } - if (property.NameEquals("modelId"u8)) - { - modelId = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); + tags = dictionary; continue; } - if (property.NameEquals("createdDateTime"u8)) + if (property.NameEquals("buildMode"u8)) { - createdDateTime = property.Value.GetDateTimeOffset("O"); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + buildMode = new DocumentBuildMode(property.Value.GetString()); continue; } - if (property.NameEquals("expirationDateTime"u8)) + if (property.NameEquals("azureBlobSource"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - expirationDateTime = property.Value.GetDateTimeOffset("O"); + azureBlobSource = AzureBlobContentSource.DeserializeAzureBlobContentSource(property.Value); continue; } - if (property.NameEquals("apiVersion"u8)) + if (property.NameEquals("azureBlobFileListSource"u8)) { - apiVersion = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureBlobFileListSource = AzureBlobFileListContentSource.DeserializeAzureBlobFileListContentSource(property.Value); continue; } - if (property.NameEquals("tags"u8)) + if (property.NameEquals("docTypes"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - Dictionary dictionary = new Dictionary(); + Dictionary dictionary = new Dictionary(); foreach (var property0 in property.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + dictionary.Add(property0.Name, DocumentTypeDetails.DeserializeDocumentTypeDetails(property0.Value)); } - tags = dictionary; + docTypes = dictionary; continue; } } - return new DocumentModelDetails(modelId, description.Value, createdDateTime, Optional.ToNullable(expirationDateTime), apiVersion.Value, Optional.ToDictionary(tags), buildMode, azureBlobSource.Value, azureBlobFileListSource.Value, Optional.ToDictionary(docTypes)); + return new DocumentModelDetails(modelId, description.Value, createdDateTime, Optional.ToNullable(expirationDateTime), apiVersion.Value, Optional.ToDictionary(tags), Optional.ToNullable(buildMode), azureBlobSource.Value, azureBlobFileListSource.Value, Optional.ToDictionary(docTypes)); } } } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelDetails.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelDetails.cs index 65245bd87f5b..bc29915f5289 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelDetails.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelDetails.cs @@ -12,17 +12,19 @@ namespace Azure.AI.DocumentIntelligence { /// Document model info. - public partial class DocumentModelDetails : DocumentModelSummary + public partial class DocumentModelDetails { /// Initializes a new instance of DocumentModelDetails. /// Unique document model name. - /// Custom document model build mode. + /// Date and time (UTC) when the document model was created. /// is null. - internal DocumentModelDetails(string modelId, DocumentBuildMode buildMode) : base(modelId) + internal DocumentModelDetails(string modelId, DateTimeOffset createdDateTime) { Argument.AssertNotNull(modelId, nameof(modelId)); - BuildMode = buildMode; + ModelId = modelId; + CreatedDateTime = createdDateTime; + Tags = new ChangeTrackingDictionary(); DocTypes = new ChangeTrackingDictionary(); } @@ -43,16 +45,34 @@ internal DocumentModelDetails(string modelId, DocumentBuildMode buildMode) : bas /// azureBlobSource or azureBlobFileListSource must be specified. /// /// Supported document types. - internal DocumentModelDetails(string modelId, string description, DateTimeOffset createdDateTime, DateTimeOffset? expirationDateTime, string apiVersion, IReadOnlyDictionary tags, DocumentBuildMode buildMode, AzureBlobContentSource azureBlobSource, AzureBlobFileListContentSource azureBlobFileListSource, IReadOnlyDictionary docTypes) : base(modelId, description, createdDateTime, expirationDateTime, apiVersion, tags) + internal DocumentModelDetails(string modelId, string description, DateTimeOffset createdDateTime, DateTimeOffset? expirationDateTime, string apiVersion, IReadOnlyDictionary tags, DocumentBuildMode? buildMode, AzureBlobContentSource azureBlobSource, AzureBlobFileListContentSource azureBlobFileListSource, IReadOnlyDictionary docTypes) { + ModelId = modelId; + Description = description; + CreatedDateTime = createdDateTime; + ExpirationDateTime = expirationDateTime; + ApiVersion = apiVersion; + Tags = tags; BuildMode = buildMode; AzureBlobSource = azureBlobSource; AzureBlobFileListSource = azureBlobFileListSource; DocTypes = docTypes; } + /// Unique document model name. + public string ModelId { get; } + /// Document model description. + public string Description { get; } + /// Date and time (UTC) when the document model was created. + public DateTimeOffset CreatedDateTime { get; } + /// Date and time (UTC) when the document model will expire. + public DateTimeOffset? ExpirationDateTime { get; } + /// API version used to create this document model. + public string ApiVersion { get; } + /// List of key-value tag attributes associated with the document model. + public IReadOnlyDictionary Tags { get; } /// Custom document model build mode. - public DocumentBuildMode BuildMode { get; } + public DocumentBuildMode? BuildMode { get; } /// /// Azure Blob Storage location containing the training data. Either /// azureBlobSource or azureBlobFileListSource must be specified. diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelSummary.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelSummary.Serialization.cs deleted file mode 100644 index 58484299e03a..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelSummary.Serialization.cs +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class DocumentModelSummary - { - internal static DocumentModelSummary DeserializeDocumentModelSummary(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string modelId = default; - Optional description = default; - DateTimeOffset createdDateTime = default; - Optional expirationDateTime = default; - Optional apiVersion = default; - Optional> tags = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("modelId"u8)) - { - modelId = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("createdDateTime"u8)) - { - createdDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("expirationDateTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - expirationDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("apiVersion"u8)) - { - apiVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - } - return new DocumentModelSummary(modelId, description.Value, createdDateTime, Optional.ToNullable(expirationDateTime), apiVersion.Value, Optional.ToDictionary(tags)); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DocumentModelSummary FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeDocumentModelSummary(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelSummary.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelSummary.cs deleted file mode 100644 index 2b8b6dc08e3c..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelSummary.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// Document model summary. - public partial class DocumentModelSummary - { - /// Initializes a new instance of DocumentModelSummary. - /// Unique document model name. - /// is null. - internal DocumentModelSummary(string modelId) - { - Argument.AssertNotNull(modelId, nameof(modelId)); - - ModelId = modelId; - Tags = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of DocumentModelSummary. - /// Unique document model name. - /// Document model description. - /// Date and time (UTC) when the document model was created. - /// Date and time (UTC) when the document model will expire. - /// API version used to create this document model. - /// List of key-value tag attributes associated with the document model. - internal DocumentModelSummary(string modelId, string description, DateTimeOffset createdDateTime, DateTimeOffset? expirationDateTime, string apiVersion, IReadOnlyDictionary tags) - { - ModelId = modelId; - Description = description; - CreatedDateTime = createdDateTime; - ExpirationDateTime = expirationDateTime; - ApiVersion = apiVersion; - Tags = tags; - } - - /// Unique document model name. - public string ModelId { get; } - /// Document model description. - public string Description { get; } - /// Date and time (UTC) when the document model was created. - public DateTimeOffset CreatedDateTime { get; } - /// Date and time (UTC) when the document model will expire. - public DateTimeOffset? ExpirationDateTime { get; } - /// API version used to create this document model. - public string ApiVersion { get; } - /// List of key-value tag attributes associated with the document model. - public IReadOnlyDictionary Tags { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSection.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSection.Serialization.cs index 3e472fb71b45..2aa2e6399e8c 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSection.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSection.Serialization.cs @@ -21,7 +21,7 @@ internal static DocumentSection DeserializeDocumentSection(JsonElement element) return null; } IReadOnlyList spans = default; - Optional> elements = default; + Optional> elements = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("spans"u8)) @@ -40,17 +40,10 @@ internal static DocumentSection DeserializeDocumentSection(JsonElement element) { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - if (item.ValueKind == JsonValueKind.Null) - { - array.Add(null); - } - else - { - array.Add(item.GetObject()); - } + array.Add(item.GetString()); } elements = array; continue; diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSection.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSection.cs index 0357da6e9d36..41ae16da014a 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSection.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSection.cs @@ -23,13 +23,13 @@ internal DocumentSection(IEnumerable spans) Argument.AssertNotNull(spans, nameof(spans)); Spans = spans.ToList(); - Elements = new ChangeTrackingList(); + Elements = new ChangeTrackingList(); } /// Initializes a new instance of DocumentSection. /// Location of the section in the reading order concatenated content. /// Child elements of the section. - internal DocumentSection(IReadOnlyList spans, IReadOnlyList elements) + internal DocumentSection(IReadOnlyList spans, IReadOnlyList elements) { Spans = spans; Elements = elements; @@ -38,6 +38,6 @@ internal DocumentSection(IReadOnlyList spans, IReadOnlyList Location of the section in the reading order concatenated content. public IReadOnlyList Spans { get; } /// Child elements of the section. - public IReadOnlyList Elements { get; } + public IReadOnlyList Elements { get; } } } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentTableCell.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentTableCell.Serialization.cs index 0fe187c84e5c..e2719e2396eb 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentTableCell.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentTableCell.Serialization.cs @@ -28,7 +28,7 @@ internal static DocumentTableCell DeserializeDocumentTableCell(JsonElement eleme string content = default; Optional> boundingRegions = default; IReadOnlyList spans = default; - Optional> elements = default; + Optional> elements = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("kind"u8)) @@ -103,17 +103,10 @@ internal static DocumentTableCell DeserializeDocumentTableCell(JsonElement eleme { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - if (item.ValueKind == JsonValueKind.Null) - { - array.Add(null); - } - else - { - array.Add(item.GetObject()); - } + array.Add(item.GetString()); } elements = array; continue; diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentTableCell.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentTableCell.cs index 1042dee81d5a..c4e0e6e721bc 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentTableCell.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentTableCell.cs @@ -31,7 +31,7 @@ internal DocumentTableCell(int rowIndex, int columnIndex, string content, IEnume Content = content; BoundingRegions = new ChangeTrackingList(); Spans = spans.ToList(); - Elements = new ChangeTrackingList(); + Elements = new ChangeTrackingList(); } /// Initializes a new instance of DocumentTableCell. @@ -44,7 +44,7 @@ internal DocumentTableCell(int rowIndex, int columnIndex, string content, IEnume /// Bounding regions covering the table cell. /// Location of the table cell in the reading order concatenated content. /// Child elements of the table cell. - internal DocumentTableCell(DocumentTableCellKind? kind, int rowIndex, int columnIndex, int? rowSpan, int? columnSpan, string content, IReadOnlyList boundingRegions, IReadOnlyList spans, IReadOnlyList elements) + internal DocumentTableCell(DocumentTableCellKind? kind, int rowIndex, int columnIndex, int? rowSpan, int? columnSpan, string content, IReadOnlyList boundingRegions, IReadOnlyList spans, IReadOnlyList elements) { Kind = kind; RowIndex = rowIndex; @@ -74,6 +74,6 @@ internal DocumentTableCell(DocumentTableCellKind? kind, int rowIndex, int column /// Location of the table cell in the reading order concatenated content. public IReadOnlyList Spans { get; } /// Child elements of the table cell. - public IReadOnlyList Elements { get; } + public IReadOnlyList Elements { get; } } } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/InnerError.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/InnerError.Serialization.cs index e837116137e6..fa561bb2d2f1 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/InnerError.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/InnerError.Serialization.cs @@ -19,7 +19,7 @@ internal static InnerError DeserializeInnerError(JsonElement element) { return null; } - string code = default; + Optional code = default; Optional message = default; Optional innererror = default; foreach (var property in element.EnumerateObject()) @@ -44,7 +44,7 @@ internal static InnerError DeserializeInnerError(JsonElement element) continue; } } - return new InnerError(code, message.Value, innererror.Value); + return new InnerError(code.Value, message.Value, innererror.Value); } /// Deserializes the model from a raw response. diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/InnerError.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/InnerError.cs index 656e62d12a85..b0f6f71a9465 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/InnerError.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/InnerError.cs @@ -5,40 +5,32 @@ #nullable disable -using System; -using Azure.Core; - namespace Azure.AI.DocumentIntelligence { - /// Detailed error. + /// An object containing more specific information about the error. public partial class InnerError { /// Initializes a new instance of InnerError. - /// Error code. - /// is null. - internal InnerError(string code) + internal InnerError() { - Argument.AssertNotNull(code, nameof(code)); - - Code = code; } /// Initializes a new instance of InnerError. - /// Error code. - /// Error message. - /// Detailed error. - internal InnerError(string code, string message, InnerError innererror) + /// One of a server-defined set of error codes. + /// A human-readable representation of the error. + /// Inner error. + internal InnerError(string code, string message, InnerError innerErrorObject) { Code = code; Message = message; - Innererror = innererror; + InnerErrorObject = innerErrorObject; } - /// Error code. + /// One of a server-defined set of error codes. public string Code { get; } - /// Error message. + /// A human-readable representation of the error. public string Message { get; } - /// Detailed error. - public InnerError Innererror { get; } + /// Inner error. + public InnerError InnerErrorObject { get; } } } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/OperationDetails.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/OperationDetails.Serialization.cs index 3b6cdbdf63b8..71fcb4e201eb 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/OperationDetails.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/OperationDetails.Serialization.cs @@ -26,7 +26,6 @@ internal static OperationDetails DeserializeOperationDetails(JsonElement element case "documentModelCompose": return DocumentModelComposeOperationDetails.DeserializeDocumentModelComposeOperationDetails(element); case "documentModelCopyTo": return DocumentModelCopyToOperationDetails.DeserializeDocumentModelCopyToOperationDetails(element); case "documentClassifierBuild": return DocumentClassifierBuildOperationDetails.DeserializeDocumentClassifierBuildOperationDetails(element); - case "chatBuild": return ChatIndexBuildOperationDetails.DeserializeChatIndexBuildOperationDetails(element); } } return UnknownOperationDetails.DeserializeUnknownOperationDetails(element); diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/OperationDetails.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/OperationDetails.cs index 825fc628f234..e1fc41af2fde 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/OperationDetails.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/OperationDetails.cs @@ -12,22 +12,24 @@ namespace Azure.AI.DocumentIntelligence { /// - /// Get Operation response object. + /// Operation info. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . + /// The available derived classes include , , and . /// public abstract partial class OperationDetails { /// Initializes a new instance of OperationDetails. + /// Operation ID. /// Operation status. /// Date and time (UTC) when the operation was created. /// Date and time (UTC) when the status was last updated. /// URL of the resource targeted by this operation. /// is null. - protected OperationDetails(OperationStatus status, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, Uri resourceLocation) + protected OperationDetails(Guid operationId, OperationStatus status, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, Uri resourceLocation) { Argument.AssertNotNull(resourceLocation, nameof(resourceLocation)); + OperationId = operationId; Status = status; CreatedDateTime = createdDateTime; LastUpdatedDateTime = lastUpdatedDateTime; diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/OperationKind.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/OperationKind.cs index 6f94849bf70b..abe6a2365934 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/OperationKind.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/OperationKind.cs @@ -11,7 +11,7 @@ namespace Azure.AI.DocumentIntelligence { /// Type of operation. - public readonly partial struct OperationKind : IEquatable + internal readonly partial struct OperationKind : IEquatable { private readonly string _value; @@ -26,7 +26,6 @@ public OperationKind(string value) private const string DocumentModelComposeValue = "documentModelCompose"; private const string DocumentModelCopyToValue = "documentModelCopyTo"; private const string DocumentClassifierBuildValue = "documentClassifierBuild"; - private const string ChatBuildValue = "chatBuild"; /// Build a new custom document model. public static OperationKind DocumentModelBuild { get; } = new OperationKind(DocumentModelBuildValue); @@ -39,8 +38,6 @@ public OperationKind(string value) public static OperationKind DocumentModelCopyTo { get; } = new OperationKind(DocumentModelCopyToValue); /// Build a new custom classifier model. public static OperationKind DocumentClassifierBuild { get; } = new OperationKind(DocumentClassifierBuildValue); - /// Build a new chat index. - public static OperationKind ChatBuild { get; } = new OperationKind(ChatBuildValue); /// Determines if two values are the same. public static bool operator ==(OperationKind left, OperationKind right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/OperationSummary.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/OperationSummary.Serialization.cs deleted file mode 100644 index ce6939253507..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/OperationSummary.Serialization.cs +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class OperationSummary - { - internal static OperationSummary DeserializeOperationSummary(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Guid operationId = default; - OperationStatus status = default; - Optional percentCompleted = default; - DateTimeOffset createdDateTime = default; - DateTimeOffset lastUpdatedDateTime = default; - OperationKind kind = default; - Uri resourceLocation = default; - Optional apiVersion = default; - Optional> tags = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("operationId"u8)) - { - operationId = property.Value.GetGuid(); - continue; - } - if (property.NameEquals("status"u8)) - { - status = new OperationStatus(property.Value.GetString()); - continue; - } - if (property.NameEquals("percentCompleted"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - percentCompleted = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("createdDateTime"u8)) - { - createdDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("lastUpdatedDateTime"u8)) - { - lastUpdatedDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("kind"u8)) - { - kind = new OperationKind(property.Value.GetString()); - continue; - } - if (property.NameEquals("resourceLocation"u8)) - { - resourceLocation = new Uri(property.Value.GetString()); - continue; - } - if (property.NameEquals("apiVersion"u8)) - { - apiVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - } - return new OperationSummary(operationId, status, Optional.ToNullable(percentCompleted), createdDateTime, lastUpdatedDateTime, kind, resourceLocation, apiVersion.Value, Optional.ToDictionary(tags)); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static OperationSummary FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeOperationSummary(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/OperationSummary.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/OperationSummary.cs deleted file mode 100644 index 5b66bd24c862..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/OperationSummary.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// Operation info. - public partial class OperationSummary - { - /// Initializes a new instance of OperationSummary. - /// Operation ID. - /// Operation status. - /// Date and time (UTC) when the operation was created. - /// Date and time (UTC) when the status was last updated. - /// Type of operation. - /// URL of the resource targeted by this operation. - /// is null. - internal OperationSummary(Guid operationId, OperationStatus status, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, OperationKind kind, Uri resourceLocation) - { - Argument.AssertNotNull(resourceLocation, nameof(resourceLocation)); - - OperationId = operationId; - Status = status; - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; - Kind = kind; - ResourceLocation = resourceLocation; - Tags = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of OperationSummary. - /// Operation ID. - /// Operation status. - /// Operation progress (0-100). - /// Date and time (UTC) when the operation was created. - /// Date and time (UTC) when the status was last updated. - /// Type of operation. - /// URL of the resource targeted by this operation. - /// API version used to create this operation. - /// List of key-value tag attributes associated with the document model. - internal OperationSummary(Guid operationId, OperationStatus status, int? percentCompleted, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, OperationKind kind, Uri resourceLocation, string apiVersion, IReadOnlyDictionary tags) - { - OperationId = operationId; - Status = status; - PercentCompleted = percentCompleted; - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; - Kind = kind; - ResourceLocation = resourceLocation; - ApiVersion = apiVersion; - Tags = tags; - } - - /// Operation ID. - public Guid OperationId { get; } - /// Operation status. - public OperationStatus Status { get; } - /// Operation progress (0-100). - public int? PercentCompleted { get; } - /// Date and time (UTC) when the operation was created. - public DateTimeOffset CreatedDateTime { get; } - /// Date and time (UTC) when the status was last updated. - public DateTimeOffset LastUpdatedDateTime { get; } - /// Type of operation. - public OperationKind Kind { get; } - /// URL of the resource targeted by this operation. - public Uri ResourceLocation { get; } - /// API version used to create this operation. - public string ApiVersion { get; } - /// List of key-value tag attributes associated with the document model. - public IReadOnlyDictionary Tags { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/UnknownOperationDetails.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/UnknownOperationDetails.cs index 24b94edd7bf6..99fce2abd815 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/UnknownOperationDetails.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/UnknownOperationDetails.cs @@ -15,12 +15,13 @@ namespace Azure.AI.DocumentIntelligence internal partial class UnknownOperationDetails : OperationDetails { /// Initializes a new instance of UnknownOperationDetails. + /// Operation ID. /// Operation status. /// Date and time (UTC) when the operation was created. /// Date and time (UTC) when the status was last updated. /// URL of the resource targeted by this operation. /// is null. - internal UnknownOperationDetails(OperationStatus status, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, Uri resourceLocation) : base(status, createdDateTime, lastUpdatedDateTime, resourceLocation) + internal UnknownOperationDetails(Guid operationId, OperationStatus status, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, Uri resourceLocation) : base(operationId, status, createdDateTime, lastUpdatedDateTime, resourceLocation) { Argument.AssertNotNull(resourceLocation, nameof(resourceLocation)); } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentAnalysisClient/DocumentClassifierLiveTests.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentAnalysisClient/DocumentClassifierLiveTests.cs index 0d4beb8c3fd8..ec3676818048 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentAnalysisClient/DocumentClassifierLiveTests.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentAnalysisClient/DocumentClassifierLiveTests.cs @@ -61,7 +61,7 @@ private void ValidateGenericClassifierResult(AnalyzeResult analyzeResult, string Assert.That(analyzeResult.ModelId, Is.EqualTo(classifierId)); Assert.That(analyzeResult.ApiVersion, Is.EqualTo(ServiceVersionString)); Assert.That(analyzeResult.StringIndexType, Is.EqualTo(StringIndexType.TextElements)); - Assert.That(analyzeResult.ContentFormat, Is.Null); + Assert.That(analyzeResult.ContentFormat, Is.Not.EqualTo(default(ContentFormat))); Assert.That(analyzeResult.Content, Is.Empty); Assert.That(analyzeResult.Paragraphs, Is.Empty); @@ -117,6 +117,8 @@ private void ValidateIrs1040ClassifierResult(AnalyzeResult analyzeResult, string { ValidateGenericClassifierResult(analyzeResult, classifierId); + Assert.That(analyzeResult.ContentFormat, Is.EqualTo(ContentFormat.Text)); + Assert.That(analyzeResult.Pages.Count, Is.EqualTo(4)); foreach (var page in analyzeResult.Pages) @@ -127,15 +129,12 @@ private void ValidateIrs1040ClassifierResult(AnalyzeResult analyzeResult, string Assert.That(page.Unit, Is.EqualTo(LengthUnit.Inch)); } - Assert.That(analyzeResult.Documents.Count, Is.EqualTo(2)); + Assert.That(analyzeResult.Documents.Count, Is.EqualTo(1)); - var document0 = analyzeResult.Documents[0]; - var document1 = analyzeResult.Documents[1]; + var document = analyzeResult.Documents.Single(); - Assert.That(document0.DocType, Is.EqualTo("IRS-1040-A")); - Assert.That(document1.DocType, Is.EqualTo("IRS-1040-C")); - Assert.That(document1.BoundingRegions.Count, Is.EqualTo(2)); - Assert.That(document1.BoundingRegions.Count, Is.EqualTo(2)); + Assert.That(document.DocType, Is.EqualTo("IRS-1040-A")); + Assert.That(document.BoundingRegions.Count, Is.EqualTo(4)); } private void AssertSingleEmptySpan(IReadOnlyList spans) diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentModelAdministrationClient/DocumentModelAdministrationLiveTests.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentModelAdministrationClient/DocumentModelAdministrationLiveTests.cs index d5771f06071d..5eabda55c38f 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentModelAdministrationClient/DocumentModelAdministrationLiveTests.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentModelAdministrationClient/DocumentModelAdministrationLiveTests.cs @@ -28,7 +28,7 @@ public DocumentModelAdministrationLiveTests(bool isAsync) [RecordedTest] [TestCaseSource(nameof(s_buildDocumentModelTestCases))] - public async Task BuildDocumentWithAzureBlobContentSource(DocumentBuildMode buildMode) + public async Task BuildDocumentModelWithAzureBlobContentSource(DocumentBuildMode buildMode) { if (buildMode == DocumentBuildMode.Neural && Recording.Mode == RecordedTestMode.Live) { @@ -57,7 +57,7 @@ public async Task BuildDocumentWithAzureBlobContentSource(DocumentBuildMode buil try { - operation = await client.BuildDocumentAsync(WaitUntil.Started, request); + operation = await client.BuildDocumentModelAsync(WaitUntil.Started, request); await (buildMode == DocumentBuildMode.Neural ? operation.WaitForCompletionAsync(TimeSpan.FromMinutes(1), CancellationToken.None) @@ -127,7 +127,7 @@ public async Task BuildDocumentWithAzureBlobContentSource(DocumentBuildMode buil } [RecordedTest] - public void BuildDocumentCanParseError() + public void BuildDocumentModelCanParseError() { var client = CreateDocumentModelAdministrationClient(); var modelId = Recording.GenerateId(); @@ -141,7 +141,7 @@ public void BuildDocumentCanParseError() AzureBlobSource = source }; - RequestFailedException ex = Assert.ThrowsAsync(async () => await client.BuildDocumentAsync(WaitUntil.Started, request)); + RequestFailedException ex = Assert.ThrowsAsync(async () => await client.BuildDocumentModelAsync(WaitUntil.Started, request)); Assert.That(ex.ErrorCode, Is.EqualTo("InvalidRequest")); } @@ -342,9 +342,9 @@ public async Task GetModels() { disposableModel0.ModelId, disposableModel0.Value }, { disposableModel1.ModelId, disposableModel1.Value } }; - var idMapping = new Dictionary(); + var idMapping = new Dictionary(); - await foreach (DocumentModelSummary model in client.GetModelsAsync()) + await foreach (DocumentModelDetails model in client.GetModelsAsync()) { if (expectedIdMapping.ContainsKey(model.ModelId)) { @@ -364,7 +364,7 @@ public async Task GetModels() Assert.That(idMapping, Contains.Key(id)); DocumentModelDetails expected = expectedIdMapping[id]; - DocumentModelSummary model = idMapping[id]; + DocumentModelDetails model = idMapping[id]; Assert.That(model.ModelId, Is.EqualTo(expected.ModelId)); Assert.That(model.Description, Is.EqualTo(expected.Description)); @@ -372,6 +372,10 @@ public async Task GetModels() Assert.That(model.CreatedDateTime, Is.EqualTo(expected.CreatedDateTime)); Assert.That(model.ExpirationDateTime, Is.EqualTo(expected.ExpirationDateTime)); Assert.That(model.Tags, Is.EquivalentTo(expected.Tags)); + + Assert.That(model.AzureBlobSource, Is.Null); + Assert.That(model.AzureBlobFileListSource, Is.Null); + Assert.That(model.DocTypes, Is.Empty); } } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentModelAdministrationClient/MiscellaneousOperationsLiveTests.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentModelAdministrationClient/MiscellaneousOperationsLiveTests.cs index 756c1f42e391..0542099db620 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentModelAdministrationClient/MiscellaneousOperationsLiveTests.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentModelAdministrationClient/MiscellaneousOperationsLiveTests.cs @@ -125,21 +125,21 @@ public async Task GetOperations() var operationId0 = new Guid(disposableModel0.Operation.Id); var operationId1 = new Guid(disposableModel1.Operation.Id); - OperationDetails operationDetails0 = await client.GetOperationAsync(operationId0); - OperationDetails operationDetails1 = await client.GetOperationAsync(operationId1); + OperationDetails expectedOperation0 = await client.GetOperationAsync(operationId0); + OperationDetails expectedOperation1 = await client.GetOperationAsync(operationId1); var expectedIdMapping = new Dictionary() { - { operationId0, operationDetails0 }, - { operationId1, operationDetails1 } + { operationId0, expectedOperation0 }, + { operationId1, expectedOperation1 } }; - var idMapping = new Dictionary(); + var idMapping = new Dictionary(); - await foreach (OperationSummary operationSummary in client.GetOperationsAsync()) + await foreach (OperationDetails operation in client.GetOperationsAsync()) { - if (expectedIdMapping.ContainsKey(operationSummary.OperationId)) + if (expectedIdMapping.ContainsKey(operation.OperationId)) { - idMapping.Add(operationSummary.OperationId, operationSummary); + idMapping.Add(operation.OperationId, operation); } if (idMapping.Count == expectedIdMapping.Count) @@ -155,16 +155,18 @@ public async Task GetOperations() Assert.That(idMapping, Contains.Key(id)); OperationDetails expected = expectedIdMapping[id]; - OperationSummary operationSummary = idMapping[id]; - - Assert.That(operationSummary.OperationId, Is.EqualTo(expected.OperationId)); - Assert.That(operationSummary.ApiVersion, Is.EqualTo(expected.ApiVersion)); - Assert.That(operationSummary.Status, Is.EqualTo(expected.Status)); - Assert.That(operationSummary.PercentCompleted, Is.EqualTo(expected.PercentCompleted)); - Assert.That(operationSummary.ResourceLocation.AbsoluteUri, Is.EqualTo(expected.ResourceLocation.AbsoluteUri)); - Assert.That(operationSummary.CreatedDateTime, Is.EqualTo(expected.CreatedDateTime)); - Assert.That(operationSummary.LastUpdatedDateTime, Is.EqualTo(expected.LastUpdatedDateTime)); - Assert.That(operationSummary.Tags, Is.EquivalentTo(expected.Tags)); + OperationDetails operation = idMapping[id]; + + Assert.That(operation.OperationId, Is.EqualTo(expected.OperationId)); + Assert.That(operation.ApiVersion, Is.EqualTo(expected.ApiVersion)); + Assert.That(operation.Status, Is.EqualTo(expected.Status)); + Assert.That(operation.PercentCompleted, Is.EqualTo(expected.PercentCompleted)); + Assert.That(operation.ResourceLocation.AbsoluteUri, Is.EqualTo(expected.ResourceLocation.AbsoluteUri)); + Assert.That(operation.CreatedDateTime, Is.EqualTo(expected.CreatedDateTime)); + Assert.That(operation.LastUpdatedDateTime, Is.EqualTo(expected.LastUpdatedDateTime)); + Assert.That(operation.Tags, Is.EquivalentTo(expected.Tags)); + + Assert.That(operation.Error, Is.Null); } } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Generated/Samples/Samples_DocumentModelAdministrationClient.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Generated/Samples/Samples_DocumentModelAdministrationClient.cs index 357c7959aa9e..ff2fc8b02de6 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Generated/Samples/Samples_DocumentModelAdministrationClient.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Generated/Samples/Samples_DocumentModelAdministrationClient.cs @@ -194,7 +194,6 @@ public void Example_GetModel_ShortVersion() Response response = client.GetModel("", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("buildMode").ToString()); Console.WriteLine(result.GetProperty("modelId").ToString()); Console.WriteLine(result.GetProperty("createdDateTime").ToString()); } @@ -210,7 +209,6 @@ public async Task Example_GetModel_ShortVersion_Async() Response response = await client.GetModelAsync("", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("buildMode").ToString()); Console.WriteLine(result.GetProperty("modelId").ToString()); Console.WriteLine(result.GetProperty("createdDateTime").ToString()); } @@ -248,6 +246,12 @@ public void Example_GetModel_AllParameters() Response response = client.GetModel("", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("apiVersion").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); Console.WriteLine(result.GetProperty("buildMode").ToString()); Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); @@ -262,12 +266,6 @@ public void Example_GetModel_AllParameters() Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); } [Test] @@ -281,6 +279,12 @@ public async Task Example_GetModel_AllParameters_Async() Response response = await client.GetModelAsync("", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("apiVersion").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); Console.WriteLine(result.GetProperty("buildMode").ToString()); Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); @@ -295,12 +299,6 @@ public async Task Example_GetModel_AllParameters_Async() Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); } [Test] @@ -845,7 +843,7 @@ public void Example_GetModels_ShortVersion_Convenience() AzureKeyCredential credential = new AzureKeyCredential(""); DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - foreach (DocumentModelSummary item in client.GetModels()) + foreach (DocumentModelDetails item in client.GetModels()) { } } @@ -858,7 +856,7 @@ public async Task Example_GetModels_ShortVersion_Convenience_Async() AzureKeyCredential credential = new AzureKeyCredential(""); DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - await foreach (DocumentModelSummary item in client.GetModelsAsync()) + await foreach (DocumentModelDetails item in client.GetModelsAsync()) { } } @@ -880,6 +878,20 @@ public void Example_GetModels_AllParameters() Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); Console.WriteLine(result.GetProperty("apiVersion").ToString()); Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("buildMode").ToString()); + Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); + Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); + Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("containerUrl").ToString()); + Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("fileList").ToString()); + Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("buildMode").ToString()); + Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("example").ToString()); + Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); + Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); } } @@ -900,6 +912,20 @@ public async Task Example_GetModels_AllParameters_Async() Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); Console.WriteLine(result.GetProperty("apiVersion").ToString()); Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("buildMode").ToString()); + Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); + Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); + Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("containerUrl").ToString()); + Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("fileList").ToString()); + Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("buildMode").ToString()); + Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("example").ToString()); + Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); + Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); } } @@ -911,7 +937,7 @@ public void Example_GetModels_AllParameters_Convenience() AzureKeyCredential credential = new AzureKeyCredential(""); DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - foreach (DocumentModelSummary item in client.GetModels()) + foreach (DocumentModelDetails item in client.GetModels()) { } } @@ -924,7 +950,7 @@ public async Task Example_GetModels_AllParameters_Convenience_Async() AzureKeyCredential credential = new AzureKeyCredential(""); DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - await foreach (DocumentModelSummary item in client.GetModelsAsync()) + await foreach (DocumentModelDetails item in client.GetModelsAsync()) { } } @@ -977,7 +1003,7 @@ public void Example_GetOperations_ShortVersion_Convenience() AzureKeyCredential credential = new AzureKeyCredential(""); DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - foreach (OperationSummary item in client.GetOperations()) + foreach (OperationDetails item in client.GetOperations()) { } } @@ -990,7 +1016,7 @@ public async Task Example_GetOperations_ShortVersion_Convenience_Async() AzureKeyCredential credential = new AzureKeyCredential(""); DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - await foreach (OperationSummary item in client.GetOperationsAsync()) + await foreach (OperationDetails item in client.GetOperationsAsync()) { } } @@ -1015,6 +1041,11 @@ public void Example_GetOperations_AllParameters() Console.WriteLine(result.GetProperty("resourceLocation").ToString()); Console.WriteLine(result.GetProperty("apiVersion").ToString()); Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("message").ToString()); } } @@ -1038,6 +1069,11 @@ public async Task Example_GetOperations_AllParameters_Async() Console.WriteLine(result.GetProperty("resourceLocation").ToString()); Console.WriteLine(result.GetProperty("apiVersion").ToString()); Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("message").ToString()); } } @@ -1049,7 +1085,7 @@ public void Example_GetOperations_AllParameters_Convenience() AzureKeyCredential credential = new AzureKeyCredential(""); DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - foreach (OperationSummary item in client.GetOperations()) + foreach (OperationDetails item in client.GetOperations()) { } } @@ -1062,7 +1098,7 @@ public async Task Example_GetOperations_AllParameters_Convenience_Async() AzureKeyCredential credential = new AzureKeyCredential(""); DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - await foreach (OperationSummary item in client.GetOperationsAsync()) + await foreach (OperationDetails item in client.GetOperationsAsync()) { } } @@ -1205,7 +1241,7 @@ public async Task Example_GetClassifiers_AllParameters_Convenience_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_BuildDocument_ShortVersion() + public void Example_BuildDocumentModel_ShortVersion() { Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); @@ -1216,18 +1252,17 @@ public void Example_BuildDocument_ShortVersion() modelId = "", buildMode = "template", }); - Operation operation = client.BuildDocument(WaitUntil.Completed, content); + Operation operation = client.BuildDocumentModel(WaitUntil.Completed, content); BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("buildMode").ToString()); Console.WriteLine(result.GetProperty("modelId").ToString()); Console.WriteLine(result.GetProperty("createdDateTime").ToString()); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_BuildDocument_ShortVersion_Async() + public async Task Example_BuildDocumentModel_ShortVersion_Async() { Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); @@ -1238,44 +1273,43 @@ public async Task Example_BuildDocument_ShortVersion_Async() modelId = "", buildMode = "template", }); - Operation operation = await client.BuildDocumentAsync(WaitUntil.Completed, content); + Operation operation = await client.BuildDocumentModelAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("buildMode").ToString()); Console.WriteLine(result.GetProperty("modelId").ToString()); Console.WriteLine(result.GetProperty("createdDateTime").ToString()); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_BuildDocument_ShortVersion_Convenience() + public void Example_BuildDocumentModel_ShortVersion_Convenience() { Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); BuildDocumentModelRequest buildRequest = new BuildDocumentModelRequest("", DocumentBuildMode.Template); - Operation operation = client.BuildDocument(WaitUntil.Completed, buildRequest); + Operation operation = client.BuildDocumentModel(WaitUntil.Completed, buildRequest); DocumentModelDetails responseData = operation.Value; } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_BuildDocument_ShortVersion_Convenience_Async() + public async Task Example_BuildDocumentModel_ShortVersion_Convenience_Async() { Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); BuildDocumentModelRequest buildRequest = new BuildDocumentModelRequest("", DocumentBuildMode.Template); - Operation operation = await client.BuildDocumentAsync(WaitUntil.Completed, buildRequest); + Operation operation = await client.BuildDocumentModelAsync(WaitUntil.Completed, buildRequest); DocumentModelDetails responseData = operation.Value; } [Test] [Ignore("Only validating compilation of examples")] - public void Example_BuildDocument_AllParameters() + public void Example_BuildDocumentModel_AllParameters() { Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); @@ -1301,10 +1335,16 @@ public void Example_BuildDocument_AllParameters() key = "", }, }); - Operation operation = client.BuildDocument(WaitUntil.Completed, content); + Operation operation = client.BuildDocumentModel(WaitUntil.Completed, content); BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("apiVersion").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); Console.WriteLine(result.GetProperty("buildMode").ToString()); Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); @@ -1319,17 +1359,11 @@ public void Example_BuildDocument_AllParameters() Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_BuildDocument_AllParameters_Async() + public async Task Example_BuildDocumentModel_AllParameters_Async() { Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); @@ -1355,10 +1389,16 @@ public async Task Example_BuildDocument_AllParameters_Async() key = "", }, }); - Operation operation = await client.BuildDocumentAsync(WaitUntil.Completed, content); + Operation operation = await client.BuildDocumentModelAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("apiVersion").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); Console.WriteLine(result.GetProperty("buildMode").ToString()); Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); @@ -1373,17 +1413,11 @@ public async Task Example_BuildDocument_AllParameters_Async() Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_BuildDocument_AllParameters_Convenience() + public void Example_BuildDocumentModel_AllParameters_Convenience() { Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); @@ -1402,13 +1436,13 @@ public void Example_BuildDocument_AllParameters_Convenience() ["key"] = "" }, }; - Operation operation = client.BuildDocument(WaitUntil.Completed, buildRequest); + Operation operation = client.BuildDocumentModel(WaitUntil.Completed, buildRequest); DocumentModelDetails responseData = operation.Value; } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_BuildDocument_AllParameters_Convenience_Async() + public async Task Example_BuildDocumentModel_AllParameters_Convenience_Async() { Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); @@ -1427,7 +1461,7 @@ public async Task Example_BuildDocument_AllParameters_Convenience_Async() ["key"] = "" }, }; - Operation operation = await client.BuildDocumentAsync(WaitUntil.Completed, buildRequest); + Operation operation = await client.BuildDocumentModelAsync(WaitUntil.Completed, buildRequest); DocumentModelDetails responseData = operation.Value; } @@ -1454,7 +1488,6 @@ public void Example_ComposeModel_ShortVersion() BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("buildMode").ToString()); Console.WriteLine(result.GetProperty("modelId").ToString()); Console.WriteLine(result.GetProperty("createdDateTime").ToString()); } @@ -1482,7 +1515,6 @@ public async Task Example_ComposeModel_ShortVersion_Async() BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("buildMode").ToString()); Console.WriteLine(result.GetProperty("modelId").ToString()); Console.WriteLine(result.GetProperty("createdDateTime").ToString()); } @@ -1547,6 +1579,12 @@ public void Example_ComposeModel_AllParameters() BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("apiVersion").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); Console.WriteLine(result.GetProperty("buildMode").ToString()); Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); @@ -1561,12 +1599,6 @@ public void Example_ComposeModel_AllParameters() Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); } [Test] @@ -1597,6 +1629,12 @@ public async Task Example_ComposeModel_AllParameters_Async() BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("apiVersion").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); Console.WriteLine(result.GetProperty("buildMode").ToString()); Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); @@ -1611,12 +1649,6 @@ public async Task Example_ComposeModel_AllParameters_Async() Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); } [Test] @@ -1686,7 +1718,6 @@ public void Example_CopyModelTo_ShortVersion() BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("buildMode").ToString()); Console.WriteLine(result.GetProperty("modelId").ToString()); Console.WriteLine(result.GetProperty("createdDateTime").ToString()); } @@ -1712,7 +1743,6 @@ public async Task Example_CopyModelTo_ShortVersion_Async() BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("buildMode").ToString()); Console.WriteLine(result.GetProperty("modelId").ToString()); Console.WriteLine(result.GetProperty("createdDateTime").ToString()); } @@ -1764,6 +1794,12 @@ public void Example_CopyModelTo_AllParameters() BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("apiVersion").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); Console.WriteLine(result.GetProperty("buildMode").ToString()); Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); @@ -1778,12 +1814,6 @@ public void Example_CopyModelTo_AllParameters() Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); } [Test] @@ -1807,6 +1837,12 @@ public async Task Example_CopyModelTo_AllParameters_Async() BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("apiVersion").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); Console.WriteLine(result.GetProperty("buildMode").ToString()); Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); @@ -1821,12 +1857,6 @@ public async Task Example_CopyModelTo_AllParameters_Async() Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); } [Test] diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Infrastructure/DisposableDocumentModel.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Infrastructure/DisposableDocumentModel.cs index 3de29f8d8924..991c1f2c77e3 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Infrastructure/DisposableDocumentModel.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Infrastructure/DisposableDocumentModel.cs @@ -24,7 +24,7 @@ private DisposableDocumentModel(DocumentModelAdministrationClient client, Operat public static async Task BuildAsync(DocumentModelAdministrationClient client, BuildDocumentModelRequest buildRequest) { - Operation operation = await client.BuildDocumentAsync(WaitUntil.Completed, buildRequest); + Operation operation = await client.BuildDocumentModelAsync(WaitUntil.Completed, buildRequest); return new DisposableDocumentModel(client, operation); } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Infrastructure/DocumentIntelligenceLiveTestBase.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Infrastructure/DocumentIntelligenceLiveTestBase.cs index eb5321fbe725..da00dcd4373e 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Infrastructure/DocumentIntelligenceLiveTestBase.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Infrastructure/DocumentIntelligenceLiveTestBase.cs @@ -4,8 +4,6 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; using Azure.Core.TestFramework; using Azure.Core.TestFramework.Models; @@ -13,34 +11,22 @@ namespace Azure.AI.DocumentIntelligence.Tests { public class DocumentIntelligenceLiveTestBase : RecordedTestBase { - private readonly AzureAIDocumentIntelligenceClientOptions _clientOptions; - public DocumentIntelligenceLiveTestBase(bool isAsync, RecordedTestMode? mode = null) : base(isAsync, mode) { - // After rebranding to Document Intelligence, the paths in service endpoints have been renamed as well. For example: - // Until 2023-07-31: /formrecognizer/documentModels:build - // After 2023-07-31: /documentintelligence/documentModels:build - // This library has been generated from a typespec file targeting 2023-10-31-preview, so the generated code builds - // endpoints with the 'documentintelligence' path. We're still using 2023-07-31 for testing, so we need to replace - // it with 'formrecognizer'. We are using a ReplaceDocumentIntelligencePolicy to this end as a temporary workaround. - - _clientOptions = new AzureAIDocumentIntelligenceClientOptions(AzureAIDocumentIntelligenceClientOptions.ServiceVersion.V2023_07_31); - _clientOptions.AddPolicy(new ReplaceDocumentIntelligencePolicy(), HttpPipelinePosition.PerCall); - JsonPathSanitizers.Add("$..accessToken"); BodyKeySanitizers.Add(new BodyKeySanitizer("https://sanitized.blob.core.windows.net") { JsonPath = "$..containerUrl" }); SanitizedHeaders.Add("Ocp-Apim-Subscription-Key"); } - protected string ServiceVersionString { get; } = "2023-07-31"; + protected string ServiceVersionString { get; } = "2023-10-31-preview"; protected DocumentAnalysisClient CreateDocumentAnalysisClient() { var endpoint = new Uri(TestEnvironment.Endpoint); var credential = new AzureKeyCredential(TestEnvironment.ApiKey); - var nonInstrumentedClient = new DocumentAnalysisClient(endpoint, credential, _clientOptions); + var nonInstrumentedClient = new DocumentAnalysisClient(endpoint, credential); return InstrumentClient(nonInstrumentedClient); } @@ -50,7 +36,7 @@ protected DocumentModelAdministrationClient CreateDocumentModelAdministrationCli var endpoint = new Uri(TestEnvironment.Endpoint); var credential = new AzureKeyCredential(TestEnvironment.ApiKey); - var nonInstrumentedClient = new DocumentModelAdministrationClient(endpoint, credential, _clientOptions); + var nonInstrumentedClient = new DocumentModelAdministrationClient(endpoint, credential); return InstrumentClient(nonInstrumentedClient); } @@ -110,15 +96,5 @@ protected async Task BuildDisposableDocumentClassi return await DisposableDocumentClassifier.BuildAsync(client, request); } - - private class ReplaceDocumentIntelligencePolicy : HttpPipelineSynchronousPolicy - { - public override void OnSendingRequest(HttpMessage message) - { - RequestUriBuilder uriBuilder = message.Request.Uri; - - uriBuilder.Path = uriBuilder.Path.Replace("documentintelligence", "formrecognizer"); - } - } } } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tsp-location.yaml b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tsp-location.yaml index 217f2358cb6a..8abaa5f25655 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tsp-location.yaml +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tsp-location.yaml @@ -1,3 +1,3 @@ directory: specification/cognitiveservices/DocumentIntelligence -commit: 6d4f448a83ac23456b8fc14f9ba5e685ae9eb215 +commit: 848f569574785ce962c31e7de25082e942b8486a repo: Azure/azure-rest-api-specs-pr diff --git a/sdk/documentintelligence/ci.yml b/sdk/documentintelligence/ci.yml index 23612921d214..9427556d76cc 100644 --- a/sdk/documentintelligence/ci.yml +++ b/sdk/documentintelligence/ci.yml @@ -8,9 +8,7 @@ trigger: - release/* paths: include: - - sdk/newprojecttypespec - - sdk/newprojecttypespec/ci.yml - - sdk/newprojecttypespec/Azure.NewProject.TypeSpec + - sdk/documentintelligence/ pr: branches: @@ -21,15 +19,13 @@ pr: - release/* paths: include: - - sdk/newprojecttypespec - - sdk/newprojecttypespec/ci.yml - - sdk/newprojecttypespec/Azure.NewProject.TypeSpec + - sdk/documentintelligence/ extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: - ServiceDirectory: newprojecttypespec + ServiceDirectory: documentintelligence ArtifactName: packages Artifacts: - - name: Azure.NewProject.TypeSpec - safeName: AzureNewProjectTypeSpec + - name: Azure.AI.DocumentIntelligence + safeName: AzureAIDocumentIntelligence