Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update CHANGELOG and samples to reflect additional type renamings in document intelligence #32327

Merged
merged 3 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ The following types are renamed
- `ResourceDetailsOutput` to `DocumentIntelligenceResourceDetailsOutput`
- `PagedOperationDetailsOutput` to `PagedDocumentIntelligenceOperationDetailsOutput`
- `GetResourceInfo` to `GetResourceDetails`
- `AnalyzeResultOperationOutput` to `AnalyzeOperationOutput`
- `FontWeightOutput` to `DocumentFontWeightOutput`
- `FontStyleOutput` to `DocumentFontStyleOutput`
- `DocumentOutput` to `AnalyzedDocumentOutput`
- `CopyAuthorizationOutput` to `ModelCopyAuthorizationOutput`

## 1.0.0-beta.3 (2024-08-20)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ if (isUnexpected(initialResponse)) {
}

const poller = await getLongRunningPoller(client, initialResponse);
const analyzeResult = ((await poller.pollUntilDone().body) as AnalyzeResultOperationOutput)
const analyzeResult = ((await poller.pollUntilDone().body) as AnalyzeOperationOutput)
.analyzeResult;

const pages = analyzeResult?.pages;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,15 @@ Continue creating the poller from initial response
```ts
import {
getLongRunningPoller,
AnalyzeResultOperationOutput,
AnalyzeOperationOutput,
isUnexpected,
} from "@azure-rest/ai-document-intelligence";

if (isUnexpected(initialResponse)) {
throw initialResponse.body.error;
}
const poller = getLongRunningPoller(client, initialResponse);
const result = (await poller.pollUntilDone()).body as AnalyzeResultOperationOutput;
const result = (await poller.pollUntilDone()).body as AnalyzeOperationOutput;
console.log(result);
// {
// status: 'succeeded',
Expand Down Expand Up @@ -365,7 +365,7 @@ if (isUnexpected(initialResponse)) {

const poller = getLongRunningPoller(client, initialResponse, { ...testPollingOptions });

const result = (await poller.pollUntilDone()).body as AnalyzeResultOperationOutput;
const result = (await poller.pollUntilDone()).body as AnalyzeOperationOutput;
const figures = result.analyzeResult?.figures;
assert.isArray(figures);
assert.isNotEmpty(figures?.[0]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/

import DocumentIntelligence, {
AnalyzeResultOperationOutput,
AnalyzeOperationOutput,
getLongRunningPoller,
isUnexpected,
} from "@azure-rest/ai-document-intelligence";
Expand All @@ -36,7 +36,7 @@ async function main() {
throw initialResponse.body.error;
}
const poller = getLongRunningPoller(client, initialResponse);
const analyzeResult = ((await poller.pollUntilDone()).body as AnalyzeResultOperationOutput)
const analyzeResult = ((await poller.pollUntilDone()).body as AnalyzeOperationOutput)
.analyzeResult;

const documents = analyzeResult?.documents;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import DocumentIntelligence, {
AnalyzeResultOperationOutput,
AnalyzeOperationOutput,
getLongRunningPoller,
isUnexpected,
} from "@azure-rest/ai-document-intelligence";
Expand Down Expand Up @@ -44,7 +44,7 @@ async function main() {
throw initialResponse.body.error;
}
const poller = getLongRunningPoller(client, initialResponse);
const analyzeResult = ((await poller.pollUntilDone()).body as AnalyzeResultOperationOutput)
const analyzeResult = ((await poller.pollUntilDone()).body as AnalyzeOperationOutput)
.analyzeResult;

const documents = analyzeResult?.documents;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/

import DocumentIntelligence, {
AnalyzeResultOperationOutput,
AnalyzeOperationOutput,
getLongRunningPoller,
isUnexpected,
} from "@azure-rest/ai-document-intelligence";
Expand Down Expand Up @@ -42,7 +42,7 @@ async function main() {
throw initialResponse.body.error;
}
const poller = getLongRunningPoller(client, initialResponse);
const analyzeResult = ((await poller.pollUntilDone()).body as AnalyzeResultOperationOutput)
const analyzeResult = ((await poller.pollUntilDone()).body as AnalyzeOperationOutput)
.analyzeResult;

const documents = analyzeResult?.documents;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/

import DocumentIntelligence, {
AnalyzeResultOperationOutput,
AnalyzeOperationOutput,
getLongRunningPoller,
isUnexpected,
} from "@azure-rest/ai-document-intelligence";
Expand Down Expand Up @@ -42,7 +42,7 @@ async function main() {
throw initialResponse.body.error;
}
const poller = getLongRunningPoller(client, initialResponse);
const analyzeResult = ((await poller.pollUntilDone()).body as AnalyzeResultOperationOutput)
const analyzeResult = ((await poller.pollUntilDone()).body as AnalyzeOperationOutput)
.analyzeResult;

const documents = analyzeResult?.documents;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import DocumentIntelligence, {
AnalyzeResultOperationOutput,
AnalyzeOperationOutput,
getLongRunningPoller,
isUnexpected,
} from "@azure-rest/ai-document-intelligence";
Expand Down Expand Up @@ -45,7 +45,7 @@ async function main() {
const poller = getLongRunningPoller(client, initialResponse);

poller.onProgress((state) => console.log("Operation:", state.result, state.status));
const analyzeResult = ((await poller.pollUntilDone()).body as AnalyzeResultOperationOutput)
const analyzeResult = ((await poller.pollUntilDone()).body as AnalyzeOperationOutput)
.analyzeResult;

const documents = analyzeResult?.documents;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/

import DocumentIntelligence, {
AnalyzeResultOperationOutput,
AnalyzeOperationOutput,
getLongRunningPoller,
isUnexpected,
} from "@azure-rest/ai-document-intelligence";
Expand Down Expand Up @@ -48,7 +48,7 @@ async function main() {
}

const poller = getLongRunningPoller(client, initialResponse);
const analyzeResult = ((await poller.pollUntilDone()).body as AnalyzeResultOperationOutput)
const analyzeResult = ((await poller.pollUntilDone()).body as AnalyzeOperationOutput)
.analyzeResult;

const documents = analyzeResult?.documents;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import DocumentIntelligence, {
AnalyzeResultOperationOutput,
AnalyzeOperationOutput,
getLongRunningPoller,
isUnexpected,
} from "@azure-rest/ai-document-intelligence";
Expand Down Expand Up @@ -39,7 +39,7 @@ async function main() {
}

const poller = getLongRunningPoller(client, initialResponse);
const analyzeResult = ((await poller.pollUntilDone()).body as AnalyzeResultOperationOutput)
const analyzeResult = ((await poller.pollUntilDone()).body as AnalyzeOperationOutput)
.analyzeResult;

if (analyzeResult?.documents === undefined || analyzeResult.documents.length === 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/

import DocumentIntelligence, {
AnalyzeResultOperationOutput,
AnalyzeOperationOutput,
getLongRunningPoller,
isUnexpected,
} from "@azure-rest/ai-document-intelligence";
Expand Down Expand Up @@ -40,7 +40,7 @@ async function main() {
}

const poller = getLongRunningPoller(client, initialResponse);
const analyzeResult = ((await poller.pollUntilDone()).body as AnalyzeResultOperationOutput)
const analyzeResult = ((await poller.pollUntilDone()).body as AnalyzeOperationOutput)
.analyzeResult;

const pages = analyzeResult?.pages;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import DocumentIntelligence, {
AnalyzeResultOperationOutput,
AnalyzeOperationOutput,
getLongRunningPoller,
isUnexpected,
} from "@azure-rest/ai-document-intelligence";
Expand Down Expand Up @@ -37,7 +37,7 @@ async function main() {
throw initialResponse.body.error;
}
const poller = getLongRunningPoller(client, initialResponse);
const analyzeResult = ((await poller.pollUntilDone()).body as AnalyzeResultOperationOutput)
const analyzeResult = ((await poller.pollUntilDone()).body as AnalyzeOperationOutput)
.analyzeResult;

// The "prebuilt-read" model (`beginReadDocument` method) only extracts information about the textual content of the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/

import DocumentIntelligence, {
AnalyzeResultOperationOutput,
AnalyzeOperationOutput,
getLongRunningPoller,
isUnexpected,
} from "@azure-rest/ai-document-intelligence";
Expand All @@ -36,7 +36,7 @@ async function main() {
throw initialResponse.body.error;
}
const poller = getLongRunningPoller(client, initialResponse);
const analyzeResult = ((await poller.pollUntilDone()).body as AnalyzeResultOperationOutput)
const analyzeResult = ((await poller.pollUntilDone()).body as AnalyzeOperationOutput)
.analyzeResult;

const documents = analyzeResult?.documents;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/

import DocumentIntelligence, {
AnalyzeResultOperationOutput,
AnalyzeOperationOutput,
getLongRunningPoller,
isUnexpected,
} from "@azure-rest/ai-document-intelligence";
Expand Down Expand Up @@ -43,7 +43,7 @@ async function main() {
throw initialResponse.body.error;
}
const poller = getLongRunningPoller(client, initialResponse);
const analyzeResult = ((await poller.pollUntilDone()).body as AnalyzeResultOperationOutput)
const analyzeResult = ((await poller.pollUntilDone()).body as AnalyzeOperationOutput)
.analyzeResult;

const documents = analyzeResult?.documents;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/

import DocumentIntelligence, {
AnalyzeResultOperationOutput,
AnalyzeOperationOutput,
getLongRunningPoller,
isUnexpected,
} from "@azure-rest/ai-document-intelligence";
Expand Down Expand Up @@ -41,7 +41,7 @@ async function main() {
throw initialResponse.body.error;
}
const poller = getLongRunningPoller(client, initialResponse);
const analyzeResult = ((await poller.pollUntilDone()).body as AnalyzeResultOperationOutput)
const analyzeResult = ((await poller.pollUntilDone()).body as AnalyzeOperationOutput)
.analyzeResult;

const documents = analyzeResult?.documents;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/

import DocumentIntelligence, {
AnalyzeResultOperationOutput,
AnalyzeOperationOutput,
getLongRunningPoller,
isUnexpected,
} from "@azure-rest/ai-document-intelligence";
Expand Down Expand Up @@ -41,7 +41,7 @@ async function main() {
throw initialResponse.body.error;
}
const poller = getLongRunningPoller(client, initialResponse);
const analyzeResult = ((await poller.pollUntilDone()).body as AnalyzeResultOperationOutput)
const analyzeResult = ((await poller.pollUntilDone()).body as AnalyzeOperationOutput)
.analyzeResult;

const documents = analyzeResult?.documents;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import DocumentIntelligence, {
AnalyzeResultOperationOutput,
AnalyzeOperationOutput,
getLongRunningPoller,
isUnexpected,
} from "@azure-rest/ai-document-intelligence";
Expand Down Expand Up @@ -45,7 +45,7 @@ async function main() {
const poller = getLongRunningPoller(client, initialResponse);

poller.onProgress((state) => console.log("Operation:", state.result, state.status));
const analyzeResult = ((await poller.pollUntilDone()).body as AnalyzeResultOperationOutput)
const analyzeResult = ((await poller.pollUntilDone()).body as AnalyzeOperationOutput)
.analyzeResult;

const documents = analyzeResult?.documents;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/

import DocumentIntelligence, {
AnalyzeResultOperationOutput,
AnalyzeOperationOutput,
getLongRunningPoller,
isUnexpected,
} from "@azure-rest/ai-document-intelligence";
Expand Down Expand Up @@ -47,7 +47,7 @@ async function main() {
}

const poller = getLongRunningPoller(client, initialResponse);
const analyzeResult = ((await poller.pollUntilDone()).body as AnalyzeResultOperationOutput)
const analyzeResult = ((await poller.pollUntilDone()).body as AnalyzeOperationOutput)
.analyzeResult;

const documents = analyzeResult?.documents;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import DocumentIntelligence, {
AnalyzeResultOperationOutput,
AnalyzeOperationOutput,
getLongRunningPoller,
isUnexpected,
} from "@azure-rest/ai-document-intelligence";
Expand Down Expand Up @@ -39,7 +39,7 @@ async function main() {
}

const poller = getLongRunningPoller(client, initialResponse);
const analyzeResult = ((await poller.pollUntilDone()).body as AnalyzeResultOperationOutput)
const analyzeResult = ((await poller.pollUntilDone()).body as AnalyzeOperationOutput)
.analyzeResult;

if (analyzeResult?.documents === undefined || analyzeResult.documents.length === 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/

import DocumentIntelligence, {
AnalyzeResultOperationOutput,
AnalyzeOperationOutput,
getLongRunningPoller,
isUnexpected,
} from "@azure-rest/ai-document-intelligence";
Expand Down Expand Up @@ -39,7 +39,7 @@ async function main() {
}

const poller = getLongRunningPoller(client, initialResponse);
const analyzeResult = ((await poller.pollUntilDone()).body as AnalyzeResultOperationOutput)
const analyzeResult = ((await poller.pollUntilDone()).body as AnalyzeOperationOutput)
.analyzeResult;

const pages = analyzeResult?.pages;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import DocumentIntelligence, {
AnalyzeResultOperationOutput,
AnalyzeOperationOutput,
getLongRunningPoller,
isUnexpected,
} from "@azure-rest/ai-document-intelligence";
Expand Down Expand Up @@ -37,7 +37,7 @@ async function main() {
throw initialResponse.body.error;
}
const poller = getLongRunningPoller(client, initialResponse);
const analyzeResult = ((await poller.pollUntilDone()).body as AnalyzeResultOperationOutput)
const analyzeResult = ((await poller.pollUntilDone()).body as AnalyzeOperationOutput)
.analyzeResult;

// The "prebuilt-read" model (`beginReadDocument` method) only extracts information about the textual content of the
Expand Down
Loading