From 05dbcae4934b4e31a34fc96e31fe7573da845aa8 Mon Sep 17 00:00:00 2001 From: Daniel Rodriguez Date: Fri, 21 Jan 2022 00:07:05 +0000 Subject: [PATCH 01/26] changes on kv-secret --- .../internal/challengeBasedAuthenticationPolicy.spec.ts | 6 +++--- sdk/keyvault/keyvault-secrets/test/public/CRUD.spec.ts | 8 ++++---- sdk/keyvault/keyvault-secrets/test/public/list.spec.ts | 8 ++++---- .../keyvault-secrets/test/public/lro.delete.spec.ts | 8 ++++---- .../keyvault-secrets/test/public/lro.recover.spec.ts | 8 ++++---- .../test/public/recoverBackupRestore.spec.ts | 8 ++++---- .../test/{ => public}/utils/lro/restore/operation.ts | 6 +++--- .../test/{ => public}/utils/lro/restore/poller.ts | 2 +- .../test/{ => public}/utils/recorderUtils.ts | 0 .../test/{ => public}/utils/testAuthentication.ts | 2 +- .../test/{ => public}/utils/testClient.ts | 2 +- .../test/{ => public}/utils/utils.common.ts | 2 +- 12 files changed, 30 insertions(+), 30 deletions(-) rename sdk/keyvault/keyvault-secrets/test/{ => public}/utils/lro/restore/operation.ts (98%) rename sdk/keyvault/keyvault-secrets/test/{ => public}/utils/lro/restore/poller.ts (95%) rename sdk/keyvault/keyvault-secrets/test/{ => public}/utils/recorderUtils.ts (100%) rename sdk/keyvault/keyvault-secrets/test/{ => public}/utils/testAuthentication.ts (97%) rename sdk/keyvault/keyvault-secrets/test/{ => public}/utils/testClient.ts (95%) rename sdk/keyvault/keyvault-secrets/test/{ => public}/utils/utils.common.ts (95%) diff --git a/sdk/keyvault/keyvault-secrets/test/internal/challengeBasedAuthenticationPolicy.spec.ts b/sdk/keyvault/keyvault-secrets/test/internal/challengeBasedAuthenticationPolicy.spec.ts index 1d3e42cdd564..0e892389334a 100644 --- a/sdk/keyvault/keyvault-secrets/test/internal/challengeBasedAuthenticationPolicy.spec.ts +++ b/sdk/keyvault/keyvault-secrets/test/internal/challengeBasedAuthenticationPolicy.spec.ts @@ -13,11 +13,11 @@ import { challengeBasedAuthenticationPolicy, } from "../../../keyvault-common/src"; import { SecretClient } from "../../src"; -import { authenticate } from "../utils/testAuthentication"; -import TestClient from "../utils/testClient"; +import { authenticate } from "../public/utils/testAuthentication"; +import TestClient from "../public/utils/testClient"; import { ClientSecretCredential } from "@azure/identity"; import { WebResource } from "@azure/core-http"; -import { getServiceVersion } from "../utils/utils.common"; +import { getServiceVersion } from "../public/utils/utils.common"; // Following the philosophy of not testing the insides if we can test the outsides... // I present you with this "Get Out of Jail Free" card (in reference to Monopoly). diff --git a/sdk/keyvault/keyvault-secrets/test/public/CRUD.spec.ts b/sdk/keyvault/keyvault-secrets/test/public/CRUD.spec.ts index 54755de842d2..a4c80f78b248 100644 --- a/sdk/keyvault/keyvault-secrets/test/public/CRUD.spec.ts +++ b/sdk/keyvault/keyvault-secrets/test/public/CRUD.spec.ts @@ -8,10 +8,10 @@ import { env, Recorder } from "@azure-tools/test-recorder"; import { AbortController } from "@azure/abort-controller"; import { SecretClient } from "../../src"; -import { assertThrowsAbortError, getServiceVersion } from "../utils/utils.common"; -import { testPollerProperties } from "../utils/recorderUtils"; -import { authenticate } from "../utils/testAuthentication"; -import TestClient from "../utils/testClient"; +import { assertThrowsAbortError, getServiceVersion } from "./utils/utils.common"; +import { testPollerProperties } from "./utils/recorderUtils"; +import { authenticate } from "./utils/testAuthentication"; +import TestClient from "./utils/testClient"; describe("Secret client - create, read, update and delete operations", () => { const secretValue = "SECRET_VALUE"; diff --git a/sdk/keyvault/keyvault-secrets/test/public/list.spec.ts b/sdk/keyvault/keyvault-secrets/test/public/list.spec.ts index 8dbeb36446ab..bb5136e8f0f1 100644 --- a/sdk/keyvault/keyvault-secrets/test/public/list.spec.ts +++ b/sdk/keyvault/keyvault-secrets/test/public/list.spec.ts @@ -7,10 +7,10 @@ import chai from "chai"; import { env, Recorder, isRecordMode } from "@azure-tools/test-recorder"; import { SecretClient } from "../../src"; -import { assertThrowsAbortError, getServiceVersion } from "../utils/utils.common"; -import { testPollerProperties } from "../utils/recorderUtils"; -import { authenticate } from "../utils/testAuthentication"; -import TestClient from "../utils/testClient"; +import { assertThrowsAbortError, getServiceVersion } from "./utils/utils.common"; +import { testPollerProperties } from "./utils/recorderUtils"; +import { authenticate } from "./utils/testAuthentication"; +import TestClient from "./utils/testClient"; const { expect } = chai; diff --git a/sdk/keyvault/keyvault-secrets/test/public/lro.delete.spec.ts b/sdk/keyvault/keyvault-secrets/test/public/lro.delete.spec.ts index 8a1b35c43bff..23ce0c564684 100644 --- a/sdk/keyvault/keyvault-secrets/test/public/lro.delete.spec.ts +++ b/sdk/keyvault/keyvault-secrets/test/public/lro.delete.spec.ts @@ -7,10 +7,10 @@ import { env, Recorder } from "@azure-tools/test-recorder"; import { PollerStoppedError } from "@azure/core-lro"; import { SecretClient, DeletedSecret } from "../../src"; -import { assertThrowsAbortError, getServiceVersion } from "../utils/utils.common"; -import { testPollerProperties } from "../utils/recorderUtils"; -import { authenticate } from "../utils/testAuthentication"; -import TestClient from "../utils/testClient"; +import { assertThrowsAbortError, getServiceVersion } from "./utils/utils.common"; +import { testPollerProperties } from "./utils/recorderUtils"; +import { authenticate } from "./utils/testAuthentication"; +import TestClient from "./utils/testClient"; describe("Secrets client - Long Running Operations - delete", () => { const secretPrefix = `lroDelete${env.CERTIFICATE_NAME || "SecretName"}`; diff --git a/sdk/keyvault/keyvault-secrets/test/public/lro.recover.spec.ts b/sdk/keyvault/keyvault-secrets/test/public/lro.recover.spec.ts index bcbc56d5634e..e77e68de1fdb 100644 --- a/sdk/keyvault/keyvault-secrets/test/public/lro.recover.spec.ts +++ b/sdk/keyvault/keyvault-secrets/test/public/lro.recover.spec.ts @@ -7,10 +7,10 @@ import { env, Recorder } from "@azure-tools/test-recorder"; import { PollerStoppedError } from "@azure/core-lro"; import { SecretClient, SecretProperties } from "../../src"; -import { assertThrowsAbortError, getServiceVersion } from "../utils/utils.common"; -import { testPollerProperties } from "../utils/recorderUtils"; -import { authenticate } from "../utils/testAuthentication"; -import TestClient from "../utils/testClient"; +import { assertThrowsAbortError, getServiceVersion } from "./utils/utils.common"; +import { testPollerProperties } from "./utils/recorderUtils"; +import { authenticate } from "./utils/testAuthentication"; +import TestClient from "./utils/testClient"; describe("Secrets client - Long Running Operations - recoverDelete", () => { const secretPrefix = `lroRecover${env.CERTIFICATE_NAME || "SecretName"}`; diff --git a/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts b/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts index f8516e7a968b..9b395120dba6 100644 --- a/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts +++ b/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts @@ -7,10 +7,10 @@ import { isNode } from "@azure/core-http"; import { env, isPlaybackMode, Recorder, isRecordMode } from "@azure-tools/test-recorder"; import { SecretClient } from "../../src"; -import { assertThrowsAbortError, getServiceVersion } from "../utils/utils.common"; -import { testPollerProperties } from "../utils/recorderUtils"; -import { authenticate } from "../utils/testAuthentication"; -import TestClient from "../utils/testClient"; +import { assertThrowsAbortError, getServiceVersion } from "./utils/utils.common"; +import { testPollerProperties } from "./utils/recorderUtils"; +import { authenticate } from "./utils/testAuthentication"; +import TestClient from "./utils/testClient"; describe("Secret client - restore secrets and recover backups", () => { const secretPrefix = `backupRestore${env.SECRET_NAME || "SecretName"}`; diff --git a/sdk/keyvault/keyvault-secrets/test/utils/lro/restore/operation.ts b/sdk/keyvault/keyvault-secrets/test/public/utils/lro/restore/operation.ts similarity index 98% rename from sdk/keyvault/keyvault-secrets/test/utils/lro/restore/operation.ts rename to sdk/keyvault/keyvault-secrets/test/public/utils/lro/restore/operation.ts index 7f6b9f265d76..18b8bbc4440d 100644 --- a/sdk/keyvault/keyvault-secrets/test/utils/lro/restore/operation.ts +++ b/sdk/keyvault/keyvault-secrets/test/public/utils/lro/restore/operation.ts @@ -4,12 +4,12 @@ import { AbortSignalLike } from "@azure/abort-controller"; import { PollOperationState, PollOperation } from "@azure/core-lro"; import { OperationOptions } from "@azure/core-http"; -import { SecretPollerOptions, SecretProperties } from "../../../../src/secretsModels"; +import { SecretPollerOptions, SecretProperties } from "../../../../../src/secretsModels"; /** * Options sent to the beginRestoreSecretBackup method. */ -export interface BeginRestoreSecretBackupOptions extends SecretPollerOptions {} +export interface BeginRestoreSecretBackupOptions extends SecretPollerOptions { } /** * @internal @@ -49,7 +49,7 @@ export interface RestoreSecretBackupPollOperationState * An interface representing a restore secret's poll operation */ export interface RestoreSecretBackupPollOperation - extends PollOperation {} + extends PollOperation { } /** * Reaches to the service and updates the restore secret's poll operation. diff --git a/sdk/keyvault/keyvault-secrets/test/utils/lro/restore/poller.ts b/sdk/keyvault/keyvault-secrets/test/public/utils/lro/restore/poller.ts similarity index 95% rename from sdk/keyvault/keyvault-secrets/test/utils/lro/restore/poller.ts rename to sdk/keyvault/keyvault-secrets/test/public/utils/lro/restore/poller.ts index 9fe9304e0dbf..a4c5697b2f6c 100644 --- a/sdk/keyvault/keyvault-secrets/test/utils/lro/restore/poller.ts +++ b/sdk/keyvault/keyvault-secrets/test/public/utils/lro/restore/poller.ts @@ -8,7 +8,7 @@ import { makeRestoreSecretBackupPollOperation, TestSecretClientInterface, } from "./operation"; -import { SecretProperties } from "../../../../src/secretsModels"; +import { SecretProperties } from "../../../../../src/secretsModels"; export interface RestoreSecretBackupPollerOptions { client: TestSecretClientInterface; diff --git a/sdk/keyvault/keyvault-secrets/test/utils/recorderUtils.ts b/sdk/keyvault/keyvault-secrets/test/public/utils/recorderUtils.ts similarity index 100% rename from sdk/keyvault/keyvault-secrets/test/utils/recorderUtils.ts rename to sdk/keyvault/keyvault-secrets/test/public/utils/recorderUtils.ts diff --git a/sdk/keyvault/keyvault-secrets/test/utils/testAuthentication.ts b/sdk/keyvault/keyvault-secrets/test/public/utils/testAuthentication.ts similarity index 97% rename from sdk/keyvault/keyvault-secrets/test/utils/testAuthentication.ts rename to sdk/keyvault/keyvault-secrets/test/public/utils/testAuthentication.ts index 73434e96fa06..d855eda6ad12 100644 --- a/sdk/keyvault/keyvault-secrets/test/utils/testAuthentication.ts +++ b/sdk/keyvault/keyvault-secrets/test/public/utils/testAuthentication.ts @@ -2,7 +2,7 @@ // Licensed under the MIT license. import { ClientSecretCredential } from "@azure/identity"; -import { SecretClient } from "../../src"; +import { SecretClient } from "../../../src"; import { env, record, RecorderEnvironmentSetup } from "@azure-tools/test-recorder"; import { uniqueString } from "./recorderUtils"; import TestClient from "./testClient"; diff --git a/sdk/keyvault/keyvault-secrets/test/utils/testClient.ts b/sdk/keyvault/keyvault-secrets/test/public/utils/testClient.ts similarity index 95% rename from sdk/keyvault/keyvault-secrets/test/utils/testClient.ts rename to sdk/keyvault/keyvault-secrets/test/public/utils/testClient.ts index 2e0a072bbcec..fcc688561f98 100644 --- a/sdk/keyvault/keyvault-secrets/test/utils/testClient.ts +++ b/sdk/keyvault/keyvault-secrets/test/public/utils/testClient.ts @@ -2,7 +2,7 @@ // Licensed under the MIT license. import { testPollerProperties } from "./recorderUtils"; -import { SecretClient, SecretProperties } from "../../src"; +import { SecretClient, SecretProperties } from "../../../src"; import { PollerLike, PollOperationState } from "@azure/core-lro"; import { RestoreSecretBackupPoller } from "./lro/restore/poller"; import { BeginRestoreSecretBackupOptions } from "./lro/restore/operation"; diff --git a/sdk/keyvault/keyvault-secrets/test/utils/utils.common.ts b/sdk/keyvault/keyvault-secrets/test/public/utils/utils.common.ts similarity index 95% rename from sdk/keyvault/keyvault-secrets/test/utils/utils.common.ts rename to sdk/keyvault/keyvault-secrets/test/public/utils/utils.common.ts index eb4cf62775e1..1644b9d2b1cf 100644 --- a/sdk/keyvault/keyvault-secrets/test/utils/utils.common.ts +++ b/sdk/keyvault/keyvault-secrets/test/public/utils/utils.common.ts @@ -4,7 +4,7 @@ import { assert } from "chai"; import { SupportedVersions, supports, TestFunctionWrapper } from "@azure/test-utils"; import { env } from "@azure-tools/test-recorder"; -import { LATEST_API_VERSION, SecretClientOptions } from "../../src/secretsModels"; +import { LATEST_API_VERSION, SecretClientOptions } from "../../../src/secretsModels"; export async function assertThrowsAbortError(cb: () => Promise): Promise { let passed = false; From 95fdb7240e0175660a3c69a357f0fd90b20b1434 Mon Sep 17 00:00:00 2001 From: Daniel Rodriguez Date: Fri, 21 Jan 2022 00:08:41 +0000 Subject: [PATCH 02/26] kv-keys --- .../test/internal/aesCryptography.spec.ts | 8 ++++---- .../challengeBasedAuthenticationPolicy.spec.ts | 6 +++--- .../keyvault-keys/test/internal/crypto.spec.ts | 2 +- .../test/internal/serviceVersionParameter.spec.ts | 2 +- .../test/internal/transformations.spec.ts | 2 +- .../keyvault-keys/test/public/crypto.hsm.spec.ts | 8 ++++---- sdk/keyvault/keyvault-keys/test/public/crypto.spec.ts | 8 ++++---- sdk/keyvault/keyvault-keys/test/public/import.spec.ts | 8 ++++---- .../keyvault-keys/test/public/keyClient.hsm.spec.ts | 8 ++++---- .../keyvault-keys/test/public/keyClient.spec.ts | 10 +++++----- sdk/keyvault/keyvault-keys/test/public/list.spec.ts | 8 ++++---- .../test/public/localCryptography.spec.ts | 6 +++--- .../keyvault-keys/test/public/lro.delete.spec.ts | 8 ++++---- .../test/public/lro.recoverDelete.spec.ts | 8 ++++---- .../test/public/recoverBackupRestore.spec.ts | 8 ++++---- .../test/{ => public}/utils/base64url.browser.ts | 0 .../keyvault-keys/test/{ => public}/utils/base64url.ts | 0 .../keyvault-keys/test/{ => public}/utils/crypto.ts | 2 +- .../test/{ => public}/utils/lro/restore/operation.ts | 6 +++--- .../test/{ => public}/utils/lro/restore/poller.ts | 2 +- .../test/{ => public}/utils/recorderUtils.ts | 0 .../test/{ => public}/utils/testAuthentication.ts | 2 +- .../test/{ => public}/utils/testClient.ts | 2 +- .../test/{ => public}/utils/utils.common.ts | 2 +- 24 files changed, 58 insertions(+), 58 deletions(-) rename sdk/keyvault/keyvault-keys/test/{ => public}/utils/base64url.browser.ts (100%) rename sdk/keyvault/keyvault-keys/test/{ => public}/utils/base64url.ts (100%) rename sdk/keyvault/keyvault-keys/test/{ => public}/utils/crypto.ts (98%) rename sdk/keyvault/keyvault-keys/test/{ => public}/utils/lro/restore/operation.ts (96%) rename sdk/keyvault/keyvault-keys/test/{ => public}/utils/lro/restore/poller.ts (96%) rename sdk/keyvault/keyvault-keys/test/{ => public}/utils/recorderUtils.ts (100%) rename sdk/keyvault/keyvault-keys/test/{ => public}/utils/testAuthentication.ts (98%) rename sdk/keyvault/keyvault-keys/test/{ => public}/utils/testClient.ts (96%) rename sdk/keyvault/keyvault-keys/test/{ => public}/utils/utils.common.ts (97%) diff --git a/sdk/keyvault/keyvault-keys/test/internal/aesCryptography.spec.ts b/sdk/keyvault/keyvault-keys/test/internal/aesCryptography.spec.ts index 5a18e9560448..afe2d954625a 100644 --- a/sdk/keyvault/keyvault-keys/test/internal/aesCryptography.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/internal/aesCryptography.spec.ts @@ -10,15 +10,15 @@ import { KeyClient, KeyVaultKey, } from "../../src"; -import { getKey, stringToUint8Array, uint8ArrayToString } from "../utils/crypto"; +import { getKey, stringToUint8Array, uint8ArrayToString } from "../public/utils/crypto"; import { isNode } from "@azure/core-http"; import { AesCryptographyProvider } from "../../src/cryptography/aesCryptographyProvider"; -import TestClient from "../utils/testClient"; -import { authenticate } from "../utils/testAuthentication"; +import TestClient from "../public/utils/testClient"; +import { authenticate } from "../public/utils/testAuthentication"; import { env, Recorder } from "@azure-tools/test-recorder"; import { RemoteCryptographyProvider } from "../../src/cryptography/remoteCryptographyProvider"; import { ClientSecretCredential } from "@azure/identity"; -import { getServiceVersion } from "../utils/utils.common"; +import { getServiceVersion } from "../public/utils/utils.common"; describe("AesCryptographyProvider browser tests", function () { it("uses the browser replacement when running in the browser", async function (this: Context) { diff --git a/sdk/keyvault/keyvault-keys/test/internal/challengeBasedAuthenticationPolicy.spec.ts b/sdk/keyvault/keyvault-keys/test/internal/challengeBasedAuthenticationPolicy.spec.ts index b798282d28cd..dc590e5477f9 100644 --- a/sdk/keyvault/keyvault-keys/test/internal/challengeBasedAuthenticationPolicy.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/internal/challengeBasedAuthenticationPolicy.spec.ts @@ -13,9 +13,9 @@ import { challengeBasedAuthenticationPolicy, } from "../../../keyvault-common/src"; import { KeyClient } from "../../src"; -import { authenticate } from "../utils/testAuthentication"; -import TestClient from "../utils/testClient"; -import { getServiceVersion } from "../utils/utils.common"; +import { authenticate } from "../public/utils/testAuthentication"; +import TestClient from "../public/utils/testClient"; +import { getServiceVersion } from "../public/utils/utils.common"; import { HttpHeaders, isNode, WebResource } from "@azure/core-http"; import { ClientSecretCredential } from "@azure/identity"; import sinon from "sinon"; diff --git a/sdk/keyvault/keyvault-keys/test/internal/crypto.spec.ts b/sdk/keyvault/keyvault-keys/test/internal/crypto.spec.ts index d65445a466a0..1b158ed291db 100644 --- a/sdk/keyvault/keyvault-keys/test/internal/crypto.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/internal/crypto.spec.ts @@ -18,7 +18,7 @@ import { } from "../../src"; import { RsaCryptographyProvider } from "../../src/cryptography/rsaCryptographyProvider"; import { JsonWebKey } from "../../src"; -import { stringToUint8Array } from "../utils/crypto"; +import { stringToUint8Array } from "../public/utils/crypto"; import { CryptographyProvider } from "../../src/cryptography/models"; import { RemoteCryptographyProvider } from "../../src/cryptography/remoteCryptographyProvider"; diff --git a/sdk/keyvault/keyvault-keys/test/internal/serviceVersionParameter.spec.ts b/sdk/keyvault/keyvault-keys/test/internal/serviceVersionParameter.spec.ts index ef7e31ce6e5c..65a138ad2722 100644 --- a/sdk/keyvault/keyvault-keys/test/internal/serviceVersionParameter.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/internal/serviceVersionParameter.spec.ts @@ -9,7 +9,7 @@ import { HttpClient, HttpOperationResponse, WebResourceLike, HttpHeaders } from import { ClientSecretCredential } from "@azure/identity"; import { env } from "@azure-tools/test-recorder"; import { versionsToTest } from "@azure/test-utils"; -import { serviceVersions } from "../utils/utils.common"; +import { serviceVersions } from "../public/utils/utils.common"; describe("The Keys client should set the serviceVersion", () => { const keyVaultUrl = `https://keyVaultName.vault.azure.net`; diff --git a/sdk/keyvault/keyvault-keys/test/internal/transformations.spec.ts b/sdk/keyvault/keyvault-keys/test/internal/transformations.spec.ts index 76f9a57f5267..3c3d2b2679fe 100644 --- a/sdk/keyvault/keyvault-keys/test/internal/transformations.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/internal/transformations.spec.ts @@ -21,7 +21,7 @@ import { getKeyPropertiesFromKeyItem, keyRotationTransformations, } from "../../src/transformations"; -import { stringToUint8Array } from "../utils/crypto"; +import { stringToUint8Array } from "../public/utils/crypto"; describe("Transformations", () => { const releasePolicy = { diff --git a/sdk/keyvault/keyvault-keys/test/public/crypto.hsm.spec.ts b/sdk/keyvault/keyvault-keys/test/public/crypto.hsm.spec.ts index a7981055387a..e06969442012 100644 --- a/sdk/keyvault/keyvault-keys/test/public/crypto.hsm.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/public/crypto.hsm.spec.ts @@ -7,10 +7,10 @@ import { Recorder } from "@azure-tools/test-recorder"; import { ClientSecretCredential } from "@azure/identity"; import { CryptographyClient, KeyVaultKey, KeyClient } from "../../src"; -import { authenticate } from "../utils/testAuthentication"; -import { stringToUint8Array, uint8ArrayToString } from "../utils/crypto"; -import TestClient from "../utils/testClient"; -import { getServiceVersion, onVersions } from "../utils/utils.common"; +import { authenticate } from "./utils/testAuthentication"; +import { stringToUint8Array, uint8ArrayToString } from "./utils/crypto"; +import TestClient from "./utils/testClient"; +import { getServiceVersion, onVersions } from "./utils/utils.common"; import { isNode } from "@azure/core-http"; onVersions({ minVer: "7.2" }).describe( diff --git a/sdk/keyvault/keyvault-keys/test/public/crypto.spec.ts b/sdk/keyvault/keyvault-keys/test/public/crypto.spec.ts index a40ada928b4a..3048cd2191b7 100644 --- a/sdk/keyvault/keyvault-keys/test/public/crypto.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/public/crypto.spec.ts @@ -9,11 +9,11 @@ import { Recorder, env, isLiveMode } from "@azure-tools/test-recorder"; import { ClientSecretCredential } from "@azure/identity"; import { CryptographyClient, KeyVaultKey, KeyClient } from "../../src"; -import { authenticate } from "../utils/testAuthentication"; -import TestClient from "../utils/testClient"; -import { stringToUint8Array, uint8ArrayToString } from "../utils/crypto"; +import { authenticate } from "./utils/testAuthentication"; +import TestClient from "./utils/testClient"; +import { stringToUint8Array, uint8ArrayToString } from "./utils/crypto"; import { RsaCryptographyProvider } from "../../src/cryptography/rsaCryptographyProvider"; -import { getServiceVersion } from "../utils/utils.common"; +import { getServiceVersion } from "./utils/utils.common"; import { isNode } from "@azure/core-http"; describe("CryptographyClient (all decrypts happen remotely)", () => { diff --git a/sdk/keyvault/keyvault-keys/test/public/import.spec.ts b/sdk/keyvault/keyvault-keys/test/public/import.spec.ts index 58434ef71e11..807412e9b941 100644 --- a/sdk/keyvault/keyvault-keys/test/public/import.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/public/import.spec.ts @@ -6,10 +6,10 @@ import { Context } from "mocha"; import { env, Recorder } from "@azure-tools/test-recorder"; import { KeyClient } from "../../src"; -import { authenticate } from "../utils/testAuthentication"; -import TestClient from "../utils/testClient"; -import { getServiceVersion } from "../utils/utils.common"; -import { createRsaKey } from "../utils/crypto"; +import { authenticate } from "./utils/testAuthentication"; +import TestClient from "./utils/testClient"; +import { getServiceVersion } from "./utils/utils.common"; +import { createRsaKey } from "./utils/crypto"; describe("Keys client - import keys", () => { const prefix = `import${env.CERTIFICATE_NAME || "KeyName"}`; diff --git a/sdk/keyvault/keyvault-keys/test/public/keyClient.hsm.spec.ts b/sdk/keyvault/keyvault-keys/test/public/keyClient.hsm.spec.ts index e17a1938df27..bc6094c5dd18 100644 --- a/sdk/keyvault/keyvault-keys/test/public/keyClient.hsm.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/public/keyClient.hsm.spec.ts @@ -5,12 +5,12 @@ import { assert } from "chai"; import { Context } from "mocha"; import { env, Recorder } from "@azure-tools/test-recorder"; import { KeyClient } from "../../src"; -import { authenticate } from "../utils/testAuthentication"; -import TestClient from "../utils/testClient"; +import { authenticate } from "./utils/testAuthentication"; +import TestClient from "./utils/testClient"; import { CreateOctKeyOptions, KnownKeyExportEncryptionAlgorithm } from "../../src/keysModels"; -import { getServiceVersion, onVersions } from "../utils/utils.common"; +import { getServiceVersion, onVersions } from "./utils/utils.common"; import { supportsTracing } from "../../../keyvault-common/test/utils/supportsTracing"; -import { createRsaKey, stringToUint8Array, uint8ArrayToString } from "../utils/crypto"; +import { createRsaKey, stringToUint8Array, uint8ArrayToString } from "./utils/crypto"; import { DefaultHttpClient, WebResource } from "@azure/core-http"; onVersions({ minVer: "7.2" }).describe( diff --git a/sdk/keyvault/keyvault-keys/test/public/keyClient.spec.ts b/sdk/keyvault/keyvault-keys/test/public/keyClient.spec.ts index 3edb25b3b772..6b1ac1cf36c9 100644 --- a/sdk/keyvault/keyvault-keys/test/public/keyClient.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/public/keyClient.spec.ts @@ -22,13 +22,13 @@ import { getServiceVersion, isPublicCloud, onVersions, -} from "../utils/utils.common"; -import { testPollerProperties } from "../utils/recorderUtils"; -import { authenticate } from "../utils/testAuthentication"; -import TestClient from "../utils/testClient"; +} from "./utils/utils.common"; +import { testPollerProperties } from "./utils/recorderUtils"; +import { authenticate } from "./utils/testAuthentication"; +import TestClient from "./utils/testClient"; import { supportsTracing } from "../../../keyvault-common/test/utils/supportsTracing"; import { DefaultHttpClient, WebResource } from "@azure/core-http"; -import { stringToUint8Array, uint8ArrayToString } from "../utils/crypto"; +import { stringToUint8Array, uint8ArrayToString } from "./utils/crypto"; describe("Keys client - create, read, update and delete operations", () => { const keyPrefix = `CRUD${env.KEY_NAME || "KeyName"}`; diff --git a/sdk/keyvault/keyvault-keys/test/public/list.spec.ts b/sdk/keyvault/keyvault-keys/test/public/list.spec.ts index 399e5dc51515..029a8222a7b2 100644 --- a/sdk/keyvault/keyvault-keys/test/public/list.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/public/list.spec.ts @@ -6,10 +6,10 @@ import { Context } from "mocha"; import { env, Recorder, isRecordMode } from "@azure-tools/test-recorder"; import { KeyClient } from "../../src"; -import { assertThrowsAbortError, getServiceVersion } from "../utils/utils.common"; -import { testPollerProperties } from "../utils/recorderUtils"; -import { authenticate } from "../utils/testAuthentication"; -import TestClient from "../utils/testClient"; +import { assertThrowsAbortError, getServiceVersion } from "./utils/utils.common"; +import { testPollerProperties } from "./utils/recorderUtils"; +import { authenticate } from "./utils/testAuthentication"; +import TestClient from "./utils/testClient"; describe("Keys client - list keys in various ways", () => { const keyPrefix = `list${env.KEY_NAME || "KeyName"}`; diff --git a/sdk/keyvault/keyvault-keys/test/public/localCryptography.spec.ts b/sdk/keyvault/keyvault-keys/test/public/localCryptography.spec.ts index 4fb598906ef3..5f397a69fa77 100644 --- a/sdk/keyvault/keyvault-keys/test/public/localCryptography.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/public/localCryptography.spec.ts @@ -8,12 +8,12 @@ import chaiAsPromised from "chai-as-promised"; chai.use(chaiAsPromised); import { isNode } from "@azure/core-http"; import { createHash } from "crypto"; -import { authenticate } from "../utils/testAuthentication"; -import TestClient from "../utils/testClient"; +import { authenticate } from "./utils/testAuthentication"; +import TestClient from "./utils/testClient"; import { Recorder, env } from "@azure-tools/test-recorder"; import { ClientSecretCredential } from "@azure/identity"; import { RsaCryptographyProvider } from "../../src/cryptography/rsaCryptographyProvider"; -import { getServiceVersion } from "../utils/utils.common"; +import { getServiceVersion } from "./utils/utils.common"; const { assert } = chai; describe("Local cryptography public tests", () => { diff --git a/sdk/keyvault/keyvault-keys/test/public/lro.delete.spec.ts b/sdk/keyvault/keyvault-keys/test/public/lro.delete.spec.ts index 15685f92597c..e4c477918083 100644 --- a/sdk/keyvault/keyvault-keys/test/public/lro.delete.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/public/lro.delete.spec.ts @@ -7,10 +7,10 @@ import { env, Recorder } from "@azure-tools/test-recorder"; import { PollerStoppedError } from "@azure/core-lro"; import { KeyClient, DeletedKey } from "../../src"; -import { testPollerProperties } from "../utils/recorderUtils"; -import { authenticate } from "../utils/testAuthentication"; -import TestClient from "../utils/testClient"; -import { getServiceVersion } from "../utils/utils.common"; +import { testPollerProperties } from "./utils/recorderUtils"; +import { authenticate } from "./utils/testAuthentication"; +import TestClient from "./utils/testClient"; +import { getServiceVersion } from "./utils/utils.common"; describe("Keys client - Long Running Operations - delete", () => { const keyPrefix = `lroDelete${env.CERTIFICATE_NAME || "KeyName"}`; diff --git a/sdk/keyvault/keyvault-keys/test/public/lro.recoverDelete.spec.ts b/sdk/keyvault/keyvault-keys/test/public/lro.recoverDelete.spec.ts index b308451ab55d..19e0c9c65661 100644 --- a/sdk/keyvault/keyvault-keys/test/public/lro.recoverDelete.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/public/lro.recoverDelete.spec.ts @@ -7,10 +7,10 @@ import { env, Recorder } from "@azure-tools/test-recorder"; import { PollerStoppedError } from "@azure/core-lro"; import { KeyClient, DeletedKey } from "../../src"; -import { assertThrowsAbortError, getServiceVersion } from "../utils/utils.common"; -import { testPollerProperties } from "../utils/recorderUtils"; -import { authenticate } from "../utils/testAuthentication"; -import TestClient from "../utils/testClient"; +import { assertThrowsAbortError, getServiceVersion } from "./utils/utils.common"; +import { testPollerProperties } from "./utils/recorderUtils"; +import { authenticate } from "./utils/testAuthentication"; +import TestClient from "./utils/testClient"; describe("Keys client - Long Running Operations - recoverDelete", () => { const keyPrefix = `lroRecoverDelete${env.CERTIFICATE_NAME || "KeyName"}`; diff --git a/sdk/keyvault/keyvault-keys/test/public/recoverBackupRestore.spec.ts b/sdk/keyvault/keyvault-keys/test/public/recoverBackupRestore.spec.ts index 5684bdc21f5f..e57958f50dff 100644 --- a/sdk/keyvault/keyvault-keys/test/public/recoverBackupRestore.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/public/recoverBackupRestore.spec.ts @@ -5,11 +5,11 @@ import { assert } from "chai"; import { Context } from "mocha"; import { isNode } from "@azure/core-http"; import { KeyClient } from "../../src"; -import { assertThrowsAbortError, getServiceVersion } from "../utils/utils.common"; -import { testPollerProperties } from "../utils/recorderUtils"; +import { assertThrowsAbortError, getServiceVersion } from "./utils/utils.common"; +import { testPollerProperties } from "./utils/recorderUtils"; import { env, Recorder, isRecordMode, isPlaybackMode } from "@azure-tools/test-recorder"; -import { authenticate } from "../utils/testAuthentication"; -import TestClient from "../utils/testClient"; +import { authenticate } from "./utils/testAuthentication"; +import TestClient from "./utils/testClient"; describe("Keys client - restore keys and recover backups", () => { const keyPrefix = `backupRestore${env.KEY_NAME || "KeyName"}`; diff --git a/sdk/keyvault/keyvault-keys/test/utils/base64url.browser.ts b/sdk/keyvault/keyvault-keys/test/public/utils/base64url.browser.ts similarity index 100% rename from sdk/keyvault/keyvault-keys/test/utils/base64url.browser.ts rename to sdk/keyvault/keyvault-keys/test/public/utils/base64url.browser.ts diff --git a/sdk/keyvault/keyvault-keys/test/utils/base64url.ts b/sdk/keyvault/keyvault-keys/test/public/utils/base64url.ts similarity index 100% rename from sdk/keyvault/keyvault-keys/test/utils/base64url.ts rename to sdk/keyvault/keyvault-keys/test/public/utils/base64url.ts diff --git a/sdk/keyvault/keyvault-keys/test/utils/crypto.ts b/sdk/keyvault/keyvault-keys/test/public/utils/crypto.ts similarity index 98% rename from sdk/keyvault/keyvault-keys/test/utils/crypto.ts rename to sdk/keyvault/keyvault-keys/test/public/utils/crypto.ts index 1ea3368ce8c3..4d1695647240 100644 --- a/sdk/keyvault/keyvault-keys/test/utils/crypto.ts +++ b/sdk/keyvault/keyvault-keys/test/public/utils/crypto.ts @@ -2,7 +2,7 @@ // Licensed under the MIT license. import { isNode } from "@azure/core-http"; -import { JsonWebKey } from "../../src/keysModels"; +import { JsonWebKey } from "../../../src/keysModels"; export function stringToUint8Array(str: string): Uint8Array { if (isNode) { diff --git a/sdk/keyvault/keyvault-keys/test/utils/lro/restore/operation.ts b/sdk/keyvault/keyvault-keys/test/public/utils/lro/restore/operation.ts similarity index 96% rename from sdk/keyvault/keyvault-keys/test/utils/lro/restore/operation.ts rename to sdk/keyvault/keyvault-keys/test/public/utils/lro/restore/operation.ts index 56855649e43f..de97ae9d9060 100644 --- a/sdk/keyvault/keyvault-keys/test/utils/lro/restore/operation.ts +++ b/sdk/keyvault/keyvault-keys/test/public/utils/lro/restore/operation.ts @@ -4,12 +4,12 @@ import { AbortSignalLike } from "@azure/abort-controller"; import { PollOperationState, PollOperation } from "@azure/core-lro"; import { RequestOptionsBase } from "@azure/core-http"; -import { KeyVaultKey, KeyPollerOptions } from "../../../../src/keysModels"; +import { KeyVaultKey, KeyPollerOptions } from "../../../../../src/keysModels"; /** * Options sent to the beginRestoreKeyBackup method. */ -export interface BeginRestoreKeyBackupOptions extends KeyPollerOptions {} +export interface BeginRestoreKeyBackupOptions extends KeyPollerOptions { } /** * @internal @@ -48,7 +48,7 @@ export interface RestoreKeyBackupPollOperationState extends PollOperationState {} + extends PollOperation { } /** * Reaches to the service and updates the restore key's poll operation. diff --git a/sdk/keyvault/keyvault-keys/test/utils/lro/restore/poller.ts b/sdk/keyvault/keyvault-keys/test/public/utils/lro/restore/poller.ts similarity index 96% rename from sdk/keyvault/keyvault-keys/test/utils/lro/restore/poller.ts rename to sdk/keyvault/keyvault-keys/test/public/utils/lro/restore/poller.ts index a5723d267f07..bd1ae34a1e7a 100644 --- a/sdk/keyvault/keyvault-keys/test/utils/lro/restore/poller.ts +++ b/sdk/keyvault/keyvault-keys/test/public/utils/lro/restore/poller.ts @@ -8,7 +8,7 @@ import { makeRestoreKeyBackupPollOperation, TestKeyClientInterface, } from "./operation"; -import { KeyVaultKey } from "../../../../src/keysModels"; +import { KeyVaultKey } from "../../../../../src/keysModels"; export interface RestoreKeyBackupPollerOptions { client: TestKeyClientInterface; diff --git a/sdk/keyvault/keyvault-keys/test/utils/recorderUtils.ts b/sdk/keyvault/keyvault-keys/test/public/utils/recorderUtils.ts similarity index 100% rename from sdk/keyvault/keyvault-keys/test/utils/recorderUtils.ts rename to sdk/keyvault/keyvault-keys/test/public/utils/recorderUtils.ts diff --git a/sdk/keyvault/keyvault-keys/test/utils/testAuthentication.ts b/sdk/keyvault/keyvault-keys/test/public/utils/testAuthentication.ts similarity index 98% rename from sdk/keyvault/keyvault-keys/test/utils/testAuthentication.ts rename to sdk/keyvault/keyvault-keys/test/public/utils/testAuthentication.ts index 60bfd0a9b617..cfe619523dc9 100644 --- a/sdk/keyvault/keyvault-keys/test/utils/testAuthentication.ts +++ b/sdk/keyvault/keyvault-keys/test/public/utils/testAuthentication.ts @@ -2,7 +2,7 @@ // Licensed under the MIT license. import { ClientSecretCredential } from "@azure/identity"; -import { KeyClient } from "../../src"; +import { KeyClient } from "../../../src"; import { env, record, RecorderEnvironmentSetup } from "@azure-tools/test-recorder"; import { uniqueString } from "./recorderUtils"; import TestClient from "./testClient"; diff --git a/sdk/keyvault/keyvault-keys/test/utils/testClient.ts b/sdk/keyvault/keyvault-keys/test/public/utils/testClient.ts similarity index 96% rename from sdk/keyvault/keyvault-keys/test/utils/testClient.ts rename to sdk/keyvault/keyvault-keys/test/public/utils/testClient.ts index 18b40d38e41e..b115ec9ccf19 100644 --- a/sdk/keyvault/keyvault-keys/test/utils/testClient.ts +++ b/sdk/keyvault/keyvault-keys/test/public/utils/testClient.ts @@ -2,7 +2,7 @@ // Licensed under the MIT license. import { testPollerProperties } from "./recorderUtils"; -import { KeyClient, KeyVaultKey } from "../../src"; +import { KeyClient, KeyVaultKey } from "../../../src"; import { PollerLike, PollOperationState } from "@azure/core-lro"; import { operationOptionsToRequestOptionsBase } from "@azure/core-http"; import { RestoreKeyBackupPoller } from "./lro/restore/poller"; diff --git a/sdk/keyvault/keyvault-keys/test/utils/utils.common.ts b/sdk/keyvault/keyvault-keys/test/public/utils/utils.common.ts similarity index 97% rename from sdk/keyvault/keyvault-keys/test/utils/utils.common.ts rename to sdk/keyvault/keyvault-keys/test/public/utils/utils.common.ts index 0c181f7774ef..9496b091fac4 100644 --- a/sdk/keyvault/keyvault-keys/test/utils/utils.common.ts +++ b/sdk/keyvault/keyvault-keys/test/public/utils/utils.common.ts @@ -4,7 +4,7 @@ import { SupportedVersions, supports, TestFunctionWrapper } from "@azure/test-utils"; import { env } from "@azure-tools/test-recorder"; import { assert } from "chai"; -import { LATEST_API_VERSION } from "../../src/keysModels"; +import { LATEST_API_VERSION } from "../../../src/keysModels"; export function getKeyvaultName(): string { const keyVaultEnvVarName = "KEYVAULT_NAME"; From 7532b47351f8d0b83516b899c4585e8ba6a9eaa7 Mon Sep 17 00:00:00 2001 From: Daniel Rodriguez Date: Fri, 21 Jan 2022 00:15:30 +0000 Subject: [PATCH 03/26] kv-certificates --- .../test/{ => public}/utils/lro/restore/operation.ts | 0 .../test/{ => public}/utils/lro/restore/poller.ts | 0 .../test/{ => public}/utils/recorderUtils.ts | 0 .../test/{ => public}/utils/testAuthentication.ts | 0 .../keyvault-certificates/test/{ => public}/utils/testClient.ts | 0 .../keyvault-certificates/test/{ => public}/utils/utils.common.ts | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename sdk/keyvault/keyvault-certificates/test/{ => public}/utils/lro/restore/operation.ts (100%) rename sdk/keyvault/keyvault-certificates/test/{ => public}/utils/lro/restore/poller.ts (100%) rename sdk/keyvault/keyvault-certificates/test/{ => public}/utils/recorderUtils.ts (100%) rename sdk/keyvault/keyvault-certificates/test/{ => public}/utils/testAuthentication.ts (100%) rename sdk/keyvault/keyvault-certificates/test/{ => public}/utils/testClient.ts (100%) rename sdk/keyvault/keyvault-certificates/test/{ => public}/utils/utils.common.ts (100%) diff --git a/sdk/keyvault/keyvault-certificates/test/utils/lro/restore/operation.ts b/sdk/keyvault/keyvault-certificates/test/public/utils/lro/restore/operation.ts similarity index 100% rename from sdk/keyvault/keyvault-certificates/test/utils/lro/restore/operation.ts rename to sdk/keyvault/keyvault-certificates/test/public/utils/lro/restore/operation.ts diff --git a/sdk/keyvault/keyvault-certificates/test/utils/lro/restore/poller.ts b/sdk/keyvault/keyvault-certificates/test/public/utils/lro/restore/poller.ts similarity index 100% rename from sdk/keyvault/keyvault-certificates/test/utils/lro/restore/poller.ts rename to sdk/keyvault/keyvault-certificates/test/public/utils/lro/restore/poller.ts diff --git a/sdk/keyvault/keyvault-certificates/test/utils/recorderUtils.ts b/sdk/keyvault/keyvault-certificates/test/public/utils/recorderUtils.ts similarity index 100% rename from sdk/keyvault/keyvault-certificates/test/utils/recorderUtils.ts rename to sdk/keyvault/keyvault-certificates/test/public/utils/recorderUtils.ts diff --git a/sdk/keyvault/keyvault-certificates/test/utils/testAuthentication.ts b/sdk/keyvault/keyvault-certificates/test/public/utils/testAuthentication.ts similarity index 100% rename from sdk/keyvault/keyvault-certificates/test/utils/testAuthentication.ts rename to sdk/keyvault/keyvault-certificates/test/public/utils/testAuthentication.ts diff --git a/sdk/keyvault/keyvault-certificates/test/utils/testClient.ts b/sdk/keyvault/keyvault-certificates/test/public/utils/testClient.ts similarity index 100% rename from sdk/keyvault/keyvault-certificates/test/utils/testClient.ts rename to sdk/keyvault/keyvault-certificates/test/public/utils/testClient.ts diff --git a/sdk/keyvault/keyvault-certificates/test/utils/utils.common.ts b/sdk/keyvault/keyvault-certificates/test/public/utils/utils.common.ts similarity index 100% rename from sdk/keyvault/keyvault-certificates/test/utils/utils.common.ts rename to sdk/keyvault/keyvault-certificates/test/public/utils/utils.common.ts From d918606c9e853b5c76e9904d98ce0450f345f4d2 Mon Sep 17 00:00:00 2001 From: Daniel Rodriguez Date: Fri, 21 Jan 2022 00:16:07 +0000 Subject: [PATCH 04/26] certificates and admin --- .../test/public/accessControlClient.aborts.spec.ts | 4 ++-- .../test/public/accessControlClient.spec.ts | 4 ++-- .../test/public/backupClient.abort.spec.ts | 6 +++--- .../keyvault-admin/test/public/backupClient.spec.ts | 6 +++--- .../test/{ => public}/utils/authentication.ts | 2 +- .../keyvault-admin/test/{ => public}/utils/common.ts | 0 .../keyvault-admin/test/{ => public}/utils/recorder.ts | 0 .../test/{ => public}/utils/supportsTracing.ts | 0 .../challengeBasedAuthenticationPolicy.spec.ts | 8 ++++---- .../keyvault-certificates/test/public/CRUD.spec.ts | 10 +++++----- .../keyvault-certificates/test/public/list.spec.ts | 10 +++++----- .../test/public/lro.create.spec.ts | 8 ++++---- .../test/public/lro.delete.spec.ts | 8 ++++---- .../test/public/lro.operation.spec.ts | 8 ++++---- .../test/public/lro.recover.spec.ts | 10 +++++----- .../test/public/mergeAndImport.spec.ts | 8 ++++---- .../test/public/recoverBackupRestore.spec.ts | 10 +++++----- .../test/public/utils/lro/restore/operation.ts | 6 +++--- .../test/public/utils/lro/restore/poller.ts | 2 +- .../test/public/utils/testAuthentication.ts | 2 +- .../test/public/utils/testClient.ts | 2 +- .../test/public/utils/utils.common.ts | 2 +- 22 files changed, 58 insertions(+), 58 deletions(-) rename sdk/keyvault/keyvault-admin/test/{ => public}/utils/authentication.ts (99%) rename sdk/keyvault/keyvault-admin/test/{ => public}/utils/common.ts (100%) rename sdk/keyvault/keyvault-admin/test/{ => public}/utils/recorder.ts (100%) rename sdk/keyvault/keyvault-admin/test/{ => public}/utils/supportsTracing.ts (100%) diff --git a/sdk/keyvault/keyvault-admin/test/public/accessControlClient.aborts.spec.ts b/sdk/keyvault/keyvault-admin/test/public/accessControlClient.aborts.spec.ts index 6bc6170a38f0..b8f7ec07c0fe 100644 --- a/sdk/keyvault/keyvault-admin/test/public/accessControlClient.aborts.spec.ts +++ b/sdk/keyvault/keyvault-admin/test/public/accessControlClient.aborts.spec.ts @@ -5,8 +5,8 @@ import { env, Recorder } from "@azure-tools/test-recorder"; import { AbortController } from "@azure/abort-controller"; import { KeyVaultAccessControlClient } from "../../src"; -import { assertThrowsAbortError } from "../utils/common"; -import { authenticate } from "../utils/authentication"; +import { assertThrowsAbortError } from "./utils/common"; +import { authenticate } from "./utils/authentication"; describe("Aborting KeyVaultAccessControlClient's requests", () => { let client: KeyVaultAccessControlClient; diff --git a/sdk/keyvault/keyvault-admin/test/public/accessControlClient.spec.ts b/sdk/keyvault/keyvault-admin/test/public/accessControlClient.spec.ts index b4749a9be8d1..4a9146f329c4 100644 --- a/sdk/keyvault/keyvault-admin/test/public/accessControlClient.spec.ts +++ b/sdk/keyvault/keyvault-admin/test/public/accessControlClient.spec.ts @@ -13,8 +13,8 @@ import { KeyVaultRoleDefinition, KnownKeyVaultDataAction, } from "../../src"; -import { authenticate } from "../utils/authentication"; -import { supportsTracing } from "../utils/supportsTracing"; +import { authenticate } from "./utils/authentication"; +import { supportsTracing } from "./utils/supportsTracing"; describe("KeyVaultAccessControlClient", () => { let client: KeyVaultAccessControlClient; diff --git a/sdk/keyvault/keyvault-admin/test/public/backupClient.abort.spec.ts b/sdk/keyvault/keyvault-admin/test/public/backupClient.abort.spec.ts index 0ac70f33a7a3..4667f842704e 100644 --- a/sdk/keyvault/keyvault-admin/test/public/backupClient.abort.spec.ts +++ b/sdk/keyvault/keyvault-admin/test/public/backupClient.abort.spec.ts @@ -5,9 +5,9 @@ import { Recorder } from "@azure-tools/test-recorder"; import { AbortController } from "@azure/abort-controller"; import { KeyVaultBackupClient } from "../../src"; -import { authenticate } from "../utils/authentication"; -import { testPollerProperties } from "../utils/recorder"; -import { assertThrowsAbortError, getSasToken } from "../utils/common"; +import { authenticate } from "./utils/authentication"; +import { testPollerProperties } from "./utils/recorder"; +import { assertThrowsAbortError, getSasToken } from "./utils/common"; describe("Aborting KeyVaultBackupClient's requests", () => { let client: KeyVaultBackupClient; diff --git a/sdk/keyvault/keyvault-admin/test/public/backupClient.spec.ts b/sdk/keyvault/keyvault-admin/test/public/backupClient.spec.ts index f2401ef76ef2..857b1aa7f69a 100644 --- a/sdk/keyvault/keyvault-admin/test/public/backupClient.spec.ts +++ b/sdk/keyvault/keyvault-admin/test/public/backupClient.spec.ts @@ -7,9 +7,9 @@ chai.use(chaiAsPromised); import { isPlaybackMode, Recorder } from "@azure-tools/test-recorder"; import { KeyVaultBackupClient } from "../../src"; -import { authenticate } from "../utils/authentication"; -import { testPollerProperties } from "../utils/recorder"; -import { getSasToken } from "../utils/common"; +import { authenticate } from "./utils/authentication"; +import { testPollerProperties } from "./utils/recorder"; +import { getSasToken } from "./utils/common"; import { delay } from "@azure/core-util"; import { assert } from "chai"; import { KeyClient } from "@azure/keyvault-keys"; diff --git a/sdk/keyvault/keyvault-admin/test/utils/authentication.ts b/sdk/keyvault/keyvault-admin/test/public/utils/authentication.ts similarity index 99% rename from sdk/keyvault/keyvault-admin/test/utils/authentication.ts rename to sdk/keyvault/keyvault-admin/test/public/utils/authentication.ts index 6b2b72e4affd..aa2a0e51f2b0 100644 --- a/sdk/keyvault/keyvault-admin/test/utils/authentication.ts +++ b/sdk/keyvault/keyvault-admin/test/public/utils/authentication.ts @@ -6,7 +6,7 @@ import { env, isPlaybackMode, record, RecorderEnvironmentSetup } from "@azure-to import { KeyClient } from "@azure/keyvault-keys"; import { v4 as uuidv4 } from "uuid"; -import { KeyVaultAccessControlClient, KeyVaultBackupClient } from "../../src"; +import { KeyVaultAccessControlClient, KeyVaultBackupClient } from "../../../src"; import { uniqueString } from "./recorder"; import { getEnvironmentVariable } from "./common"; diff --git a/sdk/keyvault/keyvault-admin/test/utils/common.ts b/sdk/keyvault/keyvault-admin/test/public/utils/common.ts similarity index 100% rename from sdk/keyvault/keyvault-admin/test/utils/common.ts rename to sdk/keyvault/keyvault-admin/test/public/utils/common.ts diff --git a/sdk/keyvault/keyvault-admin/test/utils/recorder.ts b/sdk/keyvault/keyvault-admin/test/public/utils/recorder.ts similarity index 100% rename from sdk/keyvault/keyvault-admin/test/utils/recorder.ts rename to sdk/keyvault/keyvault-admin/test/public/utils/recorder.ts diff --git a/sdk/keyvault/keyvault-admin/test/utils/supportsTracing.ts b/sdk/keyvault/keyvault-admin/test/public/utils/supportsTracing.ts similarity index 100% rename from sdk/keyvault/keyvault-admin/test/utils/supportsTracing.ts rename to sdk/keyvault/keyvault-admin/test/public/utils/supportsTracing.ts diff --git a/sdk/keyvault/keyvault-certificates/test/internal/challengeBasedAuthenticationPolicy.spec.ts b/sdk/keyvault/keyvault-certificates/test/internal/challengeBasedAuthenticationPolicy.spec.ts index b0ac27d1d7f9..c6d0dd125ee7 100644 --- a/sdk/keyvault/keyvault-certificates/test/internal/challengeBasedAuthenticationPolicy.spec.ts +++ b/sdk/keyvault/keyvault-certificates/test/internal/challengeBasedAuthenticationPolicy.spec.ts @@ -5,7 +5,7 @@ import { assert } from "chai"; import { Context } from "mocha"; import { createSandbox } from "sinon"; import { env, Recorder } from "@azure-tools/test-recorder"; -import { getServiceVersion } from "../utils/utils.common"; +import { getServiceVersion } from "../public/utils/utils.common"; import { AuthenticationChallengeCache, @@ -14,9 +14,9 @@ import { challengeBasedAuthenticationPolicy, } from "../../../keyvault-common/src"; import { CertificateClient } from "../../src"; -import { testPollerProperties } from "../utils/recorderUtils"; -import { authenticate } from "../utils/testAuthentication"; -import TestClient from "../utils/testClient"; +import { testPollerProperties } from "../public/utils/recorderUtils"; +import { authenticate } from "../public/utils/testAuthentication"; +import TestClient from "../public/utils/testClient"; import { WebResource } from "@azure/core-http"; import { ClientSecretCredential } from "@azure/identity"; diff --git a/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts b/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts index 956cd173a7ae..cc744e3d0223 100644 --- a/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts @@ -15,11 +15,11 @@ import { ClientSecretCredential } from "@azure/identity"; import { isNode } from "@azure/core-http"; import { CertificateClient } from "../../src"; -import { assertThrowsAbortError } from "../utils/utils.common"; -import { testPollerProperties } from "../utils/recorderUtils"; -import { authenticate } from "../utils/testAuthentication"; -import { getServiceVersion } from "../utils/utils.common"; -import TestClient from "../utils/testClient"; +import { assertThrowsAbortError } from "./utils/utils.common"; +import { testPollerProperties } from "./utils/recorderUtils"; +import { authenticate } from "./utils/testAuthentication"; +import { getServiceVersion } from "./utils/utils.common"; +import TestClient from "./utils/testClient"; describe("Certificates client - create, read, update and delete", () => { const prefix = `CRUD${env.CERTIFICATE_NAME || "CertificateName"}`; diff --git a/sdk/keyvault/keyvault-certificates/test/public/list.spec.ts b/sdk/keyvault/keyvault-certificates/test/public/list.spec.ts index 596715e3bd7c..f527e5656a10 100644 --- a/sdk/keyvault/keyvault-certificates/test/public/list.spec.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/list.spec.ts @@ -8,11 +8,11 @@ import { env, isPlaybackMode, Recorder, isRecordMode } from "@azure-tools/test-r import { isNode } from "@azure/core-http"; import { CertificateClient } from "../../src"; -import { assertThrowsAbortError } from "../utils/utils.common"; -import { testPollerProperties } from "../utils/recorderUtils"; -import { authenticate } from "../utils/testAuthentication"; -import { getServiceVersion } from "../utils/utils.common"; -import TestClient from "../utils/testClient"; +import { assertThrowsAbortError } from "./utils/utils.common"; +import { testPollerProperties } from "./utils/recorderUtils"; +import { authenticate } from "./utils/testAuthentication"; +import { getServiceVersion } from "./utils/utils.common"; +import TestClient from "./utils/testClient"; const { expect } = chai; diff --git a/sdk/keyvault/keyvault-certificates/test/public/lro.create.spec.ts b/sdk/keyvault/keyvault-certificates/test/public/lro.create.spec.ts index 126516651735..0d4f3ae37ff2 100644 --- a/sdk/keyvault/keyvault-certificates/test/public/lro.create.spec.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/lro.create.spec.ts @@ -7,10 +7,10 @@ import { PollerStoppedError } from "@azure/core-lro"; import { env, Recorder } from "@azure-tools/test-recorder"; import { CertificateClient, KeyVaultCertificate, DefaultCertificatePolicy } from "../../src"; -import { testPollerProperties } from "../utils/recorderUtils"; -import { authenticate } from "../utils/testAuthentication"; -import { getServiceVersion } from "../utils/utils.common"; -import TestClient from "../utils/testClient"; +import { testPollerProperties } from "./utils/recorderUtils"; +import { authenticate } from "./utils/testAuthentication"; +import { getServiceVersion } from "./utils/utils.common"; +import TestClient from "./utils/testClient"; describe("Certificates client - LRO - create", () => { const certificatePrefix = `lroCreate${env.CERTIFICATE_NAME || "CertificateName"}`; diff --git a/sdk/keyvault/keyvault-certificates/test/public/lro.delete.spec.ts b/sdk/keyvault/keyvault-certificates/test/public/lro.delete.spec.ts index f35d6eea84e7..83391f5eac4a 100644 --- a/sdk/keyvault/keyvault-certificates/test/public/lro.delete.spec.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/lro.delete.spec.ts @@ -7,10 +7,10 @@ import { PollerStoppedError } from "@azure/core-lro"; import { env, Recorder } from "@azure-tools/test-recorder"; import { CertificateClient, DeletedCertificate, DefaultCertificatePolicy } from "../../src"; -import { testPollerProperties } from "../utils/recorderUtils"; -import { authenticate } from "../utils/testAuthentication"; -import { getServiceVersion } from "../utils/utils.common"; -import TestClient from "../utils/testClient"; +import { testPollerProperties } from "./utils/recorderUtils"; +import { authenticate } from "./utils/testAuthentication"; +import { getServiceVersion } from "./utils/utils.common"; +import TestClient from "./utils/testClient"; describe("Certificates client - lro - delete", () => { const certificatePrefix = `lroDelete${env.CERTIFICATE_NAME || "CertificateName"}`; diff --git a/sdk/keyvault/keyvault-certificates/test/public/lro.operation.spec.ts b/sdk/keyvault/keyvault-certificates/test/public/lro.operation.spec.ts index c3c2b5500562..79838eda4911 100644 --- a/sdk/keyvault/keyvault-certificates/test/public/lro.operation.spec.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/lro.operation.spec.ts @@ -11,10 +11,10 @@ import { DefaultCertificatePolicy, KeyVaultCertificateWithPolicy, } from "../../src"; -import { testPollerProperties } from "../utils/recorderUtils"; -import { authenticate } from "../utils/testAuthentication"; -import { getServiceVersion } from "../utils/utils.common"; -import TestClient from "../utils/testClient"; +import { testPollerProperties } from "./utils/recorderUtils"; +import { authenticate } from "./utils/testAuthentication"; +import { getServiceVersion } from "./utils/utils.common"; +import TestClient from "./utils/testClient"; describe("Certificates client - LRO - certificate operation", () => { const certificatePrefix = `lroOperation${env.CERTIFICATE_NAME || "CertificateName"}`; diff --git a/sdk/keyvault/keyvault-certificates/test/public/lro.recover.spec.ts b/sdk/keyvault/keyvault-certificates/test/public/lro.recover.spec.ts index d27b7ea1a363..96a7e0709185 100644 --- a/sdk/keyvault/keyvault-certificates/test/public/lro.recover.spec.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/lro.recover.spec.ts @@ -7,11 +7,11 @@ import { env, Recorder } from "@azure-tools/test-recorder"; import { PollerStoppedError } from "@azure/core-lro"; import { CertificateClient, DeletedCertificate, DefaultCertificatePolicy } from "../../src"; -import { assertThrowsAbortError } from "../utils/utils.common"; -import { testPollerProperties } from "../utils/recorderUtils"; -import { authenticate } from "../utils/testAuthentication"; -import { getServiceVersion } from "../utils/utils.common"; -import TestClient from "../utils/testClient"; +import { assertThrowsAbortError } from "./utils/utils.common"; +import { testPollerProperties } from "./utils/recorderUtils"; +import { authenticate } from "./utils/testAuthentication"; +import { getServiceVersion } from "./utils/utils.common"; +import TestClient from "./utils/testClient"; describe("Certificates client - LRO - recoverDelete", () => { const certificatePrefix = `lroRecover${env.CERTIFICATE_NAME || "CertificateName"}`; diff --git a/sdk/keyvault/keyvault-certificates/test/public/mergeAndImport.spec.ts b/sdk/keyvault/keyvault-certificates/test/public/mergeAndImport.spec.ts index 560e2a01dd47..db973316f525 100644 --- a/sdk/keyvault/keyvault-certificates/test/public/mergeAndImport.spec.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/mergeAndImport.spec.ts @@ -11,10 +11,10 @@ import { ClientSecretCredential } from "@azure/identity"; import { CertificateClient } from "../../src"; import { base64ToUint8Array, stringToUint8Array } from "../../src/utils"; -import { testPollerProperties } from "../utils/recorderUtils"; -import { authenticate } from "../utils/testAuthentication"; -import { getServiceVersion } from "../utils/utils.common"; -import TestClient from "../utils/testClient"; +import { testPollerProperties } from "./utils/recorderUtils"; +import { authenticate } from "./utils/testAuthentication"; +import { getServiceVersion } from "./utils/utils.common"; +import TestClient from "./utils/testClient"; describe("Certificates client - merge and import certificates", () => { const prefix = `merge${env.CERTIFICATE_NAME || "CertificateName"}`; diff --git a/sdk/keyvault/keyvault-certificates/test/public/recoverBackupRestore.spec.ts b/sdk/keyvault/keyvault-certificates/test/public/recoverBackupRestore.spec.ts index 2525afb82049..848e552cb071 100644 --- a/sdk/keyvault/keyvault-certificates/test/public/recoverBackupRestore.spec.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/recoverBackupRestore.spec.ts @@ -7,11 +7,11 @@ import { env, isPlaybackMode, Recorder, isRecordMode } from "@azure-tools/test-r import { isNode } from "@azure/core-http"; import { CertificateClient } from "../../src"; -import { testPollerProperties } from "../utils/recorderUtils"; -import { assertThrowsAbortError } from "../utils/utils.common"; -import { authenticate } from "../utils/testAuthentication"; -import { getServiceVersion } from "../utils/utils.common"; -import TestClient from "../utils/testClient"; +import { testPollerProperties } from "./utils/recorderUtils"; +import { assertThrowsAbortError } from "./utils/utils.common"; +import { authenticate } from "./utils/testAuthentication"; +import { getServiceVersion } from "./utils/utils.common"; +import TestClient from "./utils/testClient"; describe("Certificates client - restore certificates and recover backups", () => { const prefix = `backupRestore${env.CERTIFICATE_NAME || "CertificateName"}`; diff --git a/sdk/keyvault/keyvault-certificates/test/public/utils/lro/restore/operation.ts b/sdk/keyvault/keyvault-certificates/test/public/utils/lro/restore/operation.ts index d44c176ce4a8..9f7015190068 100644 --- a/sdk/keyvault/keyvault-certificates/test/public/utils/lro/restore/operation.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/utils/lro/restore/operation.ts @@ -4,12 +4,12 @@ import { AbortSignalLike } from "@azure/abort-controller"; import { PollOperationState, PollOperation } from "@azure/core-lro"; import { OperationOptions } from "@azure/core-http"; -import { KeyVaultCertificate, CertificatePollerOptions } from "../../../../src/certificatesModels"; +import { KeyVaultCertificate, CertificatePollerOptions } from "../../../../../src/certificatesModels"; /** * Options sent to the beginRestoreCertificateBackup method. */ -export interface BeginRestoreCertificateBackupOptions extends CertificatePollerOptions {} +export interface BeginRestoreCertificateBackupOptions extends CertificatePollerOptions { } /** * @internal @@ -49,7 +49,7 @@ export interface RestoreCertificateBackupPollOperationState * An interface representing a restore certificate's poll operation */ export interface RestoreCertificateBackupPollOperation - extends PollOperation {} + extends PollOperation { } /** * Reaches to the service and updates the restore certificate's poll operation. diff --git a/sdk/keyvault/keyvault-certificates/test/public/utils/lro/restore/poller.ts b/sdk/keyvault/keyvault-certificates/test/public/utils/lro/restore/poller.ts index 0b26ddeb2b97..a876dbb471f0 100644 --- a/sdk/keyvault/keyvault-certificates/test/public/utils/lro/restore/poller.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/utils/lro/restore/poller.ts @@ -8,7 +8,7 @@ import { makeRestoreCertificateBackupPollOperation, TestCertificateClientInterface, } from "./operation"; -import { KeyVaultCertificate } from "../../../../src/certificatesModels"; +import { KeyVaultCertificate } from "../../../../../src/certificatesModels"; export interface RestoreCertificateBackupPollerOptions { client: TestCertificateClientInterface; diff --git a/sdk/keyvault/keyvault-certificates/test/public/utils/testAuthentication.ts b/sdk/keyvault/keyvault-certificates/test/public/utils/testAuthentication.ts index 100630c5b468..9d21f277f7c8 100644 --- a/sdk/keyvault/keyvault-certificates/test/public/utils/testAuthentication.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/utils/testAuthentication.ts @@ -2,7 +2,7 @@ // Licensed under the MIT license. import { ClientSecretCredential } from "@azure/identity"; -import { CertificateClient } from "../../src"; +import { CertificateClient } from "../../../src"; import { uniqueString } from "./recorderUtils"; import { env, record, RecorderEnvironmentSetup } from "@azure-tools/test-recorder"; import { getServiceVersion } from "./utils.common"; diff --git a/sdk/keyvault/keyvault-certificates/test/public/utils/testClient.ts b/sdk/keyvault/keyvault-certificates/test/public/utils/testClient.ts index 11138f8b5786..a64065bf6a49 100644 --- a/sdk/keyvault/keyvault-certificates/test/public/utils/testClient.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/utils/testClient.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { CertificateClient, KeyVaultCertificate } from "../../src"; +import { CertificateClient, KeyVaultCertificate } from "../../../src"; import { PollerLike, PollOperationState } from "@azure/core-lro"; import { RestoreCertificateBackupPoller } from "./lro/restore/poller"; import { BeginRestoreCertificateBackupOptions } from "./lro/restore/operation"; diff --git a/sdk/keyvault/keyvault-certificates/test/public/utils/utils.common.ts b/sdk/keyvault/keyvault-certificates/test/public/utils/utils.common.ts index 75fcb5e7c317..3c12cfb7bd0b 100644 --- a/sdk/keyvault/keyvault-certificates/test/public/utils/utils.common.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/utils/utils.common.ts @@ -4,7 +4,7 @@ import { env } from "@azure-tools/test-recorder"; import { assert } from "chai"; import { SupportedVersions, supports, TestFunctionWrapper } from "@azure/test-utils"; -import { LATEST_API_VERSION, CertificateClientOptions } from "../../src/certificatesModels"; +import { LATEST_API_VERSION, CertificateClientOptions } from "../../../src/certificatesModels"; export function getKeyvaultName(): string { const keyVaultEnvVarName = "KEYVAULT_NAME"; From ec27c172b2e02d4782e0a2d20b41c0934c7c965b Mon Sep 17 00:00:00 2001 From: Daniel Rodriguez Date: Fri, 21 Jan 2022 19:48:42 +0000 Subject: [PATCH 05/26] fixing paths on public tests to not reference anything that isnt public --- ...challengeBasedAuthenticationPolicy.spec.ts | 2 +- .../test/public/CRUD.spec.ts | 4 +- .../test/public/list.spec.ts | 4 +- .../test/public/lro.create.spec.ts | 2 +- .../test/public/lro.delete.spec.ts | 2 +- .../test/public/lro.operation.spec.ts | 2 +- .../test/public/lro.recover.spec.ts | 4 +- .../test/public/mergeAndImport.spec.ts | 2 +- .../test/public/recoverBackupRestore.spec.ts | 4 +- .../utils/{utils.common.ts => common.ts} | 7 ++- .../public/utils/lro/restore/operation.ts | 6 +-- .../test/public/utils/lro/restore/poller.ts | 2 +- .../test/public/utils/testAuthentication.ts | 2 +- .../test/internal/aesCryptography.spec.ts | 2 +- ...challengeBasedAuthenticationPolicy.spec.ts | 2 +- .../recoverBackupRestore.spec.ts | 10 ++-- .../internal/serviceVersionParameter.spec.ts | 2 +- .../test/internal/utils/internalTestClient.ts | 46 +++++++++++++++++++ .../test/public/crypto.hsm.spec.ts | 2 +- .../keyvault-keys/test/public/crypto.spec.ts | 2 +- .../keyvault-keys/test/public/import.spec.ts | 2 +- .../test/public/keyClient.hsm.spec.ts | 2 +- .../test/public/keyClient.spec.ts | 2 +- .../keyvault-keys/test/public/list.spec.ts | 2 +- .../test/public/localCryptography.spec.ts | 2 +- .../test/public/lro.delete.spec.ts | 2 +- .../test/public/lro.recoverDelete.spec.ts | 2 +- .../utils/{utils.common.ts => common.ts} | 6 ++- .../keyvault-keys/test/public/utils/crypto.ts | 2 +- .../public/utils/lro/restore/operation.ts | 6 +-- .../test/public/utils/lro/restore/poller.ts | 2 +- .../test/public/utils/testClient.ts | 24 +--------- ...challengeBasedAuthenticationPolicy.spec.ts | 2 +- .../keyvault-secrets/test/public/CRUD.spec.ts | 2 +- .../keyvault-secrets/test/public/list.spec.ts | 2 +- .../test/public/lro.delete.spec.ts | 2 +- .../test/public/lro.recover.spec.ts | 2 +- .../test/public/recoverBackupRestore.spec.ts | 2 +- .../utils/{utils.common.ts => common.ts} | 7 ++- .../public/utils/lro/restore/operation.ts | 6 +-- .../test/public/utils/lro/restore/poller.ts | 2 +- .../test/public/utils/testAuthentication.ts | 2 +- 42 files changed, 115 insertions(+), 77 deletions(-) rename sdk/keyvault/keyvault-certificates/test/public/utils/{utils.common.ts => common.ts} (93%) rename sdk/keyvault/keyvault-keys/test/{public => internal}/recoverBackupRestore.spec.ts (95%) create mode 100644 sdk/keyvault/keyvault-keys/test/internal/utils/internalTestClient.ts rename sdk/keyvault/keyvault-keys/test/public/utils/{utils.common.ts => common.ts} (95%) rename sdk/keyvault/keyvault-secrets/test/public/utils/{utils.common.ts => common.ts} (92%) diff --git a/sdk/keyvault/keyvault-certificates/test/internal/challengeBasedAuthenticationPolicy.spec.ts b/sdk/keyvault/keyvault-certificates/test/internal/challengeBasedAuthenticationPolicy.spec.ts index c6d0dd125ee7..a148292c6fad 100644 --- a/sdk/keyvault/keyvault-certificates/test/internal/challengeBasedAuthenticationPolicy.spec.ts +++ b/sdk/keyvault/keyvault-certificates/test/internal/challengeBasedAuthenticationPolicy.spec.ts @@ -5,7 +5,7 @@ import { assert } from "chai"; import { Context } from "mocha"; import { createSandbox } from "sinon"; import { env, Recorder } from "@azure-tools/test-recorder"; -import { getServiceVersion } from "../public/utils/utils.common"; +import { getServiceVersion } from "../public/utils/common"; import { AuthenticationChallengeCache, diff --git a/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts b/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts index cc744e3d0223..01e7ef54f2c9 100644 --- a/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts @@ -15,10 +15,10 @@ import { ClientSecretCredential } from "@azure/identity"; import { isNode } from "@azure/core-http"; import { CertificateClient } from "../../src"; -import { assertThrowsAbortError } from "./utils/utils.common"; +import { assertThrowsAbortError } from "./utils/common"; import { testPollerProperties } from "./utils/recorderUtils"; import { authenticate } from "./utils/testAuthentication"; -import { getServiceVersion } from "./utils/utils.common"; +import { getServiceVersion } from "./utils/common"; import TestClient from "./utils/testClient"; describe("Certificates client - create, read, update and delete", () => { diff --git a/sdk/keyvault/keyvault-certificates/test/public/list.spec.ts b/sdk/keyvault/keyvault-certificates/test/public/list.spec.ts index f527e5656a10..30e586485102 100644 --- a/sdk/keyvault/keyvault-certificates/test/public/list.spec.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/list.spec.ts @@ -8,10 +8,10 @@ import { env, isPlaybackMode, Recorder, isRecordMode } from "@azure-tools/test-r import { isNode } from "@azure/core-http"; import { CertificateClient } from "../../src"; -import { assertThrowsAbortError } from "./utils/utils.common"; +import { assertThrowsAbortError } from "./utils/common"; import { testPollerProperties } from "./utils/recorderUtils"; import { authenticate } from "./utils/testAuthentication"; -import { getServiceVersion } from "./utils/utils.common"; +import { getServiceVersion } from "./utils/common"; import TestClient from "./utils/testClient"; const { expect } = chai; diff --git a/sdk/keyvault/keyvault-certificates/test/public/lro.create.spec.ts b/sdk/keyvault/keyvault-certificates/test/public/lro.create.spec.ts index 0d4f3ae37ff2..743f59b53573 100644 --- a/sdk/keyvault/keyvault-certificates/test/public/lro.create.spec.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/lro.create.spec.ts @@ -9,7 +9,7 @@ import { env, Recorder } from "@azure-tools/test-recorder"; import { CertificateClient, KeyVaultCertificate, DefaultCertificatePolicy } from "../../src"; import { testPollerProperties } from "./utils/recorderUtils"; import { authenticate } from "./utils/testAuthentication"; -import { getServiceVersion } from "./utils/utils.common"; +import { getServiceVersion } from "./utils/common"; import TestClient from "./utils/testClient"; describe("Certificates client - LRO - create", () => { diff --git a/sdk/keyvault/keyvault-certificates/test/public/lro.delete.spec.ts b/sdk/keyvault/keyvault-certificates/test/public/lro.delete.spec.ts index 83391f5eac4a..73a8ebddaf51 100644 --- a/sdk/keyvault/keyvault-certificates/test/public/lro.delete.spec.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/lro.delete.spec.ts @@ -9,7 +9,7 @@ import { env, Recorder } from "@azure-tools/test-recorder"; import { CertificateClient, DeletedCertificate, DefaultCertificatePolicy } from "../../src"; import { testPollerProperties } from "./utils/recorderUtils"; import { authenticate } from "./utils/testAuthentication"; -import { getServiceVersion } from "./utils/utils.common"; +import { getServiceVersion } from "./utils/common"; import TestClient from "./utils/testClient"; describe("Certificates client - lro - delete", () => { diff --git a/sdk/keyvault/keyvault-certificates/test/public/lro.operation.spec.ts b/sdk/keyvault/keyvault-certificates/test/public/lro.operation.spec.ts index 79838eda4911..7726c5e439d5 100644 --- a/sdk/keyvault/keyvault-certificates/test/public/lro.operation.spec.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/lro.operation.spec.ts @@ -13,7 +13,7 @@ import { } from "../../src"; import { testPollerProperties } from "./utils/recorderUtils"; import { authenticate } from "./utils/testAuthentication"; -import { getServiceVersion } from "./utils/utils.common"; +import { getServiceVersion } from "./utils/common"; import TestClient from "./utils/testClient"; describe("Certificates client - LRO - certificate operation", () => { diff --git a/sdk/keyvault/keyvault-certificates/test/public/lro.recover.spec.ts b/sdk/keyvault/keyvault-certificates/test/public/lro.recover.spec.ts index 96a7e0709185..fc367a8d639d 100644 --- a/sdk/keyvault/keyvault-certificates/test/public/lro.recover.spec.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/lro.recover.spec.ts @@ -7,10 +7,10 @@ import { env, Recorder } from "@azure-tools/test-recorder"; import { PollerStoppedError } from "@azure/core-lro"; import { CertificateClient, DeletedCertificate, DefaultCertificatePolicy } from "../../src"; -import { assertThrowsAbortError } from "./utils/utils.common"; +import { assertThrowsAbortError } from "./utils/common"; import { testPollerProperties } from "./utils/recorderUtils"; import { authenticate } from "./utils/testAuthentication"; -import { getServiceVersion } from "./utils/utils.common"; +import { getServiceVersion } from "./utils/common"; import TestClient from "./utils/testClient"; describe("Certificates client - LRO - recoverDelete", () => { diff --git a/sdk/keyvault/keyvault-certificates/test/public/mergeAndImport.spec.ts b/sdk/keyvault/keyvault-certificates/test/public/mergeAndImport.spec.ts index db973316f525..7849c764193b 100644 --- a/sdk/keyvault/keyvault-certificates/test/public/mergeAndImport.spec.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/mergeAndImport.spec.ts @@ -13,7 +13,7 @@ import { CertificateClient } from "../../src"; import { base64ToUint8Array, stringToUint8Array } from "../../src/utils"; import { testPollerProperties } from "./utils/recorderUtils"; import { authenticate } from "./utils/testAuthentication"; -import { getServiceVersion } from "./utils/utils.common"; +import { getServiceVersion } from "./utils/common"; import TestClient from "./utils/testClient"; describe("Certificates client - merge and import certificates", () => { diff --git a/sdk/keyvault/keyvault-certificates/test/public/recoverBackupRestore.spec.ts b/sdk/keyvault/keyvault-certificates/test/public/recoverBackupRestore.spec.ts index 848e552cb071..4beff60e4ea4 100644 --- a/sdk/keyvault/keyvault-certificates/test/public/recoverBackupRestore.spec.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/recoverBackupRestore.spec.ts @@ -8,9 +8,9 @@ import { isNode } from "@azure/core-http"; import { CertificateClient } from "../../src"; import { testPollerProperties } from "./utils/recorderUtils"; -import { assertThrowsAbortError } from "./utils/utils.common"; +import { assertThrowsAbortError } from "./utils/common"; import { authenticate } from "./utils/testAuthentication"; -import { getServiceVersion } from "./utils/utils.common"; +import { getServiceVersion } from "./utils/common"; import TestClient from "./utils/testClient"; describe("Certificates client - restore certificates and recover backups", () => { diff --git a/sdk/keyvault/keyvault-certificates/test/public/utils/utils.common.ts b/sdk/keyvault/keyvault-certificates/test/public/utils/common.ts similarity index 93% rename from sdk/keyvault/keyvault-certificates/test/public/utils/utils.common.ts rename to sdk/keyvault/keyvault-certificates/test/public/utils/common.ts index 3c12cfb7bd0b..d8fe1a80c080 100644 --- a/sdk/keyvault/keyvault-certificates/test/public/utils/utils.common.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/utils/common.ts @@ -4,7 +4,12 @@ import { env } from "@azure-tools/test-recorder"; import { assert } from "chai"; import { SupportedVersions, supports, TestFunctionWrapper } from "@azure/test-utils"; -import { LATEST_API_VERSION, CertificateClientOptions } from "../../../src/certificatesModels"; +import { CertificateClientOptions } from "../../../src"; + +/** + * The latest supported KeyVault service API version + */ +export const LATEST_API_VERSION = "7.3-preview"; export function getKeyvaultName(): string { const keyVaultEnvVarName = "KEYVAULT_NAME"; diff --git a/sdk/keyvault/keyvault-certificates/test/public/utils/lro/restore/operation.ts b/sdk/keyvault/keyvault-certificates/test/public/utils/lro/restore/operation.ts index 9f7015190068..f0d8c37d7624 100644 --- a/sdk/keyvault/keyvault-certificates/test/public/utils/lro/restore/operation.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/utils/lro/restore/operation.ts @@ -4,12 +4,12 @@ import { AbortSignalLike } from "@azure/abort-controller"; import { PollOperationState, PollOperation } from "@azure/core-lro"; import { OperationOptions } from "@azure/core-http"; -import { KeyVaultCertificate, CertificatePollerOptions } from "../../../../../src/certificatesModels"; +import { KeyVaultCertificate, CertificatePollerOptions } from "../../../../../src"; /** * Options sent to the beginRestoreCertificateBackup method. */ -export interface BeginRestoreCertificateBackupOptions extends CertificatePollerOptions { } +export interface BeginRestoreCertificateBackupOptions extends CertificatePollerOptions {} /** * @internal @@ -49,7 +49,7 @@ export interface RestoreCertificateBackupPollOperationState * An interface representing a restore certificate's poll operation */ export interface RestoreCertificateBackupPollOperation - extends PollOperation { } + extends PollOperation {} /** * Reaches to the service and updates the restore certificate's poll operation. diff --git a/sdk/keyvault/keyvault-certificates/test/public/utils/lro/restore/poller.ts b/sdk/keyvault/keyvault-certificates/test/public/utils/lro/restore/poller.ts index a876dbb471f0..8d3e41eba5cf 100644 --- a/sdk/keyvault/keyvault-certificates/test/public/utils/lro/restore/poller.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/utils/lro/restore/poller.ts @@ -8,7 +8,7 @@ import { makeRestoreCertificateBackupPollOperation, TestCertificateClientInterface, } from "./operation"; -import { KeyVaultCertificate } from "../../../../../src/certificatesModels"; +import { KeyVaultCertificate } from "../../../../../src"; export interface RestoreCertificateBackupPollerOptions { client: TestCertificateClientInterface; diff --git a/sdk/keyvault/keyvault-certificates/test/public/utils/testAuthentication.ts b/sdk/keyvault/keyvault-certificates/test/public/utils/testAuthentication.ts index 9d21f277f7c8..807e0fbc2d9a 100644 --- a/sdk/keyvault/keyvault-certificates/test/public/utils/testAuthentication.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/utils/testAuthentication.ts @@ -5,7 +5,7 @@ import { ClientSecretCredential } from "@azure/identity"; import { CertificateClient } from "../../../src"; import { uniqueString } from "./recorderUtils"; import { env, record, RecorderEnvironmentSetup } from "@azure-tools/test-recorder"; -import { getServiceVersion } from "./utils.common"; +import { getServiceVersion } from "./common"; import TestClient from "./testClient"; import { Context } from "mocha"; diff --git a/sdk/keyvault/keyvault-keys/test/internal/aesCryptography.spec.ts b/sdk/keyvault/keyvault-keys/test/internal/aesCryptography.spec.ts index afe2d954625a..e1e442d5555f 100644 --- a/sdk/keyvault/keyvault-keys/test/internal/aesCryptography.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/internal/aesCryptography.spec.ts @@ -18,7 +18,7 @@ import { authenticate } from "../public/utils/testAuthentication"; import { env, Recorder } from "@azure-tools/test-recorder"; import { RemoteCryptographyProvider } from "../../src/cryptography/remoteCryptographyProvider"; import { ClientSecretCredential } from "@azure/identity"; -import { getServiceVersion } from "../public/utils/utils.common"; +import { getServiceVersion } from "../public/utils/common"; describe("AesCryptographyProvider browser tests", function () { it("uses the browser replacement when running in the browser", async function (this: Context) { diff --git a/sdk/keyvault/keyvault-keys/test/internal/challengeBasedAuthenticationPolicy.spec.ts b/sdk/keyvault/keyvault-keys/test/internal/challengeBasedAuthenticationPolicy.spec.ts index dc590e5477f9..dc0ae3fc14be 100644 --- a/sdk/keyvault/keyvault-keys/test/internal/challengeBasedAuthenticationPolicy.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/internal/challengeBasedAuthenticationPolicy.spec.ts @@ -15,7 +15,7 @@ import { import { KeyClient } from "../../src"; import { authenticate } from "../public/utils/testAuthentication"; import TestClient from "../public/utils/testClient"; -import { getServiceVersion } from "../public/utils/utils.common"; +import { getServiceVersion } from "../public/utils/common"; import { HttpHeaders, isNode, WebResource } from "@azure/core-http"; import { ClientSecretCredential } from "@azure/identity"; import sinon from "sinon"; diff --git a/sdk/keyvault/keyvault-keys/test/public/recoverBackupRestore.spec.ts b/sdk/keyvault/keyvault-keys/test/internal/recoverBackupRestore.spec.ts similarity index 95% rename from sdk/keyvault/keyvault-keys/test/public/recoverBackupRestore.spec.ts rename to sdk/keyvault/keyvault-keys/test/internal/recoverBackupRestore.spec.ts index e57958f50dff..a0cf19a58651 100644 --- a/sdk/keyvault/keyvault-keys/test/public/recoverBackupRestore.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/internal/recoverBackupRestore.spec.ts @@ -5,17 +5,17 @@ import { assert } from "chai"; import { Context } from "mocha"; import { isNode } from "@azure/core-http"; import { KeyClient } from "../../src"; -import { assertThrowsAbortError, getServiceVersion } from "./utils/utils.common"; -import { testPollerProperties } from "./utils/recorderUtils"; +import { assertThrowsAbortError, getServiceVersion } from "../public/utils/common"; +import { testPollerProperties } from "../public/utils/recorderUtils"; import { env, Recorder, isRecordMode, isPlaybackMode } from "@azure-tools/test-recorder"; -import { authenticate } from "./utils/testAuthentication"; -import TestClient from "./utils/testClient"; +import { authenticate } from "../public/utils/testAuthentication"; +import InternalTestClient from "./utils/internalTestClient"; describe("Keys client - restore keys and recover backups", () => { const keyPrefix = `backupRestore${env.KEY_NAME || "KeyName"}`; let keySuffix: string; let client: KeyClient; - let testClient: TestClient; + let testClient: InternalTestClient; let recorder: Recorder; beforeEach(async function (this: Context) { diff --git a/sdk/keyvault/keyvault-keys/test/internal/serviceVersionParameter.spec.ts b/sdk/keyvault/keyvault-keys/test/internal/serviceVersionParameter.spec.ts index 65a138ad2722..0fd383572c7d 100644 --- a/sdk/keyvault/keyvault-keys/test/internal/serviceVersionParameter.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/internal/serviceVersionParameter.spec.ts @@ -9,7 +9,7 @@ import { HttpClient, HttpOperationResponse, WebResourceLike, HttpHeaders } from import { ClientSecretCredential } from "@azure/identity"; import { env } from "@azure-tools/test-recorder"; import { versionsToTest } from "@azure/test-utils"; -import { serviceVersions } from "../public/utils/utils.common"; +import { serviceVersions } from "../public/utils/common"; describe("The Keys client should set the serviceVersion", () => { const keyVaultUrl = `https://keyVaultName.vault.azure.net`; diff --git a/sdk/keyvault/keyvault-keys/test/internal/utils/internalTestClient.ts b/sdk/keyvault/keyvault-keys/test/internal/utils/internalTestClient.ts new file mode 100644 index 000000000000..8794d7976194 --- /dev/null +++ b/sdk/keyvault/keyvault-keys/test/internal/utils/internalTestClient.ts @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { testPollerProperties } from "../../public/utils/recorderUtils"; +import { KeyClient, KeyVaultKey } from "../../../src"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { operationOptionsToRequestOptionsBase } from "@azure/core-http"; +import { RestoreKeyBackupPoller } from "../../public/utils/lro/restore/poller"; +import { BeginRestoreKeyBackupOptions } from "../../public/utils/lro/restore/operation"; + +export default class InternalTestClient { + public readonly client: KeyClient; + constructor(client: KeyClient) { + this.client = client; + } + public formatName(name: string): string { + return name.replace(/[^0-9a-zA-Z-]/g, ""); + } + public async purgeKey(keyName: string): Promise { + await this.client.purgeDeletedKey(keyName); + } + public async flushKey(keyName: string): Promise { + const that = this; + const poller = await that.client.beginDeleteKey(keyName, testPollerProperties); + await poller.pollUntilDone(); + await this.purgeKey(keyName); + } + public async beginRestoreKeyBackup( + backup: Uint8Array, + options: BeginRestoreKeyBackupOptions = {} + ): Promise, KeyVaultKey>> { + const requestOptions = operationOptionsToRequestOptionsBase(options); + const poller = new RestoreKeyBackupPoller({ + backup, + client: this.client, + intervalInMs: options.intervalInMs, + resumeFrom: options.resumeFrom, + requestOptions, + }); + + // This will initialize the poller's operation (the recovery of the backup). + await poller.poll(); + + return poller; + } +} diff --git a/sdk/keyvault/keyvault-keys/test/public/crypto.hsm.spec.ts b/sdk/keyvault/keyvault-keys/test/public/crypto.hsm.spec.ts index e06969442012..42ea8975af56 100644 --- a/sdk/keyvault/keyvault-keys/test/public/crypto.hsm.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/public/crypto.hsm.spec.ts @@ -10,7 +10,7 @@ import { CryptographyClient, KeyVaultKey, KeyClient } from "../../src"; import { authenticate } from "./utils/testAuthentication"; import { stringToUint8Array, uint8ArrayToString } from "./utils/crypto"; import TestClient from "./utils/testClient"; -import { getServiceVersion, onVersions } from "./utils/utils.common"; +import { getServiceVersion, onVersions } from "./utils/common"; import { isNode } from "@azure/core-http"; onVersions({ minVer: "7.2" }).describe( diff --git a/sdk/keyvault/keyvault-keys/test/public/crypto.spec.ts b/sdk/keyvault/keyvault-keys/test/public/crypto.spec.ts index 3048cd2191b7..fdea045cc6cd 100644 --- a/sdk/keyvault/keyvault-keys/test/public/crypto.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/public/crypto.spec.ts @@ -13,7 +13,7 @@ import { authenticate } from "./utils/testAuthentication"; import TestClient from "./utils/testClient"; import { stringToUint8Array, uint8ArrayToString } from "./utils/crypto"; import { RsaCryptographyProvider } from "../../src/cryptography/rsaCryptographyProvider"; -import { getServiceVersion } from "./utils/utils.common"; +import { getServiceVersion } from "./utils/common"; import { isNode } from "@azure/core-http"; describe("CryptographyClient (all decrypts happen remotely)", () => { diff --git a/sdk/keyvault/keyvault-keys/test/public/import.spec.ts b/sdk/keyvault/keyvault-keys/test/public/import.spec.ts index 807412e9b941..7f5654c08796 100644 --- a/sdk/keyvault/keyvault-keys/test/public/import.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/public/import.spec.ts @@ -8,7 +8,7 @@ import { env, Recorder } from "@azure-tools/test-recorder"; import { KeyClient } from "../../src"; import { authenticate } from "./utils/testAuthentication"; import TestClient from "./utils/testClient"; -import { getServiceVersion } from "./utils/utils.common"; +import { getServiceVersion } from "./utils/common"; import { createRsaKey } from "./utils/crypto"; describe("Keys client - import keys", () => { diff --git a/sdk/keyvault/keyvault-keys/test/public/keyClient.hsm.spec.ts b/sdk/keyvault/keyvault-keys/test/public/keyClient.hsm.spec.ts index bc6094c5dd18..38e7d75dea7d 100644 --- a/sdk/keyvault/keyvault-keys/test/public/keyClient.hsm.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/public/keyClient.hsm.spec.ts @@ -8,7 +8,7 @@ import { KeyClient } from "../../src"; import { authenticate } from "./utils/testAuthentication"; import TestClient from "./utils/testClient"; import { CreateOctKeyOptions, KnownKeyExportEncryptionAlgorithm } from "../../src/keysModels"; -import { getServiceVersion, onVersions } from "./utils/utils.common"; +import { getServiceVersion, onVersions } from "./utils/common"; import { supportsTracing } from "../../../keyvault-common/test/utils/supportsTracing"; import { createRsaKey, stringToUint8Array, uint8ArrayToString } from "./utils/crypto"; import { DefaultHttpClient, WebResource } from "@azure/core-http"; diff --git a/sdk/keyvault/keyvault-keys/test/public/keyClient.spec.ts b/sdk/keyvault/keyvault-keys/test/public/keyClient.spec.ts index 6b1ac1cf36c9..860917804ac9 100644 --- a/sdk/keyvault/keyvault-keys/test/public/keyClient.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/public/keyClient.spec.ts @@ -22,7 +22,7 @@ import { getServiceVersion, isPublicCloud, onVersions, -} from "./utils/utils.common"; +} from "./utils/common"; import { testPollerProperties } from "./utils/recorderUtils"; import { authenticate } from "./utils/testAuthentication"; import TestClient from "./utils/testClient"; diff --git a/sdk/keyvault/keyvault-keys/test/public/list.spec.ts b/sdk/keyvault/keyvault-keys/test/public/list.spec.ts index 029a8222a7b2..3747bbddaddb 100644 --- a/sdk/keyvault/keyvault-keys/test/public/list.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/public/list.spec.ts @@ -6,7 +6,7 @@ import { Context } from "mocha"; import { env, Recorder, isRecordMode } from "@azure-tools/test-recorder"; import { KeyClient } from "../../src"; -import { assertThrowsAbortError, getServiceVersion } from "./utils/utils.common"; +import { assertThrowsAbortError, getServiceVersion } from "./utils/common"; import { testPollerProperties } from "./utils/recorderUtils"; import { authenticate } from "./utils/testAuthentication"; import TestClient from "./utils/testClient"; diff --git a/sdk/keyvault/keyvault-keys/test/public/localCryptography.spec.ts b/sdk/keyvault/keyvault-keys/test/public/localCryptography.spec.ts index 5f397a69fa77..8d3f48f2077c 100644 --- a/sdk/keyvault/keyvault-keys/test/public/localCryptography.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/public/localCryptography.spec.ts @@ -13,7 +13,7 @@ import TestClient from "./utils/testClient"; import { Recorder, env } from "@azure-tools/test-recorder"; import { ClientSecretCredential } from "@azure/identity"; import { RsaCryptographyProvider } from "../../src/cryptography/rsaCryptographyProvider"; -import { getServiceVersion } from "./utils/utils.common"; +import { getServiceVersion } from "./utils/common"; const { assert } = chai; describe("Local cryptography public tests", () => { diff --git a/sdk/keyvault/keyvault-keys/test/public/lro.delete.spec.ts b/sdk/keyvault/keyvault-keys/test/public/lro.delete.spec.ts index e4c477918083..6bd70c9949e9 100644 --- a/sdk/keyvault/keyvault-keys/test/public/lro.delete.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/public/lro.delete.spec.ts @@ -10,7 +10,7 @@ import { KeyClient, DeletedKey } from "../../src"; import { testPollerProperties } from "./utils/recorderUtils"; import { authenticate } from "./utils/testAuthentication"; import TestClient from "./utils/testClient"; -import { getServiceVersion } from "./utils/utils.common"; +import { getServiceVersion } from "./utils/common"; describe("Keys client - Long Running Operations - delete", () => { const keyPrefix = `lroDelete${env.CERTIFICATE_NAME || "KeyName"}`; diff --git a/sdk/keyvault/keyvault-keys/test/public/lro.recoverDelete.spec.ts b/sdk/keyvault/keyvault-keys/test/public/lro.recoverDelete.spec.ts index 19e0c9c65661..365ca6bc6b2e 100644 --- a/sdk/keyvault/keyvault-keys/test/public/lro.recoverDelete.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/public/lro.recoverDelete.spec.ts @@ -7,7 +7,7 @@ import { env, Recorder } from "@azure-tools/test-recorder"; import { PollerStoppedError } from "@azure/core-lro"; import { KeyClient, DeletedKey } from "../../src"; -import { assertThrowsAbortError, getServiceVersion } from "./utils/utils.common"; +import { assertThrowsAbortError, getServiceVersion } from "./utils/common"; import { testPollerProperties } from "./utils/recorderUtils"; import { authenticate } from "./utils/testAuthentication"; import TestClient from "./utils/testClient"; diff --git a/sdk/keyvault/keyvault-keys/test/public/utils/utils.common.ts b/sdk/keyvault/keyvault-keys/test/public/utils/common.ts similarity index 95% rename from sdk/keyvault/keyvault-keys/test/public/utils/utils.common.ts rename to sdk/keyvault/keyvault-keys/test/public/utils/common.ts index 9496b091fac4..13a5d3df8d78 100644 --- a/sdk/keyvault/keyvault-keys/test/public/utils/utils.common.ts +++ b/sdk/keyvault/keyvault-keys/test/public/utils/common.ts @@ -4,7 +4,11 @@ import { SupportedVersions, supports, TestFunctionWrapper } from "@azure/test-utils"; import { env } from "@azure-tools/test-recorder"; import { assert } from "chai"; -import { LATEST_API_VERSION } from "../../../src/keysModels"; + +/** + * The latest supported Key Vault service API version + */ +export const LATEST_API_VERSION = "7.3-preview"; export function getKeyvaultName(): string { const keyVaultEnvVarName = "KEYVAULT_NAME"; diff --git a/sdk/keyvault/keyvault-keys/test/public/utils/crypto.ts b/sdk/keyvault/keyvault-keys/test/public/utils/crypto.ts index 4d1695647240..35241d170f8a 100644 --- a/sdk/keyvault/keyvault-keys/test/public/utils/crypto.ts +++ b/sdk/keyvault/keyvault-keys/test/public/utils/crypto.ts @@ -2,7 +2,7 @@ // Licensed under the MIT license. import { isNode } from "@azure/core-http"; -import { JsonWebKey } from "../../../src/keysModels"; +import { JsonWebKey } from "../../../src"; export function stringToUint8Array(str: string): Uint8Array { if (isNode) { diff --git a/sdk/keyvault/keyvault-keys/test/public/utils/lro/restore/operation.ts b/sdk/keyvault/keyvault-keys/test/public/utils/lro/restore/operation.ts index de97ae9d9060..3a361b3cf6ca 100644 --- a/sdk/keyvault/keyvault-keys/test/public/utils/lro/restore/operation.ts +++ b/sdk/keyvault/keyvault-keys/test/public/utils/lro/restore/operation.ts @@ -4,12 +4,12 @@ import { AbortSignalLike } from "@azure/abort-controller"; import { PollOperationState, PollOperation } from "@azure/core-lro"; import { RequestOptionsBase } from "@azure/core-http"; -import { KeyVaultKey, KeyPollerOptions } from "../../../../../src/keysModels"; +import { KeyVaultKey, KeyPollerOptions } from "../../../../../src"; /** * Options sent to the beginRestoreKeyBackup method. */ -export interface BeginRestoreKeyBackupOptions extends KeyPollerOptions { } +export interface BeginRestoreKeyBackupOptions extends KeyPollerOptions {} /** * @internal @@ -48,7 +48,7 @@ export interface RestoreKeyBackupPollOperationState extends PollOperationState { } + extends PollOperation {} /** * Reaches to the service and updates the restore key's poll operation. diff --git a/sdk/keyvault/keyvault-keys/test/public/utils/lro/restore/poller.ts b/sdk/keyvault/keyvault-keys/test/public/utils/lro/restore/poller.ts index bd1ae34a1e7a..2dfa7c3e71a7 100644 --- a/sdk/keyvault/keyvault-keys/test/public/utils/lro/restore/poller.ts +++ b/sdk/keyvault/keyvault-keys/test/public/utils/lro/restore/poller.ts @@ -8,7 +8,7 @@ import { makeRestoreKeyBackupPollOperation, TestKeyClientInterface, } from "./operation"; -import { KeyVaultKey } from "../../../../../src/keysModels"; +import { KeyVaultKey } from "../../../../../src"; export interface RestoreKeyBackupPollerOptions { client: TestKeyClientInterface; diff --git a/sdk/keyvault/keyvault-keys/test/public/utils/testClient.ts b/sdk/keyvault/keyvault-keys/test/public/utils/testClient.ts index b115ec9ccf19..cc4d9fc7a53d 100644 --- a/sdk/keyvault/keyvault-keys/test/public/utils/testClient.ts +++ b/sdk/keyvault/keyvault-keys/test/public/utils/testClient.ts @@ -2,11 +2,7 @@ // Licensed under the MIT license. import { testPollerProperties } from "./recorderUtils"; -import { KeyClient, KeyVaultKey } from "../../../src"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; -import { operationOptionsToRequestOptionsBase } from "@azure/core-http"; -import { RestoreKeyBackupPoller } from "./lro/restore/poller"; -import { BeginRestoreKeyBackupOptions } from "./lro/restore/operation"; +import { KeyClient } from "../../../src"; export default class TestClient { public readonly client: KeyClient; @@ -25,22 +21,4 @@ export default class TestClient { await poller.pollUntilDone(); await this.purgeKey(keyName); } - public async beginRestoreKeyBackup( - backup: Uint8Array, - options: BeginRestoreKeyBackupOptions = {} - ): Promise, KeyVaultKey>> { - const requestOptions = operationOptionsToRequestOptionsBase(options); - const poller = new RestoreKeyBackupPoller({ - backup, - client: this.client, - intervalInMs: options.intervalInMs, - resumeFrom: options.resumeFrom, - requestOptions, - }); - - // This will initialize the poller's operation (the recovery of the backup). - await poller.poll(); - - return poller; - } } diff --git a/sdk/keyvault/keyvault-secrets/test/internal/challengeBasedAuthenticationPolicy.spec.ts b/sdk/keyvault/keyvault-secrets/test/internal/challengeBasedAuthenticationPolicy.spec.ts index 0e892389334a..78e990b25c48 100644 --- a/sdk/keyvault/keyvault-secrets/test/internal/challengeBasedAuthenticationPolicy.spec.ts +++ b/sdk/keyvault/keyvault-secrets/test/internal/challengeBasedAuthenticationPolicy.spec.ts @@ -17,7 +17,7 @@ import { authenticate } from "../public/utils/testAuthentication"; import TestClient from "../public/utils/testClient"; import { ClientSecretCredential } from "@azure/identity"; import { WebResource } from "@azure/core-http"; -import { getServiceVersion } from "../public/utils/utils.common"; +import { getServiceVersion } from "../public/utils/common"; // Following the philosophy of not testing the insides if we can test the outsides... // I present you with this "Get Out of Jail Free" card (in reference to Monopoly). diff --git a/sdk/keyvault/keyvault-secrets/test/public/CRUD.spec.ts b/sdk/keyvault/keyvault-secrets/test/public/CRUD.spec.ts index a4c80f78b248..3a31a7457d43 100644 --- a/sdk/keyvault/keyvault-secrets/test/public/CRUD.spec.ts +++ b/sdk/keyvault/keyvault-secrets/test/public/CRUD.spec.ts @@ -8,7 +8,7 @@ import { env, Recorder } from "@azure-tools/test-recorder"; import { AbortController } from "@azure/abort-controller"; import { SecretClient } from "../../src"; -import { assertThrowsAbortError, getServiceVersion } from "./utils/utils.common"; +import { assertThrowsAbortError, getServiceVersion } from "./utils/common"; import { testPollerProperties } from "./utils/recorderUtils"; import { authenticate } from "./utils/testAuthentication"; import TestClient from "./utils/testClient"; diff --git a/sdk/keyvault/keyvault-secrets/test/public/list.spec.ts b/sdk/keyvault/keyvault-secrets/test/public/list.spec.ts index bb5136e8f0f1..b67d3eefdb28 100644 --- a/sdk/keyvault/keyvault-secrets/test/public/list.spec.ts +++ b/sdk/keyvault/keyvault-secrets/test/public/list.spec.ts @@ -7,7 +7,7 @@ import chai from "chai"; import { env, Recorder, isRecordMode } from "@azure-tools/test-recorder"; import { SecretClient } from "../../src"; -import { assertThrowsAbortError, getServiceVersion } from "./utils/utils.common"; +import { assertThrowsAbortError, getServiceVersion } from "./utils/common"; import { testPollerProperties } from "./utils/recorderUtils"; import { authenticate } from "./utils/testAuthentication"; import TestClient from "./utils/testClient"; diff --git a/sdk/keyvault/keyvault-secrets/test/public/lro.delete.spec.ts b/sdk/keyvault/keyvault-secrets/test/public/lro.delete.spec.ts index 23ce0c564684..ab9bcf8bb330 100644 --- a/sdk/keyvault/keyvault-secrets/test/public/lro.delete.spec.ts +++ b/sdk/keyvault/keyvault-secrets/test/public/lro.delete.spec.ts @@ -7,7 +7,7 @@ import { env, Recorder } from "@azure-tools/test-recorder"; import { PollerStoppedError } from "@azure/core-lro"; import { SecretClient, DeletedSecret } from "../../src"; -import { assertThrowsAbortError, getServiceVersion } from "./utils/utils.common"; +import { assertThrowsAbortError, getServiceVersion } from "./utils/common"; import { testPollerProperties } from "./utils/recorderUtils"; import { authenticate } from "./utils/testAuthentication"; import TestClient from "./utils/testClient"; diff --git a/sdk/keyvault/keyvault-secrets/test/public/lro.recover.spec.ts b/sdk/keyvault/keyvault-secrets/test/public/lro.recover.spec.ts index e77e68de1fdb..d1749dc1c2ba 100644 --- a/sdk/keyvault/keyvault-secrets/test/public/lro.recover.spec.ts +++ b/sdk/keyvault/keyvault-secrets/test/public/lro.recover.spec.ts @@ -7,7 +7,7 @@ import { env, Recorder } from "@azure-tools/test-recorder"; import { PollerStoppedError } from "@azure/core-lro"; import { SecretClient, SecretProperties } from "../../src"; -import { assertThrowsAbortError, getServiceVersion } from "./utils/utils.common"; +import { assertThrowsAbortError, getServiceVersion } from "./utils/common"; import { testPollerProperties } from "./utils/recorderUtils"; import { authenticate } from "./utils/testAuthentication"; import TestClient from "./utils/testClient"; diff --git a/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts b/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts index 9b395120dba6..1d9d337c3cf5 100644 --- a/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts +++ b/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts @@ -7,7 +7,7 @@ import { isNode } from "@azure/core-http"; import { env, isPlaybackMode, Recorder, isRecordMode } from "@azure-tools/test-recorder"; import { SecretClient } from "../../src"; -import { assertThrowsAbortError, getServiceVersion } from "./utils/utils.common"; +import { assertThrowsAbortError, getServiceVersion } from "./utils/common"; import { testPollerProperties } from "./utils/recorderUtils"; import { authenticate } from "./utils/testAuthentication"; import TestClient from "./utils/testClient"; diff --git a/sdk/keyvault/keyvault-secrets/test/public/utils/utils.common.ts b/sdk/keyvault/keyvault-secrets/test/public/utils/common.ts similarity index 92% rename from sdk/keyvault/keyvault-secrets/test/public/utils/utils.common.ts rename to sdk/keyvault/keyvault-secrets/test/public/utils/common.ts index 1644b9d2b1cf..35fe711d808e 100644 --- a/sdk/keyvault/keyvault-secrets/test/public/utils/utils.common.ts +++ b/sdk/keyvault/keyvault-secrets/test/public/utils/common.ts @@ -4,7 +4,12 @@ import { assert } from "chai"; import { SupportedVersions, supports, TestFunctionWrapper } from "@azure/test-utils"; import { env } from "@azure-tools/test-recorder"; -import { LATEST_API_VERSION, SecretClientOptions } from "../../../src/secretsModels"; +import { SecretClientOptions } from "../../../src"; + +/** + * The latest supported KeyVault service API version + */ +export const LATEST_API_VERSION = "7.3-preview"; export async function assertThrowsAbortError(cb: () => Promise): Promise { let passed = false; diff --git a/sdk/keyvault/keyvault-secrets/test/public/utils/lro/restore/operation.ts b/sdk/keyvault/keyvault-secrets/test/public/utils/lro/restore/operation.ts index 18b8bbc4440d..b221458625e5 100644 --- a/sdk/keyvault/keyvault-secrets/test/public/utils/lro/restore/operation.ts +++ b/sdk/keyvault/keyvault-secrets/test/public/utils/lro/restore/operation.ts @@ -4,12 +4,12 @@ import { AbortSignalLike } from "@azure/abort-controller"; import { PollOperationState, PollOperation } from "@azure/core-lro"; import { OperationOptions } from "@azure/core-http"; -import { SecretPollerOptions, SecretProperties } from "../../../../../src/secretsModels"; +import { SecretPollerOptions, SecretProperties } from "../../../../../src"; /** * Options sent to the beginRestoreSecretBackup method. */ -export interface BeginRestoreSecretBackupOptions extends SecretPollerOptions { } +export interface BeginRestoreSecretBackupOptions extends SecretPollerOptions {} /** * @internal @@ -49,7 +49,7 @@ export interface RestoreSecretBackupPollOperationState * An interface representing a restore secret's poll operation */ export interface RestoreSecretBackupPollOperation - extends PollOperation { } + extends PollOperation {} /** * Reaches to the service and updates the restore secret's poll operation. diff --git a/sdk/keyvault/keyvault-secrets/test/public/utils/lro/restore/poller.ts b/sdk/keyvault/keyvault-secrets/test/public/utils/lro/restore/poller.ts index a4c5697b2f6c..6b61a504ff75 100644 --- a/sdk/keyvault/keyvault-secrets/test/public/utils/lro/restore/poller.ts +++ b/sdk/keyvault/keyvault-secrets/test/public/utils/lro/restore/poller.ts @@ -8,7 +8,7 @@ import { makeRestoreSecretBackupPollOperation, TestSecretClientInterface, } from "./operation"; -import { SecretProperties } from "../../../../../src/secretsModels"; +import { SecretProperties } from "../../../../../src"; export interface RestoreSecretBackupPollerOptions { client: TestSecretClientInterface; diff --git a/sdk/keyvault/keyvault-secrets/test/public/utils/testAuthentication.ts b/sdk/keyvault/keyvault-secrets/test/public/utils/testAuthentication.ts index d855eda6ad12..3ee500760afa 100644 --- a/sdk/keyvault/keyvault-secrets/test/public/utils/testAuthentication.ts +++ b/sdk/keyvault/keyvault-secrets/test/public/utils/testAuthentication.ts @@ -7,7 +7,7 @@ import { env, record, RecorderEnvironmentSetup } from "@azure-tools/test-recorde import { uniqueString } from "./recorderUtils"; import TestClient from "./testClient"; import { Context } from "mocha"; -import { getServiceVersion } from "./utils.common"; +import { getServiceVersion } from "./common"; export async function authenticate( that: Context, From 6509b159764152a1e2dbef973235e475298775bd Mon Sep 17 00:00:00 2001 From: Daniel Rodriguez Date: Fri, 21 Jan 2022 21:54:38 +0000 Subject: [PATCH 06/26] additional fix necessary in KeyVault Keys --- .../internal/recoverBackupRestore.spec.ts | 6 ++++- .../test/internal/utils/internalTestClient.ts | 22 +++---------------- .../test/public/utils/testAuthentication.ts | 10 ++++++--- .../test/public/utils/testClient.ts | 8 ++++++- 4 files changed, 22 insertions(+), 24 deletions(-) diff --git a/sdk/keyvault/keyvault-keys/test/internal/recoverBackupRestore.spec.ts b/sdk/keyvault/keyvault-keys/test/internal/recoverBackupRestore.spec.ts index a0cf19a58651..281416f19e93 100644 --- a/sdk/keyvault/keyvault-keys/test/internal/recoverBackupRestore.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/internal/recoverBackupRestore.spec.ts @@ -19,7 +19,11 @@ describe("Keys client - restore keys and recover backups", () => { let recorder: Recorder; beforeEach(async function (this: Context) { - const authentication = await authenticate(this, getServiceVersion()); + const authentication = await authenticate( + this, + getServiceVersion(), + (keyClient) => new InternalTestClient(keyClient) + ); keySuffix = authentication.keySuffix; client = authentication.client; testClient = authentication.testClient; diff --git a/sdk/keyvault/keyvault-keys/test/internal/utils/internalTestClient.ts b/sdk/keyvault/keyvault-keys/test/internal/utils/internalTestClient.ts index 8794d7976194..356bbfe5763d 100644 --- a/sdk/keyvault/keyvault-keys/test/internal/utils/internalTestClient.ts +++ b/sdk/keyvault/keyvault-keys/test/internal/utils/internalTestClient.ts @@ -1,30 +1,14 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { testPollerProperties } from "../../public/utils/recorderUtils"; -import { KeyClient, KeyVaultKey } from "../../../src"; +import { KeyVaultKey } from "../../../src"; import { PollerLike, PollOperationState } from "@azure/core-lro"; import { operationOptionsToRequestOptionsBase } from "@azure/core-http"; import { RestoreKeyBackupPoller } from "../../public/utils/lro/restore/poller"; import { BeginRestoreKeyBackupOptions } from "../../public/utils/lro/restore/operation"; +import TestClient from "../../public/utils/testClient"; -export default class InternalTestClient { - public readonly client: KeyClient; - constructor(client: KeyClient) { - this.client = client; - } - public formatName(name: string): string { - return name.replace(/[^0-9a-zA-Z-]/g, ""); - } - public async purgeKey(keyName: string): Promise { - await this.client.purgeDeletedKey(keyName); - } - public async flushKey(keyName: string): Promise { - const that = this; - const poller = await that.client.beginDeleteKey(keyName, testPollerProperties); - await poller.pollUntilDone(); - await this.purgeKey(keyName); - } +export default class InternalTestClient extends TestClient { public async beginRestoreKeyBackup( backup: Uint8Array, options: BeginRestoreKeyBackupOptions = {} diff --git a/sdk/keyvault/keyvault-keys/test/public/utils/testAuthentication.ts b/sdk/keyvault/keyvault-keys/test/public/utils/testAuthentication.ts index cfe619523dc9..04aedf0f2da0 100644 --- a/sdk/keyvault/keyvault-keys/test/public/utils/testAuthentication.ts +++ b/sdk/keyvault/keyvault-keys/test/public/utils/testAuthentication.ts @@ -5,7 +5,7 @@ import { ClientSecretCredential } from "@azure/identity"; import { KeyClient } from "../../../src"; import { env, record, RecorderEnvironmentSetup } from "@azure-tools/test-recorder"; import { uniqueString } from "./recorderUtils"; -import TestClient from "./testClient"; +import TestClient, { TestClientInterface } from "./testClient"; import { Context } from "mocha"; import { fromBase64url, toBase64url } from "./base64url"; @@ -19,7 +19,11 @@ const replaceableVariables = { AZURE_KEYVAULT_ATTESTATION_URI: "https://skr_attestation.azure.net/", }; -export async function authenticate(that: Context, version: string): Promise { +export async function authenticate( + that: Context, + version: string, + testClientMaker?: (client: KeyClient) => TestClientInterface +): Promise { const keySuffix = uniqueString(); const recorderEnvSetup: RecorderEnvironmentSetup = { replaceableVariables, @@ -62,7 +66,7 @@ export async function authenticate(that: Context, version: string): Promise const client = new KeyClient(keyVaultUrl, credential, { serviceVersion: version, }); - const testClient = new TestClient(client); + const testClient = testClientMaker ? testClientMaker(client) : new TestClient(client); let hsmClient: KeyClient | undefined = undefined; if (env.AZURE_MANAGEDHSM_URI) { diff --git a/sdk/keyvault/keyvault-keys/test/public/utils/testClient.ts b/sdk/keyvault/keyvault-keys/test/public/utils/testClient.ts index cc4d9fc7a53d..32210e091b15 100644 --- a/sdk/keyvault/keyvault-keys/test/public/utils/testClient.ts +++ b/sdk/keyvault/keyvault-keys/test/public/utils/testClient.ts @@ -4,7 +4,13 @@ import { testPollerProperties } from "./recorderUtils"; import { KeyClient } from "../../../src"; -export default class TestClient { +export interface TestClientInterface { + client: KeyClient; + formatName: (name: string) => string; + purgeKey: (keyName: string) => Promise; + flushKey: (keyName: string) => Promise; +} +export default class TestClient implements TestClientInterface { public readonly client: KeyClient; constructor(client: KeyClient) { this.client = client; From eb1c60c558224a0be9fe2b8de2315529e9757365 Mon Sep 17 00:00:00 2001 From: Daniel Rodriguez Date: Wed, 26 Jan 2022 23:30:24 +0000 Subject: [PATCH 07/26] deriving the SERVICE_VERSION from the serviceVersions array in the same file --- .../keyvault-certificates/test/public/utils/common.ts | 7 +------ sdk/keyvault/keyvault-keys/test/public/utils/common.ts | 7 +------ sdk/keyvault/keyvault-secrets/test/public/utils/common.ts | 7 +------ 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/sdk/keyvault/keyvault-certificates/test/public/utils/common.ts b/sdk/keyvault/keyvault-certificates/test/public/utils/common.ts index d8fe1a80c080..8fa93e181ab6 100644 --- a/sdk/keyvault/keyvault-certificates/test/public/utils/common.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/utils/common.ts @@ -6,11 +6,6 @@ import { assert } from "chai"; import { SupportedVersions, supports, TestFunctionWrapper } from "@azure/test-utils"; import { CertificateClientOptions } from "../../../src"; -/** - * The latest supported KeyVault service API version - */ -export const LATEST_API_VERSION = "7.3-preview"; - export function getKeyvaultName(): string { const keyVaultEnvVarName = "KEYVAULT_NAME"; const keyVaultName: string | undefined = env[keyVaultEnvVarName]; @@ -48,7 +43,7 @@ export const serviceVersions = ["7.0", "7.1", "7.2", "7.3-preview"] as const; * @returns - The service version to test */ export function getServiceVersion(): NonNullable { - return env.SERVICE_VERSION || LATEST_API_VERSION; + return env.SERVICE_VERSION || serviceVersions[serviceVersions.length - 1]; } /** diff --git a/sdk/keyvault/keyvault-keys/test/public/utils/common.ts b/sdk/keyvault/keyvault-keys/test/public/utils/common.ts index 13a5d3df8d78..51d9e7734379 100644 --- a/sdk/keyvault/keyvault-keys/test/public/utils/common.ts +++ b/sdk/keyvault/keyvault-keys/test/public/utils/common.ts @@ -5,11 +5,6 @@ import { SupportedVersions, supports, TestFunctionWrapper } from "@azure/test-ut import { env } from "@azure-tools/test-recorder"; import { assert } from "chai"; -/** - * The latest supported Key Vault service API version - */ -export const LATEST_API_VERSION = "7.3-preview"; - export function getKeyvaultName(): string { const keyVaultEnvVarName = "KEYVAULT_NAME"; const keyVaultName: string | undefined = env[keyVaultEnvVarName]; @@ -42,7 +37,7 @@ export async function assertThrowsAbortError(cb: () => Promise): Promise Promise): Promise { let passed = false; try { @@ -37,7 +32,7 @@ export const serviceVersions = ["7.0", "7.1", "7.2", "7.3-preview"] as const; * @returns - The service version to test */ export function getServiceVersion(): NonNullable { - return env.SERVICE_VERSION || LATEST_API_VERSION; + return env.SERVICE_VERSION || serviceVersions[serviceVersions.length - 1]; } /** From 686afcff1f129578761de56653d26ce0e4150dab Mon Sep 17 00:00:00 2001 From: Daniel Rodriguez Date: Wed, 26 Jan 2022 23:33:16 +0000 Subject: [PATCH 08/26] inlining the InternalTestClient --- .../internal/recoverBackupRestore.spec.ts | 29 ++++++++++++++++-- .../test/internal/utils/internalTestClient.ts | 30 ------------------- 2 files changed, 26 insertions(+), 33 deletions(-) delete mode 100644 sdk/keyvault/keyvault-keys/test/internal/utils/internalTestClient.ts diff --git a/sdk/keyvault/keyvault-keys/test/internal/recoverBackupRestore.spec.ts b/sdk/keyvault/keyvault-keys/test/internal/recoverBackupRestore.spec.ts index 281416f19e93..012355976761 100644 --- a/sdk/keyvault/keyvault-keys/test/internal/recoverBackupRestore.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/internal/recoverBackupRestore.spec.ts @@ -3,13 +3,36 @@ import { assert } from "chai"; import { Context } from "mocha"; -import { isNode } from "@azure/core-http"; -import { KeyClient } from "../../src"; +import { isNode, operationOptionsToRequestOptionsBase } from "@azure/core-http"; +import { KeyClient, KeyVaultKey, PollerLike, PollOperationState } from "../../src"; import { assertThrowsAbortError, getServiceVersion } from "../public/utils/common"; import { testPollerProperties } from "../public/utils/recorderUtils"; import { env, Recorder, isRecordMode, isPlaybackMode } from "@azure-tools/test-recorder"; import { authenticate } from "../public/utils/testAuthentication"; -import InternalTestClient from "./utils/internalTestClient"; +import TestClient from "../public/utils/testClient"; +import { BeginRestoreKeyBackupOptions } from "../public/utils/lro/restore/operation"; +import { RestoreKeyBackupPoller } from "../public/utils/lro/restore/poller"; + +class InternalTestClient extends TestClient { + public async beginRestoreKeyBackup( + backup: Uint8Array, + options: BeginRestoreKeyBackupOptions = {} + ): Promise, KeyVaultKey>> { + const requestOptions = operationOptionsToRequestOptionsBase(options); + const poller = new RestoreKeyBackupPoller({ + backup, + client: this.client, + intervalInMs: options.intervalInMs, + resumeFrom: options.resumeFrom, + requestOptions, + }); + + // This will initialize the poller's operation (the recovery of the backup). + await poller.poll(); + + return poller; + } +} describe("Keys client - restore keys and recover backups", () => { const keyPrefix = `backupRestore${env.KEY_NAME || "KeyName"}`; diff --git a/sdk/keyvault/keyvault-keys/test/internal/utils/internalTestClient.ts b/sdk/keyvault/keyvault-keys/test/internal/utils/internalTestClient.ts deleted file mode 100644 index 356bbfe5763d..000000000000 --- a/sdk/keyvault/keyvault-keys/test/internal/utils/internalTestClient.ts +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import { KeyVaultKey } from "../../../src"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; -import { operationOptionsToRequestOptionsBase } from "@azure/core-http"; -import { RestoreKeyBackupPoller } from "../../public/utils/lro/restore/poller"; -import { BeginRestoreKeyBackupOptions } from "../../public/utils/lro/restore/operation"; -import TestClient from "../../public/utils/testClient"; - -export default class InternalTestClient extends TestClient { - public async beginRestoreKeyBackup( - backup: Uint8Array, - options: BeginRestoreKeyBackupOptions = {} - ): Promise, KeyVaultKey>> { - const requestOptions = operationOptionsToRequestOptionsBase(options); - const poller = new RestoreKeyBackupPoller({ - backup, - client: this.client, - intervalInMs: options.intervalInMs, - resumeFrom: options.resumeFrom, - requestOptions, - }); - - // This will initialize the poller's operation (the recovery of the backup). - await poller.poll(); - - return poller; - } -} From d833da3fff6960fd74e3ec51081431f0b26c263d Mon Sep 17 00:00:00 2001 From: Daniel Rodriguez Date: Thu, 27 Jan 2022 00:13:59 +0000 Subject: [PATCH 09/26] lint fix --- sdk/keyvault/keyvault-keys/test/public/utils/common.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sdk/keyvault/keyvault-keys/test/public/utils/common.ts b/sdk/keyvault/keyvault-keys/test/public/utils/common.ts index 51d9e7734379..2befaa2af9b7 100644 --- a/sdk/keyvault/keyvault-keys/test/public/utils/common.ts +++ b/sdk/keyvault/keyvault-keys/test/public/utils/common.ts @@ -31,6 +31,11 @@ export async function assertThrowsAbortError(cb: () => Promise): Promise Date: Thu, 27 Jan 2022 23:48:31 +0000 Subject: [PATCH 10/26] inlining the restore operation --- .../internal/recoverBackupRestore.spec.ts | 44 +++++-------------- .../test/public/utils/testAuthentication.ts | 10 ++--- 2 files changed, 13 insertions(+), 41 deletions(-) diff --git a/sdk/keyvault/keyvault-keys/test/internal/recoverBackupRestore.spec.ts b/sdk/keyvault/keyvault-keys/test/internal/recoverBackupRestore.spec.ts index 012355976761..541650d24d9b 100644 --- a/sdk/keyvault/keyvault-keys/test/internal/recoverBackupRestore.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/internal/recoverBackupRestore.spec.ts @@ -3,50 +3,24 @@ import { assert } from "chai"; import { Context } from "mocha"; -import { isNode, operationOptionsToRequestOptionsBase } from "@azure/core-http"; -import { KeyClient, KeyVaultKey, PollerLike, PollOperationState } from "../../src"; +import { isNode } from "@azure/core-http"; +import { KeyClient } from "../../src"; import { assertThrowsAbortError, getServiceVersion } from "../public/utils/common"; import { testPollerProperties } from "../public/utils/recorderUtils"; import { env, Recorder, isRecordMode, isPlaybackMode } from "@azure-tools/test-recorder"; import { authenticate } from "../public/utils/testAuthentication"; import TestClient from "../public/utils/testClient"; -import { BeginRestoreKeyBackupOptions } from "../public/utils/lro/restore/operation"; import { RestoreKeyBackupPoller } from "../public/utils/lro/restore/poller"; -class InternalTestClient extends TestClient { - public async beginRestoreKeyBackup( - backup: Uint8Array, - options: BeginRestoreKeyBackupOptions = {} - ): Promise, KeyVaultKey>> { - const requestOptions = operationOptionsToRequestOptionsBase(options); - const poller = new RestoreKeyBackupPoller({ - backup, - client: this.client, - intervalInMs: options.intervalInMs, - resumeFrom: options.resumeFrom, - requestOptions, - }); - - // This will initialize the poller's operation (the recovery of the backup). - await poller.poll(); - - return poller; - } -} - describe("Keys client - restore keys and recover backups", () => { const keyPrefix = `backupRestore${env.KEY_NAME || "KeyName"}`; let keySuffix: string; let client: KeyClient; - let testClient: InternalTestClient; + let testClient: TestClient; let recorder: Recorder; beforeEach(async function (this: Context) { - const authentication = await authenticate( - this, - getServiceVersion(), - (keyClient) => new InternalTestClient(keyClient) - ); + const authentication = await authenticate(this, getServiceVersion()); keySuffix = authentication.keySuffix; client = authentication.client; testClient = authentication.testClient; @@ -145,10 +119,12 @@ describe("Keys client - restore keys and recover backups", () => { // This test implementation of a restore poller only applies for backups that have been recently deleted. // Backups might not be ready to be restored in an unknown amount of time. // If this is useful to you, please open an issue at: https://github.com/Azure/azure-sdk-for-js/issues - const restorePoller = await testClient.beginRestoreKeyBackup( - backup as Uint8Array, - testPollerProperties - ); + const restorePoller = new RestoreKeyBackupPoller({ + backup: backup!, + client, + intervalInMs: testPollerProperties.intervalInMs, + }); + const restoredKey = await restorePoller.pollUntilDone(); assert.equal(restoredKey.name, keyName); diff --git a/sdk/keyvault/keyvault-keys/test/public/utils/testAuthentication.ts b/sdk/keyvault/keyvault-keys/test/public/utils/testAuthentication.ts index 04aedf0f2da0..cfe619523dc9 100644 --- a/sdk/keyvault/keyvault-keys/test/public/utils/testAuthentication.ts +++ b/sdk/keyvault/keyvault-keys/test/public/utils/testAuthentication.ts @@ -5,7 +5,7 @@ import { ClientSecretCredential } from "@azure/identity"; import { KeyClient } from "../../../src"; import { env, record, RecorderEnvironmentSetup } from "@azure-tools/test-recorder"; import { uniqueString } from "./recorderUtils"; -import TestClient, { TestClientInterface } from "./testClient"; +import TestClient from "./testClient"; import { Context } from "mocha"; import { fromBase64url, toBase64url } from "./base64url"; @@ -19,11 +19,7 @@ const replaceableVariables = { AZURE_KEYVAULT_ATTESTATION_URI: "https://skr_attestation.azure.net/", }; -export async function authenticate( - that: Context, - version: string, - testClientMaker?: (client: KeyClient) => TestClientInterface -): Promise { +export async function authenticate(that: Context, version: string): Promise { const keySuffix = uniqueString(); const recorderEnvSetup: RecorderEnvironmentSetup = { replaceableVariables, @@ -66,7 +62,7 @@ export async function authenticate( const client = new KeyClient(keyVaultUrl, credential, { serviceVersion: version, }); - const testClient = testClientMaker ? testClientMaker(client) : new TestClient(client); + const testClient = new TestClient(client); let hsmClient: KeyClient | undefined = undefined; if (env.AZURE_MANAGEDHSM_URI) { From e72fa95ea065b794c1719f1e47a371b9a3ea73c9 Mon Sep 17 00:00:00 2001 From: Timo van Veenendaal Date: Wed, 26 Jan 2022 16:34:33 -0800 Subject: [PATCH 11/26] [Perf] Decrease default perf test duration to 1 second (#19995) * Decrease default perf test duration to 1 second Fixes #19453 * Revert "Decrease default perf test duration to 1 second" This reverts commit 32324392cb2d204d289528f25f1f040d0a913d1c. * Force 1s duration for all perf tests --- sdk/test-utils/perf/runAllTests.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sdk/test-utils/perf/runAllTests.ts b/sdk/test-utils/perf/runAllTests.ts index fcf924aa638a..2fc0074897dc 100644 --- a/sdk/test-utils/perf/runAllTests.ts +++ b/sdk/test-utils/perf/runAllTests.ts @@ -11,10 +11,9 @@ function spawn(command: string) { function runTest(testClassName: string, options: string = "") { console.log("\n"); - if (options === "") { - options = `--warmup 0 --iterations 1 --duration 1`; - } - spawn(`ts-node ./test/index.spec.ts ${testClassName} ${options}`); + spawn( + `ts-node ./test/index.spec.ts ${testClassName} --warmup 0 --iterations 1 --duration 1 ${options}` + ); } allTests.forEach(({ testClass, options }) => { From 515f4c9c10d20c7990c3ab92d96e170943075909 Mon Sep 17 00:00:00 2001 From: EmmaZhu-MSFT Date: Thu, 27 Jan 2022 09:42:49 +0800 Subject: [PATCH 12/26] Fix issues of ProxyOptions doesn't passed to client when initialized with connection string. (#20073) --- sdk/storage/storage-blob/CHANGELOG.md | 10 ++++---- .../storage-blob/src/BlobServiceClient.ts | 6 ++++- sdk/storage/storage-blob/src/Clients.ts | 23 +++++++++++++++---- .../storage-blob/src/ContainerClient.ts | 6 ++++- .../storage-file-datalake/CHANGELOG.md | 2 ++ .../src/DataLakeServiceClient.ts | 4 +++- sdk/storage/storage-queue/CHANGELOG.md | 6 +++-- sdk/storage/storage-queue/src/QueueClient.ts | 6 ++++- .../storage-queue/src/QueueServiceClient.ts | 4 +++- 9 files changed, 52 insertions(+), 15 deletions(-) diff --git a/sdk/storage/storage-blob/CHANGELOG.md b/sdk/storage/storage-blob/CHANGELOG.md index 09aa7b040300..03484c83ec1d 100644 --- a/sdk/storage/storage-blob/CHANGELOG.md +++ b/sdk/storage/storage-blob/CHANGELOG.md @@ -8,6 +8,8 @@ ### Bugs Fixed +- Fixed a bug where customized `ProxyOptions` is overwrited by a default one when initializing `BlobServiceClient`, `BlobClient`, `AppendBlobClient`, `BlockBlobClient`, `PageBlobClient` or `ContainerClient` with connection string. + ### Other Changes ## 12.9.0-beta.2 (2021-12-03) @@ -266,20 +268,20 @@ Before this change the option is specified as ```js blobServiceClient.listContainers({ - include: "metadata" + include: "metadata", }); ``` After this change: ```js blobServiceClient.listContainers({ - includeMetadata: true + includeMetadata: true, }); ``` - For listing blobs Before this change the option is specified as ```js containerClient.listBlobsFlat({ - include: ["snapshots", "metadata", "uncommittedblobs", "copy", "deleted"] + include: ["snapshots", "metadata", "uncommittedblobs", "copy", "deleted"], }); ``` After this change: @@ -289,7 +291,7 @@ includeDeleted: true, includeMetadata: true, includeSnapshots: true, - includeUncommitedBlobs: true + includeUncommitedBlobs: true, }); ``` - [Breaking] `BlobClient.setTier()` is renamed to `BlobClient.setAccessTier()`. diff --git a/sdk/storage/storage-blob/src/BlobServiceClient.ts b/sdk/storage/storage-blob/src/BlobServiceClient.ts index 6dcc46346028..01956f71d65f 100644 --- a/sdk/storage/storage-blob/src/BlobServiceClient.ts +++ b/sdk/storage/storage-blob/src/BlobServiceClient.ts @@ -426,7 +426,11 @@ export class BlobServiceClient extends StorageClient { extractedCreds.accountName!, extractedCreds.accountKey ); - options.proxyOptions = getDefaultProxySettings(extractedCreds.proxyUri); + + if (!options.proxyOptions) { + options.proxyOptions = getDefaultProxySettings(extractedCreds.proxyUri); + } + const pipeline = newPipeline(sharedKeyCredential, options); return new BlobServiceClient(extractedCreds.url, pipeline); } else { diff --git a/sdk/storage/storage-blob/src/Clients.ts b/sdk/storage/storage-blob/src/Clients.ts index 0cb9bb6469f6..c1c1e2e26a6a 100644 --- a/sdk/storage/storage-blob/src/Clients.ts +++ b/sdk/storage/storage-blob/src/Clients.ts @@ -986,7 +986,10 @@ export class BlobClient extends StorageClient { encodeURIComponent(blobName) ); - options.proxyOptions = getDefaultProxySettings(extractedCreds.proxyUri); + if (!options.proxyOptions) { + options.proxyOptions = getDefaultProxySettings(extractedCreds.proxyUri); + } + pipeline = newPipeline(sharedKeyCredential, options); } else { throw new Error("Account connection string is only supported in Node.js environment"); @@ -2645,7 +2648,11 @@ export class AppendBlobClient extends BlobClient { appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName) ); - options.proxyOptions = getDefaultProxySettings(extractedCreds.proxyUri); + + if (!options.proxyOptions) { + options.proxyOptions = getDefaultProxySettings(extractedCreds.proxyUri); + } + pipeline = newPipeline(sharedKeyCredential, options); } else { throw new Error("Account connection string is only supported in Node.js environment"); @@ -3649,7 +3656,11 @@ export class BlockBlobClient extends BlobClient { appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName) ); - options.proxyOptions = getDefaultProxySettings(extractedCreds.proxyUri); + + if (!options.proxyOptions) { + options.proxyOptions = getDefaultProxySettings(extractedCreds.proxyUri); + } + pipeline = newPipeline(sharedKeyCredential, options); } else { throw new Error("Account connection string is only supported in Node.js environment"); @@ -4893,7 +4904,11 @@ export class PageBlobClient extends BlobClient { appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName) ); - options.proxyOptions = getDefaultProxySettings(extractedCreds.proxyUri); + + if (!options.proxyOptions) { + options.proxyOptions = getDefaultProxySettings(extractedCreds.proxyUri); + } + pipeline = newPipeline(sharedKeyCredential, options); } else { throw new Error("Account connection string is only supported in Node.js environment"); diff --git a/sdk/storage/storage-blob/src/ContainerClient.ts b/sdk/storage/storage-blob/src/ContainerClient.ts index 87d22869821d..03342fc613f6 100644 --- a/sdk/storage/storage-blob/src/ContainerClient.ts +++ b/sdk/storage/storage-blob/src/ContainerClient.ts @@ -683,7 +683,11 @@ export class ContainerClient extends StorageClient { extractedCreds.accountKey ); url = appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)); - options.proxyOptions = getDefaultProxySettings(extractedCreds.proxyUri); + + if (!options.proxyOptions) { + options.proxyOptions = getDefaultProxySettings(extractedCreds.proxyUri); + } + pipeline = newPipeline(sharedKeyCredential, options); } else { throw new Error("Account connection string is only supported in Node.js environment"); diff --git a/sdk/storage/storage-file-datalake/CHANGELOG.md b/sdk/storage/storage-file-datalake/CHANGELOG.md index ddfbab58b813..873595914dfa 100644 --- a/sdk/storage/storage-file-datalake/CHANGELOG.md +++ b/sdk/storage/storage-file-datalake/CHANGELOG.md @@ -8,6 +8,8 @@ ### Bugs Fixed +- Fixed a bug where customized `ProxyOptions` is overwrited by a default one when initializing `DataLakeServiceClient` with connection string. + ### Other Changes ## 12.8.0-beta.1 (2021-11-09) diff --git a/sdk/storage/storage-file-datalake/src/DataLakeServiceClient.ts b/sdk/storage/storage-file-datalake/src/DataLakeServiceClient.ts index ccf5a0828ae0..03748aece5e8 100644 --- a/sdk/storage/storage-file-datalake/src/DataLakeServiceClient.ts +++ b/sdk/storage/storage-file-datalake/src/DataLakeServiceClient.ts @@ -82,7 +82,9 @@ export class DataLakeServiceClient extends StorageClient { extractedCreds.accountName!, extractedCreds.accountKey ); - options.proxyOptions = getDefaultProxySettings(extractedCreds.proxyUri); + if (!options.proxyOptions) { + options.proxyOptions = getDefaultProxySettings(extractedCreds.proxyUri); + } const pipeline = newPipeline(sharedKeyCredential, options); return new DataLakeServiceClient(toDfsEndpointUrl(extractedCreds.url), pipeline); } else { diff --git a/sdk/storage/storage-queue/CHANGELOG.md b/sdk/storage/storage-queue/CHANGELOG.md index 9792fd9c04cd..8b61be2fe07e 100644 --- a/sdk/storage/storage-queue/CHANGELOG.md +++ b/sdk/storage/storage-queue/CHANGELOG.md @@ -8,6 +8,8 @@ ### Bugs Fixed +- Fixed a bug where customized `ProxyOptions` is overwrited by a default one when initializing `QueueServiceClient` or `QueueClient` with connection string. + ### Other Changes ## 12.8.0-beta.1 (2021-11-09) @@ -167,13 +169,13 @@ Before this change the option is specified as ```js queueServiceClient.listShares({ - include: "metadata" + include: "metadata", }); ``` After this change: ```js queueServiceClient.listShares({ - includeMetadata: true + includeMetadata: true, }); ``` diff --git a/sdk/storage/storage-queue/src/QueueClient.ts b/sdk/storage/storage-queue/src/QueueClient.ts index 3906559cd1fe..f97e6af5c16d 100644 --- a/sdk/storage/storage-queue/src/QueueClient.ts +++ b/sdk/storage/storage-queue/src/QueueClient.ts @@ -566,7 +566,11 @@ export class QueueClient extends StorageClient { extractedCreds.accountKey ); url = appendToURLPath(extractedCreds.url, queueName); - options.proxyOptions = getDefaultProxySettings(extractedCreds.proxyUri); + + if (!options.proxyOptions) { + options.proxyOptions = getDefaultProxySettings(extractedCreds.proxyUri); + } + pipeline = newPipeline(sharedKeyCredential, options); } else { throw new Error("Account connection string is only supported in Node.js environment"); diff --git a/sdk/storage/storage-queue/src/QueueServiceClient.ts b/sdk/storage/storage-queue/src/QueueServiceClient.ts index edd052e95206..3514058dd1f8 100644 --- a/sdk/storage/storage-queue/src/QueueServiceClient.ts +++ b/sdk/storage/storage-queue/src/QueueServiceClient.ts @@ -186,7 +186,9 @@ export class QueueServiceClient extends StorageClient { extractedCreds.accountName!, extractedCreds.accountKey ); - options.proxyOptions = getDefaultProxySettings(extractedCreds.proxyUri); + if (!options.proxyOptions) { + options.proxyOptions = getDefaultProxySettings(extractedCreds.proxyUri); + } const pipeline = newPipeline(sharedKeyCredential, options); return new QueueServiceClient(extractedCreds.url, pipeline); } else { From 398c3934790a0607cc7e944a40d75308d316e68d Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Wed, 26 Jan 2022 17:48:51 -0800 Subject: [PATCH 13/26] Post release automated changes for azure-arm-deploymentmanager (#20089) --- .../arm-deploymentmanager/CHANGELOG.md | 10 ++++++++++ .../arm-deploymentmanager/package.json | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/sdk/deploymentmanager/arm-deploymentmanager/CHANGELOG.md b/sdk/deploymentmanager/arm-deploymentmanager/CHANGELOG.md index dd1d6b378ad5..ff28ed084fa3 100644 --- a/sdk/deploymentmanager/arm-deploymentmanager/CHANGELOG.md +++ b/sdk/deploymentmanager/arm-deploymentmanager/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 4.0.0-beta.3 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 4.0.0-beta.2 (2022-01-26) **Feature** diff --git a/sdk/deploymentmanager/arm-deploymentmanager/package.json b/sdk/deploymentmanager/arm-deploymentmanager/package.json index 33d75c1a98dd..527109d82d98 100644 --- a/sdk/deploymentmanager/arm-deploymentmanager/package.json +++ b/sdk/deploymentmanager/arm-deploymentmanager/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for AzureDeploymentManager.", - "version": "4.0.0-beta.2", + "version": "4.0.0-beta.3", "engines": { "node": ">=12.0.0" }, From c4fea7f9bc1f7ccc82e37b6be79626f19480bc37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0vihl=C3=ADk?= Date: Thu, 27 Jan 2022 15:29:55 +0100 Subject: [PATCH 14/26] Implemented a backoff mechanism for the AutoRefreshTokenCredential (#19804) * initial backoff implementation * added test for backoff * improved the autorefresh documentation * better explained scenarios * clarify tokenRefresher's expected return type --- .../communication-common/CHANGELOG.md | 4 +- .../communication-common/README.md | 25 ++++-- .../communication-common/package.json | 2 +- .../src/autoRefreshTokenCredential.ts | 48 ++++++++---- .../test/communicationTokenCredential.spec.ts | 78 ++++++++++++++++--- 5 files changed, 121 insertions(+), 36 deletions(-) diff --git a/sdk/communication/communication-common/CHANGELOG.md b/sdk/communication/communication-common/CHANGELOG.md index 6225d3619b33..379009cee429 100644 --- a/sdk/communication/communication-common/CHANGELOG.md +++ b/sdk/communication/communication-common/CHANGELOG.md @@ -1,9 +1,11 @@ # Release History -## 1.1.1 (Unreleased) +## 1.2.0 (Unreleased) ### Features Added +- Optimization added: When the proactive refreshing is enabled and the token refresher fails to provide a token that's not about to expire soon, the subsequent refresh attempts will be scheduled for when the token reaches half of its remaining lifetime until a token with long enough validity (>10 minutes) is obtained. + ### Breaking Changes ### Bugs Fixed diff --git a/sdk/communication/communication-common/README.md b/sdk/communication/communication-common/README.md index f70f5aa82360..86eb1cb5ba59 100644 --- a/sdk/communication/communication-common/README.md +++ b/sdk/communication/communication-common/README.md @@ -25,16 +25,23 @@ To use this client library in the browser, first you need to use a bundler. For ### CommunicationTokenCredential and AzureCommunicationTokenCredential -A `CommunicationTokenCredential` authenticates a user with Communication Services, such as Chat or Calling. It optionally provides an auto-refresh mechanism to ensure a continuously stable authentication state during communications. +The `CommunicationTokenCredential` is an interface used to authenticate a user with Communication Services, such as Chat or Calling. -It is up to you the developer to first create valid user tokens with the Azure Communication Administration library. Then you use these tokens to create a `AzureCommunicationTokenCredential`. +The `AzureCommunicationTokenCredential` offers a convenient way to create a credential implementing the said interface and allows you to take advantage of the built-in auto-refresh logic. -`CommunicationTokenCredential` is only the interface, please always use the `AzureCommunicationTokenCredential` constructor to create a credential and take advantage of the built-in refresh logic. +Depending on your scenario, you may want to initialize the `AzureCommunicationTokenCredential` with: + +- a static token (suitable for short-lived clients used to e.g. send one-off Chat messages) or +- a callback function that ensures a continuous authentication state during communications (ideal e.g. for long Calling sessions). + +The tokens supplied to the `AzureCommunicationTokenCredential` either through the constructor or via the token refresher callback can be obtained using the Azure Communication Identity library. ## Examples ### Create a credential with a static token +For a short-lived clients, refreshing the token upon expiry is not necessary and the `AzureCommunicationTokenCredential` may be instantiated with a static token. + ```typescript const tokenCredential = new AzureCommunicationTokenCredential( "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjM2MDB9.adM-ddBZZlQ1WlN3pdPBOF5G4Wh9iZpxNP_fSvpF4cWs" @@ -43,11 +50,11 @@ const tokenCredential = new AzureCommunicationTokenCredential( ### Create a credential with a callback -Here we assume that we have a function `fetchTokenFromMyServerForUser` that makes a network request to retrieve a token string for a user. We pass it into the credential to fetch a token for Bob from our own server. Our server would use the Azure Communication Administration library to issue tokens. +Here we assume that we have a function `fetchTokenFromMyServerForUser` that makes a network request to retrieve a JWT token string for a user. We pass it into the credential to fetch a token for Bob from our own server. Our server would use the Azure Communication Identity library to issue tokens. It's necessary that the `fetchTokenFromMyServerForUser` function returns a valid token (with an expiration date set in the future) at all times. ```typescript const tokenCredential = new AzureCommunicationTokenCredential({ - tokenRefresher: async () => fetchTokenFromMyServerForUser("bob@contoso.com") + tokenRefresher: async () => fetchTokenFromMyServerForUser("bob@contoso.com"), }); ``` @@ -58,7 +65,7 @@ Setting `refreshProactively` to true will call your `tokenRefresher` function wh ```typescript const tokenCredential = new AzureCommunicationTokenCredential({ tokenRefresher: async () => fetchTokenFromMyServerForUser("bob@contoso.com"), - refreshProactively: true + refreshProactively: true, }); ``` @@ -71,12 +78,14 @@ const tokenCredential = new AzureCommunicationTokenCredential({ tokenRefresher: async () => fetchTokenFromMyServerForUser("bob@contoso.com"), refreshProactively: true, token: - "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjM2MDB9.adM-ddBZZlQ1WlN3pdPBOF5G4Wh9iZpxNP_fSvpF4cWs" + "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjM2MDB9.adM-ddBZZlQ1WlN3pdPBOF5G4Wh9iZpxNP_fSvpF4cWs", }); ``` ## Troubleshooting +- **Invalid token specified**: Make sure the token you are passing to the `AzureCommunicationTokenCredential` constructor or to the `tokenRefresher` callback is a bare JWT token string. E.g. if you're using the [Azure Communication Identity library][invalid_token_sdk] or [REST API][invalid_token_rest] to obtain the token, make sure you're passing just the `token` part of the response object. + ## Next steps - [Read more about Communication user access tokens](https://docs.microsoft.com/azure/communication-services/concepts/authentication?tabs=javascript) @@ -93,5 +102,7 @@ If you'd like to contribute to this library, please read the [contributing guide [azure_sub]: https://azure.microsoft.com/free/ [azure_portal]: https://portal.azure.com [azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice +[invalid_token_sdk]: https://docs.microsoft.com/javascript/api/@azure/communication-identity/communicationaccesstoken#@azure-communication-identity-communicationaccesstoken-token +[invalid_token_rest]: https://docs.microsoft.com/rest/api/communication/communicationidentity/communication-identity/issue-access-token#communicationidentityaccesstoken ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-sms%2FREADME.png) diff --git a/sdk/communication/communication-common/package.json b/sdk/communication/communication-common/package.json index 4f24e0616cd7..39a0c1dd40f5 100644 --- a/sdk/communication/communication-common/package.json +++ b/sdk/communication/communication-common/package.json @@ -1,6 +1,6 @@ { "name": "@azure/communication-common", - "version": "1.1.1", + "version": "1.2.0", "description": "Common package for Azure Communication services.", "sdk-type": "client", "main": "dist/index.js", diff --git a/sdk/communication/communication-common/src/autoRefreshTokenCredential.ts b/sdk/communication/communication-common/src/autoRefreshTokenCredential.ts index cbeab9a2783a..c6896faf08a2 100644 --- a/sdk/communication/communication-common/src/autoRefreshTokenCredential.ts +++ b/sdk/communication/communication-common/src/autoRefreshTokenCredential.ts @@ -10,7 +10,8 @@ import { TokenCredential, CommunicationGetTokenOptions } from "./communicationTo */ export interface CommunicationTokenRefreshOptions { /** - * Function that returns a token acquired from the Communication configuration SDK. + * Callback function that returns a string JWT token acquired from the Communication Identity API. + * The returned token must be valid (expiration date must be in the future). */ tokenRefresher: (abortSignal?: AbortSignalLike) => Promise; @@ -28,12 +29,14 @@ export interface CommunicationTokenRefreshOptions { const expiredToken = { token: "", expiresOnTimestamp: -10 }; const minutesToMs = (minutes: number): number => minutes * 1000 * 60; -const defaultRefreshingInterval = minutesToMs(10); +const defaultExpiringSoonInterval = minutesToMs(10); +const defaultRefreshAfterLifetimePercentage = 0.5; export class AutoRefreshTokenCredential implements TokenCredential { private readonly refresh: (abortSignal?: AbortSignalLike) => Promise; private readonly refreshProactively: boolean; - private readonly refreshingIntervalInMs: number = defaultRefreshingInterval; + private readonly expiringSoonIntervalInMs: number = defaultExpiringSoonInterval; + private readonly refreshAfterLifetimePercentage = defaultRefreshAfterLifetimePercentage; private currentToken: AccessToken; private activeTimeout: ReturnType | undefined; @@ -54,13 +57,12 @@ export class AutoRefreshTokenCredential implements TokenCredential { } public async getToken(options?: CommunicationGetTokenOptions): Promise { - if (!this.isCurrentTokenExpiringSoon) { + if (!this.isTokenExpiringSoon(this.currentToken)) { return this.currentToken; } - const updatePromise = this.updateTokenAndReschedule(options?.abortSignal); - - if (!this.isCurrentTokenValid) { + if (!this.isTokenValid(this.currentToken)) { + const updatePromise = this.updateTokenAndReschedule(options?.abortSignal); await updatePromise; } @@ -90,7 +92,13 @@ export class AutoRefreshTokenCredential implements TokenCredential { } private async refreshTokenAndReschedule(abortSignal?: AbortSignalLike): Promise { - this.currentToken = await this.refreshToken(abortSignal); + const newToken = await this.refreshToken(abortSignal); + + if (!this.isTokenValid(newToken)) { + throw new Error("The token returned from the tokenRefresher is expired."); + } + + this.currentToken = newToken; if (this.refreshProactively) { this.scheduleRefresh(); } @@ -114,19 +122,25 @@ export class AutoRefreshTokenCredential implements TokenCredential { if (this.activeTimeout) { clearTimeout(this.activeTimeout); } - const timespanInMs = - this.currentToken.expiresOnTimestamp - Date.now() - this.refreshingIntervalInMs; + const tokenTtlInMs = this.currentToken.expiresOnTimestamp - Date.now(); + let timespanInMs = null; + + if (this.isTokenExpiringSoon(this.currentToken)) { + // Schedule the next refresh for when it reaches a certain percentage of the remaining lifetime. + timespanInMs = tokenTtlInMs * this.refreshAfterLifetimePercentage; + } else { + // Schedule the next refresh for when it gets in to the soon-to-expire window. + timespanInMs = tokenTtlInMs - this.expiringSoonIntervalInMs; + } + this.activeTimeout = setTimeout(() => this.updateTokenAndReschedule(), timespanInMs); } - private get isCurrentTokenValid(): boolean { - return this.currentToken && Date.now() < this.currentToken.expiresOnTimestamp; + private isTokenValid(token: AccessToken): boolean { + return token && Date.now() < token.expiresOnTimestamp; } - private get isCurrentTokenExpiringSoon(): boolean { - return ( - !this.currentToken || - Date.now() >= this.currentToken.expiresOnTimestamp - this.refreshingIntervalInMs - ); + private isTokenExpiringSoon(token: AccessToken): boolean { + return !token || Date.now() >= token.expiresOnTimestamp - this.expiringSoonIntervalInMs; } } diff --git a/sdk/communication/communication-common/test/communicationTokenCredential.spec.ts b/sdk/communication/communication-common/test/communicationTokenCredential.spec.ts index 7e566d0f94f7..7c28bc4d3327 100644 --- a/sdk/communication/communication-common/test/communicationTokenCredential.spec.ts +++ b/sdk/communication/communication-common/test/communicationTokenCredential.spec.ts @@ -25,6 +25,16 @@ const exposeInternalTimeout = ( return ((tokenCredential as any).tokenCredential as any).activeTimeout; }; +const getDivisionWithoutFractionCount = (dividend: number, divisor: number): number => { + let i = dividend; + let result = 0; + while (i >= divisor) { + i = Math.round(i / divisor); + result++; + } + return result; +}; + const exposeInternalUpdatePromise = async ( tokenCredential: AzureCommunicationTokenCredential ): Promise => { @@ -101,13 +111,17 @@ describe("CommunicationTokenCredential", () => { sinon.assert.notCalled(tokenRefresher); }); - it("with proactive refresh, passing an expired token triggers immediate refresh", async () => { + it("throws if tokenRefresher returns an expired token", async () => { const tokenRefresher = sinon.stub().resolves(generateToken(-1)); - new AzureCommunicationTokenCredential({ - tokenRefresher, - refreshProactively: true, + const credential = new AzureCommunicationTokenCredential({ + tokenRefresher: tokenRefresher, }); clock.tick(5 * 60 * 1000); + await assert.isRejected( + credential.getToken(), + Error, + "The token returned from the tokenRefresher is expired." + ); sinon.assert.calledOnce(tokenRefresher); }); @@ -139,7 +153,7 @@ describe("CommunicationTokenCredential", () => { await assert.isRejected(withLambda.getToken()); }); - it("doesn't swallow error from tokenrefresher", async () => { + it("doesn't swallow error from tokenRefresher", async () => { const tokenRefresher = sinon.stub().throws(new Error("No token for you!")); const tokenCredential = new AzureCommunicationTokenCredential({ tokenRefresher, @@ -157,7 +171,7 @@ describe("CommunicationTokenCredential", () => { assert.strictEqual(tokenResult.token, token); tokenRefresher.resolves(newToken); - // go into soon to expire window + // go into the soon-to-expire window clock.tick(19 * 60 * 1000); const secondTokenResult = await tokenCredential.getToken(); @@ -181,7 +195,7 @@ describe("CommunicationTokenCredential", () => { token: token(), }); - // go into soon to expire window + // go into the soon-to-expire window clock.tick(19 * 60 * 1000); sinon.assert.calledOnce(tokenRefresher); }); @@ -196,7 +210,7 @@ describe("CommunicationTokenCredential", () => { }); const internalTimeout = exposeInternalTimeout(tokenCredential); - // go into soon to expire window + // go into the soon-to-expire window clock.tick(19 * 60 * 1000); await exposeInternalUpdatePromise(tokenCredential); @@ -217,7 +231,7 @@ describe("CommunicationTokenCredential", () => { }); tokenCredential.dispose(); - // go into soon to expire window + // go into the soon-to-expire window clock.tick(19 * 60 * 1000); sinon.assert.notCalled(tokenRefresher); }); @@ -240,9 +254,53 @@ describe("CommunicationTokenCredential", () => { refreshProactively: true, }); - // go into soon to expire window + // go into the soon-to-expire window clock.tick(19 * 60 * 1000); await tokenCredential.getToken(); sinon.assert.calledOnce(tokenRefresher); }); + + it("applies fractional backoff when the token is about to expire", async () => { + const defaultRefreshAfterLifetimePercentage = 0.5; + const tokenExpiration = 20; + const expectedPreBackOffCallCount = 1; + const lastMsCall = 1; + const expectedTotalCallCount = + expectedPreBackOffCallCount + + getDivisionWithoutFractionCount( + tokenExpiration * 60 * 1000, + 1 / defaultRefreshAfterLifetimePercentage + ) - + lastMsCall; + const staticToken = generateToken(tokenExpiration); + const tokenRefresher = sinon.stub().resolves(((): string => staticToken)()); // keep returning the same token for the duration of the test + const tokenCredential = new AzureCommunicationTokenCredential({ + tokenRefresher, + refreshProactively: true, + token: staticToken, + }); + + const newToken = await tokenCredential.getToken(); + + // go into the soon-to-expire window + for (let i = 0; i < 10 * 60 * 1000; i++) { + // perform token refreshing & scheduling + await exposeInternalUpdatePromise(tokenCredential); + clock.tick(1); + } + + // expect the token to be refreshed only once within the first 10 minutes + sinon.assert.callCount(tokenRefresher, expectedPreBackOffCallCount); + + // iterate until the penultimate millisecond of the token expiration + // to prevent an exception being thrown due to the token being expired + while (newToken.expiresOnTimestamp - Date.now() > lastMsCall) { + // perform token refreshing & scheduling + await exposeInternalUpdatePromise(tokenCredential); + clock.tick(1); + } + + // expect the token to be refreshed approx. Math.floor(Math.log(tokenExpirationInMs) / Math.log(2)) times + sinon.assert.callCount(tokenRefresher, expectedTotalCallCount); + }); }); From 0fc2cda292a2fd59f09eee3cb93861d0dd429927 Mon Sep 17 00:00:00 2001 From: EmmaZhu-MSFT Date: Fri, 28 Jan 2022 01:18:07 +0800 Subject: [PATCH 15/26] Enable storage-queue sample execution (#20097) --- sdk/storage/storage-queue/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/storage/storage-queue/package.json b/sdk/storage/storage-queue/package.json index e9db31d17492..a42cdd4df596 100644 --- a/sdk/storage/storage-queue/package.json +++ b/sdk/storage/storage-queue/package.json @@ -35,7 +35,7 @@ "clean": "rimraf dist dist-* types temp statistics.html coverage coverage-browser .nyc_output *.tgz *.log test*.xml TEST*.xml", "clean:samples": "rimraf samples/v12/javascript/node_modules samples/v12/typescript/node_modules samples/v12/typescript/dist samples/v12/typescript/package-lock.json samples/v12/javascript/package-lock.json", "extract-api": "tsc -p . && api-extractor run --local", - "execute:samples": "dev-tool run samples-dev", + "execute:samples": "dev-tool samples run samples-dev", "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"", "generate:client": "autorest --typescript ./swagger/README.md", "integration-test:browser": "karma start --single-run", From 4edb8fec9035a445d52f7a9706ab3dbe833b681e Mon Sep 17 00:00:00 2001 From: Jose Manuel Heredia Hidalgo Date: Thu, 27 Jan 2022 11:58:52 -0600 Subject: [PATCH 16/26] [Agrifood Farming] Regenerate with latest codegen (#20059) **Checklists** - [x] Added impacted package name to the issue description **Packages impacted by this PR:** @azure-rest/agrifood-farming **Describe the problem that is addressed by this PR:** Re-generate Agrifood Farming using the latest version of RLC generator. This package was one of the first-ever RLCs generated and codegen has changes quite a bit since then. Regenerating against the same swagger. Major changes since last generation: - Switched away from @azure-rest/core-client-lro and @azure-rest/core-client-paging in favor of @azure/core-lro and @azure/core-client - Split Output and Input models **Does this PR needs any fixes in the SDK Generator?** _(If so, create an Issue in the [Autorest/typescript](https://github.com/Azure/autorest.typescript) repository and link it here)_ NO **Are there test cases added in this PR?**_(If not, why?)_ NO, it already has tests **Provide a list of related PRs**_(if any)_ https://github.com/Azure/azure-sdk-for-js/pull/19897 **Command used to generate this PR:**_(Applicable only to SDK release request PRs)_ `rushx generate:client` --- .../agrifood-farming-rest/CHANGELOG.md | 1 + .../agrifood-farming-rest/package.json | 6 +- .../review/agrifood-farming.api.md | 2538 ++++++++++------- .../agrifood-farming-rest/src/farmBeats.ts | 130 +- .../agrifood-farming-rest/src/getPoller.ts | 26 - .../agrifood-farming-rest/src/index.ts | 8 +- .../agrifood-farming-rest/src/models.ts | 705 +---- .../agrifood-farming-rest/src/outputModels.ts | 1220 ++++++++ .../src/paginateHelper.ts | 131 + .../agrifood-farming-rest/src/paging.ts | 37 - .../agrifood-farming-rest/src/parameters.ts | 988 ++++--- .../src/pollingHelper.ts | 66 + .../agrifood-farming-rest/src/responses.ts | 473 +-- .../agrifood-farming-rest/swagger/README.md | 7 +- .../test/public/farmHeirarchy.spec.ts | 4 +- 15 files changed, 3941 insertions(+), 2399 deletions(-) delete mode 100644 sdk/agrifood/agrifood-farming-rest/src/getPoller.ts create mode 100644 sdk/agrifood/agrifood-farming-rest/src/outputModels.ts create mode 100644 sdk/agrifood/agrifood-farming-rest/src/paginateHelper.ts delete mode 100644 sdk/agrifood/agrifood-farming-rest/src/paging.ts create mode 100644 sdk/agrifood/agrifood-farming-rest/src/pollingHelper.ts diff --git a/sdk/agrifood/agrifood-farming-rest/CHANGELOG.md b/sdk/agrifood/agrifood-farming-rest/CHANGELOG.md index e9261131b5e5..af32c9892b38 100644 --- a/sdk/agrifood/agrifood-farming-rest/CHANGELOG.md +++ b/sdk/agrifood/agrifood-farming-rest/CHANGELOG.md @@ -4,6 +4,7 @@ ### Features Added +- Re-generate with latest generator version. This contains splitting models into input and output models and typing improvements [#20059](https://github.com/Azure/azure-sdk-for-js/pull/20059) - Export pagination helper function. [#15831](https://github.com/Azure/azure-sdk-for-js/pull/15831) ## 1.0.0-beta.1 (2021-05-26) diff --git a/sdk/agrifood/agrifood-farming-rest/package.json b/sdk/agrifood/agrifood-farming-rest/package.json index 2607fe539035..fbd0e20758c8 100644 --- a/sdk/agrifood/agrifood-farming-rest/package.json +++ b/sdk/agrifood/agrifood-farming-rest/package.json @@ -82,10 +82,10 @@ "sideEffects": false, "autoPublish": false, "dependencies": { - "@azure/core-auth": "^1.3.0", - "@azure-rest/core-client-paging": "1.0.0-beta.1", "@azure-rest/core-client": "1.0.0-beta.7", - "@azure-rest/core-client-lro": "1.0.0-beta.1", + "@azure/core-auth": "^1.3.0", + "@azure/core-lro": "^2.2.4", + "@azure/core-paging": "^1.2.2", "@azure/logger": "^1.0.0", "tslib": "^2.2.0" }, diff --git a/sdk/agrifood/agrifood-farming-rest/review/agrifood-farming.api.md b/sdk/agrifood/agrifood-farming-rest/review/agrifood-farming.api.md index 284ca459ab02..445423e1b3eb 100644 --- a/sdk/agrifood/agrifood-farming-rest/review/agrifood-farming.api.md +++ b/sdk/agrifood/agrifood-farming-rest/review/agrifood-farming.api.md @@ -7,33 +7,33 @@ import { Client } from '@azure-rest/core-client'; import { ClientOptions } from '@azure-rest/core-client'; import { HttpResponse } from '@azure-rest/core-client'; -import { PagedAsyncIterableIterator } from '@azure-rest/core-client-paging'; +import { LroEngineOptions } from '@azure/core-lro'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; import { PathUncheckedResponse } from '@azure-rest/core-client'; -import { PollerLike } from '@azure-rest/core-client-lro'; -import { PollerOptions } from '@azure-rest/core-client-lro'; -import { PollOperationState } from '@azure-rest/core-client-lro'; +import { PollerLike } from '@azure/core-lro'; +import { PollOperationState } from '@azure/core-lro'; import { RequestParameters } from '@azure-rest/core-client'; import { TokenCredential } from '@azure/core-auth'; // @public (undocumented) export interface ApplicationData { - applicationProductDetails?: ApplicationProductDetail[]; + applicationProductDetails?: Array; area?: Measure; associatedBoundaryId?: string; attachmentsLink?: string; avgMaterial?: Measure; - createdDateTime?: Date; + createdDateTime?: Date | string; description?: string; eTag?: string; farmerId?: string; id?: string; - modifiedDateTime?: Date; + modifiedDateTime?: Date | string; name?: string; operationBoundaryId?: string; - operationEndDateTime?: Date; - operationModifiedDateTime?: Date; - operationStartDateTime?: Date; - properties?: ApplicationDataPropertiesDictionary; + operationEndDateTime?: Date | string; + operationModifiedDateTime?: Date | string; + operationStartDateTime?: Date | string; + properties?: Record; source?: string; status?: string; totalMaterial?: Measure; @@ -42,7 +42,7 @@ export interface ApplicationData { // @public export interface ApplicationDataCreateOrUpdate200Response extends HttpResponse { // (undocumented) - body: ApplicationData; + body: ApplicationDataOutput; // (undocumented) status: "200"; } @@ -50,37 +50,36 @@ export interface ApplicationDataCreateOrUpdate200Response extends HttpResponse { // @public export interface ApplicationDataCreateOrUpdate201Response extends HttpResponse { // (undocumented) - body: ApplicationData; + body: ApplicationDataOutput; // (undocumented) status: "201"; } // @public (undocumented) export interface ApplicationDataCreateOrUpdateBodyParam { - // (undocumented) body?: ApplicationData; } // @public export interface ApplicationDataCreateOrUpdatedefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type ApplicationDataCreateOrUpdateParameters = RequestParameters & ApplicationDataCreateOrUpdateBodyParam; +export interface ApplicationDataCreateOrUpdateMediaTypesParam { + contentType?: "application/merge-patch+json"; +} // @public (undocumented) -export interface ApplicationDataDelete { - delete(options?: ApplicationDataDeleteParameters): Promise; - get(options?: ApplicationDataGetParameters): Promise; - patch(options?: ApplicationDataCreateOrUpdateParameters): Promise; -} +export type ApplicationDataCreateOrUpdateParameters = ApplicationDataCreateOrUpdateMediaTypesParam & ApplicationDataCreateOrUpdateBodyParam & RequestParameters; // @public export interface ApplicationDataDelete204Response extends HttpResponse { + // (undocumented) + body: Record; // (undocumented) status: "204"; } @@ -88,7 +87,7 @@ export interface ApplicationDataDelete204Response extends HttpResponse { // @public export interface ApplicationDataDeletedefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } @@ -96,10 +95,17 @@ export interface ApplicationDataDeletedefaultResponse extends HttpResponse { // @public (undocumented) export type ApplicationDataDeleteParameters = RequestParameters; +// @public (undocumented) +export interface ApplicationDataGet { + delete(options?: ApplicationDataDeleteParameters): Promise; + get(options?: ApplicationDataGetParameters): Promise; + patch(options?: ApplicationDataCreateOrUpdateParameters): Promise; +} + // @public export interface ApplicationDataGet200Response extends HttpResponse { // (undocumented) - body: ApplicationData; + body: ApplicationDataOutput; // (undocumented) status: "200"; } @@ -107,7 +113,7 @@ export interface ApplicationDataGet200Response extends HttpResponse { // @public export interface ApplicationDataGetdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } @@ -123,7 +129,7 @@ export interface ApplicationDataList { // @public export interface ApplicationDataList200Response extends HttpResponse { // (undocumented) - body: ApplicationDataListResponse; + body: ApplicationDataListResponseOutput; // (undocumented) status: "200"; } @@ -136,7 +142,7 @@ export interface ApplicationDataListByFarmerId { // @public export interface ApplicationDataListByFarmerId200Response extends HttpResponse { // (undocumented) - body: ApplicationDataListResponse; + body: ApplicationDataListResponseOutput; // (undocumented) status: "200"; } @@ -144,13 +150,13 @@ export interface ApplicationDataListByFarmerId200Response extends HttpResponse { // @public export interface ApplicationDataListByFarmerIddefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type ApplicationDataListByFarmerIdParameters = RequestParameters & ApplicationDataListByFarmerIdQueryParam; +export type ApplicationDataListByFarmerIdParameters = ApplicationDataListByFarmerIdQueryParam & RequestParameters; // @public (undocumented) export interface ApplicationDataListByFarmerIdQueryParam { @@ -162,41 +168,41 @@ export interface ApplicationDataListByFarmerIdQueryParam { export interface ApplicationDataListByFarmerIdQueryParamProperties { $maxPageSize?: number; $skipToken?: string; - associatedBoundaryIds?: string[]; - ids?: string[]; + associatedBoundaryIds?: Array; + ids?: Array; maxArea?: number; maxAvgMaterial?: number; - maxCreatedDateTime?: Date; - maxLastModifiedDateTime?: Date; - maxOperationEndDateTime?: Date; - maxOperationModifiedDateTime?: Date; - maxOperationStartDateTime?: Date; + maxCreatedDateTime?: Date | string; + maxLastModifiedDateTime?: Date | string; + maxOperationEndDateTime?: Date | string; + maxOperationModifiedDateTime?: Date | string; + maxOperationStartDateTime?: Date | string; maxTotalMaterial?: number; minArea?: number; minAvgMaterial?: number; - minCreatedDateTime?: Date; - minLastModifiedDateTime?: Date; - minOperationEndDateTime?: Date; - minOperationModifiedDateTime?: Date; - minOperationStartDateTime?: Date; + minCreatedDateTime?: Date | string; + minLastModifiedDateTime?: Date | string; + minOperationEndDateTime?: Date | string; + minOperationModifiedDateTime?: Date | string; + minOperationStartDateTime?: Date | string; minTotalMaterial?: number; - names?: string[]; - operationBoundaryIds?: string[]; - propertyFilters?: string[]; - sources?: string[]; - statuses?: string[]; + names?: Array; + operationBoundaryIds?: Array; + propertyFilters?: Array; + sources?: Array; + statuses?: Array; } // @public export interface ApplicationDataListdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type ApplicationDataListParameters = RequestParameters & ApplicationDataListQueryParam; +export type ApplicationDataListParameters = ApplicationDataListQueryParam & RequestParameters; // @public (undocumented) export interface ApplicationDataListQueryParam { @@ -208,40 +214,61 @@ export interface ApplicationDataListQueryParam { export interface ApplicationDataListQueryParamProperties { $maxPageSize?: number; $skipToken?: string; - associatedBoundaryIds?: string[]; - ids?: string[]; + associatedBoundaryIds?: Array; + ids?: Array; maxArea?: number; maxAvgMaterial?: number; - maxCreatedDateTime?: Date; - maxLastModifiedDateTime?: Date; - maxOperationEndDateTime?: Date; - maxOperationModifiedDateTime?: Date; - maxOperationStartDateTime?: Date; + maxCreatedDateTime?: Date | string; + maxLastModifiedDateTime?: Date | string; + maxOperationEndDateTime?: Date | string; + maxOperationModifiedDateTime?: Date | string; + maxOperationStartDateTime?: Date | string; maxTotalMaterial?: number; minArea?: number; minAvgMaterial?: number; - minCreatedDateTime?: Date; - minLastModifiedDateTime?: Date; - minOperationEndDateTime?: Date; - minOperationModifiedDateTime?: Date; - minOperationStartDateTime?: Date; + minCreatedDateTime?: Date | string; + minLastModifiedDateTime?: Date | string; + minOperationEndDateTime?: Date | string; + minOperationModifiedDateTime?: Date | string; + minOperationStartDateTime?: Date | string; minTotalMaterial?: number; - names?: string[]; - operationBoundaryIds?: string[]; - propertyFilters?: string[]; - sources?: string[]; - statuses?: string[]; + names?: Array; + operationBoundaryIds?: Array; + propertyFilters?: Array; + sources?: Array; + statuses?: Array; } // @public (undocumented) -export interface ApplicationDataListResponse { +export interface ApplicationDataListResponseOutput { + $skipToken?: string; nextLink?: string; - skipToken?: string; - value?: ApplicationData[]; + value?: Array; } // @public (undocumented) -export type ApplicationDataPropertiesDictionary = Record; +export interface ApplicationDataOutput { + applicationProductDetails?: Array; + area?: MeasureOutput; + associatedBoundaryId?: string; + attachmentsLink?: string; + avgMaterial?: MeasureOutput; + createdDateTime?: string; + description?: string; + eTag?: string; + farmerId?: string; + id?: string; + modifiedDateTime?: string; + name?: string; + operationBoundaryId?: string; + operationEndDateTime?: string; + operationModifiedDateTime?: string; + operationStartDateTime?: string; + properties?: Record; + source?: string; + status?: string; + totalMaterial?: MeasureOutput; +} // @public (undocumented) export interface ApplicationProductDetail { @@ -252,13 +279,28 @@ export interface ApplicationProductDetail { } // @public (undocumented) -export interface Attachment { - createdDateTime?: Date; +export interface ApplicationProductDetailOutput { + avgMaterial?: MeasureOutput; + isCarrier?: boolean; + productName?: string; + totalMaterial?: MeasureOutput; +} + +// @public (undocumented) +export interface AttachmentListResponseOutput { + $skipToken?: string; + nextLink?: string; + value?: Array; +} + +// @public (undocumented) +export interface AttachmentOutput { + createdDateTime?: string; description?: string; eTag?: string; farmerId?: string; id?: string; - modifiedDateTime?: Date; + modifiedDateTime?: string; name?: string; originalFileName?: string; resourceId?: string; @@ -266,17 +308,10 @@ export interface Attachment { status?: string; } -// @public (undocumented) -export interface AttachmentListResponse { - nextLink?: string; - skipToken?: string; - value?: Attachment[]; -} - // @public export interface AttachmentsCreateOrUpdate200Response extends HttpResponse { // (undocumented) - body: Attachment; + body: AttachmentOutput; // (undocumented) status: "200"; } @@ -284,37 +319,36 @@ export interface AttachmentsCreateOrUpdate200Response extends HttpResponse { // @public export interface AttachmentsCreateOrUpdate201Response extends HttpResponse { // (undocumented) - body: Attachment; + body: AttachmentOutput; // (undocumented) status: "201"; } // @public (undocumented) export interface AttachmentsCreateOrUpdateBodyParam { - // (undocumented) body?: string; } // @public export interface AttachmentsCreateOrUpdatedefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type AttachmentsCreateOrUpdateParameters = RequestParameters & AttachmentsCreateOrUpdateBodyParam; +export interface AttachmentsCreateOrUpdateMediaTypesParam { + contentType?: "multipart/form-data"; +} // @public (undocumented) -export interface AttachmentsDelete { - delete(options?: AttachmentsDeleteParameters): Promise; - get(options?: AttachmentsGetParameters): Promise; - patch(options?: AttachmentsCreateOrUpdateParameters): Promise; -} +export type AttachmentsCreateOrUpdateParameters = AttachmentsCreateOrUpdateMediaTypesParam & AttachmentsCreateOrUpdateBodyParam & RequestParameters; // @public export interface AttachmentsDelete204Response extends HttpResponse { + // (undocumented) + body: Record; // (undocumented) status: "204"; } @@ -322,7 +356,7 @@ export interface AttachmentsDelete204Response extends HttpResponse { // @public export interface AttachmentsDeletedefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } @@ -337,6 +371,8 @@ export interface AttachmentsDownload { // @public export interface AttachmentsDownload200Response extends HttpResponse { + // (undocumented) + body: Record; // (undocumented) status: "200"; } @@ -344,7 +380,7 @@ export interface AttachmentsDownload200Response extends HttpResponse { // @public export interface AttachmentsDownloaddefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } @@ -352,10 +388,17 @@ export interface AttachmentsDownloaddefaultResponse extends HttpResponse { // @public (undocumented) export type AttachmentsDownloadParameters = RequestParameters; +// @public (undocumented) +export interface AttachmentsGet { + delete(options?: AttachmentsDeleteParameters): Promise; + get(options?: AttachmentsGetParameters): Promise; + patch(options?: AttachmentsCreateOrUpdateParameters): Promise; +} + // @public export interface AttachmentsGet200Response extends HttpResponse { // (undocumented) - body: Attachment; + body: AttachmentOutput; // (undocumented) status: "200"; } @@ -363,7 +406,7 @@ export interface AttachmentsGet200Response extends HttpResponse { // @public export interface AttachmentsGetdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } @@ -379,7 +422,7 @@ export interface AttachmentsListByFarmerId { // @public export interface AttachmentsListByFarmerId200Response extends HttpResponse { // (undocumented) - body: AttachmentListResponse; + body: AttachmentListResponseOutput; // (undocumented) status: "200"; } @@ -387,13 +430,13 @@ export interface AttachmentsListByFarmerId200Response extends HttpResponse { // @public export interface AttachmentsListByFarmerIddefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type AttachmentsListByFarmerIdParameters = RequestParameters & AttachmentsListByFarmerIdQueryParam; +export type AttachmentsListByFarmerIdParameters = AttachmentsListByFarmerIdQueryParam & RequestParameters; // @public (undocumented) export interface AttachmentsListByFarmerIdQueryParam { @@ -405,28 +448,22 @@ export interface AttachmentsListByFarmerIdQueryParam { export interface AttachmentsListByFarmerIdQueryParamProperties { $maxPageSize?: number; $skipToken?: string; - ids?: string[]; - maxCreatedDateTime?: Date; - maxLastModifiedDateTime?: Date; - minCreatedDateTime?: Date; - minLastModifiedDateTime?: Date; - names?: string[]; - propertyFilters?: string[]; - resourceIds?: string[]; - resourceTypes?: string[]; - statuses?: string[]; -} - -// @public (undocumented) -export interface BoundariesCreateCascadeDeleteJob { - get(options?: BoundariesGetCascadeDeleteJobDetailsParameters): Promise; - put(options?: BoundariesCreateCascadeDeleteJobParameters): Promise; + ids?: Array; + maxCreatedDateTime?: Date | string; + maxLastModifiedDateTime?: Date | string; + minCreatedDateTime?: Date | string; + minLastModifiedDateTime?: Date | string; + names?: Array; + propertyFilters?: Array; + resourceIds?: Array; + resourceTypes?: Array; + statuses?: Array; } // @public export interface BoundariesCreateCascadeDeleteJob202Response extends HttpResponse { // (undocumented) - body: CascadeDeleteJob; + body: CascadeDeleteJobOutput; // (undocumented) status: "202"; } @@ -434,13 +471,13 @@ export interface BoundariesCreateCascadeDeleteJob202Response extends HttpRespons // @public export interface BoundariesCreateCascadeDeleteJobdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type BoundariesCreateCascadeDeleteJobParameters = RequestParameters & BoundariesCreateCascadeDeleteJobQueryParam; +export type BoundariesCreateCascadeDeleteJobParameters = BoundariesCreateCascadeDeleteJobQueryParam & RequestParameters; // @public (undocumented) export interface BoundariesCreateCascadeDeleteJobQueryParam { @@ -457,7 +494,7 @@ export interface BoundariesCreateCascadeDeleteJobQueryParamProperties { // @public export interface BoundariesCreateOrUpdate200Response extends HttpResponse { // (undocumented) - body: Boundary; + body: BoundaryOutput; // (undocumented) status: "200"; } @@ -465,37 +502,36 @@ export interface BoundariesCreateOrUpdate200Response extends HttpResponse { // @public export interface BoundariesCreateOrUpdate201Response extends HttpResponse { // (undocumented) - body: Boundary; + body: BoundaryOutput; // (undocumented) status: "201"; } // @public (undocumented) export interface BoundariesCreateOrUpdateBodyParam { - // (undocumented) body?: Boundary; } // @public export interface BoundariesCreateOrUpdatedefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type BoundariesCreateOrUpdateParameters = RequestParameters & BoundariesCreateOrUpdateBodyParam; +export interface BoundariesCreateOrUpdateMediaTypesParam { + contentType?: "application/merge-patch+json"; +} // @public (undocumented) -export interface BoundariesDelete { - delete(options?: BoundariesDeleteParameters): Promise; - get(options?: BoundariesGetParameters): Promise; - patch(options?: BoundariesCreateOrUpdateParameters): Promise; -} +export type BoundariesCreateOrUpdateParameters = BoundariesCreateOrUpdateMediaTypesParam & BoundariesCreateOrUpdateBodyParam & RequestParameters; // @public export interface BoundariesDelete204Response extends HttpResponse { + // (undocumented) + body: Record; // (undocumented) status: "204"; } @@ -503,7 +539,7 @@ export interface BoundariesDelete204Response extends HttpResponse { // @public export interface BoundariesDeletedefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } @@ -511,18 +547,31 @@ export interface BoundariesDeletedefaultResponse extends HttpResponse { // @public (undocumented) export type BoundariesDeleteParameters = RequestParameters; +// @public (undocumented) +export interface BoundariesGet { + delete(options?: BoundariesDeleteParameters): Promise; + get(options?: BoundariesGetParameters): Promise; + patch(options?: BoundariesCreateOrUpdateParameters): Promise; +} + // @public export interface BoundariesGet200Response extends HttpResponse { // (undocumented) - body: Boundary; + body: BoundaryOutput; // (undocumented) status: "200"; } +// @public (undocumented) +export interface BoundariesGetCascadeDeleteJobDetails { + get(options?: BoundariesGetCascadeDeleteJobDetailsParameters): Promise; + put(options: BoundariesCreateCascadeDeleteJobParameters): Promise; +} + // @public export interface BoundariesGetCascadeDeleteJobDetails200Response extends HttpResponse { // (undocumented) - body: CascadeDeleteJob; + body: CascadeDeleteJobOutput; // (undocumented) status: "200"; } @@ -530,7 +579,7 @@ export interface BoundariesGetCascadeDeleteJobDetails200Response extends HttpRes // @public export interface BoundariesGetCascadeDeleteJobDetailsdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } @@ -541,20 +590,20 @@ export type BoundariesGetCascadeDeleteJobDetailsParameters = RequestParameters; // @public export interface BoundariesGetdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) export interface BoundariesGetOverlap { - get(options?: BoundariesGetOverlapParameters): Promise; + get(options: BoundariesGetOverlapParameters): Promise; } // @public export interface BoundariesGetOverlap200Response extends HttpResponse { // (undocumented) - body: BoundaryOverlapResponse; + body: BoundaryOverlapResponseOutput; // (undocumented) status: "200"; } @@ -562,13 +611,13 @@ export interface BoundariesGetOverlap200Response extends HttpResponse { // @public export interface BoundariesGetOverlapdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type BoundariesGetOverlapParameters = RequestParameters & BoundariesGetOverlapQueryParam; +export type BoundariesGetOverlapParameters = BoundariesGetOverlapQueryParam & RequestParameters; // @public (undocumented) export interface BoundariesGetOverlapQueryParam { @@ -585,18 +634,30 @@ export interface BoundariesGetOverlapQueryParamProperties { // @public (undocumented) export type BoundariesGetParameters = RequestParameters; +// @public (undocumented) +export interface BoundariesList { + get(options?: BoundariesListParameters): Promise; + post(options?: BoundariesSearchParameters): Promise; +} + // @public export interface BoundariesList200Response extends HttpResponse { // (undocumented) - body: BoundaryListResponse; + body: BoundaryListResponseOutput; // (undocumented) status: "200"; } +// @public (undocumented) +export interface BoundariesListByFarmerId { + get(options?: BoundariesListByFarmerIdParameters): Promise; + post(options?: BoundariesSearchByFarmerIdParameters): Promise; +} + // @public export interface BoundariesListByFarmerId200Response extends HttpResponse { // (undocumented) - body: BoundaryListResponse; + body: BoundaryListResponseOutput; // (undocumented) status: "200"; } @@ -604,13 +665,13 @@ export interface BoundariesListByFarmerId200Response extends HttpResponse { // @public export interface BoundariesListByFarmerIddefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type BoundariesListByFarmerIdParameters = RequestParameters & BoundariesListByFarmerIdQueryParam; +export type BoundariesListByFarmerIdParameters = BoundariesListByFarmerIdQueryParam & RequestParameters; // @public (undocumented) export interface BoundariesListByFarmerIdQueryParam { @@ -622,31 +683,31 @@ export interface BoundariesListByFarmerIdQueryParam { export interface BoundariesListByFarmerIdQueryParamProperties { $maxPageSize?: number; $skipToken?: string; - ids?: string[]; + ids?: Array; isPrimary?: boolean; maxAcreage?: number; - maxCreatedDateTime?: Date; - maxLastModifiedDateTime?: Date; + maxCreatedDateTime?: Date | string; + maxLastModifiedDateTime?: Date | string; minAcreage?: number; - minCreatedDateTime?: Date; - minLastModifiedDateTime?: Date; - names?: string[]; - parentIds?: string[]; + minCreatedDateTime?: Date | string; + minLastModifiedDateTime?: Date | string; + names?: Array; + parentIds?: Array; parentType?: string; - propertyFilters?: string[]; - statuses?: string[]; + propertyFilters?: Array; + statuses?: Array; } // @public export interface BoundariesListdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type BoundariesListParameters = RequestParameters & BoundariesListQueryParam; +export type BoundariesListParameters = BoundariesListQueryParam & RequestParameters; // @public (undocumented) export interface BoundariesListQueryParam { @@ -658,166 +719,184 @@ export interface BoundariesListQueryParam { export interface BoundariesListQueryParamProperties { $maxPageSize?: number; $skipToken?: string; - ids?: string[]; + ids?: Array; isPrimary?: boolean; maxAcreage?: number; - maxCreatedDateTime?: Date; - maxLastModifiedDateTime?: Date; + maxCreatedDateTime?: Date | string; + maxLastModifiedDateTime?: Date | string; minAcreage?: number; - minCreatedDateTime?: Date; - minLastModifiedDateTime?: Date; - names?: string[]; - parentIds?: string[]; + minCreatedDateTime?: Date | string; + minLastModifiedDateTime?: Date | string; + names?: Array; + parentIds?: Array; parentType?: string; - propertyFilters?: string[]; - statuses?: string[]; -} - -// @public (undocumented) -export interface BoundariesSearch { - get(options?: BoundariesListParameters): Promise; - post(options?: BoundariesSearchParameters): Promise; + propertyFilters?: Array; + statuses?: Array; } // @public export interface BoundariesSearch200Response extends HttpResponse { // (undocumented) - body: BoundaryListResponse; + body: BoundaryListResponseOutput; // (undocumented) status: "200"; } // @public (undocumented) export interface BoundariesSearchBodyParam { - // (undocumented) body?: SearchBoundaryQuery; } -// @public (undocumented) -export interface BoundariesSearchByFarmerId { - get(options?: BoundariesListByFarmerIdParameters): Promise; - post(options?: BoundariesSearchByFarmerIdParameters): Promise; -} - // @public export interface BoundariesSearchByFarmerId200Response extends HttpResponse { // (undocumented) - body: BoundaryListResponse; + body: BoundaryListResponseOutput; // (undocumented) status: "200"; } // @public (undocumented) export interface BoundariesSearchByFarmerIdBodyParam { - // (undocumented) body?: SearchBoundaryQuery; } // @public export interface BoundariesSearchByFarmerIddefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type BoundariesSearchByFarmerIdParameters = RequestParameters & BoundariesSearchByFarmerIdBodyParam; +export interface BoundariesSearchByFarmerIdMediaTypesParam { + contentType?: "application/json"; +} + +// @public (undocumented) +export type BoundariesSearchByFarmerIdParameters = BoundariesSearchByFarmerIdMediaTypesParam & BoundariesSearchByFarmerIdBodyParam & RequestParameters; // @public export interface BoundariesSearchdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type BoundariesSearchParameters = RequestParameters & BoundariesSearchBodyParam; +export interface BoundariesSearchMediaTypesParam { + contentType?: "application/json"; +} + +// @public (undocumented) +export type BoundariesSearchParameters = BoundariesSearchMediaTypesParam & BoundariesSearchBodyParam & RequestParameters; // @public (undocumented) export interface Boundary { acreage?: number; - createdDateTime?: Date; + createdDateTime?: Date | string; description?: string; eTag?: string; farmerId?: string; geometry?: GeoJsonObject; id?: string; isPrimary?: boolean; - modifiedDateTime?: Date; + modifiedDateTime?: Date | string; name?: string; parentId?: string; parentType?: string; - properties?: BoundaryPropertiesDictionary; + properties?: Record; status?: string; } // @public (undocumented) -export interface BoundaryListResponse { +export interface BoundaryListResponseOutput { + $skipToken?: string; nextLink?: string; - skipToken?: string; - value?: Boundary[]; + value?: Array; +} + +// @public (undocumented) +export interface BoundaryOutput { + acreage?: number; + createdDateTime?: string; + description?: string; + eTag?: string; + farmerId?: string; + geometry?: GeoJsonObjectOutput; + id?: string; + isPrimary?: boolean; + modifiedDateTime?: string; + name?: string; + parentId?: string; + parentType?: string; + properties?: Record; + status?: string; } // @public (undocumented) -export interface BoundaryOverlapResponse { +export interface BoundaryOverlapResponseOutput { boundaryAcreage?: number; intersectingAcreage?: number; otherBoundaryAcreage?: number; } // @public (undocumented) -export type BoundaryPropertiesDictionary = Record; - -// @public (undocumented) -export interface CascadeDeleteJob { - createdDateTime?: Date; +export interface CascadeDeleteJobOutput { + createdDateTime?: string; description?: string; durationInSeconds?: number; - endTime?: Date; + endTime?: string; farmerId: string; id?: string; - lastActionDateTime?: Date; + lastActionDateTime?: string; message?: string; name?: string; - properties?: CascadeDeleteJobPropertiesDictionary; + properties?: Record; resourceId: string; resourceType: string; - startTime?: Date; + startTime?: string; status?: string; } -// @public (undocumented) -export type CascadeDeleteJobPropertiesDictionary = Record; - // @public (undocumented) export interface Crop { - createdDateTime?: Date; + createdDateTime?: Date | string; description?: string; eTag?: string; id?: string; - modifiedDateTime?: Date; + modifiedDateTime?: Date | string; name?: string; phenotype?: string; - properties?: CropPropertiesDictionary; + properties?: Record; status?: string; } // @public (undocumented) -export interface CropListResponse { +export interface CropListResponseOutput { + $skipToken?: string; nextLink?: string; - skipToken?: string; - value?: Crop[]; + value?: Array; } // @public (undocumented) -export type CropPropertiesDictionary = Record; +export interface CropOutput { + createdDateTime?: string; + description?: string; + eTag?: string; + id?: string; + modifiedDateTime?: string; + name?: string; + phenotype?: string; + properties?: Record; + status?: string; +} // @public export interface CropsCreateOrUpdate200Response extends HttpResponse { // (undocumented) - body: Crop; + body: CropOutput; // (undocumented) status: "200"; } @@ -825,37 +904,36 @@ export interface CropsCreateOrUpdate200Response extends HttpResponse { // @public export interface CropsCreateOrUpdate201Response extends HttpResponse { // (undocumented) - body: Crop; + body: CropOutput; // (undocumented) status: "201"; } // @public (undocumented) export interface CropsCreateOrUpdateBodyParam { - // (undocumented) body?: Crop; } // @public export interface CropsCreateOrUpdatedefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type CropsCreateOrUpdateParameters = RequestParameters & CropsCreateOrUpdateBodyParam; +export interface CropsCreateOrUpdateMediaTypesParam { + contentType?: "application/merge-patch+json"; +} // @public (undocumented) -export interface CropsDelete { - delete(options?: CropsDeleteParameters): Promise; - get(options?: CropsGetParameters): Promise; - patch(options?: CropsCreateOrUpdateParameters): Promise; -} +export type CropsCreateOrUpdateParameters = CropsCreateOrUpdateMediaTypesParam & CropsCreateOrUpdateBodyParam & RequestParameters; // @public export interface CropsDelete204Response extends HttpResponse { + // (undocumented) + body: Record; // (undocumented) status: "204"; } @@ -863,7 +941,7 @@ export interface CropsDelete204Response extends HttpResponse { // @public export interface CropsDeletedefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } @@ -871,10 +949,17 @@ export interface CropsDeletedefaultResponse extends HttpResponse { // @public (undocumented) export type CropsDeleteParameters = RequestParameters; +// @public (undocumented) +export interface CropsGet { + delete(options?: CropsDeleteParameters): Promise; + get(options?: CropsGetParameters): Promise; + patch(options?: CropsCreateOrUpdateParameters): Promise; +} + // @public export interface CropsGet200Response extends HttpResponse { // (undocumented) - body: Crop; + body: CropOutput; // (undocumented) status: "200"; } @@ -882,7 +967,7 @@ export interface CropsGet200Response extends HttpResponse { // @public export interface CropsGetdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } @@ -898,7 +983,7 @@ export interface CropsList { // @public export interface CropsList200Response extends HttpResponse { // (undocumented) - body: CropListResponse; + body: CropListResponseOutput; // (undocumented) status: "200"; } @@ -906,13 +991,13 @@ export interface CropsList200Response extends HttpResponse { // @public export interface CropsListdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type CropsListParameters = RequestParameters & CropsListQueryParam; +export type CropsListParameters = CropsListQueryParam & RequestParameters; // @public (undocumented) export interface CropsListQueryParam { @@ -924,21 +1009,21 @@ export interface CropsListQueryParam { export interface CropsListQueryParamProperties { $maxPageSize?: number; $skipToken?: string; - ids?: string[]; - maxCreatedDateTime?: Date; - maxLastModifiedDateTime?: Date; - minCreatedDateTime?: Date; - minLastModifiedDateTime?: Date; - names?: string[]; - phenotypes?: string[]; - propertyFilters?: string[]; - statuses?: string[]; + ids?: Array; + maxCreatedDateTime?: Date | string; + maxLastModifiedDateTime?: Date | string; + minCreatedDateTime?: Date | string; + minLastModifiedDateTime?: Date | string; + names?: Array; + phenotypes?: Array; + propertyFilters?: Array; + statuses?: Array; } // @public export interface CropVarietiesCreateOrUpdate200Response extends HttpResponse { // (undocumented) - body: CropVariety; + body: CropVarietyOutput; // (undocumented) status: "200"; } @@ -946,37 +1031,36 @@ export interface CropVarietiesCreateOrUpdate200Response extends HttpResponse { // @public export interface CropVarietiesCreateOrUpdate201Response extends HttpResponse { // (undocumented) - body: CropVariety; + body: CropVarietyOutput; // (undocumented) status: "201"; } // @public (undocumented) export interface CropVarietiesCreateOrUpdateBodyParam { - // (undocumented) body?: CropVariety; } // @public export interface CropVarietiesCreateOrUpdatedefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type CropVarietiesCreateOrUpdateParameters = RequestParameters & CropVarietiesCreateOrUpdateBodyParam; +export interface CropVarietiesCreateOrUpdateMediaTypesParam { + contentType?: "application/merge-patch+json"; +} // @public (undocumented) -export interface CropVarietiesDelete { - delete(options?: CropVarietiesDeleteParameters): Promise; - get(options?: CropVarietiesGetParameters): Promise; - patch(options?: CropVarietiesCreateOrUpdateParameters): Promise; -} +export type CropVarietiesCreateOrUpdateParameters = CropVarietiesCreateOrUpdateMediaTypesParam & CropVarietiesCreateOrUpdateBodyParam & RequestParameters; // @public export interface CropVarietiesDelete204Response extends HttpResponse { + // (undocumented) + body: Record; // (undocumented) status: "204"; } @@ -984,7 +1068,7 @@ export interface CropVarietiesDelete204Response extends HttpResponse { // @public export interface CropVarietiesDeletedefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } @@ -992,10 +1076,17 @@ export interface CropVarietiesDeletedefaultResponse extends HttpResponse { // @public (undocumented) export type CropVarietiesDeleteParameters = RequestParameters; +// @public (undocumented) +export interface CropVarietiesGet { + delete(options?: CropVarietiesDeleteParameters): Promise; + get(options?: CropVarietiesGetParameters): Promise; + patch(options?: CropVarietiesCreateOrUpdateParameters): Promise; +} + // @public export interface CropVarietiesGet200Response extends HttpResponse { // (undocumented) - body: CropVariety; + body: CropVarietyOutput; // (undocumented) status: "200"; } @@ -1003,7 +1094,7 @@ export interface CropVarietiesGet200Response extends HttpResponse { // @public export interface CropVarietiesGetdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } @@ -1019,7 +1110,7 @@ export interface CropVarietiesList { // @public export interface CropVarietiesList200Response extends HttpResponse { // (undocumented) - body: CropVarietyListResponse; + body: CropVarietyListResponseOutput; // (undocumented) status: "200"; } @@ -1032,7 +1123,7 @@ export interface CropVarietiesListByCropId { // @public export interface CropVarietiesListByCropId200Response extends HttpResponse { // (undocumented) - body: CropVarietyListResponse; + body: CropVarietyListResponseOutput; // (undocumented) status: "200"; } @@ -1040,13 +1131,13 @@ export interface CropVarietiesListByCropId200Response extends HttpResponse { // @public export interface CropVarietiesListByCropIddefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type CropVarietiesListByCropIdParameters = RequestParameters & CropVarietiesListByCropIdQueryParam; +export type CropVarietiesListByCropIdParameters = CropVarietiesListByCropIdQueryParam & RequestParameters; // @public (undocumented) export interface CropVarietiesListByCropIdQueryParam { @@ -1058,29 +1149,29 @@ export interface CropVarietiesListByCropIdQueryParam { export interface CropVarietiesListByCropIdQueryParamProperties { $maxPageSize?: number; $skipToken?: string; - brands?: string[]; - cropIds?: string[]; - ids?: string[]; - maxCreatedDateTime?: Date; - maxLastModifiedDateTime?: Date; - minCreatedDateTime?: Date; - minLastModifiedDateTime?: Date; - names?: string[]; - products?: string[]; - propertyFilters?: string[]; - statuses?: string[]; + brands?: Array; + cropIds?: Array; + ids?: Array; + maxCreatedDateTime?: Date | string; + maxLastModifiedDateTime?: Date | string; + minCreatedDateTime?: Date | string; + minLastModifiedDateTime?: Date | string; + names?: Array; + products?: Array; + propertyFilters?: Array; + statuses?: Array; } // @public export interface CropVarietiesListdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type CropVarietiesListParameters = RequestParameters & CropVarietiesListQueryParam; +export type CropVarietiesListParameters = CropVarietiesListQueryParam & RequestParameters; // @public (undocumented) export interface CropVarietiesListQueryParam { @@ -1092,80 +1183,86 @@ export interface CropVarietiesListQueryParam { export interface CropVarietiesListQueryParamProperties { $maxPageSize?: number; $skipToken?: string; - brands?: string[]; - cropIds?: string[]; - ids?: string[]; - maxCreatedDateTime?: Date; - maxLastModifiedDateTime?: Date; - minCreatedDateTime?: Date; - minLastModifiedDateTime?: Date; - names?: string[]; - products?: string[]; - propertyFilters?: string[]; - statuses?: string[]; + brands?: Array; + cropIds?: Array; + ids?: Array; + maxCreatedDateTime?: Date | string; + maxLastModifiedDateTime?: Date | string; + minCreatedDateTime?: Date | string; + minLastModifiedDateTime?: Date | string; + names?: Array; + products?: Array; + propertyFilters?: Array; + statuses?: Array; } // @public (undocumented) export interface CropVariety { brand?: string; - createdDateTime?: Date; + createdDateTime?: Date | string; cropId?: string; description?: string; eTag?: string; id?: string; - modifiedDateTime?: Date; + modifiedDateTime?: Date | string; name?: string; product?: string; - properties?: CropVarietyPropertiesDictionary; + properties?: Record; status?: string; } // @public (undocumented) -export interface CropVarietyListResponse { +export interface CropVarietyListResponseOutput { + $skipToken?: string; nextLink?: string; - skipToken?: string; - value?: CropVariety[]; + value?: Array; } // @public (undocumented) -export type CropVarietyPropertiesDictionary = Record; - -// @public (undocumented) -export type DataProvider = "Microsoft"; +export interface CropVarietyOutput { + brand?: string; + createdDateTime?: string; + cropId?: string; + description?: string; + eTag?: string; + id?: string; + modifiedDateTime?: string; + name?: string; + product?: string; + properties?: Record; + status?: string; +} // @public (undocumented) -interface Error_2 { +export interface ErrorModelOutput { code?: string; - details?: Error_2[]; - innererror?: InnerError; + details?: Array; + innererror?: InnerErrorOutput; message?: string; target?: string; } -export { Error_2 as Error } - // @public (undocumented) -export interface ErrorResponse { - error?: Error_2; +export interface ErrorResponseOutput { + error?: ErrorModelOutput; traceId?: string; } // @public (undocumented) export interface Farm { - createdDateTime?: Date; + createdDateTime?: Date | string; description?: string; eTag?: string; farmerId?: string; id?: string; - modifiedDateTime?: Date; + modifiedDateTime?: Date | string; name?: string; - properties?: FarmPropertiesDictionary; + properties?: Record; status?: string; } // @public (undocumented) function FarmBeats(Endpoint: string, credentials: TokenCredential, options?: ClientOptions): FarmBeatsRestClient; - export default FarmBeats; // @public (undocumented) @@ -1175,36 +1272,39 @@ export type FarmBeatsRestClient = Client & { // @public (undocumented) export interface Farmer { - createdDateTime?: Date; + createdDateTime?: Date | string; description?: string; eTag?: string; id?: string; - modifiedDateTime?: Date; + modifiedDateTime?: Date | string; name?: string; - properties?: FarmerPropertiesDictionary; + properties?: Record; status?: string; } // @public (undocumented) -export interface FarmerListResponse { +export interface FarmerListResponseOutput { + $skipToken?: string; nextLink?: string; - skipToken?: string; - value?: Farmer[]; + value?: Array; } // @public (undocumented) -export type FarmerPropertiesDictionary = Record; - -// @public (undocumented) -export interface FarmersCreateCascadeDeleteJob { - get(options?: FarmersGetCascadeDeleteJobDetailsParameters): Promise; - put(options?: FarmersCreateCascadeDeleteJobParameters): Promise; +export interface FarmerOutput { + createdDateTime?: string; + description?: string; + eTag?: string; + id?: string; + modifiedDateTime?: string; + name?: string; + properties?: Record; + status?: string; } // @public export interface FarmersCreateCascadeDeleteJob202Response extends HttpResponse { // (undocumented) - body: CascadeDeleteJob; + body: CascadeDeleteJobOutput; // (undocumented) status: "202"; } @@ -1212,13 +1312,13 @@ export interface FarmersCreateCascadeDeleteJob202Response extends HttpResponse { // @public export interface FarmersCreateCascadeDeleteJobdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type FarmersCreateCascadeDeleteJobParameters = RequestParameters & FarmersCreateCascadeDeleteJobQueryParam; +export type FarmersCreateCascadeDeleteJobParameters = FarmersCreateCascadeDeleteJobQueryParam & RequestParameters; // @public (undocumented) export interface FarmersCreateCascadeDeleteJobQueryParam { @@ -1234,7 +1334,7 @@ export interface FarmersCreateCascadeDeleteJobQueryParamProperties { // @public export interface FarmersCreateOrUpdate200Response extends HttpResponse { // (undocumented) - body: Farmer; + body: FarmerOutput; // (undocumented) status: "200"; } @@ -1242,37 +1342,36 @@ export interface FarmersCreateOrUpdate200Response extends HttpResponse { // @public export interface FarmersCreateOrUpdate201Response extends HttpResponse { // (undocumented) - body: Farmer; + body: FarmerOutput; // (undocumented) status: "201"; } // @public (undocumented) export interface FarmersCreateOrUpdateBodyParam { - // (undocumented) body?: Farmer; } // @public export interface FarmersCreateOrUpdatedefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type FarmersCreateOrUpdateParameters = RequestParameters & FarmersCreateOrUpdateBodyParam; +export interface FarmersCreateOrUpdateMediaTypesParam { + contentType?: "application/merge-patch+json"; +} // @public (undocumented) -export interface FarmersDelete { - delete(options?: FarmersDeleteParameters): Promise; - get(options?: FarmersGetParameters): Promise; - patch(options?: FarmersCreateOrUpdateParameters): Promise; -} +export type FarmersCreateOrUpdateParameters = FarmersCreateOrUpdateMediaTypesParam & FarmersCreateOrUpdateBodyParam & RequestParameters; // @public export interface FarmersDelete204Response extends HttpResponse { + // (undocumented) + body: Record; // (undocumented) status: "204"; } @@ -1280,7 +1379,7 @@ export interface FarmersDelete204Response extends HttpResponse { // @public export interface FarmersDeletedefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } @@ -1288,18 +1387,31 @@ export interface FarmersDeletedefaultResponse extends HttpResponse { // @public (undocumented) export type FarmersDeleteParameters = RequestParameters; +// @public (undocumented) +export interface FarmersGet { + delete(options?: FarmersDeleteParameters): Promise; + get(options?: FarmersGetParameters): Promise; + patch(options?: FarmersCreateOrUpdateParameters): Promise; +} + // @public export interface FarmersGet200Response extends HttpResponse { // (undocumented) - body: Farmer; + body: FarmerOutput; // (undocumented) status: "200"; } +// @public (undocumented) +export interface FarmersGetCascadeDeleteJobDetails { + get(options?: FarmersGetCascadeDeleteJobDetailsParameters): Promise; + put(options: FarmersCreateCascadeDeleteJobParameters): Promise; +} + // @public export interface FarmersGetCascadeDeleteJobDetails200Response extends HttpResponse { // (undocumented) - body: CascadeDeleteJob; + body: CascadeDeleteJobOutput; // (undocumented) status: "200"; } @@ -1307,7 +1419,7 @@ export interface FarmersGetCascadeDeleteJobDetails200Response extends HttpRespon // @public export interface FarmersGetCascadeDeleteJobDetailsdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } @@ -1318,7 +1430,7 @@ export type FarmersGetCascadeDeleteJobDetailsParameters = RequestParameters; // @public export interface FarmersGetdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } @@ -1334,7 +1446,7 @@ export interface FarmersList { // @public export interface FarmersList200Response extends HttpResponse { // (undocumented) - body: FarmerListResponse; + body: FarmerListResponseOutput; // (undocumented) status: "200"; } @@ -1342,13 +1454,13 @@ export interface FarmersList200Response extends HttpResponse { // @public export interface FarmersListdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type FarmersListParameters = RequestParameters & FarmersListQueryParam; +export type FarmersListParameters = FarmersListQueryParam & RequestParameters; // @public (undocumented) export interface FarmersListQueryParam { @@ -1360,80 +1472,100 @@ export interface FarmersListQueryParam { export interface FarmersListQueryParamProperties { $maxPageSize?: number; $skipToken?: string; - ids?: string[]; - maxCreatedDateTime?: Date; - maxLastModifiedDateTime?: Date; - minCreatedDateTime?: Date; - minLastModifiedDateTime?: Date; - names?: string[]; - propertyFilters?: string[]; - statuses?: string[]; + ids?: Array; + maxCreatedDateTime?: Date | string; + maxLastModifiedDateTime?: Date | string; + minCreatedDateTime?: Date | string; + minLastModifiedDateTime?: Date | string; + names?: Array; + propertyFilters?: Array; + statuses?: Array; } // @public (undocumented) -export interface FarmListResponse { +export interface FarmListResponseOutput { + $skipToken?: string; nextLink?: string; - skipToken?: string; - value?: Farm[]; + value?: Array; } // @public (undocumented) export interface FarmOperationDataIngestionJob { authProviderId: string; - createdDateTime?: Date; + createdDateTime?: Date | string; description?: string; durationInSeconds?: number; - endTime?: Date; + endTime?: Date | string; farmerId: string; id?: string; - lastActionDateTime?: Date; + lastActionDateTime?: Date | string; message?: string; name?: string; - operations?: string[]; - properties?: FarmOperationDataIngestionJobPropertiesDictionary; - startTime?: Date; + operations?: Array; + properties?: Record; + startTime?: Date | string; startYear: number; status?: string; } // @public (undocumented) -export type FarmOperationDataIngestionJobPropertiesDictionary = Record; +export interface FarmOperationDataIngestionJobOutput { + authProviderId: string; + createdDateTime?: string; + description?: string; + durationInSeconds?: number; + endTime?: string; + farmerId: string; + id?: string; + lastActionDateTime?: string; + message?: string; + name?: string; + operations?: Array; + properties?: Record; + startTime?: string; + startYear: number; + status?: string; +} + +// @public (undocumented) +export interface FarmOperationsCreateDataIngestionJob { + get(options?: FarmOperationsGetDataIngestionJobDetailsParameters): Promise; + put(options?: FarmOperationsCreateDataIngestionJobParameters): Promise; +} // @public export interface FarmOperationsCreateDataIngestionJob202Response extends HttpResponse { // (undocumented) - body: FarmOperationDataIngestionJob; + body: FarmOperationDataIngestionJobOutput; // (undocumented) status: "202"; } // @public (undocumented) export interface FarmOperationsCreateDataIngestionJobBodyParam { - // (undocumented) body?: FarmOperationDataIngestionJob; } // @public export interface FarmOperationsCreateDataIngestionJobdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type FarmOperationsCreateDataIngestionJobParameters = RequestParameters & FarmOperationsCreateDataIngestionJobBodyParam; +export interface FarmOperationsCreateDataIngestionJobMediaTypesParam { + contentType?: "application/json"; +} // @public (undocumented) -export interface FarmOperationsGetDataIngestionJobDetails { - get(options?: FarmOperationsGetDataIngestionJobDetailsParameters): Promise; - put(options?: FarmOperationsCreateDataIngestionJobParameters): Promise; -} +export type FarmOperationsCreateDataIngestionJobParameters = FarmOperationsCreateDataIngestionJobMediaTypesParam & FarmOperationsCreateDataIngestionJobBodyParam & RequestParameters; // @public export interface FarmOperationsGetDataIngestionJobDetails200Response extends HttpResponse { // (undocumented) - body: FarmOperationDataIngestionJob; + body: FarmOperationDataIngestionJobOutput; // (undocumented) status: "200"; } @@ -1441,7 +1573,7 @@ export interface FarmOperationsGetDataIngestionJobDetails200Response extends Htt // @public export interface FarmOperationsGetDataIngestionJobDetailsdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } @@ -1450,18 +1582,22 @@ export interface FarmOperationsGetDataIngestionJobDetailsdefaultResponse extends export type FarmOperationsGetDataIngestionJobDetailsParameters = RequestParameters; // @public (undocumented) -export type FarmPropertiesDictionary = Record; - -// @public (undocumented) -export interface FarmsCreateCascadeDeleteJob { - get(options?: FarmsGetCascadeDeleteJobDetailsParameters): Promise; - put(options?: FarmsCreateCascadeDeleteJobParameters): Promise; +export interface FarmOutput { + createdDateTime?: string; + description?: string; + eTag?: string; + farmerId?: string; + id?: string; + modifiedDateTime?: string; + name?: string; + properties?: Record; + status?: string; } // @public export interface FarmsCreateCascadeDeleteJob202Response extends HttpResponse { // (undocumented) - body: CascadeDeleteJob; + body: CascadeDeleteJobOutput; // (undocumented) status: "202"; } @@ -1469,13 +1605,13 @@ export interface FarmsCreateCascadeDeleteJob202Response extends HttpResponse { // @public export interface FarmsCreateCascadeDeleteJobdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type FarmsCreateCascadeDeleteJobParameters = RequestParameters & FarmsCreateCascadeDeleteJobQueryParam; +export type FarmsCreateCascadeDeleteJobParameters = FarmsCreateCascadeDeleteJobQueryParam & RequestParameters; // @public (undocumented) export interface FarmsCreateCascadeDeleteJobQueryParam { @@ -1492,7 +1628,7 @@ export interface FarmsCreateCascadeDeleteJobQueryParamProperties { // @public export interface FarmsCreateOrUpdate200Response extends HttpResponse { // (undocumented) - body: Farm; + body: FarmOutput; // (undocumented) status: "200"; } @@ -1500,37 +1636,36 @@ export interface FarmsCreateOrUpdate200Response extends HttpResponse { // @public export interface FarmsCreateOrUpdate201Response extends HttpResponse { // (undocumented) - body: Farm; + body: FarmOutput; // (undocumented) status: "201"; } // @public (undocumented) export interface FarmsCreateOrUpdateBodyParam { - // (undocumented) body?: Farm; } // @public export interface FarmsCreateOrUpdatedefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type FarmsCreateOrUpdateParameters = RequestParameters & FarmsCreateOrUpdateBodyParam; +export interface FarmsCreateOrUpdateMediaTypesParam { + contentType?: "application/merge-patch+json"; +} // @public (undocumented) -export interface FarmsDelete { - delete(options?: FarmsDeleteParameters): Promise; - get(options?: FarmsGetParameters): Promise; - patch(options?: FarmsCreateOrUpdateParameters): Promise; -} +export type FarmsCreateOrUpdateParameters = FarmsCreateOrUpdateMediaTypesParam & FarmsCreateOrUpdateBodyParam & RequestParameters; // @public export interface FarmsDelete204Response extends HttpResponse { + // (undocumented) + body: Record; // (undocumented) status: "204"; } @@ -1538,7 +1673,7 @@ export interface FarmsDelete204Response extends HttpResponse { // @public export interface FarmsDeletedefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } @@ -1546,18 +1681,31 @@ export interface FarmsDeletedefaultResponse extends HttpResponse { // @public (undocumented) export type FarmsDeleteParameters = RequestParameters; +// @public (undocumented) +export interface FarmsGet { + delete(options?: FarmsDeleteParameters): Promise; + get(options?: FarmsGetParameters): Promise; + patch(options?: FarmsCreateOrUpdateParameters): Promise; +} + // @public export interface FarmsGet200Response extends HttpResponse { // (undocumented) - body: Farm; + body: FarmOutput; // (undocumented) status: "200"; } -// @public -export interface FarmsGetCascadeDeleteJobDetails200Response extends HttpResponse { - // (undocumented) - body: CascadeDeleteJob; +// @public (undocumented) +export interface FarmsGetCascadeDeleteJobDetails { + get(options?: FarmsGetCascadeDeleteJobDetailsParameters): Promise; + put(options: FarmsCreateCascadeDeleteJobParameters): Promise; +} + +// @public +export interface FarmsGetCascadeDeleteJobDetails200Response extends HttpResponse { + // (undocumented) + body: CascadeDeleteJobOutput; // (undocumented) status: "200"; } @@ -1565,7 +1713,7 @@ export interface FarmsGetCascadeDeleteJobDetails200Response extends HttpResponse // @public export interface FarmsGetCascadeDeleteJobDetailsdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } @@ -1576,7 +1724,7 @@ export type FarmsGetCascadeDeleteJobDetailsParameters = RequestParameters; // @public export interface FarmsGetdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } @@ -1592,7 +1740,7 @@ export interface FarmsList { // @public export interface FarmsList200Response extends HttpResponse { // (undocumented) - body: FarmListResponse; + body: FarmListResponseOutput; // (undocumented) status: "200"; } @@ -1605,7 +1753,7 @@ export interface FarmsListByFarmerId { // @public export interface FarmsListByFarmerId200Response extends HttpResponse { // (undocumented) - body: FarmListResponse; + body: FarmListResponseOutput; // (undocumented) status: "200"; } @@ -1613,13 +1761,13 @@ export interface FarmsListByFarmerId200Response extends HttpResponse { // @public export interface FarmsListByFarmerIddefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type FarmsListByFarmerIdParameters = RequestParameters & FarmsListByFarmerIdQueryParam; +export type FarmsListByFarmerIdParameters = FarmsListByFarmerIdQueryParam & RequestParameters; // @public (undocumented) export interface FarmsListByFarmerIdQueryParam { @@ -1631,26 +1779,26 @@ export interface FarmsListByFarmerIdQueryParam { export interface FarmsListByFarmerIdQueryParamProperties { $maxPageSize?: number; $skipToken?: string; - ids?: string[]; - maxCreatedDateTime?: Date; - maxLastModifiedDateTime?: Date; - minCreatedDateTime?: Date; - minLastModifiedDateTime?: Date; - names?: string[]; - propertyFilters?: string[]; - statuses?: string[]; + ids?: Array; + maxCreatedDateTime?: Date | string; + maxLastModifiedDateTime?: Date | string; + minCreatedDateTime?: Date | string; + minLastModifiedDateTime?: Date | string; + names?: Array; + propertyFilters?: Array; + statuses?: Array; } // @public export interface FarmsListdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type FarmsListParameters = RequestParameters & FarmsListQueryParam; +export type FarmsListParameters = FarmsListQueryParam & RequestParameters; // @public (undocumented) export interface FarmsListQueryParam { @@ -1662,52 +1810,59 @@ export interface FarmsListQueryParam { export interface FarmsListQueryParamProperties { $maxPageSize?: number; $skipToken?: string; - ids?: string[]; - maxCreatedDateTime?: Date; - maxLastModifiedDateTime?: Date; - minCreatedDateTime?: Date; - minLastModifiedDateTime?: Date; - names?: string[]; - propertyFilters?: string[]; - statuses?: string[]; + ids?: Array; + maxCreatedDateTime?: Date | string; + maxLastModifiedDateTime?: Date | string; + minCreatedDateTime?: Date | string; + minLastModifiedDateTime?: Date | string; + names?: Array; + propertyFilters?: Array; + statuses?: Array; } // @public (undocumented) export interface Field { - boundaryIds?: string[]; - createdDateTime?: Date; + boundaryIds?: Array; + createdDateTime?: Date | string; description?: string; eTag?: string; farmerId?: string; farmId?: string; id?: string; - modifiedDateTime?: Date; + modifiedDateTime?: Date | string; name?: string; primaryBoundaryId?: string; - properties?: FieldPropertiesDictionary; + properties?: Record; status?: string; } // @public (undocumented) -export interface FieldListResponse { +export interface FieldListResponseOutput { + $skipToken?: string; nextLink?: string; - skipToken?: string; - value?: Field[]; + value?: Array; } // @public (undocumented) -export type FieldPropertiesDictionary = Record; - -// @public (undocumented) -export interface FieldsCreateCascadeDeleteJob { - get(options?: FieldsGetCascadeDeleteJobDetailsParameters): Promise; - put(options?: FieldsCreateCascadeDeleteJobParameters): Promise; +export interface FieldOutput { + boundaryIds?: Array; + createdDateTime?: string; + description?: string; + eTag?: string; + farmerId?: string; + farmId?: string; + id?: string; + modifiedDateTime?: string; + name?: string; + primaryBoundaryId?: string; + properties?: Record; + status?: string; } // @public export interface FieldsCreateCascadeDeleteJob202Response extends HttpResponse { // (undocumented) - body: CascadeDeleteJob; + body: CascadeDeleteJobOutput; // (undocumented) status: "202"; } @@ -1715,13 +1870,13 @@ export interface FieldsCreateCascadeDeleteJob202Response extends HttpResponse { // @public export interface FieldsCreateCascadeDeleteJobdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type FieldsCreateCascadeDeleteJobParameters = RequestParameters & FieldsCreateCascadeDeleteJobQueryParam; +export type FieldsCreateCascadeDeleteJobParameters = FieldsCreateCascadeDeleteJobQueryParam & RequestParameters; // @public (undocumented) export interface FieldsCreateCascadeDeleteJobQueryParam { @@ -1738,7 +1893,7 @@ export interface FieldsCreateCascadeDeleteJobQueryParamProperties { // @public export interface FieldsCreateOrUpdate200Response extends HttpResponse { // (undocumented) - body: Field; + body: FieldOutput; // (undocumented) status: "200"; } @@ -1746,37 +1901,36 @@ export interface FieldsCreateOrUpdate200Response extends HttpResponse { // @public export interface FieldsCreateOrUpdate201Response extends HttpResponse { // (undocumented) - body: Field; + body: FieldOutput; // (undocumented) status: "201"; } // @public (undocumented) export interface FieldsCreateOrUpdateBodyParam { - // (undocumented) body?: Field; } // @public export interface FieldsCreateOrUpdatedefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type FieldsCreateOrUpdateParameters = RequestParameters & FieldsCreateOrUpdateBodyParam; +export interface FieldsCreateOrUpdateMediaTypesParam { + contentType?: "application/merge-patch+json"; +} // @public (undocumented) -export interface FieldsDelete { - delete(options?: FieldsDeleteParameters): Promise; - get(options?: FieldsGetParameters): Promise; - patch(options?: FieldsCreateOrUpdateParameters): Promise; -} +export type FieldsCreateOrUpdateParameters = FieldsCreateOrUpdateMediaTypesParam & FieldsCreateOrUpdateBodyParam & RequestParameters; // @public export interface FieldsDelete204Response extends HttpResponse { + // (undocumented) + body: Record; // (undocumented) status: "204"; } @@ -1784,7 +1938,7 @@ export interface FieldsDelete204Response extends HttpResponse { // @public export interface FieldsDeletedefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } @@ -1792,18 +1946,31 @@ export interface FieldsDeletedefaultResponse extends HttpResponse { // @public (undocumented) export type FieldsDeleteParameters = RequestParameters; +// @public (undocumented) +export interface FieldsGet { + delete(options?: FieldsDeleteParameters): Promise; + get(options?: FieldsGetParameters): Promise; + patch(options?: FieldsCreateOrUpdateParameters): Promise; +} + // @public export interface FieldsGet200Response extends HttpResponse { // (undocumented) - body: Field; + body: FieldOutput; // (undocumented) status: "200"; } +// @public (undocumented) +export interface FieldsGetCascadeDeleteJobDetails { + get(options?: FieldsGetCascadeDeleteJobDetailsParameters): Promise; + put(options: FieldsCreateCascadeDeleteJobParameters): Promise; +} + // @public export interface FieldsGetCascadeDeleteJobDetails200Response extends HttpResponse { // (undocumented) - body: CascadeDeleteJob; + body: CascadeDeleteJobOutput; // (undocumented) status: "200"; } @@ -1811,7 +1978,7 @@ export interface FieldsGetCascadeDeleteJobDetails200Response extends HttpRespons // @public export interface FieldsGetCascadeDeleteJobDetailsdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } @@ -1822,7 +1989,7 @@ export type FieldsGetCascadeDeleteJobDetailsParameters = RequestParameters; // @public export interface FieldsGetdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } @@ -1838,7 +2005,7 @@ export interface FieldsList { // @public export interface FieldsList200Response extends HttpResponse { // (undocumented) - body: FieldListResponse; + body: FieldListResponseOutput; // (undocumented) status: "200"; } @@ -1851,7 +2018,7 @@ export interface FieldsListByFarmerId { // @public export interface FieldsListByFarmerId200Response extends HttpResponse { // (undocumented) - body: FieldListResponse; + body: FieldListResponseOutput; // (undocumented) status: "200"; } @@ -1859,13 +2026,13 @@ export interface FieldsListByFarmerId200Response extends HttpResponse { // @public export interface FieldsListByFarmerIddefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type FieldsListByFarmerIdParameters = RequestParameters & FieldsListByFarmerIdQueryParam; +export type FieldsListByFarmerIdParameters = FieldsListByFarmerIdQueryParam & RequestParameters; // @public (undocumented) export interface FieldsListByFarmerIdQueryParam { @@ -1877,27 +2044,27 @@ export interface FieldsListByFarmerIdQueryParam { export interface FieldsListByFarmerIdQueryParamProperties { $maxPageSize?: number; $skipToken?: string; - farmIds?: string[]; - ids?: string[]; - maxCreatedDateTime?: Date; - maxLastModifiedDateTime?: Date; - minCreatedDateTime?: Date; - minLastModifiedDateTime?: Date; - names?: string[]; - propertyFilters?: string[]; - statuses?: string[]; + farmIds?: Array; + ids?: Array; + maxCreatedDateTime?: Date | string; + maxLastModifiedDateTime?: Date | string; + minCreatedDateTime?: Date | string; + minLastModifiedDateTime?: Date | string; + names?: Array; + propertyFilters?: Array; + statuses?: Array; } // @public export interface FieldsListdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type FieldsListParameters = RequestParameters & FieldsListQueryParam; +export type FieldsListParameters = FieldsListQueryParam & RequestParameters; // @public (undocumented) export interface FieldsListQueryParam { @@ -1909,28 +2076,46 @@ export interface FieldsListQueryParam { export interface FieldsListQueryParamProperties { $maxPageSize?: number; $skipToken?: string; - farmIds?: string[]; - ids?: string[]; - maxCreatedDateTime?: Date; - maxLastModifiedDateTime?: Date; - minCreatedDateTime?: Date; - minLastModifiedDateTime?: Date; - names?: string[]; - propertyFilters?: string[]; - statuses?: string[]; + farmIds?: Array; + ids?: Array; + maxCreatedDateTime?: Date | string; + maxLastModifiedDateTime?: Date | string; + minCreatedDateTime?: Date | string; + minLastModifiedDateTime?: Date | string; + names?: Array; + propertyFilters?: Array; + statuses?: Array; +} + +// @public (undocumented) +export type GeoJsonObject = MultiPolygon | Point | Polygon; + +// @public (undocumented) +export interface GeoJsonObjectBase { + // (undocumented) + type: "MultiPolygon" | "Point" | "Polygon"; } // @public (undocumented) -export type GeoJsonObject = Polygon | MultiPolygon | Point; +export type GeoJsonObjectOutput = MultiPolygonOutput | PointOutput | PolygonOutput; // @public (undocumented) -export type GeoJsonObjectType = "Point" | "Polygon" | "MultiPolygon"; +export interface GeoJsonObjectOutputBase { + // (undocumented) + type: "MultiPolygon" | "Point" | "Polygon"; +} // @public export type GetArrayType = T extends Array ? TData : never; // @public -export function getPoller(client: FarmBeatsRestClient, initialResponse: TResult, options?: PollerOptions): PollerLike, TResult>; +export function getLongRunningPoller(client: Client, initialResponse: TResult, options?: LroEngineOptions>): PollerLike, TResult>; + +// @public +export type GetPage = (pageLink: string, maxPageSize?: number) => Promise<{ + page: TPage; + nextPageLink?: string; +}>; // @public (undocumented) export interface HarvestData { @@ -1941,19 +2126,19 @@ export interface HarvestData { avgSpeed?: Measure; avgWetMass?: Measure; avgYield?: Measure; - createdDateTime?: Date; + createdDateTime?: Date | string; description?: string; eTag?: string; farmerId?: string; - harvestProductDetails?: HarvestProductDetail[]; + harvestProductDetails?: Array; id?: string; - modifiedDateTime?: Date; + modifiedDateTime?: Date | string; name?: string; operationBoundaryId?: string; - operationEndDateTime?: Date; - operationModifiedDateTime?: Date; - operationStartDateTime?: Date; - properties?: HarvestDataPropertiesDictionary; + operationEndDateTime?: Date | string; + operationModifiedDateTime?: Date | string; + operationStartDateTime?: Date | string; + properties?: Record; source?: string; status?: string; totalWetMass?: Measure; @@ -1963,7 +2148,7 @@ export interface HarvestData { // @public export interface HarvestDataCreateOrUpdate200Response extends HttpResponse { // (undocumented) - body: HarvestData; + body: HarvestDataOutput; // (undocumented) status: "200"; } @@ -1971,37 +2156,36 @@ export interface HarvestDataCreateOrUpdate200Response extends HttpResponse { // @public export interface HarvestDataCreateOrUpdate201Response extends HttpResponse { // (undocumented) - body: HarvestData; + body: HarvestDataOutput; // (undocumented) status: "201"; } // @public (undocumented) export interface HarvestDataCreateOrUpdateBodyParam { - // (undocumented) body?: HarvestData; } // @public export interface HarvestDataCreateOrUpdatedefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type HarvestDataCreateOrUpdateParameters = RequestParameters & HarvestDataCreateOrUpdateBodyParam; +export interface HarvestDataCreateOrUpdateMediaTypesParam { + contentType?: "application/merge-patch+json"; +} // @public (undocumented) -export interface HarvestDataDelete { - delete(options?: HarvestDataDeleteParameters): Promise; - get(options?: HarvestDataGetParameters): Promise; - patch(options?: HarvestDataCreateOrUpdateParameters): Promise; -} +export type HarvestDataCreateOrUpdateParameters = HarvestDataCreateOrUpdateMediaTypesParam & HarvestDataCreateOrUpdateBodyParam & RequestParameters; // @public export interface HarvestDataDelete204Response extends HttpResponse { + // (undocumented) + body: Record; // (undocumented) status: "204"; } @@ -2009,7 +2193,7 @@ export interface HarvestDataDelete204Response extends HttpResponse { // @public export interface HarvestDataDeletedefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } @@ -2017,10 +2201,17 @@ export interface HarvestDataDeletedefaultResponse extends HttpResponse { // @public (undocumented) export type HarvestDataDeleteParameters = RequestParameters; +// @public (undocumented) +export interface HarvestDataGet { + delete(options?: HarvestDataDeleteParameters): Promise; + get(options?: HarvestDataGetParameters): Promise; + patch(options?: HarvestDataCreateOrUpdateParameters): Promise; +} + // @public export interface HarvestDataGet200Response extends HttpResponse { // (undocumented) - body: HarvestData; + body: HarvestDataOutput; // (undocumented) status: "200"; } @@ -2028,7 +2219,7 @@ export interface HarvestDataGet200Response extends HttpResponse { // @public export interface HarvestDataGetdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } @@ -2044,7 +2235,7 @@ export interface HarvestDataList { // @public export interface HarvestDataList200Response extends HttpResponse { // (undocumented) - body: HarvestDataListResponse; + body: HarvestDataListResponseOutput; // (undocumented) status: "200"; } @@ -2057,7 +2248,7 @@ export interface HarvestDataListByFarmerId { // @public export interface HarvestDataListByFarmerId200Response extends HttpResponse { // (undocumented) - body: HarvestDataListResponse; + body: HarvestDataListResponseOutput; // (undocumented) status: "200"; } @@ -2065,13 +2256,13 @@ export interface HarvestDataListByFarmerId200Response extends HttpResponse { // @public export interface HarvestDataListByFarmerIddefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type HarvestDataListByFarmerIdParameters = RequestParameters & HarvestDataListByFarmerIdQueryParam; +export type HarvestDataListByFarmerIdParameters = HarvestDataListByFarmerIdQueryParam & RequestParameters; // @public (undocumented) export interface HarvestDataListByFarmerIdQueryParam { @@ -2083,18 +2274,18 @@ export interface HarvestDataListByFarmerIdQueryParam { export interface HarvestDataListByFarmerIdQueryParamProperties { $maxPageSize?: number; $skipToken?: string; - associatedBoundaryIds?: string[]; - ids?: string[]; + associatedBoundaryIds?: Array; + ids?: Array; maxArea?: number; maxAvgMoisture?: number; maxAvgSpeed?: number; maxAvgWetMass?: number; maxAvgYield?: number; - maxCreatedDateTime?: Date; - maxLastModifiedDateTime?: Date; - maxOperationEndDateTime?: Date; - maxOperationModifiedDateTime?: Date; - maxOperationStartDateTime?: Date; + maxCreatedDateTime?: Date | string; + maxLastModifiedDateTime?: Date | string; + maxOperationEndDateTime?: Date | string; + maxOperationModifiedDateTime?: Date | string; + maxOperationStartDateTime?: Date | string; maxTotalWetMass?: number; maxTotalYield?: number; minArea?: number; @@ -2102,30 +2293,30 @@ export interface HarvestDataListByFarmerIdQueryParamProperties { minAvgSpeed?: number; minAvgWetMass?: number; minAvgYield?: number; - minCreatedDateTime?: Date; - minLastModifiedDateTime?: Date; - minOperationEndDateTime?: Date; - minOperationModifiedDateTime?: Date; - minOperationStartDateTime?: Date; + minCreatedDateTime?: Date | string; + minLastModifiedDateTime?: Date | string; + minOperationEndDateTime?: Date | string; + minOperationModifiedDateTime?: Date | string; + minOperationStartDateTime?: Date | string; minTotalWetMass?: number; minTotalYield?: number; - names?: string[]; - operationBoundaryIds?: string[]; - propertyFilters?: string[]; - sources?: string[]; - statuses?: string[]; + names?: Array; + operationBoundaryIds?: Array; + propertyFilters?: Array; + sources?: Array; + statuses?: Array; } // @public export interface HarvestDataListdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type HarvestDataListParameters = RequestParameters & HarvestDataListQueryParam; +export type HarvestDataListParameters = HarvestDataListQueryParam & RequestParameters; // @public (undocumented) export interface HarvestDataListQueryParam { @@ -2137,18 +2328,18 @@ export interface HarvestDataListQueryParam { export interface HarvestDataListQueryParamProperties { $maxPageSize?: number; $skipToken?: string; - associatedBoundaryIds?: string[]; - ids?: string[]; + associatedBoundaryIds?: Array; + ids?: Array; maxArea?: number; maxAvgMoisture?: number; maxAvgSpeed?: number; maxAvgWetMass?: number; maxAvgYield?: number; - maxCreatedDateTime?: Date; - maxLastModifiedDateTime?: Date; - maxOperationEndDateTime?: Date; - maxOperationModifiedDateTime?: Date; - maxOperationStartDateTime?: Date; + maxCreatedDateTime?: Date | string; + maxLastModifiedDateTime?: Date | string; + maxOperationEndDateTime?: Date | string; + maxOperationModifiedDateTime?: Date | string; + maxOperationStartDateTime?: Date | string; maxTotalWetMass?: number; maxTotalYield?: number; minArea?: number; @@ -2156,29 +2347,54 @@ export interface HarvestDataListQueryParamProperties { minAvgSpeed?: number; minAvgWetMass?: number; minAvgYield?: number; - minCreatedDateTime?: Date; - minLastModifiedDateTime?: Date; - minOperationEndDateTime?: Date; - minOperationModifiedDateTime?: Date; - minOperationStartDateTime?: Date; + minCreatedDateTime?: Date | string; + minLastModifiedDateTime?: Date | string; + minOperationEndDateTime?: Date | string; + minOperationModifiedDateTime?: Date | string; + minOperationStartDateTime?: Date | string; minTotalWetMass?: number; minTotalYield?: number; - names?: string[]; - operationBoundaryIds?: string[]; - propertyFilters?: string[]; - sources?: string[]; - statuses?: string[]; + names?: Array; + operationBoundaryIds?: Array; + propertyFilters?: Array; + sources?: Array; + statuses?: Array; } // @public (undocumented) -export interface HarvestDataListResponse { +export interface HarvestDataListResponseOutput { + $skipToken?: string; nextLink?: string; - skipToken?: string; - value?: HarvestData[]; + value?: Array; } // @public (undocumented) -export type HarvestDataPropertiesDictionary = Record; +export interface HarvestDataOutput { + area?: MeasureOutput; + associatedBoundaryId?: string; + attachmentsLink?: string; + avgMoisture?: MeasureOutput; + avgSpeed?: MeasureOutput; + avgWetMass?: MeasureOutput; + avgYield?: MeasureOutput; + createdDateTime?: string; + description?: string; + eTag?: string; + farmerId?: string; + harvestProductDetails?: Array; + id?: string; + modifiedDateTime?: string; + name?: string; + operationBoundaryId?: string; + operationEndDateTime?: string; + operationModifiedDateTime?: string; + operationStartDateTime?: string; + properties?: Record; + source?: string; + status?: string; + totalWetMass?: MeasureOutput; + totalYield?: MeasureOutput; +} // @public (undocumented) export interface HarvestProductDetail { @@ -2192,49 +2408,63 @@ export interface HarvestProductDetail { } // @public (undocumented) -export interface ImageFile { +export interface HarvestProductDetailOutput { + area?: MeasureOutput; + avgMoisture?: MeasureOutput; + avgWetMass?: MeasureOutput; + avgYield?: MeasureOutput; + productName?: string; + totalWetMass?: MeasureOutput; + totalYield?: MeasureOutput; +} + +// @public (undocumented) +export interface ImageFileOutput { fileLink?: string; - imageFormat?: ImageFormat; + imageFormat?: "TIF"; name: string; resolution?: number; } // @public (undocumented) -export type ImageFormat = "TIF"; +export interface ImageProcessingCreateRasterizeJob { + get(options?: ImageProcessingGetRasterizeJobParameters): Promise; + put(options?: ImageProcessingCreateRasterizeJobParameters): Promise; +} // @public export interface ImageProcessingCreateRasterizeJob202Response extends HttpResponse { // (undocumented) - body: ImageProcessingRasterizeJob; + body: ImageProcessingRasterizeJobOutput; // (undocumented) status: "202"; } // @public (undocumented) export interface ImageProcessingCreateRasterizeJobBodyParam { - // (undocumented) body?: ImageProcessingRasterizeJob; } // @public export interface ImageProcessingCreateRasterizeJobdefaultResponse extends HttpResponse { + // (undocumented) + body: Record; // (undocumented) status: "500"; } // @public (undocumented) -export type ImageProcessingCreateRasterizeJobParameters = RequestParameters & ImageProcessingCreateRasterizeJobBodyParam; +export interface ImageProcessingCreateRasterizeJobMediaTypesParam { + contentType?: "application/json"; +} // @public (undocumented) -export interface ImageProcessingGetRasterizeJob { - get(options?: ImageProcessingGetRasterizeJobParameters): Promise; - put(options?: ImageProcessingCreateRasterizeJobParameters): Promise; -} +export type ImageProcessingCreateRasterizeJobParameters = ImageProcessingCreateRasterizeJobMediaTypesParam & ImageProcessingCreateRasterizeJobBodyParam & RequestParameters; // @public export interface ImageProcessingGetRasterizeJob200Response extends HttpResponse { // (undocumented) - body: ImageProcessingRasterizeJob; + body: ImageProcessingRasterizeJobOutput; // (undocumented) status: "200"; } @@ -2244,39 +2474,48 @@ export type ImageProcessingGetRasterizeJobParameters = RequestParameters; // @public (undocumented) export interface ImageProcessingRasterizeJob { - createdDateTime?: Date; + createdDateTime?: Date | string; description?: string; durationInSeconds?: number; - endTime?: Date; + endTime?: Date | string; farmerId: string; id?: string; - lastActionDateTime?: Date; + lastActionDateTime?: Date | string; message?: string; name?: string; - properties?: ImageProcessingRasterizeJobPropertiesDictionary; + properties?: Record; shapefileAttachmentId: string; - shapefileColumnNames: string[]; - startTime?: Date; + shapefileColumnNames: Array; + startTime?: Date | string; status?: string; } // @public (undocumented) -export type ImageProcessingRasterizeJobPropertiesDictionary = Record; - -// @public (undocumented) -export type InnerError = InnerErrorBase & InnerErrorDictionary; +export interface ImageProcessingRasterizeJobOutput { + createdDateTime?: string; + description?: string; + durationInSeconds?: number; + endTime?: string; + farmerId: string; + id?: string; + lastActionDateTime?: string; + message?: string; + name?: string; + properties?: Record; + shapefileAttachmentId: string; + shapefileColumnNames: Array; + startTime?: string; + status?: string; +} // @public (undocumented) -export interface InnerErrorBase { +export interface InnerErrorOutput extends Record { code?: string; - innererror?: InnerError; + innererror?: InnerErrorOutput; } // @public (undocumented) -export type InnerErrorDictionary = Record; - -// @public (undocumented) -export interface Location { +export interface LocationOutput { latitude: number; longitude: number; } @@ -2288,17 +2527,31 @@ export interface Measure { } // @public (undocumented) -export type MultiPolygon = MultiPolygonBase & MultiPolygonCoordinates & { - type: "MultiPolygon"; -}; +export interface MeasureOutput { + unit?: string; + value?: number; +} // @public (undocumented) -export interface MultiPolygonBase { +export interface MultiPolygon extends GeoJsonObjectBase, MultiPolygonCoordinates { + // (undocumented) + type: "MultiPolygon"; } // @public (undocumented) export interface MultiPolygonCoordinates { - coordinates: number[][][][]; + coordinates: Array>>>; +} + +// @public (undocumented) +export interface MultiPolygonCoordinatesOutput { + coordinates: Array>>>; +} + +// @public (undocumented) +export interface MultiPolygonOutput extends GeoJsonObjectOutputBase, MultiPolygonCoordinatesOutput { + // (undocumented) + type: "MultiPolygon"; } // @public (undocumented) @@ -2314,30 +2567,42 @@ export interface OAuthProvider { apiKey?: string; appId?: string; appSecret?: string; - createdDateTime?: Date; + createdDateTime?: Date | string; description?: string; eTag?: string; id?: string; isProductionApp?: boolean; - modifiedDateTime?: Date; + modifiedDateTime?: Date | string; name?: string; - properties?: OAuthProviderPropertiesDictionary; + properties?: Record; } // @public (undocumented) -export interface OAuthProviderListResponse { +export interface OAuthProviderListResponseOutput { + $skipToken?: string; nextLink?: string; - skipToken?: string; - value?: OAuthProvider[]; + value?: Array; } // @public (undocumented) -export type OAuthProviderPropertiesDictionary = Record; +export interface OAuthProviderOutput { + apiKey?: string; + appId?: string; + appSecret?: string; + createdDateTime?: string; + description?: string; + eTag?: string; + id?: string; + isProductionApp?: boolean; + modifiedDateTime?: string; + name?: string; + properties?: Record; +} // @public export interface OAuthProvidersCreateOrUpdate200Response extends HttpResponse { // (undocumented) - body: OAuthProvider; + body: OAuthProviderOutput; // (undocumented) status: "200"; } @@ -2345,37 +2610,36 @@ export interface OAuthProvidersCreateOrUpdate200Response extends HttpResponse { // @public export interface OAuthProvidersCreateOrUpdate201Response extends HttpResponse { // (undocumented) - body: OAuthProvider; + body: OAuthProviderOutput; // (undocumented) status: "201"; } // @public (undocumented) export interface OAuthProvidersCreateOrUpdateBodyParam { - // (undocumented) body?: OAuthProvider; } // @public export interface OAuthProvidersCreateOrUpdatedefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type OAuthProvidersCreateOrUpdateParameters = RequestParameters & OAuthProvidersCreateOrUpdateBodyParam; +export interface OAuthProvidersCreateOrUpdateMediaTypesParam { + contentType?: "application/merge-patch+json"; +} // @public (undocumented) -export interface OAuthProvidersDelete { - delete(options?: OAuthProvidersDeleteParameters): Promise; - get(options?: OAuthProvidersGetParameters): Promise; - patch(options?: OAuthProvidersCreateOrUpdateParameters): Promise; -} +export type OAuthProvidersCreateOrUpdateParameters = OAuthProvidersCreateOrUpdateMediaTypesParam & OAuthProvidersCreateOrUpdateBodyParam & RequestParameters; // @public export interface OAuthProvidersDelete204Response extends HttpResponse { + // (undocumented) + body: Record; // (undocumented) status: "204"; } @@ -2383,7 +2647,7 @@ export interface OAuthProvidersDelete204Response extends HttpResponse { // @public export interface OAuthProvidersDeletedefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } @@ -2391,10 +2655,17 @@ export interface OAuthProvidersDeletedefaultResponse extends HttpResponse { // @public (undocumented) export type OAuthProvidersDeleteParameters = RequestParameters; +// @public (undocumented) +export interface OAuthProvidersGet { + delete(options?: OAuthProvidersDeleteParameters): Promise; + get(options?: OAuthProvidersGetParameters): Promise; + patch(options?: OAuthProvidersCreateOrUpdateParameters): Promise; +} + // @public export interface OAuthProvidersGet200Response extends HttpResponse { // (undocumented) - body: OAuthProvider; + body: OAuthProviderOutput; // (undocumented) status: "200"; } @@ -2402,7 +2673,7 @@ export interface OAuthProvidersGet200Response extends HttpResponse { // @public export interface OAuthProvidersGetdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } @@ -2418,7 +2689,7 @@ export interface OAuthProvidersList { // @public export interface OAuthProvidersList200Response extends HttpResponse { // (undocumented) - body: OAuthProviderListResponse; + body: OAuthProviderListResponseOutput; // (undocumented) status: "200"; } @@ -2426,13 +2697,13 @@ export interface OAuthProvidersList200Response extends HttpResponse { // @public export interface OAuthProvidersListdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type OAuthProvidersListParameters = RequestParameters & OAuthProvidersListQueryParam; +export type OAuthProvidersListParameters = OAuthProvidersListQueryParam & RequestParameters; // @public (undocumented) export interface OAuthProvidersListQueryParam { @@ -2444,43 +2715,37 @@ export interface OAuthProvidersListQueryParam { export interface OAuthProvidersListQueryParamProperties { $maxPageSize?: number; $skipToken?: string; - ids?: string[]; - maxCreatedDateTime?: Date; - maxLastModifiedDateTime?: Date; - minCreatedDateTime?: Date; - minLastModifiedDateTime?: Date; - names?: string[]; - propertyFilters?: string[]; - statuses?: string[]; -} - -// @public (undocumented) -export interface OAuthToken { - authProviderId: string; - createdDateTime?: Date; - eTag?: string; - farmerId: string; - isValid?: boolean; - modifiedDateTime?: Date; + ids?: Array; + maxCreatedDateTime?: Date | string; + maxLastModifiedDateTime?: Date | string; + minCreatedDateTime?: Date | string; + minLastModifiedDateTime?: Date | string; + names?: Array; + propertyFilters?: Array; + statuses?: Array; } // @public (undocumented) -export interface OAuthTokenListResponse { +export interface OAuthTokenListResponseOutput { + $skipToken?: string; nextLink?: string; - skipToken?: string; - value?: OAuthToken[]; + value?: Array; } // @public (undocumented) -export interface OAuthTokensCreateCascadeDeleteJob { - get(options?: OAuthTokensGetCascadeDeleteJobDetailsParameters): Promise; - put(options?: OAuthTokensCreateCascadeDeleteJobParameters): Promise; +export interface OAuthTokenOutput { + authProviderId: string; + createdDateTime?: string; + eTag?: string; + farmerId: string; + isValid?: boolean; + modifiedDateTime?: string; } // @public export interface OAuthTokensCreateCascadeDeleteJob202Response extends HttpResponse { // (undocumented) - body: CascadeDeleteJob; + body: CascadeDeleteJobOutput; // (undocumented) status: "202"; } @@ -2488,13 +2753,13 @@ export interface OAuthTokensCreateCascadeDeleteJob202Response extends HttpRespon // @public export interface OAuthTokensCreateCascadeDeleteJobdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type OAuthTokensCreateCascadeDeleteJobParameters = RequestParameters & OAuthTokensCreateCascadeDeleteJobQueryParam; +export type OAuthTokensCreateCascadeDeleteJobParameters = OAuthTokensCreateCascadeDeleteJobQueryParam & RequestParameters; // @public (undocumented) export interface OAuthTokensCreateCascadeDeleteJobQueryParam { @@ -2508,10 +2773,16 @@ export interface OAuthTokensCreateCascadeDeleteJobQueryParamProperties { oauthProviderId: string; } +// @public (undocumented) +export interface OAuthTokensGetCascadeDeleteJobDetails { + get(options?: OAuthTokensGetCascadeDeleteJobDetailsParameters): Promise; + put(options: OAuthTokensCreateCascadeDeleteJobParameters): Promise; +} + // @public export interface OAuthTokensGetCascadeDeleteJobDetails200Response extends HttpResponse { // (undocumented) - body: CascadeDeleteJob; + body: CascadeDeleteJobOutput; // (undocumented) status: "200"; } @@ -2519,7 +2790,7 @@ export interface OAuthTokensGetCascadeDeleteJobDetails200Response extends HttpRe // @public export interface OAuthTokensGetCascadeDeleteJobDetailsdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } @@ -2542,20 +2813,24 @@ export interface OAuthTokensGetOAuthConnectionLink200Response extends HttpRespon // @public (undocumented) export interface OAuthTokensGetOAuthConnectionLinkBodyParam { - // (undocumented) body?: OAuthConnectRequest; } // @public export interface OAuthTokensGetOAuthConnectionLinkdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type OAuthTokensGetOAuthConnectionLinkParameters = RequestParameters & OAuthTokensGetOAuthConnectionLinkBodyParam; +export interface OAuthTokensGetOAuthConnectionLinkMediaTypesParam { + contentType?: "application/json"; +} + +// @public (undocumented) +export type OAuthTokensGetOAuthConnectionLinkParameters = OAuthTokensGetOAuthConnectionLinkMediaTypesParam & OAuthTokensGetOAuthConnectionLinkBodyParam & RequestParameters; // @public (undocumented) export interface OAuthTokensList { @@ -2565,7 +2840,7 @@ export interface OAuthTokensList { // @public export interface OAuthTokensList200Response extends HttpResponse { // (undocumented) - body: OAuthTokenListResponse; + body: OAuthTokenListResponseOutput; // (undocumented) status: "200"; } @@ -2573,13 +2848,13 @@ export interface OAuthTokensList200Response extends HttpResponse { // @public export interface OAuthTokensListdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type OAuthTokensListParameters = RequestParameters & OAuthTokensListQueryParam; +export type OAuthTokensListParameters = OAuthTokensListQueryParam & RequestParameters; // @public (undocumented) export interface OAuthTokensListQueryParam { @@ -2591,17 +2866,17 @@ export interface OAuthTokensListQueryParam { export interface OAuthTokensListQueryParamProperties { $maxPageSize?: number; $skipToken?: string; - authProviderIds?: string[]; - farmerIds?: string[]; + authProviderIds?: Array; + farmerIds?: Array; isValid?: boolean; - maxCreatedDateTime?: Date; - maxLastModifiedDateTime?: Date; - minCreatedDateTime?: Date; - minLastModifiedDateTime?: Date; + maxCreatedDateTime?: Date | string; + maxLastModifiedDateTime?: Date | string; + minCreatedDateTime?: Date | string; + minLastModifiedDateTime?: Date | string; } // @public -export function paginate(client: Client, initialResponse: TReturn): PagedAsyncIterableIterator, PaginateReturn[]>; +export function paginate(client: Client, initialResponse: TResponse, options?: PagingOptions): PagedAsyncIterableIterator>; // @public export type PaginateReturn = TResult extends { @@ -2610,20 +2885,9 @@ export type PaginateReturn = TResult extends { }; } ? GetArrayType : Array; -// @public (undocumented) -export interface Paths1LxjoxzFarmersFarmeridAttachmentsAttachmentidPatchRequestbodyContentMultipartFormDataSchema { - createdDateTime?: string; - description?: string; - eTag?: string; - farmerId?: string; - file?: string; - id?: string; - modifiedDateTime?: string; - name?: string; - originalFileName?: string; - resourceId?: string; - resourceType?: string; - status?: string; +// @public +export interface PagingOptions { + customGetPage?: GetPage[]>; } // @public (undocumented) @@ -2633,19 +2897,19 @@ export interface PlantingData { attachmentsLink?: string; avgMaterial?: Measure; avgPlantingRate?: Measure; - createdDateTime?: Date; + createdDateTime?: Date | string; description?: string; eTag?: string; farmerId?: string; id?: string; - modifiedDateTime?: Date; + modifiedDateTime?: Date | string; name?: string; operationBoundaryId?: string; - operationEndDateTime?: Date; - operationModifiedDateTime?: Date; - operationStartDateTime?: Date; - plantingProductDetails?: PlantingProductDetail[]; - properties?: PlantingDataPropertiesDictionary; + operationEndDateTime?: Date | string; + operationModifiedDateTime?: Date | string; + operationStartDateTime?: Date | string; + plantingProductDetails?: Array; + properties?: Record; source?: string; status?: string; totalMaterial?: Measure; @@ -2654,7 +2918,7 @@ export interface PlantingData { // @public export interface PlantingDataCreateOrUpdate200Response extends HttpResponse { // (undocumented) - body: PlantingData; + body: PlantingDataOutput; // (undocumented) status: "200"; } @@ -2662,37 +2926,36 @@ export interface PlantingDataCreateOrUpdate200Response extends HttpResponse { // @public export interface PlantingDataCreateOrUpdate201Response extends HttpResponse { // (undocumented) - body: PlantingData; + body: PlantingDataOutput; // (undocumented) status: "201"; } // @public (undocumented) export interface PlantingDataCreateOrUpdateBodyParam { - // (undocumented) body?: PlantingData; } // @public export interface PlantingDataCreateOrUpdatedefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type PlantingDataCreateOrUpdateParameters = RequestParameters & PlantingDataCreateOrUpdateBodyParam; +export interface PlantingDataCreateOrUpdateMediaTypesParam { + contentType?: "application/merge-patch+json"; +} // @public (undocumented) -export interface PlantingDataDelete { - delete(options?: PlantingDataDeleteParameters): Promise; - get(options?: PlantingDataGetParameters): Promise; - patch(options?: PlantingDataCreateOrUpdateParameters): Promise; -} +export type PlantingDataCreateOrUpdateParameters = PlantingDataCreateOrUpdateMediaTypesParam & PlantingDataCreateOrUpdateBodyParam & RequestParameters; // @public export interface PlantingDataDelete204Response extends HttpResponse { + // (undocumented) + body: Record; // (undocumented) status: "204"; } @@ -2700,7 +2963,7 @@ export interface PlantingDataDelete204Response extends HttpResponse { // @public export interface PlantingDataDeletedefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } @@ -2708,10 +2971,17 @@ export interface PlantingDataDeletedefaultResponse extends HttpResponse { // @public (undocumented) export type PlantingDataDeleteParameters = RequestParameters; +// @public (undocumented) +export interface PlantingDataGet { + delete(options?: PlantingDataDeleteParameters): Promise; + get(options?: PlantingDataGetParameters): Promise; + patch(options?: PlantingDataCreateOrUpdateParameters): Promise; +} + // @public export interface PlantingDataGet200Response extends HttpResponse { // (undocumented) - body: PlantingData; + body: PlantingDataOutput; // (undocumented) status: "200"; } @@ -2719,7 +2989,7 @@ export interface PlantingDataGet200Response extends HttpResponse { // @public export interface PlantingDataGetdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } @@ -2735,7 +3005,7 @@ export interface PlantingDataList { // @public export interface PlantingDataList200Response extends HttpResponse { // (undocumented) - body: PlantingDataListResponse; + body: PlantingDataListResponseOutput; // (undocumented) status: "200"; } @@ -2748,7 +3018,7 @@ export interface PlantingDataListByFarmerId { // @public export interface PlantingDataListByFarmerId200Response extends HttpResponse { // (undocumented) - body: PlantingDataListResponse; + body: PlantingDataListResponseOutput; // (undocumented) status: "200"; } @@ -2756,13 +3026,13 @@ export interface PlantingDataListByFarmerId200Response extends HttpResponse { // @public export interface PlantingDataListByFarmerIddefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type PlantingDataListByFarmerIdParameters = RequestParameters & PlantingDataListByFarmerIdQueryParam; +export type PlantingDataListByFarmerIdParameters = PlantingDataListByFarmerIdQueryParam & RequestParameters; // @public (undocumented) export interface PlantingDataListByFarmerIdQueryParam { @@ -2774,43 +3044,43 @@ export interface PlantingDataListByFarmerIdQueryParam { export interface PlantingDataListByFarmerIdQueryParamProperties { $maxPageSize?: number; $skipToken?: string; - associatedBoundaryIds?: string[]; - ids?: string[]; + associatedBoundaryIds?: Array; + ids?: Array; maxArea?: number; maxAvgMaterial?: number; maxAvgPlantingRate?: number; - maxCreatedDateTime?: Date; - maxLastModifiedDateTime?: Date; - maxOperationEndDateTime?: Date; - maxOperationModifiedDateTime?: Date; - maxOperationStartDateTime?: Date; + maxCreatedDateTime?: Date | string; + maxLastModifiedDateTime?: Date | string; + maxOperationEndDateTime?: Date | string; + maxOperationModifiedDateTime?: Date | string; + maxOperationStartDateTime?: Date | string; maxTotalMaterial?: number; minArea?: number; minAvgMaterial?: number; minAvgPlantingRate?: number; - minCreatedDateTime?: Date; - minLastModifiedDateTime?: Date; - minOperationEndDateTime?: Date; - minOperationModifiedDateTime?: Date; - minOperationStartDateTime?: Date; + minCreatedDateTime?: Date | string; + minLastModifiedDateTime?: Date | string; + minOperationEndDateTime?: Date | string; + minOperationModifiedDateTime?: Date | string; + minOperationStartDateTime?: Date | string; minTotalMaterial?: number; - names?: string[]; - operationBoundaryIds?: string[]; - propertyFilters?: string[]; - sources?: string[]; - statuses?: string[]; + names?: Array; + operationBoundaryIds?: Array; + propertyFilters?: Array; + sources?: Array; + statuses?: Array; } // @public export interface PlantingDataListdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type PlantingDataListParameters = RequestParameters & PlantingDataListQueryParam; +export type PlantingDataListParameters = PlantingDataListQueryParam & RequestParameters; // @public (undocumented) export interface PlantingDataListQueryParam { @@ -2822,42 +3092,64 @@ export interface PlantingDataListQueryParam { export interface PlantingDataListQueryParamProperties { $maxPageSize?: number; $skipToken?: string; - associatedBoundaryIds?: string[]; - ids?: string[]; + associatedBoundaryIds?: Array; + ids?: Array; maxArea?: number; maxAvgMaterial?: number; maxAvgPlantingRate?: number; - maxCreatedDateTime?: Date; - maxLastModifiedDateTime?: Date; - maxOperationEndDateTime?: Date; - maxOperationModifiedDateTime?: Date; - maxOperationStartDateTime?: Date; + maxCreatedDateTime?: Date | string; + maxLastModifiedDateTime?: Date | string; + maxOperationEndDateTime?: Date | string; + maxOperationModifiedDateTime?: Date | string; + maxOperationStartDateTime?: Date | string; maxTotalMaterial?: number; minArea?: number; minAvgMaterial?: number; minAvgPlantingRate?: number; - minCreatedDateTime?: Date; - minLastModifiedDateTime?: Date; - minOperationEndDateTime?: Date; - minOperationModifiedDateTime?: Date; - minOperationStartDateTime?: Date; + minCreatedDateTime?: Date | string; + minLastModifiedDateTime?: Date | string; + minOperationEndDateTime?: Date | string; + minOperationModifiedDateTime?: Date | string; + minOperationStartDateTime?: Date | string; minTotalMaterial?: number; - names?: string[]; - operationBoundaryIds?: string[]; - propertyFilters?: string[]; - sources?: string[]; - statuses?: string[]; + names?: Array; + operationBoundaryIds?: Array; + propertyFilters?: Array; + sources?: Array; + statuses?: Array; } // @public (undocumented) -export interface PlantingDataListResponse { +export interface PlantingDataListResponseOutput { + $skipToken?: string; nextLink?: string; - skipToken?: string; - value?: PlantingData[]; + value?: Array; } // @public (undocumented) -export type PlantingDataPropertiesDictionary = Record; +export interface PlantingDataOutput { + area?: MeasureOutput; + associatedBoundaryId?: string; + attachmentsLink?: string; + avgMaterial?: MeasureOutput; + avgPlantingRate?: MeasureOutput; + createdDateTime?: string; + description?: string; + eTag?: string; + farmerId?: string; + id?: string; + modifiedDateTime?: string; + name?: string; + operationBoundaryId?: string; + operationEndDateTime?: string; + operationModifiedDateTime?: string; + operationStartDateTime?: string; + plantingProductDetails?: Array; + properties?: Record; + source?: string; + status?: string; + totalMaterial?: MeasureOutput; +} // @public (undocumented) export interface PlantingProductDetail { @@ -2868,179 +3160,241 @@ export interface PlantingProductDetail { } // @public (undocumented) -export type Point = PointBase & PointCoordinates & { - type: "Point"; -}; +export interface PlantingProductDetailOutput { + area?: MeasureOutput; + avgMaterial?: MeasureOutput; + productName?: string; + totalMaterial?: MeasureOutput; +} // @public (undocumented) -export interface PointBase { +export interface Point extends GeoJsonObjectBase, PointCoordinates { + // (undocumented) + type: "Point"; } // @public (undocumented) export interface PointCoordinates { - coordinates: number[]; + coordinates: Array; } // @public (undocumented) -export type Polygon = PolygonBase & PolygonCoordinates & { - type: "Polygon"; -}; +export interface PointCoordinatesOutput { + coordinates: Array; +} + +// @public (undocumented) +export interface PointOutput extends GeoJsonObjectOutputBase, PointCoordinatesOutput { + // (undocumented) + type: "Point"; +} // @public (undocumented) -export interface PolygonBase { +export interface Polygon extends GeoJsonObjectBase, PolygonCoordinates { + // (undocumented) + type: "Polygon"; } // @public (undocumented) export interface PolygonCoordinates { - coordinates: number[][][]; + coordinates: Array>>; +} + +// @public (undocumented) +export interface PolygonCoordinatesOutput { + coordinates: Array>>; +} + +// @public (undocumented) +export interface PolygonOutput extends GeoJsonObjectOutputBase, PolygonCoordinatesOutput { + // (undocumented) + type: "Polygon"; } // @public (undocumented) export interface Routes { (path: "/farmers/{farmerId}/application-data", farmerId: string): ApplicationDataListByFarmerId; (path: "/application-data"): ApplicationDataList; - (path: "/farmers/{farmerId}/application-data/{applicationDataId}", farmerId: string, applicationDataId: string): ApplicationDataDelete; + (path: "/farmers/{farmerId}/application-data/{applicationDataId}", farmerId: string, applicationDataId: string): ApplicationDataGet; (path: "/farmers/{farmerId}/attachments", farmerId: string): AttachmentsListByFarmerId; - (path: "/farmers/{farmerId}/attachments/{attachmentId}", farmerId: string, attachmentId: string): AttachmentsDelete; + (path: "/farmers/{farmerId}/attachments/{attachmentId}", farmerId: string, attachmentId: string): AttachmentsGet; (path: "/farmers/{farmerId}/attachments/{attachmentId}/file", farmerId: string, attachmentId: string): AttachmentsDownload; - (path: "/farmers/{farmerId}/boundaries", farmerId: string): BoundariesSearchByFarmerId; - (path: "/boundaries"): BoundariesSearch; - (path: "/boundaries/cascade-delete/{jobId}", jobId: string): BoundariesCreateCascadeDeleteJob; - (path: "/farmers/{farmerId}/boundaries/{boundaryId}", farmerId: string, boundaryId: string): BoundariesDelete; + (path: "/farmers/{farmerId}/boundaries", farmerId: string): BoundariesListByFarmerId; + (path: "/boundaries"): BoundariesList; + (path: "/boundaries/cascade-delete/{jobId}", jobId: string): BoundariesGetCascadeDeleteJobDetails; + (path: "/farmers/{farmerId}/boundaries/{boundaryId}", farmerId: string, boundaryId: string): BoundariesGet; (path: "/farmers/{farmerId}/boundaries/{boundaryId}/overlap", farmerId: string, boundaryId: string): BoundariesGetOverlap; (path: "/crops"): CropsList; - (path: "/crops/{cropId}", cropId: string): CropsDelete; + (path: "/crops/{cropId}", cropId: string): CropsGet; (path: "/crops/{cropId}/crop-varieties", cropId: string): CropVarietiesListByCropId; (path: "/crop-varieties"): CropVarietiesList; - (path: "/crops/{cropId}/crop-varieties/{cropVarietyId}", cropId: string, cropVarietyId: string): CropVarietiesDelete; + (path: "/crops/{cropId}/crop-varieties/{cropVarietyId}", cropId: string, cropVarietyId: string): CropVarietiesGet; (path: "/farmers"): FarmersList; - (path: "/farmers/{farmerId}", farmerId: string): FarmersDelete; - (path: "/farmers/cascade-delete/{jobId}", jobId: string): FarmersCreateCascadeDeleteJob; - (path: "/farm-operations/ingest-data/{jobId}", jobId: string): FarmOperationsGetDataIngestionJobDetails; + (path: "/farmers/{farmerId}", farmerId: string): FarmersGet; + (path: "/farmers/cascade-delete/{jobId}", jobId: string): FarmersGetCascadeDeleteJobDetails; + (path: "/farm-operations/ingest-data/{jobId}", jobId: string): FarmOperationsCreateDataIngestionJob; (path: "/farmers/{farmerId}/farms", farmerId: string): FarmsListByFarmerId; (path: "/farms"): FarmsList; - (path: "/farmers/{farmerId}/farms/{farmId}", farmerId: string, farmId: string): FarmsDelete; - (path: "/farms/cascade-delete/{jobId}", jobId: string): FarmsCreateCascadeDeleteJob; + (path: "/farmers/{farmerId}/farms/{farmId}", farmerId: string, farmId: string): FarmsGet; + (path: "/farms/cascade-delete/{jobId}", jobId: string): FarmsGetCascadeDeleteJobDetails; (path: "/farmers/{farmerId}/fields", farmerId: string): FieldsListByFarmerId; (path: "/fields"): FieldsList; - (path: "/farmers/{farmerId}/fields/{fieldId}", farmerId: string, fieldId: string): FieldsDelete; - (path: "/fields/cascade-delete/{jobId}", jobId: string): FieldsCreateCascadeDeleteJob; + (path: "/farmers/{farmerId}/fields/{fieldId}", farmerId: string, fieldId: string): FieldsGet; + (path: "/fields/cascade-delete/{jobId}", jobId: string): FieldsGetCascadeDeleteJobDetails; (path: "/farmers/{farmerId}/harvest-data", farmerId: string): HarvestDataListByFarmerId; (path: "/harvest-data"): HarvestDataList; - (path: "/farmers/{farmerId}/harvest-data/{harvestDataId}", farmerId: string, harvestDataId: string): HarvestDataDelete; - (path: "/image-processing/rasterize/{jobId}", jobId: string): ImageProcessingGetRasterizeJob; + (path: "/farmers/{farmerId}/harvest-data/{harvestDataId}", farmerId: string, harvestDataId: string): HarvestDataGet; + (path: "/image-processing/rasterize/{jobId}", jobId: string): ImageProcessingCreateRasterizeJob; (path: "/oauth/providers"): OAuthProvidersList; - (path: "/oauth/providers/{oauthProviderId}", oauthProviderId: string): OAuthProvidersDelete; + (path: "/oauth/providers/{oauthProviderId}", oauthProviderId: string): OAuthProvidersGet; (path: "/oauth/tokens"): OAuthTokensList; (path: "/oauth/tokens/:connect"): OAuthTokensGetOAuthConnectionLink; - (path: "/oauth/tokens/remove/{jobId}", jobId: string): OAuthTokensCreateCascadeDeleteJob; + (path: "/oauth/tokens/remove/{jobId}", jobId: string): OAuthTokensGetCascadeDeleteJobDetails; (path: "/farmers/{farmerId}/planting-data", farmerId: string): PlantingDataListByFarmerId; (path: "/planting-data"): PlantingDataList; - (path: "/farmers/{farmerId}/planting-data/{plantingDataId}", farmerId: string, plantingDataId: string): PlantingDataDelete; + (path: "/farmers/{farmerId}/planting-data/{plantingDataId}", farmerId: string, plantingDataId: string): PlantingDataGet; (path: "/scenes"): ScenesList; - (path: "/scenes/satellite/ingest-data/{jobId}", jobId: string): ScenesGetSatelliteDataIngestionJobDetails; + (path: "/scenes/satellite/ingest-data/{jobId}", jobId: string): ScenesCreateSatelliteDataIngestionJob; (path: "/scenes/downloadFiles"): ScenesDownload; (path: "/farmers/{farmerId}/seasonal-fields", farmerId: string): SeasonalFieldsListByFarmerId; (path: "/seasonal-fields"): SeasonalFieldsList; - (path: "/farmers/{farmerId}/seasonal-fields/{seasonalFieldId}", farmerId: string, seasonalFieldId: string): SeasonalFieldsDelete; - (path: "/seasonal-fields/cascade-delete/{jobId}", jobId: string): SeasonalFieldsCreateCascadeDeleteJob; + (path: "/farmers/{farmerId}/seasonal-fields/{seasonalFieldId}", farmerId: string, seasonalFieldId: string): SeasonalFieldsGet; + (path: "/seasonal-fields/cascade-delete/{jobId}", jobId: string): SeasonalFieldsGetCascadeDeleteJobDetails; (path: "/seasons"): SeasonsList; - (path: "/seasons/{seasonId}", seasonId: string): SeasonsDelete; + (path: "/seasons/{seasonId}", seasonId: string): SeasonsGet; (path: "/farmers/{farmerId}/tillage-data", farmerId: string): TillageDataListByFarmerId; (path: "/tillage-data"): TillageDataList; - (path: "/farmers/{farmerId}/tillage-data/{tillageDataId}", farmerId: string, tillageDataId: string): TillageDataDelete; + (path: "/farmers/{farmerId}/tillage-data/{tillageDataId}", farmerId: string, tillageDataId: string): TillageDataGet; (path: "/weather"): WeatherList; - (path: "/weather/ingest-data/{jobId}", jobId: string): WeatherCreateDataIngestionJob; - (path: "/weather/delete-data/{jobId}", jobId: string): WeatherCreateDataDeleteJob; + (path: "/weather/ingest-data/{jobId}", jobId: string): WeatherGetDataIngestionJobDetails; + (path: "/weather/delete-data/{jobId}", jobId: string): WeatherGetDataDeleteJobDetails; } // @public (undocumented) export interface SatelliteData { - imageFormats?: string[]; - imageNames?: string[]; - imageResolutions?: number[]; + imageFormats?: Array; + imageNames?: Array; + imageResolutions?: Array; } // @public (undocumented) export interface SatelliteDataIngestionJob { boundaryId: string; - createdDateTime?: Date; + createdDateTime?: Date | string; data?: SatelliteData; description?: string; durationInSeconds?: number; - endDateTime: Date; - endTime?: Date; + endDateTime: Date | string; + endTime?: Date | string; farmerId: string; id?: string; - lastActionDateTime?: Date; + lastActionDateTime?: Date | string; message?: string; name?: string; - properties?: SatelliteDataIngestionJobPropertiesDictionary; - provider?: DataProvider; - source?: Source; - startDateTime: Date; - startTime?: Date; + properties?: Record; + provider?: "Microsoft"; + source?: "Sentinel_2_L2A"; + startDateTime: Date | string; + startTime?: Date | string; status?: string; } // @public (undocumented) -export type SatelliteDataIngestionJobPropertiesDictionary = Record; +export interface SatelliteDataIngestionJobOutput { + boundaryId: string; + createdDateTime?: string; + data?: SatelliteDataOutput; + description?: string; + durationInSeconds?: number; + endDateTime: string; + endTime?: string; + farmerId: string; + id?: string; + lastActionDateTime?: string; + message?: string; + name?: string; + properties?: Record; + provider?: "Microsoft"; + source?: "Sentinel_2_L2A"; + startDateTime: string; + startTime?: string; + status?: string; +} // @public (undocumented) -export interface Scene { +export interface SatelliteDataOutput { + imageFormats?: Array; + imageNames?: Array; + imageResolutions?: Array; +} + +// @public (undocumented) +export interface SceneListResponseOutput { + $skipToken?: string; + nextLink?: string; + value?: Array; +} + +// @public (undocumented) +export interface SceneOutput { boundaryId?: string; cloudCoverPercentage?: number; darkPixelPercentage?: number; eTag?: string; farmerId?: string; id?: string; - imageFiles?: ImageFile[]; - imageFormat?: ImageFormat; + imageFiles?: Array; + imageFormat?: "TIF"; ndviMedianValue?: number; provider?: string; - sceneDateTime?: Date; + sceneDateTime?: string; source?: string; } // @public (undocumented) -export interface SceneListResponse { - nextLink?: string; - skipToken?: string; - value?: Scene[]; +export interface ScenesCreateSatelliteDataIngestionJob { + get(options?: ScenesGetSatelliteDataIngestionJobDetailsParameters): Promise; + put(options?: ScenesCreateSatelliteDataIngestionJobParameters): Promise; } // @public export interface ScenesCreateSatelliteDataIngestionJob202Response extends HttpResponse { // (undocumented) - body: SatelliteDataIngestionJob; + body: SatelliteDataIngestionJobOutput; // (undocumented) status: "202"; } // @public (undocumented) export interface ScenesCreateSatelliteDataIngestionJobBodyParam { - // (undocumented) body?: SatelliteDataIngestionJob; } // @public export interface ScenesCreateSatelliteDataIngestionJobdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type ScenesCreateSatelliteDataIngestionJobParameters = RequestParameters & ScenesCreateSatelliteDataIngestionJobBodyParam; +export interface ScenesCreateSatelliteDataIngestionJobMediaTypesParam { + contentType?: "application/json"; +} + +// @public (undocumented) +export type ScenesCreateSatelliteDataIngestionJobParameters = ScenesCreateSatelliteDataIngestionJobMediaTypesParam & ScenesCreateSatelliteDataIngestionJobBodyParam & RequestParameters; // @public (undocumented) export interface ScenesDownload { - get(options?: ScenesDownloadParameters): Promise; + get(options: ScenesDownloadParameters): Promise; } // @public export interface ScenesDownload200Response extends HttpResponse { + // (undocumented) + body: Record; // (undocumented) status: "200"; } @@ -3048,13 +3402,13 @@ export interface ScenesDownload200Response extends HttpResponse { // @public export interface ScenesDownloaddefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type ScenesDownloadParameters = RequestParameters & ScenesDownloadQueryParam; +export type ScenesDownloadParameters = ScenesDownloadQueryParam & RequestParameters; // @public (undocumented) export interface ScenesDownloadQueryParam { @@ -3067,16 +3421,10 @@ export interface ScenesDownloadQueryParamProperties { filePath: string; } -// @public (undocumented) -export interface ScenesGetSatelliteDataIngestionJobDetails { - get(options?: ScenesGetSatelliteDataIngestionJobDetailsParameters): Promise; - put(options?: ScenesCreateSatelliteDataIngestionJobParameters): Promise; -} - // @public export interface ScenesGetSatelliteDataIngestionJobDetails200Response extends HttpResponse { // (undocumented) - body: SatelliteDataIngestionJob; + body: SatelliteDataIngestionJobOutput; // (undocumented) status: "200"; } @@ -3084,7 +3432,7 @@ export interface ScenesGetSatelliteDataIngestionJobDetails200Response extends Ht // @public export interface ScenesGetSatelliteDataIngestionJobDetailsdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } @@ -3094,13 +3442,13 @@ export type ScenesGetSatelliteDataIngestionJobDetailsParameters = RequestParamet // @public (undocumented) export interface ScenesList { - get(options?: ScenesListParameters): Promise; + get(options: ScenesListParameters): Promise; } // @public export interface ScenesList200Response extends HttpResponse { // (undocumented) - body: SceneListResponse; + body: SceneListResponseOutput; // (undocumented) status: "200"; } @@ -3108,13 +3456,13 @@ export interface ScenesList200Response extends HttpResponse { // @public export interface ScenesListdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type ScenesListParameters = RequestParameters & ScenesListQueryParam; +export type ScenesListParameters = ScenesListQueryParam & RequestParameters; // @public (undocumented) export interface ScenesListQueryParam { @@ -3127,49 +3475,49 @@ export interface ScenesListQueryParamProperties { $maxPageSize?: number; $skipToken?: string; boundaryId: string; - endDateTime?: Date; + endDateTime?: Date | string; farmerId: string; - imageFormats?: string[]; - imageNames?: string[]; - imageResolutions?: number[]; + imageFormats?: Array; + imageNames?: Array; + imageResolutions?: Array; maxCloudCoveragePercentage?: number; maxDarkPixelCoveragePercentage?: number; provider: string; source?: string; - startDateTime?: Date; + startDateTime?: Date | string; } // @public (undocumented) export interface SearchBoundaryQuery { - ids?: string[]; + $maxPageSize?: number; + $skipToken?: string; + ids?: Array; intersectsWithGeometry?: GeoJsonObject; isPrimary?: boolean; maxAcreage?: number; - maxCreatedDateTime?: Date; - maxLastModifiedDateTime?: Date; - maxPageSize?: number; + maxCreatedDateTime?: Date | string; + maxLastModifiedDateTime?: Date | string; minAcreage?: number; - minCreatedDateTime?: Date; - minLastModifiedDateTime?: Date; - names?: string[]; - parentIds?: string[]; + minCreatedDateTime?: Date | string; + minLastModifiedDateTime?: Date | string; + names?: Array; + parentIds?: Array; parentType?: string; - propertyFilters?: string[]; - skipToken?: string; - statuses?: string[]; + propertyFilters?: Array; + statuses?: Array; } // @public (undocumented) export interface Season { - createdDateTime?: Date; + createdDateTime?: Date | string; description?: string; - endDateTime?: Date; + endDateTime?: Date | string; eTag?: string; id?: string; - modifiedDateTime?: Date; + modifiedDateTime?: Date | string; name?: string; - properties?: SeasonPropertiesDictionary; - startDateTime?: Date; + properties?: Record; + startDateTime?: Date | string; status?: string; year?: number; } @@ -3180,45 +3528,61 @@ export interface SeasonalField { avgSeedPopulationValue?: number; avgYieldUnit?: string; avgYieldValue?: number; - boundaryIds?: string[]; - createdDateTime?: Date; + boundaryIds?: Array; + createdDateTime?: Date | string; cropId?: string; - cropVarietyIds?: string[]; + cropVarietyIds?: Array; description?: string; eTag?: string; farmerId?: string; farmId?: string; fieldId?: string; id?: string; - modifiedDateTime?: Date; + modifiedDateTime?: Date | string; name?: string; - plantingDateTime?: Date; + plantingDateTime?: Date | string; primaryBoundaryId?: string; - properties?: SeasonalFieldPropertiesDictionary; + properties?: Record; seasonId?: string; status?: string; } // @public (undocumented) -export interface SeasonalFieldListResponse { +export interface SeasonalFieldListResponseOutput { + $skipToken?: string; nextLink?: string; - skipToken?: string; - value?: SeasonalField[]; + value?: Array; } // @public (undocumented) -export type SeasonalFieldPropertiesDictionary = Record; - -// @public (undocumented) -export interface SeasonalFieldsCreateCascadeDeleteJob { - get(options?: SeasonalFieldsGetCascadeDeleteJobDetailsParameters): Promise; - put(options?: SeasonalFieldsCreateCascadeDeleteJobParameters): Promise; +export interface SeasonalFieldOutput { + avgSeedPopulationUnit?: string; + avgSeedPopulationValue?: number; + avgYieldUnit?: string; + avgYieldValue?: number; + boundaryIds?: Array; + createdDateTime?: string; + cropId?: string; + cropVarietyIds?: Array; + description?: string; + eTag?: string; + farmerId?: string; + farmId?: string; + fieldId?: string; + id?: string; + modifiedDateTime?: string; + name?: string; + plantingDateTime?: string; + primaryBoundaryId?: string; + properties?: Record; + seasonId?: string; + status?: string; } // @public export interface SeasonalFieldsCreateCascadeDeleteJob202Response extends HttpResponse { // (undocumented) - body: CascadeDeleteJob; + body: CascadeDeleteJobOutput; // (undocumented) status: "202"; } @@ -3226,13 +3590,13 @@ export interface SeasonalFieldsCreateCascadeDeleteJob202Response extends HttpRes // @public export interface SeasonalFieldsCreateCascadeDeleteJobdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type SeasonalFieldsCreateCascadeDeleteJobParameters = RequestParameters & SeasonalFieldsCreateCascadeDeleteJobQueryParam; +export type SeasonalFieldsCreateCascadeDeleteJobParameters = SeasonalFieldsCreateCascadeDeleteJobQueryParam & RequestParameters; // @public (undocumented) export interface SeasonalFieldsCreateCascadeDeleteJobQueryParam { @@ -3249,7 +3613,7 @@ export interface SeasonalFieldsCreateCascadeDeleteJobQueryParamProperties { // @public export interface SeasonalFieldsCreateOrUpdate200Response extends HttpResponse { // (undocumented) - body: SeasonalField; + body: SeasonalFieldOutput; // (undocumented) status: "200"; } @@ -3257,37 +3621,36 @@ export interface SeasonalFieldsCreateOrUpdate200Response extends HttpResponse { // @public export interface SeasonalFieldsCreateOrUpdate201Response extends HttpResponse { // (undocumented) - body: SeasonalField; + body: SeasonalFieldOutput; // (undocumented) status: "201"; } // @public (undocumented) export interface SeasonalFieldsCreateOrUpdateBodyParam { - // (undocumented) body?: SeasonalField; } // @public export interface SeasonalFieldsCreateOrUpdatedefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type SeasonalFieldsCreateOrUpdateParameters = RequestParameters & SeasonalFieldsCreateOrUpdateBodyParam; +export interface SeasonalFieldsCreateOrUpdateMediaTypesParam { + contentType?: "application/merge-patch+json"; +} // @public (undocumented) -export interface SeasonalFieldsDelete { - delete(options?: SeasonalFieldsDeleteParameters): Promise; - get(options?: SeasonalFieldsGetParameters): Promise; - patch(options?: SeasonalFieldsCreateOrUpdateParameters): Promise; -} +export type SeasonalFieldsCreateOrUpdateParameters = SeasonalFieldsCreateOrUpdateMediaTypesParam & SeasonalFieldsCreateOrUpdateBodyParam & RequestParameters; // @public export interface SeasonalFieldsDelete204Response extends HttpResponse { + // (undocumented) + body: Record; // (undocumented) status: "204"; } @@ -3295,7 +3658,7 @@ export interface SeasonalFieldsDelete204Response extends HttpResponse { // @public export interface SeasonalFieldsDeletedefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } @@ -3303,18 +3666,31 @@ export interface SeasonalFieldsDeletedefaultResponse extends HttpResponse { // @public (undocumented) export type SeasonalFieldsDeleteParameters = RequestParameters; +// @public (undocumented) +export interface SeasonalFieldsGet { + delete(options?: SeasonalFieldsDeleteParameters): Promise; + get(options?: SeasonalFieldsGetParameters): Promise; + patch(options?: SeasonalFieldsCreateOrUpdateParameters): Promise; +} + // @public export interface SeasonalFieldsGet200Response extends HttpResponse { // (undocumented) - body: SeasonalField; + body: SeasonalFieldOutput; // (undocumented) status: "200"; } +// @public (undocumented) +export interface SeasonalFieldsGetCascadeDeleteJobDetails { + get(options?: SeasonalFieldsGetCascadeDeleteJobDetailsParameters): Promise; + put(options: SeasonalFieldsCreateCascadeDeleteJobParameters): Promise; +} + // @public export interface SeasonalFieldsGetCascadeDeleteJobDetails200Response extends HttpResponse { // (undocumented) - body: CascadeDeleteJob; + body: CascadeDeleteJobOutput; // (undocumented) status: "200"; } @@ -3322,7 +3698,7 @@ export interface SeasonalFieldsGetCascadeDeleteJobDetails200Response extends Htt // @public export interface SeasonalFieldsGetCascadeDeleteJobDetailsdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } @@ -3333,7 +3709,7 @@ export type SeasonalFieldsGetCascadeDeleteJobDetailsParameters = RequestParamete // @public export interface SeasonalFieldsGetdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } @@ -3349,7 +3725,7 @@ export interface SeasonalFieldsList { // @public export interface SeasonalFieldsList200Response extends HttpResponse { // (undocumented) - body: SeasonalFieldListResponse; + body: SeasonalFieldListResponseOutput; // (undocumented) status: "200"; } @@ -3362,7 +3738,7 @@ export interface SeasonalFieldsListByFarmerId { // @public export interface SeasonalFieldsListByFarmerId200Response extends HttpResponse { // (undocumented) - body: SeasonalFieldListResponse; + body: SeasonalFieldListResponseOutput; // (undocumented) status: "200"; } @@ -3370,13 +3746,13 @@ export interface SeasonalFieldsListByFarmerId200Response extends HttpResponse { // @public export interface SeasonalFieldsListByFarmerIddefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type SeasonalFieldsListByFarmerIdParameters = RequestParameters & SeasonalFieldsListByFarmerIdQueryParam; +export type SeasonalFieldsListByFarmerIdParameters = SeasonalFieldsListByFarmerIdQueryParam & RequestParameters; // @public (undocumented) export interface SeasonalFieldsListByFarmerIdQueryParam { @@ -3390,37 +3766,37 @@ export interface SeasonalFieldsListByFarmerIdQueryParamProperties { $skipToken?: string; avgSeedPopulationUnit?: string; avgYieldUnit?: string; - cropIds?: string[]; - cropVarietyIds?: string[]; - farmIds?: string[]; - fieldIds?: string[]; - ids?: string[]; + cropIds?: Array; + cropVarietyIds?: Array; + farmIds?: Array; + fieldIds?: Array; + ids?: Array; maxAvgSeedPopulationValue?: number; maxAvgYieldValue?: number; - maxCreatedDateTime?: Date; - maxLastModifiedDateTime?: Date; - maxPlantingDateTime?: Date; + maxCreatedDateTime?: Date | string; + maxLastModifiedDateTime?: Date | string; + maxPlantingDateTime?: Date | string; minAvgSeedPopulationValue?: number; minAvgYieldValue?: number; - minCreatedDateTime?: Date; - minLastModifiedDateTime?: Date; - minPlantingDateTime?: Date; - names?: string[]; - propertyFilters?: string[]; - seasonIds?: string[]; - statuses?: string[]; + minCreatedDateTime?: Date | string; + minLastModifiedDateTime?: Date | string; + minPlantingDateTime?: Date | string; + names?: Array; + propertyFilters?: Array; + seasonIds?: Array; + statuses?: Array; } // @public export interface SeasonalFieldsListdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type SeasonalFieldsListParameters = RequestParameters & SeasonalFieldsListQueryParam; +export type SeasonalFieldsListParameters = SeasonalFieldsListQueryParam & RequestParameters; // @public (undocumented) export interface SeasonalFieldsListQueryParam { @@ -3434,41 +3810,53 @@ export interface SeasonalFieldsListQueryParamProperties { $skipToken?: string; avgSeedPopulationUnit?: string; avgYieldUnit?: string; - cropIds?: string[]; - cropVarietyIds?: string[]; - farmIds?: string[]; - fieldIds?: string[]; - ids?: string[]; + cropIds?: Array; + cropVarietyIds?: Array; + farmIds?: Array; + fieldIds?: Array; + ids?: Array; maxAvgSeedPopulationValue?: number; maxAvgYieldValue?: number; - maxCreatedDateTime?: Date; - maxLastModifiedDateTime?: Date; - maxPlantingDateTime?: Date; + maxCreatedDateTime?: Date | string; + maxLastModifiedDateTime?: Date | string; + maxPlantingDateTime?: Date | string; minAvgSeedPopulationValue?: number; minAvgYieldValue?: number; - minCreatedDateTime?: Date; - minLastModifiedDateTime?: Date; - minPlantingDateTime?: Date; - names?: string[]; - propertyFilters?: string[]; - seasonIds?: string[]; - statuses?: string[]; + minCreatedDateTime?: Date | string; + minLastModifiedDateTime?: Date | string; + minPlantingDateTime?: Date | string; + names?: Array; + propertyFilters?: Array; + seasonIds?: Array; + statuses?: Array; } // @public (undocumented) -export interface SeasonListResponse { +export interface SeasonListResponseOutput { + $skipToken?: string; nextLink?: string; - skipToken?: string; - value?: Season[]; + value?: Array; } // @public (undocumented) -export type SeasonPropertiesDictionary = Record; +export interface SeasonOutput { + createdDateTime?: string; + description?: string; + endDateTime?: string; + eTag?: string; + id?: string; + modifiedDateTime?: string; + name?: string; + properties?: Record; + startDateTime?: string; + status?: string; + year?: number; +} // @public export interface SeasonsCreateOrUpdate200Response extends HttpResponse { // (undocumented) - body: Season; + body: SeasonOutput; // (undocumented) status: "200"; } @@ -3476,37 +3864,36 @@ export interface SeasonsCreateOrUpdate200Response extends HttpResponse { // @public export interface SeasonsCreateOrUpdate201Response extends HttpResponse { // (undocumented) - body: Season; + body: SeasonOutput; // (undocumented) status: "201"; } // @public (undocumented) export interface SeasonsCreateOrUpdateBodyParam { - // (undocumented) body?: Season; } // @public export interface SeasonsCreateOrUpdatedefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type SeasonsCreateOrUpdateParameters = RequestParameters & SeasonsCreateOrUpdateBodyParam; +export interface SeasonsCreateOrUpdateMediaTypesParam { + contentType?: "application/merge-patch+json"; +} // @public (undocumented) -export interface SeasonsDelete { - delete(options?: SeasonsDeleteParameters): Promise; - get(options?: SeasonsGetParameters): Promise; - patch(options?: SeasonsCreateOrUpdateParameters): Promise; -} +export type SeasonsCreateOrUpdateParameters = SeasonsCreateOrUpdateMediaTypesParam & SeasonsCreateOrUpdateBodyParam & RequestParameters; // @public export interface SeasonsDelete204Response extends HttpResponse { + // (undocumented) + body: Record; // (undocumented) status: "204"; } @@ -3514,7 +3901,7 @@ export interface SeasonsDelete204Response extends HttpResponse { // @public export interface SeasonsDeletedefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } @@ -3522,10 +3909,17 @@ export interface SeasonsDeletedefaultResponse extends HttpResponse { // @public (undocumented) export type SeasonsDeleteParameters = RequestParameters; +// @public (undocumented) +export interface SeasonsGet { + delete(options?: SeasonsDeleteParameters): Promise; + get(options?: SeasonsGetParameters): Promise; + patch(options?: SeasonsCreateOrUpdateParameters): Promise; +} + // @public export interface SeasonsGet200Response extends HttpResponse { // (undocumented) - body: Season; + body: SeasonOutput; // (undocumented) status: "200"; } @@ -3533,7 +3927,7 @@ export interface SeasonsGet200Response extends HttpResponse { // @public export interface SeasonsGetdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } @@ -3549,7 +3943,7 @@ export interface SeasonsList { // @public export interface SeasonsList200Response extends HttpResponse { // (undocumented) - body: SeasonListResponse; + body: SeasonListResponseOutput; // (undocumented) status: "200"; } @@ -3557,13 +3951,13 @@ export interface SeasonsList200Response extends HttpResponse { // @public export interface SeasonsListdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type SeasonsListParameters = RequestParameters & SeasonsListQueryParam; +export type SeasonsListParameters = SeasonsListQueryParam & RequestParameters; // @public (undocumented) export interface SeasonsListQueryParam { @@ -3575,41 +3969,38 @@ export interface SeasonsListQueryParam { export interface SeasonsListQueryParamProperties { $maxPageSize?: number; $skipToken?: string; - ids?: string[]; - maxCreatedDateTime?: Date; - maxEndDateTime?: Date; - maxLastModifiedDateTime?: Date; - maxStartDateTime?: Date; - minCreatedDateTime?: Date; - minEndDateTime?: Date; - minLastModifiedDateTime?: Date; - minStartDateTime?: Date; - names?: string[]; - propertyFilters?: string[]; - statuses?: string[]; - years?: number[]; + ids?: Array; + maxCreatedDateTime?: Date | string; + maxEndDateTime?: Date | string; + maxLastModifiedDateTime?: Date | string; + maxStartDateTime?: Date | string; + minCreatedDateTime?: Date | string; + minEndDateTime?: Date | string; + minLastModifiedDateTime?: Date | string; + minStartDateTime?: Date | string; + names?: Array; + propertyFilters?: Array; + statuses?: Array; + years?: Array; } -// @public (undocumented) -export type Source = "Sentinel_2_L2A"; - // @public (undocumented) export interface TillageData { area?: Measure; associatedBoundaryId?: string; attachmentsLink?: string; - createdDateTime?: Date; + createdDateTime?: Date | string; description?: string; eTag?: string; farmerId?: string; id?: string; - modifiedDateTime?: Date; + modifiedDateTime?: Date | string; name?: string; operationBoundaryId?: string; - operationEndDateTime?: Date; - operationModifiedDateTime?: Date; - operationStartDateTime?: Date; - properties?: TillageDataPropertiesDictionary; + operationEndDateTime?: Date | string; + operationModifiedDateTime?: Date | string; + operationStartDateTime?: Date | string; + properties?: Record; source?: string; status?: string; tillageDepth?: Measure; @@ -3619,7 +4010,7 @@ export interface TillageData { // @public export interface TillageDataCreateOrUpdate200Response extends HttpResponse { // (undocumented) - body: TillageData; + body: TillageDataOutput; // (undocumented) status: "200"; } @@ -3627,37 +4018,36 @@ export interface TillageDataCreateOrUpdate200Response extends HttpResponse { // @public export interface TillageDataCreateOrUpdate201Response extends HttpResponse { // (undocumented) - body: TillageData; + body: TillageDataOutput; // (undocumented) status: "201"; } // @public (undocumented) export interface TillageDataCreateOrUpdateBodyParam { - // (undocumented) body?: TillageData; } // @public export interface TillageDataCreateOrUpdatedefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type TillageDataCreateOrUpdateParameters = RequestParameters & TillageDataCreateOrUpdateBodyParam; +export interface TillageDataCreateOrUpdateMediaTypesParam { + contentType?: "application/merge-patch+json"; +} // @public (undocumented) -export interface TillageDataDelete { - delete(options?: TillageDataDeleteParameters): Promise; - get(options?: TillageDataGetParameters): Promise; - patch(options?: TillageDataCreateOrUpdateParameters): Promise; -} +export type TillageDataCreateOrUpdateParameters = TillageDataCreateOrUpdateMediaTypesParam & TillageDataCreateOrUpdateBodyParam & RequestParameters; // @public export interface TillageDataDelete204Response extends HttpResponse { + // (undocumented) + body: Record; // (undocumented) status: "204"; } @@ -3665,7 +4055,7 @@ export interface TillageDataDelete204Response extends HttpResponse { // @public export interface TillageDataDeletedefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } @@ -3673,10 +4063,17 @@ export interface TillageDataDeletedefaultResponse extends HttpResponse { // @public (undocumented) export type TillageDataDeleteParameters = RequestParameters; +// @public (undocumented) +export interface TillageDataGet { + delete(options?: TillageDataDeleteParameters): Promise; + get(options?: TillageDataGetParameters): Promise; + patch(options?: TillageDataCreateOrUpdateParameters): Promise; +} + // @public export interface TillageDataGet200Response extends HttpResponse { // (undocumented) - body: TillageData; + body: TillageDataOutput; // (undocumented) status: "200"; } @@ -3684,7 +4081,7 @@ export interface TillageDataGet200Response extends HttpResponse { // @public export interface TillageDataGetdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } @@ -3700,7 +4097,7 @@ export interface TillageDataList { // @public export interface TillageDataList200Response extends HttpResponse { // (undocumented) - body: TillageDataListResponse; + body: TillageDataListResponseOutput; // (undocumented) status: "200"; } @@ -3713,7 +4110,7 @@ export interface TillageDataListByFarmerId { // @public export interface TillageDataListByFarmerId200Response extends HttpResponse { // (undocumented) - body: TillageDataListResponse; + body: TillageDataListResponseOutput; // (undocumented) status: "200"; } @@ -3721,13 +4118,13 @@ export interface TillageDataListByFarmerId200Response extends HttpResponse { // @public export interface TillageDataListByFarmerIddefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type TillageDataListByFarmerIdParameters = RequestParameters & TillageDataListByFarmerIdQueryParam; +export type TillageDataListByFarmerIdParameters = TillageDataListByFarmerIdQueryParam & RequestParameters; // @public (undocumented) export interface TillageDataListByFarmerIdQueryParam { @@ -3739,41 +4136,41 @@ export interface TillageDataListByFarmerIdQueryParam { export interface TillageDataListByFarmerIdQueryParamProperties { $maxPageSize?: number; $skipToken?: string; - associatedBoundaryIds?: string[]; - ids?: string[]; + associatedBoundaryIds?: Array; + ids?: Array; maxArea?: number; - maxCreatedDateTime?: Date; - maxLastModifiedDateTime?: Date; - maxOperationEndDateTime?: Date; - maxOperationModifiedDateTime?: Date; - maxOperationStartDateTime?: Date; + maxCreatedDateTime?: Date | string; + maxLastModifiedDateTime?: Date | string; + maxOperationEndDateTime?: Date | string; + maxOperationModifiedDateTime?: Date | string; + maxOperationStartDateTime?: Date | string; maxTillageDepth?: number; maxTillagePressure?: number; minArea?: number; - minCreatedDateTime?: Date; - minLastModifiedDateTime?: Date; - minOperationEndDateTime?: Date; - minOperationModifiedDateTime?: Date; - minOperationStartDateTime?: Date; + minCreatedDateTime?: Date | string; + minLastModifiedDateTime?: Date | string; + minOperationEndDateTime?: Date | string; + minOperationModifiedDateTime?: Date | string; + minOperationStartDateTime?: Date | string; minTillageDepth?: number; minTillagePressure?: number; - names?: string[]; - operationBoundaryIds?: string[]; - propertyFilters?: string[]; - sources?: string[]; - statuses?: string[]; + names?: Array; + operationBoundaryIds?: Array; + propertyFilters?: Array; + sources?: Array; + statuses?: Array; } // @public export interface TillageDataListdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type TillageDataListParameters = RequestParameters & TillageDataListQueryParam; +export type TillageDataListParameters = TillageDataListQueryParam & RequestParameters; // @public (undocumented) export interface TillageDataListQueryParam { @@ -3785,203 +4182,257 @@ export interface TillageDataListQueryParam { export interface TillageDataListQueryParamProperties { $maxPageSize?: number; $skipToken?: string; - associatedBoundaryIds?: string[]; - ids?: string[]; + associatedBoundaryIds?: Array; + ids?: Array; maxArea?: number; - maxCreatedDateTime?: Date; - maxLastModifiedDateTime?: Date; - maxOperationEndDateTime?: Date; - maxOperationModifiedDateTime?: Date; - maxOperationStartDateTime?: Date; + maxCreatedDateTime?: Date | string; + maxLastModifiedDateTime?: Date | string; + maxOperationEndDateTime?: Date | string; + maxOperationModifiedDateTime?: Date | string; + maxOperationStartDateTime?: Date | string; maxTillageDepth?: number; maxTillagePressure?: number; minArea?: number; - minCreatedDateTime?: Date; - minLastModifiedDateTime?: Date; - minOperationEndDateTime?: Date; - minOperationModifiedDateTime?: Date; - minOperationStartDateTime?: Date; + minCreatedDateTime?: Date | string; + minLastModifiedDateTime?: Date | string; + minOperationEndDateTime?: Date | string; + minOperationModifiedDateTime?: Date | string; + minOperationStartDateTime?: Date | string; minTillageDepth?: number; minTillagePressure?: number; - names?: string[]; - operationBoundaryIds?: string[]; - propertyFilters?: string[]; - sources?: string[]; - statuses?: string[]; + names?: Array; + operationBoundaryIds?: Array; + propertyFilters?: Array; + sources?: Array; + statuses?: Array; } // @public (undocumented) -export interface TillageDataListResponse { +export interface TillageDataListResponseOutput { + $skipToken?: string; nextLink?: string; - skipToken?: string; - value?: TillageData[]; + value?: Array; } // @public (undocumented) -export type TillageDataPropertiesDictionary = Record; - -// @public (undocumented) -export interface WeatherCreateDataDeleteJob { - get(options?: WeatherGetDataDeleteJobDetailsParameters): Promise; - put(options?: WeatherCreateDataDeleteJobParameters): Promise; +export interface TillageDataOutput { + area?: MeasureOutput; + associatedBoundaryId?: string; + attachmentsLink?: string; + createdDateTime?: string; + description?: string; + eTag?: string; + farmerId?: string; + id?: string; + modifiedDateTime?: string; + name?: string; + operationBoundaryId?: string; + operationEndDateTime?: string; + operationModifiedDateTime?: string; + operationStartDateTime?: string; + properties?: Record; + source?: string; + status?: string; + tillageDepth?: MeasureOutput; + tillagePressure?: MeasureOutput; } // @public export interface WeatherCreateDataDeleteJob202Response extends HttpResponse { // (undocumented) - body: WeatherDataDeleteJob; + body: WeatherDataDeleteJobOutput; // (undocumented) status: "202"; } // @public (undocumented) export interface WeatherCreateDataDeleteJobBodyParam { - // (undocumented) body?: WeatherDataDeleteJob; } // @public export interface WeatherCreateDataDeleteJobdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type WeatherCreateDataDeleteJobParameters = RequestParameters & WeatherCreateDataDeleteJobBodyParam; +export interface WeatherCreateDataDeleteJobMediaTypesParam { + contentType?: "application/json"; +} // @public (undocumented) -export interface WeatherCreateDataIngestionJob { - get(options?: WeatherGetDataIngestionJobDetailsParameters): Promise; - put(options?: WeatherCreateDataIngestionJobParameters): Promise; -} +export type WeatherCreateDataDeleteJobParameters = WeatherCreateDataDeleteJobMediaTypesParam & WeatherCreateDataDeleteJobBodyParam & RequestParameters; // @public export interface WeatherCreateDataIngestionJob202Response extends HttpResponse { // (undocumented) - body: WeatherDataIngestionJob; + body: WeatherDataIngestionJobOutput; // (undocumented) status: "202"; } // @public (undocumented) export interface WeatherCreateDataIngestionJobBodyParam { - // (undocumented) body?: WeatherDataIngestionJob; } // @public export interface WeatherCreateDataIngestionJobdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type WeatherCreateDataIngestionJobParameters = RequestParameters & WeatherCreateDataIngestionJobBodyParam; +export interface WeatherCreateDataIngestionJobMediaTypesParam { + contentType?: "application/json"; +} + +// @public (undocumented) +export type WeatherCreateDataIngestionJobParameters = WeatherCreateDataIngestionJobMediaTypesParam & WeatherCreateDataIngestionJobBodyParam & RequestParameters; // @public (undocumented) -export interface WeatherData { +export interface WeatherDataDeleteJob { boundaryId: string; - cloudCover?: Measure; - createdDateTime?: Date; - dateTime: Date; - dewPoint?: Measure; - eTag?: string; + createdDateTime?: Date | string; + description?: string; + durationInSeconds?: number; + endDateTime?: Date | string; + endTime?: Date | string; extensionId: string; - extensionVersion: string; farmerId: string; - granularity: string; - growingDegreeDay?: Measure; + granularity?: string; id?: string; - location: Location; - modifiedDateTime?: Date; - precipitation?: Measure; - pressure?: Measure; - properties?: WeatherDataPropertiesDictionary; - relativeHumidity?: Measure; - soilMoisture?: Measure; - soilTemperature?: Measure; - temperature?: Measure; - unitSystemCode?: string; - visibility?: Measure; - weatherDataType: string; - wetBulbTemperature?: Measure; - windChill?: Measure; - windDirection?: Measure; - windGust?: Measure; - windSpeed?: Measure; + lastActionDateTime?: Date | string; + message?: string; + name?: string; + properties?: Record; + startDateTime?: Date | string; + startTime?: Date | string; + status?: string; + weatherDataType?: string; } // @public (undocumented) -export interface WeatherDataDeleteJob { +export interface WeatherDataDeleteJobOutput { boundaryId: string; - createdDateTime?: Date; + createdDateTime?: string; description?: string; durationInSeconds?: number; - endDateTime?: Date; - endTime?: Date; + endDateTime?: string; + endTime?: string; extensionId: string; farmerId: string; granularity?: string; id?: string; - lastActionDateTime?: Date; + lastActionDateTime?: string; message?: string; name?: string; - properties?: WeatherDataDeleteJobPropertiesDictionary; - startDateTime?: Date; - startTime?: Date; + properties?: Record; + startDateTime?: string; + startTime?: string; status?: string; weatherDataType?: string; } -// @public (undocumented) -export type WeatherDataDeleteJobPropertiesDictionary = Record; - // @public (undocumented) export interface WeatherDataIngestionJob { boundaryId: string; - createdDateTime?: Date; + createdDateTime?: Date | string; description?: string; durationInSeconds?: number; - endTime?: Date; - extensionApiInput: WeatherDataIngestionJobExtensionApiInputDictionary; + endTime?: Date | string; + extensionApiInput: Record; extensionApiName: string; extensionDataProviderApiKey?: string; extensionDataProviderAppId?: string; extensionId: string; farmerId: string; id?: string; - lastActionDateTime?: Date; + lastActionDateTime?: Date | string; message?: string; name?: string; - properties?: WeatherDataIngestionJobPropertiesDictionary; - startTime?: Date; + properties?: Record; + startTime?: Date | string; status?: string; } // @public (undocumented) -export type WeatherDataIngestionJobExtensionApiInputDictionary = Record; +export interface WeatherDataIngestionJobOutput { + boundaryId: string; + createdDateTime?: string; + description?: string; + durationInSeconds?: number; + endTime?: string; + extensionApiInput: Record; + extensionApiName: string; + extensionDataProviderApiKey?: string; + extensionDataProviderAppId?: string; + extensionId: string; + farmerId: string; + id?: string; + lastActionDateTime?: string; + message?: string; + name?: string; + properties?: Record; + startTime?: string; + status?: string; +} // @public (undocumented) -export type WeatherDataIngestionJobPropertiesDictionary = Record; +export interface WeatherDataListResponseOutput { + $skipToken?: string; + nextLink?: string; + value?: Array; +} // @public (undocumented) -export interface WeatherDataListResponse { - nextLink?: string; - skipToken?: string; - value?: WeatherData[]; +export interface WeatherDataOutput { + boundaryId: string; + cloudCover?: MeasureOutput; + createdDateTime?: string; + dateTime: string; + dewPoint?: MeasureOutput; + eTag?: string; + extensionId: string; + extensionVersion: string; + farmerId: string; + granularity: string; + growingDegreeDay?: MeasureOutput; + id?: string; + location: LocationOutput; + modifiedDateTime?: string; + precipitation?: MeasureOutput; + pressure?: MeasureOutput; + properties?: Record; + relativeHumidity?: MeasureOutput; + soilMoisture?: MeasureOutput; + soilTemperature?: MeasureOutput; + temperature?: MeasureOutput; + unitSystemCode?: string; + visibility?: MeasureOutput; + weatherDataType: string; + wetBulbTemperature?: MeasureOutput; + windChill?: MeasureOutput; + windDirection?: MeasureOutput; + windGust?: MeasureOutput; + windSpeed?: MeasureOutput; } // @public (undocumented) -export type WeatherDataPropertiesDictionary = Record; +export interface WeatherGetDataDeleteJobDetails { + get(options?: WeatherGetDataDeleteJobDetailsParameters): Promise; + put(options?: WeatherCreateDataDeleteJobParameters): Promise; +} // @public export interface WeatherGetDataDeleteJobDetails200Response extends HttpResponse { // (undocumented) - body: WeatherDataDeleteJob; + body: WeatherDataDeleteJobOutput; // (undocumented) status: "200"; } @@ -3989,7 +4440,7 @@ export interface WeatherGetDataDeleteJobDetails200Response extends HttpResponse // @public export interface WeatherGetDataDeleteJobDetailsdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } @@ -3997,10 +4448,16 @@ export interface WeatherGetDataDeleteJobDetailsdefaultResponse extends HttpRespo // @public (undocumented) export type WeatherGetDataDeleteJobDetailsParameters = RequestParameters; +// @public (undocumented) +export interface WeatherGetDataIngestionJobDetails { + get(options?: WeatherGetDataIngestionJobDetailsParameters): Promise; + put(options?: WeatherCreateDataIngestionJobParameters): Promise; +} + // @public export interface WeatherGetDataIngestionJobDetails200Response extends HttpResponse { // (undocumented) - body: WeatherDataIngestionJob; + body: WeatherDataIngestionJobOutput; // (undocumented) status: "200"; } @@ -4008,7 +4465,7 @@ export interface WeatherGetDataIngestionJobDetails200Response extends HttpRespon // @public export interface WeatherGetDataIngestionJobDetailsdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } @@ -4018,13 +4475,13 @@ export type WeatherGetDataIngestionJobDetailsParameters = RequestParameters; // @public (undocumented) export interface WeatherList { - get(options?: WeatherListParameters): Promise; + get(options: WeatherListParameters): Promise; } // @public export interface WeatherList200Response extends HttpResponse { // (undocumented) - body: WeatherDataListResponse; + body: WeatherDataListResponseOutput; // (undocumented) status: "200"; } @@ -4032,13 +4489,13 @@ export interface WeatherList200Response extends HttpResponse { // @public export interface WeatherListdefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponse; + body: ErrorResponseOutput; // (undocumented) status: "500"; } // @public (undocumented) -export type WeatherListParameters = RequestParameters & WeatherListQueryParam; +export type WeatherListParameters = WeatherListQueryParam & RequestParameters; // @public (undocumented) export interface WeatherListQueryParam { @@ -4051,15 +4508,14 @@ export interface WeatherListQueryParamProperties { $maxPageSize?: number; $skipToken?: string; boundaryId: string; - endDateTime?: Date; + endDateTime?: Date | string; extensionId: string; farmerId: string; granularity: string; - startDateTime?: Date; + startDateTime?: Date | string; weatherDataType: string; } - // (No @packageDocumentation comment for this package) ``` diff --git a/sdk/agrifood/agrifood-farming-rest/src/farmBeats.ts b/sdk/agrifood/agrifood-farming-rest/src/farmBeats.ts index 9e439797a8e2..0142686145fe 100644 --- a/sdk/agrifood/agrifood-farming-rest/src/farmBeats.ts +++ b/sdk/agrifood/agrifood-farming-rest/src/farmBeats.ts @@ -325,7 +325,7 @@ export interface ApplicationDataList { ): Promise; } -export interface ApplicationDataDelete { +export interface ApplicationDataGet { /** Get a specified application data resource under a particular farmer. */ get( options?: ApplicationDataGetParameters @@ -351,7 +351,7 @@ export interface AttachmentsListByFarmerId { ): Promise; } -export interface AttachmentsDelete { +export interface AttachmentsGet { /** Gets a specified attachment resource under a particular farmer. */ get( options?: AttachmentsGetParameters @@ -377,7 +377,7 @@ export interface AttachmentsDownload { ): Promise; } -export interface BoundariesSearchByFarmerId { +export interface BoundariesListByFarmerId { /** Returns a paginated list of boundary resources under a particular farmer. */ get( options?: BoundariesListByFarmerIdParameters @@ -388,7 +388,7 @@ export interface BoundariesSearchByFarmerId { ): Promise; } -export interface BoundariesSearch { +export interface BoundariesList { /** Returns a paginated list of boundary resources across all farmers. */ get( options?: BoundariesListParameters @@ -399,7 +399,7 @@ export interface BoundariesSearch { ): Promise; } -export interface BoundariesCreateCascadeDeleteJob { +export interface BoundariesGetCascadeDeleteJobDetails { /** Get cascade delete job for specified boundary. */ get( options?: BoundariesGetCascadeDeleteJobDetailsParameters @@ -409,13 +409,13 @@ export interface BoundariesCreateCascadeDeleteJob { >; /** Create a cascade delete job for specified boundary. */ put( - options?: BoundariesCreateCascadeDeleteJobParameters + options: BoundariesCreateCascadeDeleteJobParameters ): Promise< BoundariesCreateCascadeDeleteJob202Response | BoundariesCreateCascadeDeleteJobdefaultResponse >; } -export interface BoundariesDelete { +export interface BoundariesGet { /** Gets a specified boundary resource under a particular farmer. */ get( options?: BoundariesGetParameters @@ -437,7 +437,7 @@ export interface BoundariesDelete { export interface BoundariesGetOverlap { /** Returns overlapping acreage between two boundary Ids. */ get( - options?: BoundariesGetOverlapParameters + options: BoundariesGetOverlapParameters ): Promise; } @@ -446,7 +446,7 @@ export interface CropsList { get(options?: CropsListParameters): Promise; } -export interface CropsDelete { +export interface CropsGet { /** Gets a specified crop resource. */ get(options?: CropsGetParameters): Promise; /** Creates or updates a crop resource. */ @@ -477,7 +477,7 @@ export interface CropVarietiesList { ): Promise; } -export interface CropVarietiesDelete { +export interface CropVarietiesGet { /** Gets a specified crop variety resource under a particular crop. */ get( options?: CropVarietiesGetParameters @@ -503,7 +503,7 @@ export interface FarmersList { ): Promise; } -export interface FarmersDelete { +export interface FarmersGet { /** Gets a specified farmer resource. */ get(options?: FarmersGetParameters): Promise; /** Creates or updates a farmer resource. */ @@ -520,7 +520,7 @@ export interface FarmersDelete { ): Promise; } -export interface FarmersCreateCascadeDeleteJob { +export interface FarmersGetCascadeDeleteJobDetails { /** Get a cascade delete job for specified farmer. */ get( options?: FarmersGetCascadeDeleteJobDetailsParameters @@ -529,13 +529,13 @@ export interface FarmersCreateCascadeDeleteJob { >; /** Create a cascade delete job for specified farmer. */ put( - options?: FarmersCreateCascadeDeleteJobParameters + options: FarmersCreateCascadeDeleteJobParameters ): Promise< FarmersCreateCascadeDeleteJob202Response | FarmersCreateCascadeDeleteJobdefaultResponse >; } -export interface FarmOperationsGetDataIngestionJobDetails { +export interface FarmOperationsCreateDataIngestionJob { /** Create a farm operation data ingestion job. */ put( options?: FarmOperationsCreateDataIngestionJobParameters @@ -564,7 +564,7 @@ export interface FarmsList { get(options?: FarmsListParameters): Promise; } -export interface FarmsDelete { +export interface FarmsGet { /** Gets a specified farm resource under a particular farmer. */ get(options?: FarmsGetParameters): Promise; /** Creates or updates a farm resource under a particular farmer. */ @@ -581,7 +581,7 @@ export interface FarmsDelete { ): Promise; } -export interface FarmsCreateCascadeDeleteJob { +export interface FarmsGetCascadeDeleteJobDetails { /** Get a cascade delete job for specified farm. */ get( options?: FarmsGetCascadeDeleteJobDetailsParameters @@ -590,7 +590,7 @@ export interface FarmsCreateCascadeDeleteJob { >; /** Create a cascade delete job for specified farm. */ put( - options?: FarmsCreateCascadeDeleteJobParameters + options: FarmsCreateCascadeDeleteJobParameters ): Promise; } @@ -606,7 +606,7 @@ export interface FieldsList { get(options?: FieldsListParameters): Promise; } -export interface FieldsDelete { +export interface FieldsGet { /** Gets a specified field resource under a particular farmer. */ get(options?: FieldsGetParameters): Promise; /** Creates or Updates a field resource under a particular farmer. */ @@ -623,7 +623,7 @@ export interface FieldsDelete { ): Promise; } -export interface FieldsCreateCascadeDeleteJob { +export interface FieldsGetCascadeDeleteJobDetails { /** Get a cascade delete job for specified field. */ get( options?: FieldsGetCascadeDeleteJobDetailsParameters @@ -632,7 +632,7 @@ export interface FieldsCreateCascadeDeleteJob { >; /** Create a cascade delete job for specified field. */ put( - options?: FieldsCreateCascadeDeleteJobParameters + options: FieldsCreateCascadeDeleteJobParameters ): Promise; } @@ -650,7 +650,7 @@ export interface HarvestDataList { ): Promise; } -export interface HarvestDataDelete { +export interface HarvestDataGet { /** Get a specified harvest data resource under a particular farmer. */ get( options?: HarvestDataGetParameters @@ -669,7 +669,7 @@ export interface HarvestDataDelete { ): Promise; } -export interface ImageProcessingGetRasterizeJob { +export interface ImageProcessingCreateRasterizeJob { /** Create a ImageProcessing Rasterize job. */ put( options?: ImageProcessingCreateRasterizeJobParameters @@ -689,7 +689,7 @@ export interface OAuthProvidersList { ): Promise; } -export interface OAuthProvidersDelete { +export interface OAuthProvidersGet { /** Get a specified oauthProvider resource. */ get( options?: OAuthProvidersGetParameters @@ -724,7 +724,7 @@ export interface OAuthTokensGetOAuthConnectionLink { >; } -export interface OAuthTokensCreateCascadeDeleteJob { +export interface OAuthTokensGetCascadeDeleteJobDetails { /** Get cascade delete job details for OAuth tokens for specified job ID. */ get( options?: OAuthTokensGetCascadeDeleteJobDetailsParameters @@ -734,7 +734,7 @@ export interface OAuthTokensCreateCascadeDeleteJob { >; /** Create a cascade delete job for OAuth tokens. */ put( - options?: OAuthTokensCreateCascadeDeleteJobParameters + options: OAuthTokensCreateCascadeDeleteJobParameters ): Promise< OAuthTokensCreateCascadeDeleteJob202Response | OAuthTokensCreateCascadeDeleteJobdefaultResponse >; @@ -754,7 +754,7 @@ export interface PlantingDataList { ): Promise; } -export interface PlantingDataDelete { +export interface PlantingDataGet { /** Get a specified planting data resource under a particular farmer. */ get( options?: PlantingDataGetParameters @@ -775,10 +775,10 @@ export interface PlantingDataDelete { export interface ScenesList { /** Returns a paginated list of scene resources. */ - get(options?: ScenesListParameters): Promise; + get(options: ScenesListParameters): Promise; } -export interface ScenesGetSatelliteDataIngestionJobDetails { +export interface ScenesCreateSatelliteDataIngestionJob { /** Create a satellite data ingestion job. */ put( options?: ScenesCreateSatelliteDataIngestionJobParameters @@ -798,7 +798,7 @@ export interface ScenesGetSatelliteDataIngestionJobDetails { export interface ScenesDownload { /** Downloads and returns file stream as response for the given input filePath. */ get( - options?: ScenesDownloadParameters + options: ScenesDownloadParameters ): Promise; } @@ -816,7 +816,7 @@ export interface SeasonalFieldsList { ): Promise; } -export interface SeasonalFieldsDelete { +export interface SeasonalFieldsGet { /** Gets a specified seasonal field resource under a particular farmer. */ get( options?: SeasonalFieldsGetParameters @@ -835,7 +835,7 @@ export interface SeasonalFieldsDelete { ): Promise; } -export interface SeasonalFieldsCreateCascadeDeleteJob { +export interface SeasonalFieldsGetCascadeDeleteJobDetails { /** Get cascade delete job for specified seasonal field. */ get( options?: SeasonalFieldsGetCascadeDeleteJobDetailsParameters @@ -845,7 +845,7 @@ export interface SeasonalFieldsCreateCascadeDeleteJob { >; /** Create a cascade delete job for specified seasonal field. */ put( - options?: SeasonalFieldsCreateCascadeDeleteJobParameters + options: SeasonalFieldsCreateCascadeDeleteJobParameters ): Promise< | SeasonalFieldsCreateCascadeDeleteJob202Response | SeasonalFieldsCreateCascadeDeleteJobdefaultResponse @@ -859,7 +859,7 @@ export interface SeasonsList { ): Promise; } -export interface SeasonsDelete { +export interface SeasonsGet { /** Gets a specified season resource. */ get(options?: SeasonsGetParameters): Promise; /** Creates or updates a season resource. */ @@ -890,7 +890,7 @@ export interface TillageDataList { ): Promise; } -export interface TillageDataDelete { +export interface TillageDataGet { /** Get a specified tillage data resource under a particular farmer. */ get( options?: TillageDataGetParameters @@ -911,12 +911,10 @@ export interface TillageDataDelete { export interface WeatherList { /** Returns a paginated list of weather data. */ - get( - options?: WeatherListParameters - ): Promise; + get(options: WeatherListParameters): Promise; } -export interface WeatherCreateDataIngestionJob { +export interface WeatherGetDataIngestionJobDetails { /** Get weather ingestion job. */ get( options?: WeatherGetDataIngestionJobDetailsParameters @@ -931,7 +929,7 @@ export interface WeatherCreateDataIngestionJob { >; } -export interface WeatherCreateDataDeleteJob { +export interface WeatherGetDataDeleteJobDetails { /** Get weather data delete job. */ get( options?: WeatherGetDataDeleteJobDetailsParameters @@ -954,7 +952,7 @@ export interface Routes { path: "/farmers/{farmerId}/application-data/{applicationDataId}", farmerId: string, applicationDataId: string - ): ApplicationDataDelete; + ): ApplicationDataGet; /** Resource for '/farmers/\{farmerId\}/attachments' has methods for the following verbs: get */ (path: "/farmers/{farmerId}/attachments", farmerId: string): AttachmentsListByFarmerId; /** Resource for '/farmers/\{farmerId\}/attachments/\{attachmentId\}' has methods for the following verbs: get, patch, delete */ @@ -962,7 +960,7 @@ export interface Routes { path: "/farmers/{farmerId}/attachments/{attachmentId}", farmerId: string, attachmentId: string - ): AttachmentsDelete; + ): AttachmentsGet; /** Resource for '/farmers/\{farmerId\}/attachments/\{attachmentId\}/file' has methods for the following verbs: get */ ( path: "/farmers/{farmerId}/attachments/{attachmentId}/file", @@ -970,17 +968,17 @@ export interface Routes { attachmentId: string ): AttachmentsDownload; /** Resource for '/farmers/\{farmerId\}/boundaries' has methods for the following verbs: get, post */ - (path: "/farmers/{farmerId}/boundaries", farmerId: string): BoundariesSearchByFarmerId; + (path: "/farmers/{farmerId}/boundaries", farmerId: string): BoundariesListByFarmerId; /** Resource for '/boundaries' has methods for the following verbs: get, post */ - (path: "/boundaries"): BoundariesSearch; + (path: "/boundaries"): BoundariesList; /** Resource for '/boundaries/cascade-delete/\{jobId\}' has methods for the following verbs: get, put */ - (path: "/boundaries/cascade-delete/{jobId}", jobId: string): BoundariesCreateCascadeDeleteJob; + (path: "/boundaries/cascade-delete/{jobId}", jobId: string): BoundariesGetCascadeDeleteJobDetails; /** Resource for '/farmers/\{farmerId\}/boundaries/\{boundaryId\}' has methods for the following verbs: get, patch, delete */ ( path: "/farmers/{farmerId}/boundaries/{boundaryId}", farmerId: string, boundaryId: string - ): BoundariesDelete; + ): BoundariesGet; /** Resource for '/farmers/\{farmerId\}/boundaries/\{boundaryId\}/overlap' has methods for the following verbs: get */ ( path: "/farmers/{farmerId}/boundaries/{boundaryId}/overlap", @@ -990,7 +988,7 @@ export interface Routes { /** Resource for '/crops' has methods for the following verbs: get */ (path: "/crops"): CropsList; /** Resource for '/crops/\{cropId\}' has methods for the following verbs: get, patch, delete */ - (path: "/crops/{cropId}", cropId: string): CropsDelete; + (path: "/crops/{cropId}", cropId: string): CropsGet; /** Resource for '/crops/\{cropId\}/crop-varieties' has methods for the following verbs: get */ (path: "/crops/{cropId}/crop-varieties", cropId: string): CropVarietiesListByCropId; /** Resource for '/crop-varieties' has methods for the following verbs: get */ @@ -1000,34 +998,34 @@ export interface Routes { path: "/crops/{cropId}/crop-varieties/{cropVarietyId}", cropId: string, cropVarietyId: string - ): CropVarietiesDelete; + ): CropVarietiesGet; /** Resource for '/farmers' has methods for the following verbs: get */ (path: "/farmers"): FarmersList; /** Resource for '/farmers/\{farmerId\}' has methods for the following verbs: get, patch, delete */ - (path: "/farmers/{farmerId}", farmerId: string): FarmersDelete; + (path: "/farmers/{farmerId}", farmerId: string): FarmersGet; /** Resource for '/farmers/cascade-delete/\{jobId\}' has methods for the following verbs: get, put */ - (path: "/farmers/cascade-delete/{jobId}", jobId: string): FarmersCreateCascadeDeleteJob; + (path: "/farmers/cascade-delete/{jobId}", jobId: string): FarmersGetCascadeDeleteJobDetails; /** Resource for '/farm-operations/ingest-data/\{jobId\}' has methods for the following verbs: put, get */ ( path: "/farm-operations/ingest-data/{jobId}", jobId: string - ): FarmOperationsGetDataIngestionJobDetails; + ): FarmOperationsCreateDataIngestionJob; /** Resource for '/farmers/\{farmerId\}/farms' has methods for the following verbs: get */ (path: "/farmers/{farmerId}/farms", farmerId: string): FarmsListByFarmerId; /** Resource for '/farms' has methods for the following verbs: get */ (path: "/farms"): FarmsList; /** Resource for '/farmers/\{farmerId\}/farms/\{farmId\}' has methods for the following verbs: get, patch, delete */ - (path: "/farmers/{farmerId}/farms/{farmId}", farmerId: string, farmId: string): FarmsDelete; + (path: "/farmers/{farmerId}/farms/{farmId}", farmerId: string, farmId: string): FarmsGet; /** Resource for '/farms/cascade-delete/\{jobId\}' has methods for the following verbs: get, put */ - (path: "/farms/cascade-delete/{jobId}", jobId: string): FarmsCreateCascadeDeleteJob; + (path: "/farms/cascade-delete/{jobId}", jobId: string): FarmsGetCascadeDeleteJobDetails; /** Resource for '/farmers/\{farmerId\}/fields' has methods for the following verbs: get */ (path: "/farmers/{farmerId}/fields", farmerId: string): FieldsListByFarmerId; /** Resource for '/fields' has methods for the following verbs: get */ (path: "/fields"): FieldsList; /** Resource for '/farmers/\{farmerId\}/fields/\{fieldId\}' has methods for the following verbs: get, patch, delete */ - (path: "/farmers/{farmerId}/fields/{fieldId}", farmerId: string, fieldId: string): FieldsDelete; + (path: "/farmers/{farmerId}/fields/{fieldId}", farmerId: string, fieldId: string): FieldsGet; /** Resource for '/fields/cascade-delete/\{jobId\}' has methods for the following verbs: get, put */ - (path: "/fields/cascade-delete/{jobId}", jobId: string): FieldsCreateCascadeDeleteJob; + (path: "/fields/cascade-delete/{jobId}", jobId: string): FieldsGetCascadeDeleteJobDetails; /** Resource for '/farmers/\{farmerId\}/harvest-data' has methods for the following verbs: get */ (path: "/farmers/{farmerId}/harvest-data", farmerId: string): HarvestDataListByFarmerId; /** Resource for '/harvest-data' has methods for the following verbs: get */ @@ -1037,19 +1035,19 @@ export interface Routes { path: "/farmers/{farmerId}/harvest-data/{harvestDataId}", farmerId: string, harvestDataId: string - ): HarvestDataDelete; + ): HarvestDataGet; /** Resource for '/image-processing/rasterize/\{jobId\}' has methods for the following verbs: put, get */ - (path: "/image-processing/rasterize/{jobId}", jobId: string): ImageProcessingGetRasterizeJob; + (path: "/image-processing/rasterize/{jobId}", jobId: string): ImageProcessingCreateRasterizeJob; /** Resource for '/oauth/providers' has methods for the following verbs: get */ (path: "/oauth/providers"): OAuthProvidersList; /** Resource for '/oauth/providers/\{oauthProviderId\}' has methods for the following verbs: get, patch, delete */ - (path: "/oauth/providers/{oauthProviderId}", oauthProviderId: string): OAuthProvidersDelete; + (path: "/oauth/providers/{oauthProviderId}", oauthProviderId: string): OAuthProvidersGet; /** Resource for '/oauth/tokens' has methods for the following verbs: get */ (path: "/oauth/tokens"): OAuthTokensList; /** Resource for '/oauth/tokens/:connect' has methods for the following verbs: post */ (path: "/oauth/tokens/:connect"): OAuthTokensGetOAuthConnectionLink; /** Resource for '/oauth/tokens/remove/\{jobId\}' has methods for the following verbs: get, put */ - (path: "/oauth/tokens/remove/{jobId}", jobId: string): OAuthTokensCreateCascadeDeleteJob; + (path: "/oauth/tokens/remove/{jobId}", jobId: string): OAuthTokensGetCascadeDeleteJobDetails; /** Resource for '/farmers/\{farmerId\}/planting-data' has methods for the following verbs: get */ (path: "/farmers/{farmerId}/planting-data", farmerId: string): PlantingDataListByFarmerId; /** Resource for '/planting-data' has methods for the following verbs: get */ @@ -1059,14 +1057,14 @@ export interface Routes { path: "/farmers/{farmerId}/planting-data/{plantingDataId}", farmerId: string, plantingDataId: string - ): PlantingDataDelete; + ): PlantingDataGet; /** Resource for '/scenes' has methods for the following verbs: get */ (path: "/scenes"): ScenesList; /** Resource for '/scenes/satellite/ingest-data/\{jobId\}' has methods for the following verbs: put, get */ ( path: "/scenes/satellite/ingest-data/{jobId}", jobId: string - ): ScenesGetSatelliteDataIngestionJobDetails; + ): ScenesCreateSatelliteDataIngestionJob; /** Resource for '/scenes/downloadFiles' has methods for the following verbs: get */ (path: "/scenes/downloadFiles"): ScenesDownload; /** Resource for '/farmers/\{farmerId\}/seasonal-fields' has methods for the following verbs: get */ @@ -1078,16 +1076,16 @@ export interface Routes { path: "/farmers/{farmerId}/seasonal-fields/{seasonalFieldId}", farmerId: string, seasonalFieldId: string - ): SeasonalFieldsDelete; + ): SeasonalFieldsGet; /** Resource for '/seasonal-fields/cascade-delete/\{jobId\}' has methods for the following verbs: get, put */ ( path: "/seasonal-fields/cascade-delete/{jobId}", jobId: string - ): SeasonalFieldsCreateCascadeDeleteJob; + ): SeasonalFieldsGetCascadeDeleteJobDetails; /** Resource for '/seasons' has methods for the following verbs: get */ (path: "/seasons"): SeasonsList; /** Resource for '/seasons/\{seasonId\}' has methods for the following verbs: get, patch, delete */ - (path: "/seasons/{seasonId}", seasonId: string): SeasonsDelete; + (path: "/seasons/{seasonId}", seasonId: string): SeasonsGet; /** Resource for '/farmers/\{farmerId\}/tillage-data' has methods for the following verbs: get */ (path: "/farmers/{farmerId}/tillage-data", farmerId: string): TillageDataListByFarmerId; /** Resource for '/tillage-data' has methods for the following verbs: get */ @@ -1097,13 +1095,13 @@ export interface Routes { path: "/farmers/{farmerId}/tillage-data/{tillageDataId}", farmerId: string, tillageDataId: string - ): TillageDataDelete; + ): TillageDataGet; /** Resource for '/weather' has methods for the following verbs: get */ (path: "/weather"): WeatherList; /** Resource for '/weather/ingest-data/\{jobId\}' has methods for the following verbs: get, put */ - (path: "/weather/ingest-data/{jobId}", jobId: string): WeatherCreateDataIngestionJob; + (path: "/weather/ingest-data/{jobId}", jobId: string): WeatherGetDataIngestionJobDetails; /** Resource for '/weather/delete-data/\{jobId\}' has methods for the following verbs: get, put */ - (path: "/weather/delete-data/{jobId}", jobId: string): WeatherCreateDataDeleteJob; + (path: "/weather/delete-data/{jobId}", jobId: string): WeatherGetDataDeleteJobDetails; } export type FarmBeatsRestClient = Client & { diff --git a/sdk/agrifood/agrifood-farming-rest/src/getPoller.ts b/sdk/agrifood/agrifood-farming-rest/src/getPoller.ts deleted file mode 100644 index f97b32861956..000000000000 --- a/sdk/agrifood/agrifood-farming-rest/src/getPoller.ts +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import { - getLongRunningPoller, - PollerLike, - PollOperationState, - PollerOptions, -} from "@azure-rest/core-client-lro"; -import { HttpResponse } from "@azure-rest/core-client"; -import { FarmBeatsRestClient } from "./farmBeats"; - -/** - * Gets a poller object to help polling for a long running operation status. - * @param client - FarmBeats Rest Client. - * @param initialResponse - Initial response for the operation that needs to be polled. - * @param options - Polling options - * @returns - Gets a poller that can be run on demand or automatically awaited until the operation is completed. - */ -export function getPoller( - client: FarmBeatsRestClient, - initialResponse: TResult, - options: PollerOptions = {} -): PollerLike, TResult> { - return getLongRunningPoller(client, initialResponse, options); -} diff --git a/sdk/agrifood/agrifood-farming-rest/src/index.ts b/sdk/agrifood/agrifood-farming-rest/src/index.ts index a9474b016c30..9fc396e8ae50 100644 --- a/sdk/agrifood/agrifood-farming-rest/src/index.ts +++ b/sdk/agrifood/agrifood-farming-rest/src/index.ts @@ -4,11 +4,11 @@ import FarmBeats from "./farmBeats"; export * from "./farmBeats"; -export * from "./models"; export * from "./parameters"; export * from "./responses"; - -export { paginate, PaginateReturn, GetArrayType } from "./paging"; -export { getPoller } from "./getPoller"; +export * from "./models"; +export * from "./outputModels"; +export * from "./paginateHelper"; +export * from "./pollingHelper"; export default FarmBeats; diff --git a/sdk/agrifood/agrifood-farming-rest/src/models.ts b/sdk/agrifood/agrifood-farming-rest/src/models.ts index e3e8813a2ee4..28ed5da15ac6 100644 --- a/sdk/agrifood/agrifood-farming-rest/src/models.ts +++ b/sdk/agrifood/agrifood-farming-rest/src/models.ts @@ -1,18 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -export interface ApplicationDataListResponse { - /** List of requested objects. */ - value?: ApplicationData[]; - /** Token used in retrieving the next page. If null, there are no additional pages. */ - skipToken?: string; - /** Continuation link (absolute URI) to the next page of results in the list. */ - nextLink?: string; -} - export interface ApplicationData { /** Application product details. */ - applicationProductDetails?: ApplicationProductDetail[]; + applicationProductDetails?: Array; /** Schema for storing measurement reading and unit. */ avgMaterial?: Measure; /** Schema for storing measurement reading and unit. */ @@ -25,11 +16,11 @@ export interface ApplicationData { * Modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ. * Note: this will be specified by the source provider itself. */ - operationModifiedDateTime?: Date; + operationModifiedDateTime?: Date | string; /** Start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - operationStartDateTime?: Date; + operationStartDateTime?: Date | string; /** End date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - operationEndDateTime?: Date; + operationEndDateTime?: Date | string; /** Link for attachments. */ attachmentsLink?: string; /** Optional boundary ID of the field for which operation was applied. */ @@ -45,9 +36,9 @@ export interface ApplicationData { /** Status of the resource. */ status?: string; /** Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - createdDateTime?: Date; + createdDateTime?: Date | string; /** Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - modifiedDateTime?: Date; + modifiedDateTime?: Date | string; /** Name to identify resource. */ name?: string; /** Textual description of the resource. */ @@ -58,7 +49,7 @@ export interface ApplicationData { * and must not have a value greater than 150 characters. * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. */ - properties?: ApplicationDataPropertiesDictionary; + properties?: Record; } export interface ApplicationProductDetail { @@ -79,90 +70,6 @@ export interface Measure { value?: number; } -export interface ErrorResponse { - /** An error from the Azure AgPlatform service. */ - error?: Error; - /** Unique trace ID. */ - traceId?: string; -} - -export interface Error { - /** Server-defined set of error codes. */ - code?: string; - /** Human-readable representation of the error. */ - message?: string; - /** Target of the error. */ - target?: string; - /** Array of details about specific errors that led to this reported error. */ - details?: Error[]; - /** - * Inner error containing list of errors. - * InnerError reference document. - */ - innererror?: InnerError; -} - -export type InnerError = InnerErrorBase & InnerErrorDictionary; - -export interface InnerErrorBase { - /** - * Specific error code than was provided by the - * containing error. - */ - code?: string; - /** - * Inner error containing list of errors. - * InnerError reference document. - */ - innererror?: InnerError; -} - -export interface AttachmentListResponse { - /** List of requested objects. */ - value?: Attachment[]; - /** Token used in retrieving the next page. If null, there are no additional pages. */ - skipToken?: string; - /** Continuation link (absolute URI) to the next page of results in the list. */ - nextLink?: string; -} - -export interface Attachment { - /** Farmer id for this attachment. */ - farmerId?: string; - /** Associated Resource id for this attachment. */ - resourceId?: string; - /** - * Associated Resource type for this attachment - * i.e. Farmer, Farm, Field, SeasonalField, Boundary, FarmOperationApplicationData, HarvestData, TillageData, PlantingData. - */ - resourceType?: string; - /** Original File Name for this attachment. */ - originalFileName?: string; - /** Unique id. */ - id?: string; - /** Status of the resource. */ - status?: string; - /** Date when resource was created. */ - createdDateTime?: Date; - /** Date when resource was last modified. */ - modifiedDateTime?: Date; - /** Name to identify resource. */ - name?: string; - /** Textual description of resource. */ - description?: string; - /** The ETag value to implement optimistic concurrency. */ - eTag?: string; -} - -export interface BoundaryListResponse { - /** List of requested objects. */ - value?: Boundary[]; - /** Token used in retrieving the next page. If null, there are no additional pages. */ - skipToken?: string; - /** Continuation link (absolute URI) to the next page of results in the list. */ - nextLink?: string; -} - export interface Boundary { /** Farmer ID. */ farmerId?: string; @@ -183,9 +90,9 @@ export interface Boundary { /** Status of the resource. */ status?: string; /** Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - createdDateTime?: Date; + createdDateTime?: Date | string; /** Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - modifiedDateTime?: Date; + modifiedDateTime?: Date | string; /** Name to identify resource. */ name?: string; /** Textual description of the resource. */ @@ -196,44 +103,46 @@ export interface Boundary { * and must not have a value greater than 150 characters. * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. */ - properties?: BoundaryPropertiesDictionary; + properties?: Record; } -export type GeoJsonObject = Polygon | MultiPolygon | Point; +export interface GeoJsonObjectBase { + type: "MultiPolygon" | "Point" | "Polygon"; +} export interface SearchBoundaryQuery { /** Ids of the resource. */ - ids?: string[]; + ids?: Array; /** Names of the resource. */ - names?: string[]; + names?: Array; /** * Filters on key-value pairs within the Properties object. * eg. "{testKey} eq {testValue}". */ - propertyFilters?: string[]; + propertyFilters?: Array; /** Statuses of the resource. */ - statuses?: string[]; + statuses?: Array; /** Minimum creation date of resource (inclusive). */ - minCreatedDateTime?: Date; + minCreatedDateTime?: Date | string; /** Maximum creation date of resource (inclusive). */ - maxCreatedDateTime?: Date; + maxCreatedDateTime?: Date | string; /** Minimum last modified date of resource (inclusive). */ - minLastModifiedDateTime?: Date; + minLastModifiedDateTime?: Date | string; /** Maximum last modified date of resource (inclusive). */ - maxLastModifiedDateTime?: Date; + maxLastModifiedDateTime?: Date | string; /** * Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. */ - maxPageSize?: number; + $maxPageSize?: number; /** Skip token for getting next set of results. */ - skipToken?: string; + $skipToken?: string; /** Is the boundary primary. */ isPrimary?: boolean; /** Type of the parent it belongs to. */ parentType?: string; /** Parent Ids of the resource. */ - parentIds?: string[]; + parentIds?: Array; /** Minimum acreage of the boundary (inclusive). */ minAcreage?: number; /** Maximum acreage of the boundary (inclusive). */ @@ -242,63 +151,6 @@ export interface SearchBoundaryQuery { intersectsWithGeometry?: GeoJsonObject; } -export interface CascadeDeleteJob { - /** Farmer ID. */ - farmerId: string; - /** The id of the resource. */ - resourceId: string; - /** The type of the resource. */ - resourceType: string; - /** Unique job id. */ - id?: string; - /** - * Status of the job. - * Possible values: 'Waiting', 'Running', 'Succeeded', 'Failed', 'Cancelled'. - */ - status?: string; - /** Duration of the job in seconds. */ - durationInSeconds?: number; - /** Status message to capture more details of the job. */ - message?: string; - /** Job created at dateTime. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ - createdDateTime?: Date; - /** Job was last acted upon at dateTime. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ - lastActionDateTime?: Date; - /** Job start time when available. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ - startTime?: Date; - /** Job end time when available. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ - endTime?: Date; - /** Name to identify resource. */ - name?: string; - /** Textual description of the resource. */ - description?: string; - /** - * A collection of key value pairs that belongs to the resource. - * Each pair must not have a key greater than 50 characters - * and must not have a value greater than 150 characters. - * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. - */ - properties?: CascadeDeleteJobPropertiesDictionary; -} - -export interface BoundaryOverlapResponse { - /** Acreage of Main boundary. */ - boundaryAcreage?: number; - /** Acreage of other boundary. */ - otherBoundaryAcreage?: number; - /** Acreage of intersecting boundary. */ - intersectingAcreage?: number; -} - -export interface CropListResponse { - /** List of requested objects. */ - value?: Crop[]; - /** Token used in retrieving the next page. If null, there are no additional pages. */ - skipToken?: string; - /** Continuation link (absolute URI) to the next page of results in the list. */ - nextLink?: string; -} - export interface Crop { /** Crop phenotype. */ phenotype?: string; @@ -309,9 +161,9 @@ export interface Crop { /** Status of the resource. */ status?: string; /** Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - createdDateTime?: Date; + createdDateTime?: Date | string; /** Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - modifiedDateTime?: Date; + modifiedDateTime?: Date | string; /** Name to identify resource. */ name?: string; /** Textual description of the resource. */ @@ -322,16 +174,7 @@ export interface Crop { * and must not have a value greater than 150 characters. * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. */ - properties?: CropPropertiesDictionary; -} - -export interface CropVarietyListResponse { - /** List of requested objects. */ - value?: CropVariety[]; - /** Token used in retrieving the next page. If null, there are no additional pages. */ - skipToken?: string; - /** Continuation link (absolute URI) to the next page of results in the list. */ - nextLink?: string; + properties?: Record; } export interface CropVariety { @@ -348,9 +191,9 @@ export interface CropVariety { /** Status of the resource. */ status?: string; /** Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - createdDateTime?: Date; + createdDateTime?: Date | string; /** Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - modifiedDateTime?: Date; + modifiedDateTime?: Date | string; /** Name to identify resource. */ name?: string; /** Textual description of the resource. */ @@ -361,16 +204,7 @@ export interface CropVariety { * and must not have a value greater than 150 characters. * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. */ - properties?: CropVarietyPropertiesDictionary; -} - -export interface FarmerListResponse { - /** List of requested objects. */ - value?: Farmer[]; - /** Token used in retrieving the next page. If null, there are no additional pages. */ - skipToken?: string; - /** Continuation link (absolute URI) to the next page of results in the list. */ - nextLink?: string; + properties?: Record; } export interface Farmer { @@ -381,9 +215,9 @@ export interface Farmer { /** Status of the resource. */ status?: string; /** Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - createdDateTime?: Date; + createdDateTime?: Date | string; /** Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - modifiedDateTime?: Date; + modifiedDateTime?: Date | string; /** Name to identify resource. */ name?: string; /** Textual description of the resource. */ @@ -394,7 +228,7 @@ export interface Farmer { * and must not have a value greater than 150 characters. * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. */ - properties?: FarmerPropertiesDictionary; + properties?: Record; } export interface FarmOperationDataIngestionJob { @@ -403,7 +237,7 @@ export interface FarmOperationDataIngestionJob { /** Authentication provider ID. */ authProviderId: string; /** List of operation types for which data needs to be downloaded. Available values: AllOperations, Application, Planting, Harvest, Tillage. */ - operations?: string[]; + operations?: Array; /** Start Year (Minimum = 2000, Maximum = CurrentYear). */ startYear: number; /** Unique job id. */ @@ -418,13 +252,13 @@ export interface FarmOperationDataIngestionJob { /** Status message to capture more details of the job. */ message?: string; /** Job created at dateTime. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ - createdDateTime?: Date; + createdDateTime?: Date | string; /** Job was last acted upon at dateTime. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ - lastActionDateTime?: Date; + lastActionDateTime?: Date | string; /** Job start time when available. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ - startTime?: Date; + startTime?: Date | string; /** Job end time when available. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ - endTime?: Date; + endTime?: Date | string; /** Name to identify resource. */ name?: string; /** Textual description of the resource. */ @@ -435,16 +269,7 @@ export interface FarmOperationDataIngestionJob { * and must not have a value greater than 150 characters. * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. */ - properties?: FarmOperationDataIngestionJobPropertiesDictionary; -} - -export interface FarmListResponse { - /** List of requested objects. */ - value?: Farm[]; - /** Token used in retrieving the next page. If null, there are no additional pages. */ - skipToken?: string; - /** Continuation link (absolute URI) to the next page of results in the list. */ - nextLink?: string; + properties?: Record; } export interface Farm { @@ -457,9 +282,9 @@ export interface Farm { /** Status of the resource. */ status?: string; /** Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - createdDateTime?: Date; + createdDateTime?: Date | string; /** Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - modifiedDateTime?: Date; + modifiedDateTime?: Date | string; /** Name to identify resource. */ name?: string; /** Textual description of the resource. */ @@ -470,16 +295,7 @@ export interface Farm { * and must not have a value greater than 150 characters. * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. */ - properties?: FarmPropertiesDictionary; -} - -export interface FieldListResponse { - /** List of requested objects. */ - value?: Field[]; - /** Token used in retrieving the next page. If null, there are no additional pages. */ - skipToken?: string; - /** Continuation link (absolute URI) to the next page of results in the list. */ - nextLink?: string; + properties?: Record; } export interface Field { @@ -490,7 +306,7 @@ export interface Field { /** Primary boundary id. */ primaryBoundaryId?: string; /** Boundary Ids. */ - boundaryIds?: string[]; + boundaryIds?: Array; /** Unique resource ID. */ id?: string; /** The ETag value to implement optimistic concurrency. */ @@ -498,9 +314,9 @@ export interface Field { /** Status of the resource. */ status?: string; /** Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - createdDateTime?: Date; + createdDateTime?: Date | string; /** Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - modifiedDateTime?: Date; + modifiedDateTime?: Date | string; /** Name to identify resource. */ name?: string; /** Textual description of the resource. */ @@ -511,16 +327,7 @@ export interface Field { * and must not have a value greater than 150 characters. * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. */ - properties?: FieldPropertiesDictionary; -} - -export interface HarvestDataListResponse { - /** List of requested objects. */ - value?: HarvestData[]; - /** Token used in retrieving the next page. If null, there are no additional pages. */ - skipToken?: string; - /** Continuation link (absolute URI) to the next page of results in the list. */ - nextLink?: string; + properties?: Record; } export interface HarvestData { @@ -537,7 +344,7 @@ export interface HarvestData { /** Schema for storing measurement reading and unit. */ avgSpeed?: Measure; /** Harvest product details. */ - harvestProductDetails?: HarvestProductDetail[]; + harvestProductDetails?: Array; /** Schema for storing measurement reading and unit. */ area?: Measure; /** Source of the operation data. */ @@ -546,11 +353,11 @@ export interface HarvestData { * Modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ. * Note: this will be specified by the source provider itself. */ - operationModifiedDateTime?: Date; + operationModifiedDateTime?: Date | string; /** Start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - operationStartDateTime?: Date; + operationStartDateTime?: Date | string; /** End date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - operationEndDateTime?: Date; + operationEndDateTime?: Date | string; /** Link for attachments. */ attachmentsLink?: string; /** Optional boundary ID of the field for which operation was applied. */ @@ -566,9 +373,9 @@ export interface HarvestData { /** Status of the resource. */ status?: string; /** Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - createdDateTime?: Date; + createdDateTime?: Date | string; /** Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - modifiedDateTime?: Date; + modifiedDateTime?: Date | string; /** Name to identify resource. */ name?: string; /** Textual description of the resource. */ @@ -579,7 +386,7 @@ export interface HarvestData { * and must not have a value greater than 150 characters. * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. */ - properties?: HarvestDataPropertiesDictionary; + properties?: Record; } export interface HarvestProductDetail { @@ -605,7 +412,7 @@ export interface ImageProcessingRasterizeJob { /** Shapefile attachment ID. */ shapefileAttachmentId: string; /** List of shapefile column names to create raster attachments. */ - shapefileColumnNames: string[]; + shapefileColumnNames: Array; /** Unique job id. */ id?: string; /** @@ -618,13 +425,13 @@ export interface ImageProcessingRasterizeJob { /** Status message to capture more details of the job. */ message?: string; /** Job created at dateTime. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ - createdDateTime?: Date; + createdDateTime?: Date | string; /** Job was last acted upon at dateTime. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ - lastActionDateTime?: Date; + lastActionDateTime?: Date | string; /** Job start time when available. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ - startTime?: Date; + startTime?: Date | string; /** Job end time when available. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ - endTime?: Date; + endTime?: Date | string; /** Name to identify resource. */ name?: string; /** Textual description of the resource. */ @@ -635,16 +442,7 @@ export interface ImageProcessingRasterizeJob { * and must not have a value greater than 150 characters. * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. */ - properties?: ImageProcessingRasterizeJobPropertiesDictionary; -} - -export interface OAuthProviderListResponse { - /** List of requested objects. */ - value?: OAuthProvider[]; - /** Token used in retrieving the next page. If null, there are no additional pages. */ - skipToken?: string; - /** Continuation link (absolute URI) to the next page of results in the list. */ - nextLink?: string; + properties?: Record; } export interface OAuthProvider { @@ -670,9 +468,9 @@ export interface OAuthProvider { /** The ETag value to implement optimistic concurrency. */ eTag?: string; /** Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - createdDateTime?: Date; + createdDateTime?: Date | string; /** Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - modifiedDateTime?: Date; + modifiedDateTime?: Date | string; /** Name to identify resource. */ name?: string; /** Textual description of the resource. */ @@ -683,31 +481,7 @@ export interface OAuthProvider { * and must not have a value greater than 150 characters. * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. */ - properties?: OAuthProviderPropertiesDictionary; -} - -export interface OAuthTokenListResponse { - /** List of requested objects. */ - value?: OAuthToken[]; - /** Token used in retrieving the next page. If null, there are no additional pages. */ - skipToken?: string; - /** Continuation link (absolute URI) to the next page of results in the list. */ - nextLink?: string; -} - -export interface OAuthToken { - /** Farmer ID for this OAuth config. */ - farmerId: string; - /** ID of the OAuth provider resource containing app information. */ - authProviderId: string; - /** An optional flag indicating whether the token is a valid or expired (Default value: true). */ - isValid?: boolean; - /** The ETag value to implement optimistic concurrency. */ - eTag?: string; - /** Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - createdDateTime?: Date; - /** Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - modifiedDateTime?: Date; + properties?: Record; } export interface OAuthConnectRequest { @@ -721,15 +495,6 @@ export interface OAuthConnectRequest { userRedirectState?: string; } -export interface PlantingDataListResponse { - /** List of requested objects. */ - value?: PlantingData[]; - /** Token used in retrieving the next page. If null, there are no additional pages. */ - skipToken?: string; - /** Continuation link (absolute URI) to the next page of results in the list. */ - nextLink?: string; -} - export interface PlantingData { /** Schema for storing measurement reading and unit. */ avgPlantingRate?: Measure; @@ -738,7 +503,7 @@ export interface PlantingData { /** Schema for storing measurement reading and unit. */ avgMaterial?: Measure; /** Planting product details. */ - plantingProductDetails?: PlantingProductDetail[]; + plantingProductDetails?: Array; /** Schema for storing measurement reading and unit. */ area?: Measure; /** Source of the operation data. */ @@ -747,11 +512,11 @@ export interface PlantingData { * Modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ. * Note: this will be specified by the source provider itself. */ - operationModifiedDateTime?: Date; + operationModifiedDateTime?: Date | string; /** Start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - operationStartDateTime?: Date; + operationStartDateTime?: Date | string; /** End date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - operationEndDateTime?: Date; + operationEndDateTime?: Date | string; /** Link for attachments. */ attachmentsLink?: string; /** Optional boundary ID of the field for which operation was applied. */ @@ -767,9 +532,9 @@ export interface PlantingData { /** Status of the resource. */ status?: string; /** Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - createdDateTime?: Date; + createdDateTime?: Date | string; /** Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - modifiedDateTime?: Date; + modifiedDateTime?: Date | string; /** Name to identify resource. */ name?: string; /** Textual description of the resource. */ @@ -780,7 +545,7 @@ export interface PlantingData { * and must not have a value greater than 150 characters. * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. */ - properties?: PlantingDataPropertiesDictionary; + properties?: Record; } export interface PlantingProductDetail { @@ -794,66 +559,19 @@ export interface PlantingProductDetail { avgMaterial?: Measure; } -export interface SceneListResponse { - /** List of requested objects. */ - value?: Scene[]; - /** Token used in retrieving the next page. If null, there are no additional pages. */ - skipToken?: string; - /** Continuation link (absolute URI) to the next page of results in the list. */ - nextLink?: string; -} - -export interface Scene { - /** Date-time of the scene, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - sceneDateTime?: Date; - /** Data provider of the scene. */ - provider?: string; - /** Data source of the scene. */ - source?: string; - /** Collection of image files. */ - imageFiles?: ImageFile[]; - /** Supported image formats for scene resource. */ - imageFormat?: ImageFormat; - /** Cloud cover percentage of the scene. */ - cloudCoverPercentage?: number; - /** Dark pixel percentage of the scene. */ - darkPixelPercentage?: number; - /** Median of NDVI of the scene. */ - ndviMedianValue?: number; - /** Boundary ID which belongs to the scene. */ - boundaryId?: string; - /** Farmer ID which belongs to the scene. */ - farmerId?: string; - /** Unique scene resource ID. */ - id?: string; - /** The ETag value to implement optimistic concurrency. */ - eTag?: string; -} - -export interface ImageFile { - /** Link of the image file. */ - fileLink?: string; - /** Name of the image file. */ - name: string; - /** Supported image formats for scene resource. */ - imageFormat?: ImageFormat; - /** Resolution of image file in meters. */ - resolution?: number; -} - export interface SatelliteDataIngestionJob { /** Farmer ID. */ farmerId: string; /** The id of the boundary object for which satellite data is being fetched. */ boundaryId: string; /** Start Date. */ - startDateTime: Date; + startDateTime: Date | string; /** End Date. */ - endDateTime: Date; + endDateTime: Date | string; /** Provider of satellite data. */ - provider?: DataProvider; + provider?: "Microsoft"; /** Source of satellite data. */ - source?: Source; + source?: "Sentinel_2_L2A"; /** Data Model for SatelliteIngestionJobRequest. */ data?: SatelliteData; /** Unique job id. */ @@ -868,13 +586,13 @@ export interface SatelliteDataIngestionJob { /** Status message to capture more details of the job. */ message?: string; /** Job created at dateTime. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ - createdDateTime?: Date; + createdDateTime?: Date | string; /** Job was last acted upon at dateTime. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ - lastActionDateTime?: Date; + lastActionDateTime?: Date | string; /** Job start time when available. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ - startTime?: Date; + startTime?: Date | string; /** Job end time when available. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ - endTime?: Date; + endTime?: Date | string; /** Name to identify resource. */ name?: string; /** Textual description of the resource. */ @@ -885,25 +603,16 @@ export interface SatelliteDataIngestionJob { * and must not have a value greater than 150 characters. * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. */ - properties?: SatelliteDataIngestionJobPropertiesDictionary; + properties?: Record; } export interface SatelliteData { /** List of ImageNames. */ - imageNames?: string[]; + imageNames?: Array; /** List of ImageFormats. Available value: TIF. */ - imageFormats?: string[]; + imageFormats?: Array; /** List of ImageResolutions in meters. Available values: 10, 20, 60. */ - imageResolutions?: number[]; -} - -export interface SeasonalFieldListResponse { - /** List of requested objects. */ - value?: SeasonalField[]; - /** Token used in retrieving the next page. If null, there are no additional pages. */ - skipToken?: string; - /** Continuation link (absolute URI) to the next page of results in the list. */ - nextLink?: string; + imageResolutions?: Array; } export interface SeasonalField { @@ -912,7 +621,7 @@ export interface SeasonalField { /** Primary boundary id. */ primaryBoundaryId?: string; /** Boundary Ids. */ - boundaryIds?: string[]; + boundaryIds?: Array; /** ID of the associated Farm. */ farmId?: string; /** ID of the associated Field. */ @@ -920,7 +629,7 @@ export interface SeasonalField { /** ID of the season it belongs to. */ seasonId?: string; /** CropVariety ids. */ - cropVarietyIds?: string[]; + cropVarietyIds?: Array; /** ID of the crop it belongs to. */ cropId?: string; /** Average yield value of the seasonal field. */ @@ -932,7 +641,7 @@ export interface SeasonalField { /** Unit of average seed population value attribute. */ avgSeedPopulationUnit?: string; /** Planting datetime, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - plantingDateTime?: Date; + plantingDateTime?: Date | string; /** Unique resource ID. */ id?: string; /** The ETag value to implement optimistic concurrency. */ @@ -940,9 +649,9 @@ export interface SeasonalField { /** Status of the resource. */ status?: string; /** Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - createdDateTime?: Date; + createdDateTime?: Date | string; /** Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - modifiedDateTime?: Date; + modifiedDateTime?: Date | string; /** Name to identify resource. */ name?: string; /** Textual description of the resource. */ @@ -953,23 +662,14 @@ export interface SeasonalField { * and must not have a value greater than 150 characters. * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. */ - properties?: SeasonalFieldPropertiesDictionary; -} - -export interface SeasonListResponse { - /** List of requested objects. */ - value?: Season[]; - /** Token used in retrieving the next page. If null, there are no additional pages. */ - skipToken?: string; - /** Continuation link (absolute URI) to the next page of results in the list. */ - nextLink?: string; + properties?: Record; } export interface Season { /** Season start datetime, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - startDateTime?: Date; + startDateTime?: Date | string; /** Season end datetime, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - endDateTime?: Date; + endDateTime?: Date | string; /** Season year. */ year?: number; /** Unique resource ID. */ @@ -979,9 +679,9 @@ export interface Season { /** Status of the resource. */ status?: string; /** Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - createdDateTime?: Date; + createdDateTime?: Date | string; /** Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - modifiedDateTime?: Date; + modifiedDateTime?: Date | string; /** Name to identify resource. */ name?: string; /** Textual description of the resource. */ @@ -992,16 +692,7 @@ export interface Season { * and must not have a value greater than 150 characters. * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. */ - properties?: SeasonPropertiesDictionary; -} - -export interface TillageDataListResponse { - /** List of requested objects. */ - value?: TillageData[]; - /** Token used in retrieving the next page. If null, there are no additional pages. */ - skipToken?: string; - /** Continuation link (absolute URI) to the next page of results in the list. */ - nextLink?: string; + properties?: Record; } export interface TillageData { @@ -1017,11 +708,11 @@ export interface TillageData { * Modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ. * Note: this will be specified by the source provider itself. */ - operationModifiedDateTime?: Date; + operationModifiedDateTime?: Date | string; /** Start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - operationStartDateTime?: Date; + operationStartDateTime?: Date | string; /** End date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - operationEndDateTime?: Date; + operationEndDateTime?: Date | string; /** Link for attachments. */ attachmentsLink?: string; /** Optional boundary ID of the field for which operation was applied. */ @@ -1037,9 +728,9 @@ export interface TillageData { /** Status of the resource. */ status?: string; /** Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - createdDateTime?: Date; + createdDateTime?: Date | string; /** Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - modifiedDateTime?: Date; + modifiedDateTime?: Date | string; /** Name to identify resource. */ name?: string; /** Textual description of the resource. */ @@ -1050,89 +741,7 @@ export interface TillageData { * and must not have a value greater than 150 characters. * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. */ - properties?: TillageDataPropertiesDictionary; -} - -export interface WeatherDataListResponse { - /** List of requested objects. */ - value?: WeatherData[]; - /** Token used in retrieving the next page. If null, there are no additional pages. */ - skipToken?: string; - /** Continuation link (absolute URI) to the next page of results in the list. */ - nextLink?: string; -} - -export interface WeatherData { - /** Farmer ID. */ - farmerId: string; - /** Boundary ID. */ - boundaryId: string; - /** ID of the weather extension. */ - extensionId: string; - /** Location model class. */ - location: Location; - /** Date-time of the weather data, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - dateTime: Date; - /** Unit System like US/SI etc. */ - unitSystemCode?: string; - /** Version of the weather data extension. */ - extensionVersion: string; - /** Type of weather data (forecast/historical). */ - weatherDataType: string; - /** Granularity of weather data (daily/hourly). */ - granularity: string; - /** Schema for storing measurement reading and unit. */ - cloudCover?: Measure; - /** Schema for storing measurement reading and unit. */ - dewPoint?: Measure; - /** Schema for storing measurement reading and unit. */ - growingDegreeDay?: Measure; - /** Schema for storing measurement reading and unit. */ - precipitation?: Measure; - /** Schema for storing measurement reading and unit. */ - pressure?: Measure; - /** Schema for storing measurement reading and unit. */ - relativeHumidity?: Measure; - /** Schema for storing measurement reading and unit. */ - soilMoisture?: Measure; - /** Schema for storing measurement reading and unit. */ - soilTemperature?: Measure; - /** Schema for storing measurement reading and unit. */ - temperature?: Measure; - /** Schema for storing measurement reading and unit. */ - visibility?: Measure; - /** Schema for storing measurement reading and unit. */ - wetBulbTemperature?: Measure; - /** Schema for storing measurement reading and unit. */ - windChill?: Measure; - /** Schema for storing measurement reading and unit. */ - windDirection?: Measure; - /** Schema for storing measurement reading and unit. */ - windGust?: Measure; - /** Schema for storing measurement reading and unit. */ - windSpeed?: Measure; - /** Weather data ID. */ - id?: string; - /** The ETag value to implement optimistic concurrency. */ - eTag?: string; - /** Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - createdDateTime?: Date; - /** Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - modifiedDateTime?: Date; - /** - * A collection of key value pairs that belongs to the resource. - * Each pair must not have a key greater than 50 characters - * and must not have a value greater than 150 characters. - * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. - */ - properties?: WeatherDataPropertiesDictionary; -} - -export interface Location { - /** Latitude of the location. */ - latitude: number; - /** Longitude of the location. */ - longitude: number; + properties?: Record; } export interface WeatherDataIngestionJob { @@ -1145,7 +754,7 @@ export interface WeatherDataIngestionJob { /** Extension api name to which request is to be made. */ extensionApiName: string; /** Extension api input dictionary which would be used to feed request query/body/parameter information. */ - extensionApiInput: WeatherDataIngestionJobExtensionApiInputDictionary; + extensionApiInput: Record; /** App id of the weather data provider. */ extensionDataProviderAppId?: string; /** Api key of the weather data provider. */ @@ -1162,13 +771,13 @@ export interface WeatherDataIngestionJob { /** Status message to capture more details of the job. */ message?: string; /** Job created at dateTime. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ - createdDateTime?: Date; + createdDateTime?: Date | string; /** Job was last acted upon at dateTime. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ - lastActionDateTime?: Date; + lastActionDateTime?: Date | string; /** Job start time when available. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ - startTime?: Date; + startTime?: Date | string; /** Job end time when available. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ - endTime?: Date; + endTime?: Date | string; /** Name to identify resource. */ name?: string; /** Textual description of the resource. */ @@ -1179,7 +788,7 @@ export interface WeatherDataIngestionJob { * and must not have a value greater than 150 characters. * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. */ - properties?: WeatherDataIngestionJobPropertiesDictionary; + properties?: Record; } export interface WeatherDataDeleteJob { @@ -1194,9 +803,9 @@ export interface WeatherDataDeleteJob { /** Granularity of weather data. Possible values include: 'daily' , 'hourly'. */ granularity?: string; /** Weather data start UTC date-time (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ. */ - startDateTime?: Date; + startDateTime?: Date | string; /** Weather data end UTC date-time (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ. */ - endDateTime?: Date; + endDateTime?: Date | string; /** Unique job id. */ id?: string; /** @@ -1209,13 +818,13 @@ export interface WeatherDataDeleteJob { /** Status message to capture more details of the job. */ message?: string; /** Job created at dateTime. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ - createdDateTime?: Date; + createdDateTime?: Date | string; /** Job was last acted upon at dateTime. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ - lastActionDateTime?: Date; + lastActionDateTime?: Date | string; /** Job start time when available. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ - startTime?: Date; + startTime?: Date | string; /** Job end time when available. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ - endTime?: Date; + endTime?: Date | string; /** Name to identify resource. */ name?: string; /** Textual description of the resource. */ @@ -1226,7 +835,11 @@ export interface WeatherDataDeleteJob { * and must not have a value greater than 150 characters. * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. */ - properties?: WeatherDataDeleteJobPropertiesDictionary; + properties?: Record; +} + +export interface MultiPolygon extends GeoJsonObjectBase, MultiPolygonCoordinates { + type: "MultiPolygon"; } export interface MultiPolygonCoordinates { @@ -1236,30 +849,24 @@ export interface MultiPolygonCoordinates { * For Polygons with more than one of these rings, the first MUST be the exterior ring, * and any others MUST be interior rings. */ - coordinates: number[][][][]; + coordinates: Array>>>; } -export type MultiPolygon = MultiPolygonBase & - MultiPolygonCoordinates & { - type: "MultiPolygon"; - }; - -export interface MultiPolygonBase {} +export interface Point extends GeoJsonObjectBase, PointCoordinates { + type: "Point"; +} export interface PointCoordinates { /** * Gets or sets the coordinate of this point. * It must be an array of 2 or 3 elements for a 2D or 3D system. */ - coordinates: number[]; + coordinates: Array; } -export type Point = PointBase & - PointCoordinates & { - type: "Point"; - }; - -export interface PointBase {} +export interface Polygon extends GeoJsonObjectBase, PolygonCoordinates { + type: "Polygon"; +} export interface PolygonCoordinates { /** @@ -1268,69 +875,7 @@ export interface PolygonCoordinates { * For Polygons with more than one of these rings, the first MUST be the exterior ring, * and any others MUST be interior rings. */ - coordinates: number[][][]; -} - -export type Polygon = PolygonBase & - PolygonCoordinates & { - type: "Polygon"; - }; - -export interface PolygonBase {} - -export interface Paths1LxjoxzFarmersFarmeridAttachmentsAttachmentidPatchRequestbodyContentMultipartFormDataSchema { - /** File to be uploaded. */ - file?: string; - /** Farmer id for this attachment. */ - farmerId?: string; - /** Associated Resource id for this attachment. */ - resourceId?: string; - /** - * Associated Resource type for this attachment - * i.e. Farmer, Farm, Field, SeasonalField, Boundary, FarmOperationApplicationData, HarvestData, TillageData, PlantingData. - */ - resourceType?: string; - /** Original File Name for this attachment. */ - originalFileName?: string; - /** Unique id. */ - id?: string; - /** Status of the resource. */ - status?: string; - /** Date when resource was created. */ - createdDateTime?: string; - /** Date when resource was last modified. */ - modifiedDateTime?: string; - /** Name to identify resource. */ - name?: string; - /** Textual description of resource. */ - description?: string; - /** The ETag value to implement optimistic concurrency. */ - eTag?: string; + coordinates: Array>>; } -export type GeoJsonObjectType = "Point" | "Polygon" | "MultiPolygon"; -export type ImageFormat = "TIF"; -export type DataProvider = "Microsoft"; -export type Source = "Sentinel_2_L2A"; -export type ApplicationDataPropertiesDictionary = Record; -export type InnerErrorDictionary = Record; -export type BoundaryPropertiesDictionary = Record; -export type CascadeDeleteJobPropertiesDictionary = Record; -export type CropPropertiesDictionary = Record; -export type CropVarietyPropertiesDictionary = Record; -export type FarmerPropertiesDictionary = Record; -export type FarmOperationDataIngestionJobPropertiesDictionary = Record; -export type FarmPropertiesDictionary = Record; -export type FieldPropertiesDictionary = Record; -export type HarvestDataPropertiesDictionary = Record; -export type ImageProcessingRasterizeJobPropertiesDictionary = Record; -export type OAuthProviderPropertiesDictionary = Record; -export type PlantingDataPropertiesDictionary = Record; -export type SatelliteDataIngestionJobPropertiesDictionary = Record; -export type SeasonalFieldPropertiesDictionary = Record; -export type SeasonPropertiesDictionary = Record; -export type TillageDataPropertiesDictionary = Record; -export type WeatherDataPropertiesDictionary = Record; -export type WeatherDataIngestionJobExtensionApiInputDictionary = Record; -export type WeatherDataIngestionJobPropertiesDictionary = Record; -export type WeatherDataDeleteJobPropertiesDictionary = Record; +export type GeoJsonObject = MultiPolygon | Point | Polygon; diff --git a/sdk/agrifood/agrifood-farming-rest/src/outputModels.ts b/sdk/agrifood/agrifood-farming-rest/src/outputModels.ts new file mode 100644 index 000000000000..975970819480 --- /dev/null +++ b/sdk/agrifood/agrifood-farming-rest/src/outputModels.ts @@ -0,0 +1,1220 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +export interface ApplicationDataListResponseOutput { + /** List of requested objects. */ + value?: Array; + /** Token used in retrieving the next page. If null, there are no additional pages. */ + $skipToken?: string; + /** Continuation link (absolute URI) to the next page of results in the list. */ + nextLink?: string; +} + +export interface ApplicationDataOutput { + /** Application product details. */ + applicationProductDetails?: Array; + /** Schema for storing measurement reading and unit. */ + avgMaterial?: MeasureOutput; + /** Schema for storing measurement reading and unit. */ + totalMaterial?: MeasureOutput; + /** Schema for storing measurement reading and unit. */ + area?: MeasureOutput; + /** Source of the operation data. */ + source?: string; + /** + * Modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ. + * Note: this will be specified by the source provider itself. + */ + operationModifiedDateTime?: string; + /** Start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + operationStartDateTime?: string; + /** End date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + operationEndDateTime?: string; + /** Link for attachments. */ + attachmentsLink?: string; + /** Optional boundary ID of the field for which operation was applied. */ + associatedBoundaryId?: string; + /** Optional boundary ID of the actual area for which operation was applied inside the specified field. */ + operationBoundaryId?: string; + /** Farmer ID which belongs to the operation data. */ + farmerId?: string; + /** Unique resource ID. */ + id?: string; + /** The ETag value to implement optimistic concurrency. */ + eTag?: string; + /** Status of the resource. */ + status?: string; + /** Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + createdDateTime?: string; + /** Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + modifiedDateTime?: string; + /** Name to identify resource. */ + name?: string; + /** Textual description of the resource. */ + description?: string; + /** + * A collection of key value pairs that belongs to the resource. + * Each pair must not have a key greater than 50 characters + * and must not have a value greater than 150 characters. + * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. + */ + properties?: Record; +} + +export interface ApplicationProductDetailOutput { + /** Name of the product applied. */ + productName?: string; + /** A flag indicating whether product is a carrier for a tank mix. */ + isCarrier?: boolean; + /** Schema for storing measurement reading and unit. */ + avgMaterial?: MeasureOutput; + /** Schema for storing measurement reading and unit. */ + totalMaterial?: MeasureOutput; +} + +export interface MeasureOutput { + /** Data unit. */ + unit?: string; + /** Data value. */ + value?: number; +} + +export interface ErrorResponseOutput { + /** An error from the Azure AgPlatform service. */ + error?: ErrorModelOutput; + /** Unique trace ID. */ + traceId?: string; +} + +export interface ErrorModelOutput { + /** Server-defined set of error codes. */ + code?: string; + /** Human-readable representation of the error. */ + message?: string; + /** Target of the error. */ + target?: string; + /** Array of details about specific errors that led to this reported error. */ + details?: Array; + /** + * Inner error containing list of errors. + * InnerError reference document. + */ + innererror?: InnerErrorOutput; +} + +export interface InnerErrorOutput extends Record { + /** + * Specific error code than was provided by the + * containing error. + */ + code?: string; + /** + * Inner error containing list of errors. + * InnerError reference document. + */ + innererror?: InnerErrorOutput; +} + +export interface AttachmentListResponseOutput { + /** List of requested objects. */ + value?: Array; + /** Token used in retrieving the next page. If null, there are no additional pages. */ + $skipToken?: string; + /** Continuation link (absolute URI) to the next page of results in the list. */ + nextLink?: string; +} + +export interface AttachmentOutput { + /** Farmer id for this attachment. */ + farmerId?: string; + /** Associated Resource id for this attachment. */ + resourceId?: string; + /** + * Associated Resource type for this attachment + * i.e. Farmer, Farm, Field, SeasonalField, Boundary, FarmOperationApplicationData, HarvestData, TillageData, PlantingData. + */ + resourceType?: string; + /** Original File Name for this attachment. */ + originalFileName?: string; + /** Unique id. */ + id?: string; + /** Status of the resource. */ + status?: string; + /** Date when resource was created. */ + createdDateTime?: string; + /** Date when resource was last modified. */ + modifiedDateTime?: string; + /** Name to identify resource. */ + name?: string; + /** Textual description of resource. */ + description?: string; + /** The ETag value to implement optimistic concurrency. */ + eTag?: string; +} + +export interface BoundaryListResponseOutput { + /** List of requested objects. */ + value?: Array; + /** Token used in retrieving the next page. If null, there are no additional pages. */ + $skipToken?: string; + /** Continuation link (absolute URI) to the next page of results in the list. */ + nextLink?: string; +} + +export interface BoundaryOutput { + /** Farmer ID. */ + farmerId?: string; + /** ID of the parent(field or seasonalField) it belongs to. */ + parentId?: string; + /** GeoJSON abstract class. */ + geometry?: GeoJsonObjectOutput; + /** Is the boundary primary. */ + isPrimary?: boolean; + /** Boundary area in acres. */ + acreage?: number; + /** Type of the parent it belongs to. */ + parentType?: string; + /** Unique resource ID. */ + id?: string; + /** The ETag value to implement optimistic concurrency. */ + eTag?: string; + /** Status of the resource. */ + status?: string; + /** Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + createdDateTime?: string; + /** Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + modifiedDateTime?: string; + /** Name to identify resource. */ + name?: string; + /** Textual description of the resource. */ + description?: string; + /** + * A collection of key value pairs that belongs to the resource. + * Each pair must not have a key greater than 50 characters + * and must not have a value greater than 150 characters. + * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. + */ + properties?: Record; +} + +export interface GeoJsonObjectOutputBase { + type: "MultiPolygon" | "Point" | "Polygon"; +} + +export interface CascadeDeleteJobOutput { + /** Farmer ID. */ + farmerId: string; + /** The id of the resource. */ + resourceId: string; + /** The type of the resource. */ + resourceType: string; + /** Unique job id. */ + id?: string; + /** + * Status of the job. + * Possible values: 'Waiting', 'Running', 'Succeeded', 'Failed', 'Cancelled'. + */ + status?: string; + /** Duration of the job in seconds. */ + durationInSeconds?: number; + /** Status message to capture more details of the job. */ + message?: string; + /** Job created at dateTime. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ + createdDateTime?: string; + /** Job was last acted upon at dateTime. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ + lastActionDateTime?: string; + /** Job start time when available. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ + startTime?: string; + /** Job end time when available. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ + endTime?: string; + /** Name to identify resource. */ + name?: string; + /** Textual description of the resource. */ + description?: string; + /** + * A collection of key value pairs that belongs to the resource. + * Each pair must not have a key greater than 50 characters + * and must not have a value greater than 150 characters. + * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. + */ + properties?: Record; +} + +export interface BoundaryOverlapResponseOutput { + /** Acreage of Main boundary. */ + boundaryAcreage?: number; + /** Acreage of other boundary. */ + otherBoundaryAcreage?: number; + /** Acreage of intersecting boundary. */ + intersectingAcreage?: number; +} + +export interface CropListResponseOutput { + /** List of requested objects. */ + value?: Array; + /** Token used in retrieving the next page. If null, there are no additional pages. */ + $skipToken?: string; + /** Continuation link (absolute URI) to the next page of results in the list. */ + nextLink?: string; +} + +export interface CropOutput { + /** Crop phenotype. */ + phenotype?: string; + /** Unique resource ID. */ + id?: string; + /** The ETag value to implement optimistic concurrency. */ + eTag?: string; + /** Status of the resource. */ + status?: string; + /** Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + createdDateTime?: string; + /** Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + modifiedDateTime?: string; + /** Name to identify resource. */ + name?: string; + /** Textual description of the resource. */ + description?: string; + /** + * A collection of key value pairs that belongs to the resource. + * Each pair must not have a key greater than 50 characters + * and must not have a value greater than 150 characters. + * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. + */ + properties?: Record; +} + +export interface CropVarietyListResponseOutput { + /** List of requested objects. */ + value?: Array; + /** Token used in retrieving the next page. If null, there are no additional pages. */ + $skipToken?: string; + /** Continuation link (absolute URI) to the next page of results in the list. */ + nextLink?: string; +} + +export interface CropVarietyOutput { + /** ID of the crop it belongs to. */ + cropId?: string; + /** CropVariety Brand. */ + brand?: string; + /** CropVariety product. */ + product?: string; + /** Unique resource ID. */ + id?: string; + /** The ETag value to implement optimistic concurrency. */ + eTag?: string; + /** Status of the resource. */ + status?: string; + /** Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + createdDateTime?: string; + /** Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + modifiedDateTime?: string; + /** Name to identify resource. */ + name?: string; + /** Textual description of the resource. */ + description?: string; + /** + * A collection of key value pairs that belongs to the resource. + * Each pair must not have a key greater than 50 characters + * and must not have a value greater than 150 characters. + * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. + */ + properties?: Record; +} + +export interface FarmerListResponseOutput { + /** List of requested objects. */ + value?: Array; + /** Token used in retrieving the next page. If null, there are no additional pages. */ + $skipToken?: string; + /** Continuation link (absolute URI) to the next page of results in the list. */ + nextLink?: string; +} + +export interface FarmerOutput { + /** Unique resource ID. */ + id?: string; + /** The ETag value to implement optimistic concurrency. */ + eTag?: string; + /** Status of the resource. */ + status?: string; + /** Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + createdDateTime?: string; + /** Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + modifiedDateTime?: string; + /** Name to identify resource. */ + name?: string; + /** Textual description of the resource. */ + description?: string; + /** + * A collection of key value pairs that belongs to the resource. + * Each pair must not have a key greater than 50 characters + * and must not have a value greater than 150 characters. + * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. + */ + properties?: Record; +} + +export interface FarmOperationDataIngestionJobOutput { + /** Farmer ID. */ + farmerId: string; + /** Authentication provider ID. */ + authProviderId: string; + /** List of operation types for which data needs to be downloaded. Available values: AllOperations, Application, Planting, Harvest, Tillage. */ + operations?: Array; + /** Start Year (Minimum = 2000, Maximum = CurrentYear). */ + startYear: number; + /** Unique job id. */ + id?: string; + /** + * Status of the job. + * Possible values: 'Waiting', 'Running', 'Succeeded', 'Failed', 'Cancelled'. + */ + status?: string; + /** Duration of the job in seconds. */ + durationInSeconds?: number; + /** Status message to capture more details of the job. */ + message?: string; + /** Job created at dateTime. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ + createdDateTime?: string; + /** Job was last acted upon at dateTime. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ + lastActionDateTime?: string; + /** Job start time when available. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ + startTime?: string; + /** Job end time when available. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ + endTime?: string; + /** Name to identify resource. */ + name?: string; + /** Textual description of the resource. */ + description?: string; + /** + * A collection of key value pairs that belongs to the resource. + * Each pair must not have a key greater than 50 characters + * and must not have a value greater than 150 characters. + * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. + */ + properties?: Record; +} + +export interface FarmListResponseOutput { + /** List of requested objects. */ + value?: Array; + /** Token used in retrieving the next page. If null, there are no additional pages. */ + $skipToken?: string; + /** Continuation link (absolute URI) to the next page of results in the list. */ + nextLink?: string; +} + +export interface FarmOutput { + /** Farmer ID. */ + farmerId?: string; + /** Unique resource ID. */ + id?: string; + /** The ETag value to implement optimistic concurrency. */ + eTag?: string; + /** Status of the resource. */ + status?: string; + /** Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + createdDateTime?: string; + /** Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + modifiedDateTime?: string; + /** Name to identify resource. */ + name?: string; + /** Textual description of the resource. */ + description?: string; + /** + * A collection of key value pairs that belongs to the resource. + * Each pair must not have a key greater than 50 characters + * and must not have a value greater than 150 characters. + * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. + */ + properties?: Record; +} + +export interface FieldListResponseOutput { + /** List of requested objects. */ + value?: Array; + /** Token used in retrieving the next page. If null, there are no additional pages. */ + $skipToken?: string; + /** Continuation link (absolute URI) to the next page of results in the list. */ + nextLink?: string; +} + +export interface FieldOutput { + /** ID of the associated Farm. */ + farmId?: string; + /** Farmer ID. */ + farmerId?: string; + /** Primary boundary id. */ + primaryBoundaryId?: string; + /** Boundary Ids. */ + boundaryIds?: Array; + /** Unique resource ID. */ + id?: string; + /** The ETag value to implement optimistic concurrency. */ + eTag?: string; + /** Status of the resource. */ + status?: string; + /** Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + createdDateTime?: string; + /** Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + modifiedDateTime?: string; + /** Name to identify resource. */ + name?: string; + /** Textual description of the resource. */ + description?: string; + /** + * A collection of key value pairs that belongs to the resource. + * Each pair must not have a key greater than 50 characters + * and must not have a value greater than 150 characters. + * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. + */ + properties?: Record; +} + +export interface HarvestDataListResponseOutput { + /** List of requested objects. */ + value?: Array; + /** Token used in retrieving the next page. If null, there are no additional pages. */ + $skipToken?: string; + /** Continuation link (absolute URI) to the next page of results in the list. */ + nextLink?: string; +} + +export interface HarvestDataOutput { + /** Schema for storing measurement reading and unit. */ + totalYield?: MeasureOutput; + /** Schema for storing measurement reading and unit. */ + avgYield?: MeasureOutput; + /** Schema for storing measurement reading and unit. */ + totalWetMass?: MeasureOutput; + /** Schema for storing measurement reading and unit. */ + avgWetMass?: MeasureOutput; + /** Schema for storing measurement reading and unit. */ + avgMoisture?: MeasureOutput; + /** Schema for storing measurement reading and unit. */ + avgSpeed?: MeasureOutput; + /** Harvest product details. */ + harvestProductDetails?: Array; + /** Schema for storing measurement reading and unit. */ + area?: MeasureOutput; + /** Source of the operation data. */ + source?: string; + /** + * Modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ. + * Note: this will be specified by the source provider itself. + */ + operationModifiedDateTime?: string; + /** Start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + operationStartDateTime?: string; + /** End date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + operationEndDateTime?: string; + /** Link for attachments. */ + attachmentsLink?: string; + /** Optional boundary ID of the field for which operation was applied. */ + associatedBoundaryId?: string; + /** Optional boundary ID of the actual area for which operation was applied inside the specified field. */ + operationBoundaryId?: string; + /** Farmer ID which belongs to the operation data. */ + farmerId?: string; + /** Unique resource ID. */ + id?: string; + /** The ETag value to implement optimistic concurrency. */ + eTag?: string; + /** Status of the resource. */ + status?: string; + /** Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + createdDateTime?: string; + /** Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + modifiedDateTime?: string; + /** Name to identify resource. */ + name?: string; + /** Textual description of the resource. */ + description?: string; + /** + * A collection of key value pairs that belongs to the resource. + * Each pair must not have a key greater than 50 characters + * and must not have a value greater than 150 characters. + * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. + */ + properties?: Record; +} + +export interface HarvestProductDetailOutput { + /** Name of the product. */ + productName?: string; + /** Schema for storing measurement reading and unit. */ + area?: MeasureOutput; + /** Schema for storing measurement reading and unit. */ + totalYield?: MeasureOutput; + /** Schema for storing measurement reading and unit. */ + avgYield?: MeasureOutput; + /** Schema for storing measurement reading and unit. */ + avgMoisture?: MeasureOutput; + /** Schema for storing measurement reading and unit. */ + totalWetMass?: MeasureOutput; + /** Schema for storing measurement reading and unit. */ + avgWetMass?: MeasureOutput; +} + +export interface ImageProcessingRasterizeJobOutput { + /** Farmer ID. */ + farmerId: string; + /** Shapefile attachment ID. */ + shapefileAttachmentId: string; + /** List of shapefile column names to create raster attachments. */ + shapefileColumnNames: Array; + /** Unique job id. */ + id?: string; + /** + * Status of the job. + * Possible values: 'Waiting', 'Running', 'Succeeded', 'Failed', 'Cancelled'. + */ + status?: string; + /** Duration of the job in seconds. */ + durationInSeconds?: number; + /** Status message to capture more details of the job. */ + message?: string; + /** Job created at dateTime. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ + createdDateTime?: string; + /** Job was last acted upon at dateTime. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ + lastActionDateTime?: string; + /** Job start time when available. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ + startTime?: string; + /** Job end time when available. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ + endTime?: string; + /** Name to identify resource. */ + name?: string; + /** Textual description of the resource. */ + description?: string; + /** + * A collection of key value pairs that belongs to the resource. + * Each pair must not have a key greater than 50 characters + * and must not have a value greater than 150 characters. + * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. + */ + properties?: Record; +} + +export interface OAuthProviderListResponseOutput { + /** List of requested objects. */ + value?: Array; + /** Token used in retrieving the next page. If null, there are no additional pages. */ + $skipToken?: string; + /** Continuation link (absolute URI) to the next page of results in the list. */ + nextLink?: string; +} + +export interface OAuthProviderOutput { + /** OAuth App ID for given OAuth Provider. */ + appId?: string; + /** + * OAuth App secret for given Provider. + * Note: Won't be sent in response. + */ + appSecret?: string; + /** + * OAuth Api key for given Provider. + * Note: currently Applicable to Climate provider. Won't be sent in response. + */ + apiKey?: string; + /** + * An optional flag to determine if the App is ready to be used for Production scenarios in the provider side or not. (Default value: false) + * Note: Currently applicable for JohnDeere. + */ + isProductionApp?: boolean; + /** Unique OAuth provider ID. */ + id?: string; + /** The ETag value to implement optimistic concurrency. */ + eTag?: string; + /** Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + createdDateTime?: string; + /** Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + modifiedDateTime?: string; + /** Name to identify resource. */ + name?: string; + /** Textual description of the resource. */ + description?: string; + /** + * A collection of key value pairs that belongs to the resource. + * Each pair must not have a key greater than 50 characters + * and must not have a value greater than 150 characters. + * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. + */ + properties?: Record; +} + +export interface OAuthTokenListResponseOutput { + /** List of requested objects. */ + value?: Array; + /** Token used in retrieving the next page. If null, there are no additional pages. */ + $skipToken?: string; + /** Continuation link (absolute URI) to the next page of results in the list. */ + nextLink?: string; +} + +export interface OAuthTokenOutput { + /** Farmer ID for this OAuth config. */ + farmerId: string; + /** ID of the OAuth provider resource containing app information. */ + authProviderId: string; + /** An optional flag indicating whether the token is a valid or expired (Default value: true). */ + isValid?: boolean; + /** The ETag value to implement optimistic concurrency. */ + eTag?: string; + /** Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + createdDateTime?: string; + /** Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + modifiedDateTime?: string; +} + +export interface PlantingDataListResponseOutput { + /** List of requested objects. */ + value?: Array; + /** Token used in retrieving the next page. If null, there are no additional pages. */ + $skipToken?: string; + /** Continuation link (absolute URI) to the next page of results in the list. */ + nextLink?: string; +} + +export interface PlantingDataOutput { + /** Schema for storing measurement reading and unit. */ + avgPlantingRate?: MeasureOutput; + /** Schema for storing measurement reading and unit. */ + totalMaterial?: MeasureOutput; + /** Schema for storing measurement reading and unit. */ + avgMaterial?: MeasureOutput; + /** Planting product details. */ + plantingProductDetails?: Array; + /** Schema for storing measurement reading and unit. */ + area?: MeasureOutput; + /** Source of the operation data. */ + source?: string; + /** + * Modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ. + * Note: this will be specified by the source provider itself. + */ + operationModifiedDateTime?: string; + /** Start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + operationStartDateTime?: string; + /** End date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + operationEndDateTime?: string; + /** Link for attachments. */ + attachmentsLink?: string; + /** Optional boundary ID of the field for which operation was applied. */ + associatedBoundaryId?: string; + /** Optional boundary ID of the actual area for which operation was applied inside the specified field. */ + operationBoundaryId?: string; + /** Farmer ID which belongs to the operation data. */ + farmerId?: string; + /** Unique resource ID. */ + id?: string; + /** The ETag value to implement optimistic concurrency. */ + eTag?: string; + /** Status of the resource. */ + status?: string; + /** Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + createdDateTime?: string; + /** Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + modifiedDateTime?: string; + /** Name to identify resource. */ + name?: string; + /** Textual description of the resource. */ + description?: string; + /** + * A collection of key value pairs that belongs to the resource. + * Each pair must not have a key greater than 50 characters + * and must not have a value greater than 150 characters. + * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. + */ + properties?: Record; +} + +export interface PlantingProductDetailOutput { + /** Name of the product. */ + productName?: string; + /** Schema for storing measurement reading and unit. */ + area?: MeasureOutput; + /** Schema for storing measurement reading and unit. */ + totalMaterial?: MeasureOutput; + /** Schema for storing measurement reading and unit. */ + avgMaterial?: MeasureOutput; +} + +export interface SceneListResponseOutput { + /** List of requested objects. */ + value?: Array; + /** Token used in retrieving the next page. If null, there are no additional pages. */ + $skipToken?: string; + /** Continuation link (absolute URI) to the next page of results in the list. */ + nextLink?: string; +} + +export interface SceneOutput { + /** Date-time of the scene, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + sceneDateTime?: string; + /** Data provider of the scene. */ + provider?: string; + /** Data source of the scene. */ + source?: string; + /** Collection of image files. */ + imageFiles?: Array; + /** Supported image formats for scene resource. */ + imageFormat?: "TIF"; + /** Cloud cover percentage of the scene. */ + cloudCoverPercentage?: number; + /** Dark pixel percentage of the scene. */ + darkPixelPercentage?: number; + /** Median of NDVI of the scene. */ + ndviMedianValue?: number; + /** Boundary ID which belongs to the scene. */ + boundaryId?: string; + /** Farmer ID which belongs to the scene. */ + farmerId?: string; + /** Unique scene resource ID. */ + id?: string; + /** The ETag value to implement optimistic concurrency. */ + eTag?: string; +} + +export interface ImageFileOutput { + /** Link of the image file. */ + fileLink?: string; + /** Name of the image file. */ + name: string; + /** Supported image formats for scene resource. */ + imageFormat?: "TIF"; + /** Resolution of image file in meters. */ + resolution?: number; +} + +export interface SatelliteDataIngestionJobOutput { + /** Farmer ID. */ + farmerId: string; + /** The id of the boundary object for which satellite data is being fetched. */ + boundaryId: string; + /** Start Date. */ + startDateTime: string; + /** End Date. */ + endDateTime: string; + /** Provider of satellite data. */ + provider?: "Microsoft"; + /** Source of satellite data. */ + source?: "Sentinel_2_L2A"; + /** Data Model for SatelliteIngestionJobRequest. */ + data?: SatelliteDataOutput; + /** Unique job id. */ + id?: string; + /** + * Status of the job. + * Possible values: 'Waiting', 'Running', 'Succeeded', 'Failed', 'Cancelled'. + */ + status?: string; + /** Duration of the job in seconds. */ + durationInSeconds?: number; + /** Status message to capture more details of the job. */ + message?: string; + /** Job created at dateTime. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ + createdDateTime?: string; + /** Job was last acted upon at dateTime. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ + lastActionDateTime?: string; + /** Job start time when available. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ + startTime?: string; + /** Job end time when available. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ + endTime?: string; + /** Name to identify resource. */ + name?: string; + /** Textual description of the resource. */ + description?: string; + /** + * A collection of key value pairs that belongs to the resource. + * Each pair must not have a key greater than 50 characters + * and must not have a value greater than 150 characters. + * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. + */ + properties?: Record; +} + +export interface SatelliteDataOutput { + /** List of ImageNames. */ + imageNames?: Array; + /** List of ImageFormats. Available value: TIF. */ + imageFormats?: Array; + /** List of ImageResolutions in meters. Available values: 10, 20, 60. */ + imageResolutions?: Array; +} + +export interface SeasonalFieldListResponseOutput { + /** List of requested objects. */ + value?: Array; + /** Token used in retrieving the next page. If null, there are no additional pages. */ + $skipToken?: string; + /** Continuation link (absolute URI) to the next page of results in the list. */ + nextLink?: string; +} + +export interface SeasonalFieldOutput { + /** Farmer ID. */ + farmerId?: string; + /** Primary boundary id. */ + primaryBoundaryId?: string; + /** Boundary Ids. */ + boundaryIds?: Array; + /** ID of the associated Farm. */ + farmId?: string; + /** ID of the associated Field. */ + fieldId?: string; + /** ID of the season it belongs to. */ + seasonId?: string; + /** CropVariety ids. */ + cropVarietyIds?: Array; + /** ID of the crop it belongs to. */ + cropId?: string; + /** Average yield value of the seasonal field. */ + avgYieldValue?: number; + /** Unit of the average yield value attribute. */ + avgYieldUnit?: string; + /** Average seed population value of the seasonal field. */ + avgSeedPopulationValue?: number; + /** Unit of average seed population value attribute. */ + avgSeedPopulationUnit?: string; + /** Planting datetime, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + plantingDateTime?: string; + /** Unique resource ID. */ + id?: string; + /** The ETag value to implement optimistic concurrency. */ + eTag?: string; + /** Status of the resource. */ + status?: string; + /** Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + createdDateTime?: string; + /** Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + modifiedDateTime?: string; + /** Name to identify resource. */ + name?: string; + /** Textual description of the resource. */ + description?: string; + /** + * A collection of key value pairs that belongs to the resource. + * Each pair must not have a key greater than 50 characters + * and must not have a value greater than 150 characters. + * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. + */ + properties?: Record; +} + +export interface SeasonListResponseOutput { + /** List of requested objects. */ + value?: Array; + /** Token used in retrieving the next page. If null, there are no additional pages. */ + $skipToken?: string; + /** Continuation link (absolute URI) to the next page of results in the list. */ + nextLink?: string; +} + +export interface SeasonOutput { + /** Season start datetime, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + startDateTime?: string; + /** Season end datetime, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + endDateTime?: string; + /** Season year. */ + year?: number; + /** Unique resource ID. */ + id?: string; + /** The ETag value to implement optimistic concurrency. */ + eTag?: string; + /** Status of the resource. */ + status?: string; + /** Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + createdDateTime?: string; + /** Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + modifiedDateTime?: string; + /** Name to identify resource. */ + name?: string; + /** Textual description of the resource. */ + description?: string; + /** + * A collection of key value pairs that belongs to the resource. + * Each pair must not have a key greater than 50 characters + * and must not have a value greater than 150 characters. + * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. + */ + properties?: Record; +} + +export interface TillageDataListResponseOutput { + /** List of requested objects. */ + value?: Array; + /** Token used in retrieving the next page. If null, there are no additional pages. */ + $skipToken?: string; + /** Continuation link (absolute URI) to the next page of results in the list. */ + nextLink?: string; +} + +export interface TillageDataOutput { + /** Schema for storing measurement reading and unit. */ + tillageDepth?: MeasureOutput; + /** Schema for storing measurement reading and unit. */ + tillagePressure?: MeasureOutput; + /** Schema for storing measurement reading and unit. */ + area?: MeasureOutput; + /** Source of the operation data. */ + source?: string; + /** + * Modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ. + * Note: this will be specified by the source provider itself. + */ + operationModifiedDateTime?: string; + /** Start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + operationStartDateTime?: string; + /** End date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + operationEndDateTime?: string; + /** Link for attachments. */ + attachmentsLink?: string; + /** Optional boundary ID of the field for which operation was applied. */ + associatedBoundaryId?: string; + /** Optional boundary ID of the actual area for which operation was applied inside the specified field. */ + operationBoundaryId?: string; + /** Farmer ID which belongs to the operation data. */ + farmerId?: string; + /** Unique resource ID. */ + id?: string; + /** The ETag value to implement optimistic concurrency. */ + eTag?: string; + /** Status of the resource. */ + status?: string; + /** Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + createdDateTime?: string; + /** Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + modifiedDateTime?: string; + /** Name to identify resource. */ + name?: string; + /** Textual description of the resource. */ + description?: string; + /** + * A collection of key value pairs that belongs to the resource. + * Each pair must not have a key greater than 50 characters + * and must not have a value greater than 150 characters. + * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. + */ + properties?: Record; +} + +export interface WeatherDataListResponseOutput { + /** List of requested objects. */ + value?: Array; + /** Token used in retrieving the next page. If null, there are no additional pages. */ + $skipToken?: string; + /** Continuation link (absolute URI) to the next page of results in the list. */ + nextLink?: string; +} + +export interface WeatherDataOutput { + /** Farmer ID. */ + farmerId: string; + /** Boundary ID. */ + boundaryId: string; + /** ID of the weather extension. */ + extensionId: string; + /** Location model class. */ + location: LocationOutput; + /** Date-time of the weather data, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + dateTime: string; + /** Unit System like US/SI etc. */ + unitSystemCode?: string; + /** Version of the weather data extension. */ + extensionVersion: string; + /** Type of weather data (forecast/historical). */ + weatherDataType: string; + /** Granularity of weather data (daily/hourly). */ + granularity: string; + /** Schema for storing measurement reading and unit. */ + cloudCover?: MeasureOutput; + /** Schema for storing measurement reading and unit. */ + dewPoint?: MeasureOutput; + /** Schema for storing measurement reading and unit. */ + growingDegreeDay?: MeasureOutput; + /** Schema for storing measurement reading and unit. */ + precipitation?: MeasureOutput; + /** Schema for storing measurement reading and unit. */ + pressure?: MeasureOutput; + /** Schema for storing measurement reading and unit. */ + relativeHumidity?: MeasureOutput; + /** Schema for storing measurement reading and unit. */ + soilMoisture?: MeasureOutput; + /** Schema for storing measurement reading and unit. */ + soilTemperature?: MeasureOutput; + /** Schema for storing measurement reading and unit. */ + temperature?: MeasureOutput; + /** Schema for storing measurement reading and unit. */ + visibility?: MeasureOutput; + /** Schema for storing measurement reading and unit. */ + wetBulbTemperature?: MeasureOutput; + /** Schema for storing measurement reading and unit. */ + windChill?: MeasureOutput; + /** Schema for storing measurement reading and unit. */ + windDirection?: MeasureOutput; + /** Schema for storing measurement reading and unit. */ + windGust?: MeasureOutput; + /** Schema for storing measurement reading and unit. */ + windSpeed?: MeasureOutput; + /** Weather data ID. */ + id?: string; + /** The ETag value to implement optimistic concurrency. */ + eTag?: string; + /** Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + createdDateTime?: string; + /** Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ. */ + modifiedDateTime?: string; + /** + * A collection of key value pairs that belongs to the resource. + * Each pair must not have a key greater than 50 characters + * and must not have a value greater than 150 characters. + * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. + */ + properties?: Record; +} + +export interface LocationOutput { + /** Latitude of the location. */ + latitude: number; + /** Longitude of the location. */ + longitude: number; +} + +export interface WeatherDataIngestionJobOutput { + /** The id of the boundary object for which weather data is being fetched. */ + boundaryId: string; + /** The id of the farmer object for which weather data is being fetched. */ + farmerId: string; + /** ID of the extension to be used for the providerInput. eg. DTN.ClearAg. */ + extensionId: string; + /** Extension api name to which request is to be made. */ + extensionApiName: string; + /** Extension api input dictionary which would be used to feed request query/body/parameter information. */ + extensionApiInput: Record; + /** App id of the weather data provider. */ + extensionDataProviderAppId?: string; + /** Api key of the weather data provider. */ + extensionDataProviderApiKey?: string; + /** Unique job id. */ + id?: string; + /** + * Status of the job. + * Possible values: 'Waiting', 'Running', 'Succeeded', 'Failed', 'Cancelled'. + */ + status?: string; + /** Duration of the job in seconds. */ + durationInSeconds?: number; + /** Status message to capture more details of the job. */ + message?: string; + /** Job created at dateTime. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ + createdDateTime?: string; + /** Job was last acted upon at dateTime. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ + lastActionDateTime?: string; + /** Job start time when available. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ + startTime?: string; + /** Job end time when available. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ + endTime?: string; + /** Name to identify resource. */ + name?: string; + /** Textual description of the resource. */ + description?: string; + /** + * A collection of key value pairs that belongs to the resource. + * Each pair must not have a key greater than 50 characters + * and must not have a value greater than 150 characters. + * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. + */ + properties?: Record; +} + +export interface WeatherDataDeleteJobOutput { + /** ID of the extension to be used for the providerInput. eg. DTN.ClearAg. */ + extensionId: string; + /** The id of the farmer object for which weather data is being fetched. */ + farmerId: string; + /** The id of the boundary object for which weather data is being fetched. */ + boundaryId: string; + /** Type of weather data. Possible values include: 'forecast' , 'historical'. */ + weatherDataType?: string; + /** Granularity of weather data. Possible values include: 'daily' , 'hourly'. */ + granularity?: string; + /** Weather data start UTC date-time (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ. */ + startDateTime?: string; + /** Weather data end UTC date-time (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ. */ + endDateTime?: string; + /** Unique job id. */ + id?: string; + /** + * Status of the job. + * Possible values: 'Waiting', 'Running', 'Succeeded', 'Failed', 'Cancelled'. + */ + status?: string; + /** Duration of the job in seconds. */ + durationInSeconds?: number; + /** Status message to capture more details of the job. */ + message?: string; + /** Job created at dateTime. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ + createdDateTime?: string; + /** Job was last acted upon at dateTime. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ + lastActionDateTime?: string; + /** Job start time when available. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ + startTime?: string; + /** Job end time when available. Sample format: yyyy-MM-ddTHH:mm:ssZ. */ + endTime?: string; + /** Name to identify resource. */ + name?: string; + /** Textual description of the resource. */ + description?: string; + /** + * A collection of key value pairs that belongs to the resource. + * Each pair must not have a key greater than 50 characters + * and must not have a value greater than 150 characters. + * Note: A maximum of 25 key value pairs can be provided for a resource and only string and numeral values are supported. + */ + properties?: Record; +} + +export interface MultiPolygonOutput extends GeoJsonObjectOutputBase, MultiPolygonCoordinatesOutput { + type: "MultiPolygon"; +} + +export interface MultiPolygonCoordinatesOutput { + /** + * Gets or sets Coordinates of GeoJSON Object. + * It must be an array of polygons, each polygon contains list of linear rings. + * For Polygons with more than one of these rings, the first MUST be the exterior ring, + * and any others MUST be interior rings. + */ + coordinates: Array>>>; +} + +export interface PointOutput extends GeoJsonObjectOutputBase, PointCoordinatesOutput { + type: "Point"; +} + +export interface PointCoordinatesOutput { + /** + * Gets or sets the coordinate of this point. + * It must be an array of 2 or 3 elements for a 2D or 3D system. + */ + coordinates: Array; +} + +export interface PolygonOutput extends GeoJsonObjectOutputBase, PolygonCoordinatesOutput { + type: "Polygon"; +} + +export interface PolygonCoordinatesOutput { + /** + * Gets or sets type of the GeoJSON Object. + * It must be an array of linear ring coordinate arrays. + * For Polygons with more than one of these rings, the first MUST be the exterior ring, + * and any others MUST be interior rings. + */ + coordinates: Array>>; +} + +export type GeoJsonObjectOutput = MultiPolygonOutput | PointOutput | PolygonOutput; diff --git a/sdk/agrifood/agrifood-farming-rest/src/paginateHelper.ts b/sdk/agrifood/agrifood-farming-rest/src/paginateHelper.ts new file mode 100644 index 000000000000..477bace4a37f --- /dev/null +++ b/sdk/agrifood/agrifood-farming-rest/src/paginateHelper.ts @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { getPagedAsyncIterator, PagedAsyncIterableIterator, PagedResult } from "@azure/core-paging"; +import { Client, createRestError, PathUncheckedResponse } from "@azure-rest/core-client"; + +/** + * Helper type to extract the type of an array + */ +export type GetArrayType = T extends Array ? TData : never; + +/** + * The type of a custom function that defines how to get a page and a link to the next one if any. + */ +export type GetPage = ( + pageLink: string, + maxPageSize?: number +) => Promise<{ + page: TPage; + nextPageLink?: string; +}>; + +/** + * Options for the paging helper + */ +export interface PagingOptions { + /** + * Custom function to extract pagination details for crating the PagedAsyncIterableIterator + */ + customGetPage?: GetPage[]>; +} + +/** + * Helper type to infer the Type of the paged elements from the response type + * This type is generated based on the swagger information for x-ms-pageable + * specifically on the itemName property which indicates the property of the response + * where the page items are found. The default value is `value`. + * This type will allow us to provide strongly typed Iterator based on the response we get as second parameter + */ +export type PaginateReturn = TResult extends { + body: { value?: infer TPage }; +} + ? GetArrayType + : Array; + +/** + * Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension + * @param client - Client to use for sending the next page requests + * @param initialResponse - Initial response containing the nextLink and current page of elements + * @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results + * @returns - PagedAsyncIterableIterator to iterate the elements + */ +export function paginate( + client: Client, + initialResponse: TResponse, + options: PagingOptions = {} +): PagedAsyncIterableIterator> { + // Extract element type from initial response + type TElement = PaginateReturn; + let firstRun = true; + const itemName = "value"; + const nextLinkName = "nextLink"; + const { customGetPage } = options; + const pagedResult: PagedResult = { + firstPageLink: "", + getPage: + typeof customGetPage === "function" + ? customGetPage + : async (pageLink: string) => { + const result = firstRun ? initialResponse : await client.pathUnchecked(pageLink).get(); + firstRun = false; + checkPagingRequest(result); + const nextLink = getNextLink(result.body, nextLinkName); + const values = getElements(result.body, itemName); + return { + page: values, + nextPageLink: nextLink, + }; + }, + }; + + return getPagedAsyncIterator(pagedResult); +} + +/** + * Gets for the value of nextLink in the body + */ +function getNextLink(body: unknown, nextLinkName?: string): string | undefined { + if (!nextLinkName) { + return undefined; + } + + const nextLink = (body as Record)[nextLinkName]; + + if (typeof nextLink !== "string" && typeof nextLink !== "undefined") { + throw new Error(`Body Property ${nextLinkName} should be a string or undefined`); + } + + return nextLink; +} + +/** + * Gets the elements of the current request in the body. + */ +function getElements(body: unknown, itemName: string): T[] { + const value = (body as Record)[itemName] as T[]; + + // value has to be an array according to the x-ms-pageable extension. + // The fact that this must be an array is used above to calculate the + // type of elements in the page in PaginateReturn + if (!Array.isArray(value)) { + throw new Error( + `Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}` + ); + } + + return value ?? []; +} + +/** + * Checks if a request failed + */ +function checkPagingRequest(response: PathUncheckedResponse): void { + const Http2xxStatusCodes = ["200", "201", "202", "203", "204", "205", "206", "207", "208", "226"]; + if (!Http2xxStatusCodes.includes(response.status)) { + throw createRestError( + `Pagination failed with unexpected statusCode ${response.status}`, + response + ); + } +} diff --git a/sdk/agrifood/agrifood-farming-rest/src/paging.ts b/sdk/agrifood/agrifood-farming-rest/src/paging.ts deleted file mode 100644 index 2dabe2eeb0d0..000000000000 --- a/sdk/agrifood/agrifood-farming-rest/src/paging.ts +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import { paginateResponse, PagedAsyncIterableIterator } from "@azure-rest/core-client-paging"; -import { Client, PathUncheckedResponse } from "@azure-rest/core-client"; - -/** - * Helper type to extract the type of an array - */ -export type GetArrayType = T extends Array ? TData : never; - -/** - * Helper type to infer the Type of the paged elements from the response type - * This type is generated based on the swagger information for x-ms-pageable - * specifically on the itemName property which indicates the property of the response - * where the page items are found. The default value is `value`. - * This type will allow us to provide strongly typed Iterator based on the response we get as second parameter - */ -export type PaginateReturn = TResult extends { - body: { value?: infer TPage }; -} - ? GetArrayType - : Array; - -/** - * This is the wrapper function that would be exposed. It is hiding the Pagination Options because it can be - * obtained from the swagger - * @param client - Client to use for sending the next page requests - * @param initialResponse - Initial response containing the nextLink and current page of elements - * @returns - PagedAsyncIterableIterator to iterate the elements - */ -export function paginate( - client: Client, - initialResponse: TReturn -): PagedAsyncIterableIterator, PaginateReturn[]> { - return paginateResponse>(client, initialResponse); -} diff --git a/sdk/agrifood/agrifood-farming-rest/src/parameters.ts b/sdk/agrifood/agrifood-farming-rest/src/parameters.ts index b8f5d0030548..fff6002e6226 100644 --- a/sdk/agrifood/agrifood-farming-rest/src/parameters.ts +++ b/sdk/agrifood/agrifood-farming-rest/src/parameters.ts @@ -35,46 +35,46 @@ export interface ApplicationDataListByFarmerIdQueryParamProperties { /** Maximum total amount of material applied during the application (inclusive). */ maxTotalMaterial?: number; /** Sources of the operation data. */ - sources?: string[]; + sources?: Array; /** Boundary IDs associated with operation data. */ - associatedBoundaryIds?: string[]; + associatedBoundaryIds?: Array; /** Operation boundary IDs associated with operation data. */ - operationBoundaryIds?: string[]; + operationBoundaryIds?: Array; /** Minimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - minOperationStartDateTime?: Date; + minOperationStartDateTime?: Date | string; /** Maximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - maxOperationStartDateTime?: Date; + maxOperationStartDateTime?: Date | string; /** Minimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - minOperationEndDateTime?: Date; + minOperationEndDateTime?: Date | string; /** Maximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - maxOperationEndDateTime?: Date; + maxOperationEndDateTime?: Date | string; /** Minimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - minOperationModifiedDateTime?: Date; + minOperationModifiedDateTime?: Date | string; /** Maximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - maxOperationModifiedDateTime?: Date; + maxOperationModifiedDateTime?: Date | string; /** Minimum area for which operation was applied (inclusive). */ minArea?: number; /** Maximum area for which operation was applied (inclusive). */ maxArea?: number; /** Ids of the resource. */ - ids?: string[]; + ids?: Array; /** Names of the resource. */ - names?: string[]; + names?: Array; /** * Filters on key-value pairs within the Properties object. - * eg. "\{testKey\} eq \{testValue\}". + * eg. "{testKey} eq {testValue}". */ - propertyFilters?: string[]; + propertyFilters?: Array; /** Statuses of the resource. */ - statuses?: string[]; + statuses?: Array; /** Minimum creation date of resource (inclusive). */ - minCreatedDateTime?: Date; + minCreatedDateTime?: Date | string; /** Maximum creation date of resource (inclusive). */ - maxCreatedDateTime?: Date; + maxCreatedDateTime?: Date | string; /** Minimum last modified date of resource (inclusive). */ - minLastModifiedDateTime?: Date; + minLastModifiedDateTime?: Date | string; /** Maximum last modified date of resource (inclusive). */ - maxLastModifiedDateTime?: Date; + maxLastModifiedDateTime?: Date | string; /** * Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. @@ -88,8 +88,8 @@ export interface ApplicationDataListByFarmerIdQueryParam { queryParameters?: ApplicationDataListByFarmerIdQueryParamProperties; } -export type ApplicationDataListByFarmerIdParameters = RequestParameters & - ApplicationDataListByFarmerIdQueryParam; +export type ApplicationDataListByFarmerIdParameters = ApplicationDataListByFarmerIdQueryParam & + RequestParameters; export interface ApplicationDataListQueryParamProperties { /** Minimum average amount of material applied during the application (inclusive). */ @@ -101,46 +101,46 @@ export interface ApplicationDataListQueryParamProperties { /** Maximum total amount of material applied during the application (inclusive). */ maxTotalMaterial?: number; /** Sources of the operation data. */ - sources?: string[]; + sources?: Array; /** Boundary IDs associated with operation data. */ - associatedBoundaryIds?: string[]; + associatedBoundaryIds?: Array; /** Operation boundary IDs associated with operation data. */ - operationBoundaryIds?: string[]; + operationBoundaryIds?: Array; /** Minimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - minOperationStartDateTime?: Date; + minOperationStartDateTime?: Date | string; /** Maximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - maxOperationStartDateTime?: Date; + maxOperationStartDateTime?: Date | string; /** Minimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - minOperationEndDateTime?: Date; + minOperationEndDateTime?: Date | string; /** Maximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - maxOperationEndDateTime?: Date; + maxOperationEndDateTime?: Date | string; /** Minimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - minOperationModifiedDateTime?: Date; + minOperationModifiedDateTime?: Date | string; /** Maximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - maxOperationModifiedDateTime?: Date; + maxOperationModifiedDateTime?: Date | string; /** Minimum area for which operation was applied (inclusive). */ minArea?: number; /** Maximum area for which operation was applied (inclusive). */ maxArea?: number; /** Ids of the resource. */ - ids?: string[]; + ids?: Array; /** Names of the resource. */ - names?: string[]; + names?: Array; /** * Filters on key-value pairs within the Properties object. - * eg. "\{testKey\} eq \{testValue\}". + * eg. "{testKey} eq {testValue}". */ - propertyFilters?: string[]; + propertyFilters?: Array; /** Statuses of the resource. */ - statuses?: string[]; + statuses?: Array; /** Minimum creation date of resource (inclusive). */ - minCreatedDateTime?: Date; + minCreatedDateTime?: Date | string; /** Maximum creation date of resource (inclusive). */ - maxCreatedDateTime?: Date; + maxCreatedDateTime?: Date | string; /** Minimum last modified date of resource (inclusive). */ - minLastModifiedDateTime?: Date; + minLastModifiedDateTime?: Date | string; /** Maximum last modified date of resource (inclusive). */ - maxLastModifiedDateTime?: Date; + maxLastModifiedDateTime?: Date | string; /** * Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. @@ -154,41 +154,48 @@ export interface ApplicationDataListQueryParam { queryParameters?: ApplicationDataListQueryParamProperties; } -export type ApplicationDataListParameters = RequestParameters & ApplicationDataListQueryParam; +export type ApplicationDataListParameters = ApplicationDataListQueryParam & RequestParameters; export type ApplicationDataGetParameters = RequestParameters; export interface ApplicationDataCreateOrUpdateBodyParam { + /** Application data resource payload to create or update. */ body?: ApplicationData; } -export type ApplicationDataCreateOrUpdateParameters = RequestParameters & - ApplicationDataCreateOrUpdateBodyParam; +export interface ApplicationDataCreateOrUpdateMediaTypesParam { + /** Request content type */ + contentType?: "application/merge-patch+json"; +} + +export type ApplicationDataCreateOrUpdateParameters = ApplicationDataCreateOrUpdateMediaTypesParam & + ApplicationDataCreateOrUpdateBodyParam & + RequestParameters; export type ApplicationDataDeleteParameters = RequestParameters; export interface AttachmentsListByFarmerIdQueryParamProperties { /** Resource Ids of the resource. */ - resourceIds?: string[]; + resourceIds?: Array; /** Resource Types of the resource. */ - resourceTypes?: string[]; + resourceTypes?: Array; /** Ids of the resource. */ - ids?: string[]; + ids?: Array; /** Names of the resource. */ - names?: string[]; + names?: Array; /** * Filters on key-value pairs within the Properties object. - * eg. "\{testKey\} eq \{testValue\}". + * eg. "{testKey} eq {testValue}". */ - propertyFilters?: string[]; + propertyFilters?: Array; /** Statuses of the resource. */ - statuses?: string[]; + statuses?: Array; /** Minimum creation date of resource (inclusive). */ - minCreatedDateTime?: Date; + minCreatedDateTime?: Date | string; /** Maximum creation date of resource (inclusive). */ - maxCreatedDateTime?: Date; + maxCreatedDateTime?: Date | string; /** Minimum last modified date of resource (inclusive). */ - minLastModifiedDateTime?: Date; + minLastModifiedDateTime?: Date | string; /** Maximum last modified date of resource (inclusive). */ - maxLastModifiedDateTime?: Date; + maxLastModifiedDateTime?: Date | string; /** * Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. @@ -202,16 +209,27 @@ export interface AttachmentsListByFarmerIdQueryParam { queryParameters?: AttachmentsListByFarmerIdQueryParamProperties; } -export type AttachmentsListByFarmerIdParameters = RequestParameters & - AttachmentsListByFarmerIdQueryParam; +export type AttachmentsListByFarmerIdParameters = AttachmentsListByFarmerIdQueryParam & + RequestParameters; export type AttachmentsGetParameters = RequestParameters; export interface AttachmentsCreateOrUpdateBodyParam { + /** + * File to be uploaded. + * + * Value may contain any sequence of octets + */ body?: string; } -export type AttachmentsCreateOrUpdateParameters = RequestParameters & - AttachmentsCreateOrUpdateBodyParam; +export interface AttachmentsCreateOrUpdateMediaTypesParam { + /** Request content type */ + contentType?: "multipart/form-data"; +} + +export type AttachmentsCreateOrUpdateParameters = AttachmentsCreateOrUpdateMediaTypesParam & + AttachmentsCreateOrUpdateBodyParam & + RequestParameters; export type AttachmentsDeleteParameters = RequestParameters; export type AttachmentsDownloadParameters = RequestParameters; @@ -221,30 +239,30 @@ export interface BoundariesListByFarmerIdQueryParamProperties { /** Type of the parent it belongs to. */ parentType?: string; /** Parent Ids of the resource. */ - parentIds?: string[]; + parentIds?: Array; /** Minimum acreage of the boundary (inclusive). */ minAcreage?: number; /** Maximum acreage of the boundary (inclusive). */ maxAcreage?: number; /** Ids of the resource. */ - ids?: string[]; + ids?: Array; /** Names of the resource. */ - names?: string[]; + names?: Array; /** * Filters on key-value pairs within the Properties object. - * eg. "\{testKey\} eq \{testValue\}". + * eg. "{testKey} eq {testValue}". */ - propertyFilters?: string[]; + propertyFilters?: Array; /** Statuses of the resource. */ - statuses?: string[]; + statuses?: Array; /** Minimum creation date of resource (inclusive). */ - minCreatedDateTime?: Date; + minCreatedDateTime?: Date | string; /** Maximum creation date of resource (inclusive). */ - maxCreatedDateTime?: Date; + maxCreatedDateTime?: Date | string; /** Minimum last modified date of resource (inclusive). */ - minLastModifiedDateTime?: Date; + minLastModifiedDateTime?: Date | string; /** Maximum last modified date of resource (inclusive). */ - maxLastModifiedDateTime?: Date; + maxLastModifiedDateTime?: Date | string; /** * Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. @@ -258,15 +276,22 @@ export interface BoundariesListByFarmerIdQueryParam { queryParameters?: BoundariesListByFarmerIdQueryParamProperties; } -export type BoundariesListByFarmerIdParameters = RequestParameters & - BoundariesListByFarmerIdQueryParam; +export type BoundariesListByFarmerIdParameters = BoundariesListByFarmerIdQueryParam & + RequestParameters; export interface BoundariesSearchByFarmerIdBodyParam { + /** Query filters. */ body?: SearchBoundaryQuery; } -export type BoundariesSearchByFarmerIdParameters = RequestParameters & - BoundariesSearchByFarmerIdBodyParam; +export interface BoundariesSearchByFarmerIdMediaTypesParam { + /** Request content type */ + contentType?: "application/json"; +} + +export type BoundariesSearchByFarmerIdParameters = BoundariesSearchByFarmerIdMediaTypesParam & + BoundariesSearchByFarmerIdBodyParam & + RequestParameters; export interface BoundariesListQueryParamProperties { /** Is the boundary primary. */ @@ -274,30 +299,30 @@ export interface BoundariesListQueryParamProperties { /** Type of the parent it belongs to. */ parentType?: string; /** Parent Ids of the resource. */ - parentIds?: string[]; + parentIds?: Array; /** Minimum acreage of the boundary (inclusive). */ minAcreage?: number; /** Maximum acreage of the boundary (inclusive). */ maxAcreage?: number; /** Ids of the resource. */ - ids?: string[]; + ids?: Array; /** Names of the resource. */ - names?: string[]; + names?: Array; /** * Filters on key-value pairs within the Properties object. - * eg. "\{testKey\} eq \{testValue\}". + * eg. "{testKey} eq {testValue}". */ - propertyFilters?: string[]; + propertyFilters?: Array; /** Statuses of the resource. */ - statuses?: string[]; + statuses?: Array; /** Minimum creation date of resource (inclusive). */ - minCreatedDateTime?: Date; + minCreatedDateTime?: Date | string; /** Maximum creation date of resource (inclusive). */ - maxCreatedDateTime?: Date; + maxCreatedDateTime?: Date | string; /** Minimum last modified date of resource (inclusive). */ - minLastModifiedDateTime?: Date; + minLastModifiedDateTime?: Date | string; /** Maximum last modified date of resource (inclusive). */ - maxLastModifiedDateTime?: Date; + maxLastModifiedDateTime?: Date | string; /** * Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. @@ -311,13 +336,21 @@ export interface BoundariesListQueryParam { queryParameters?: BoundariesListQueryParamProperties; } -export type BoundariesListParameters = RequestParameters & BoundariesListQueryParam; +export type BoundariesListParameters = BoundariesListQueryParam & RequestParameters; export interface BoundariesSearchBodyParam { + /** Query filters. */ body?: SearchBoundaryQuery; } -export type BoundariesSearchParameters = RequestParameters & BoundariesSearchBodyParam; +export interface BoundariesSearchMediaTypesParam { + /** Request content type */ + contentType?: "application/json"; +} + +export type BoundariesSearchParameters = BoundariesSearchMediaTypesParam & + BoundariesSearchBodyParam & + RequestParameters; export type BoundariesGetCascadeDeleteJobDetailsParameters = RequestParameters; export interface BoundariesCreateCascadeDeleteJobQueryParamProperties { @@ -331,16 +364,23 @@ export interface BoundariesCreateCascadeDeleteJobQueryParam { queryParameters: BoundariesCreateCascadeDeleteJobQueryParamProperties; } -export type BoundariesCreateCascadeDeleteJobParameters = RequestParameters & - BoundariesCreateCascadeDeleteJobQueryParam; +export type BoundariesCreateCascadeDeleteJobParameters = + BoundariesCreateCascadeDeleteJobQueryParam & RequestParameters; export type BoundariesGetParameters = RequestParameters; export interface BoundariesCreateOrUpdateBodyParam { + /** Boundary resource payload to create or update. */ body?: Boundary; } -export type BoundariesCreateOrUpdateParameters = RequestParameters & - BoundariesCreateOrUpdateBodyParam; +export interface BoundariesCreateOrUpdateMediaTypesParam { + /** Request content type */ + contentType?: "application/merge-patch+json"; +} + +export type BoundariesCreateOrUpdateParameters = BoundariesCreateOrUpdateMediaTypesParam & + BoundariesCreateOrUpdateBodyParam & + RequestParameters; export type BoundariesDeleteParameters = RequestParameters; export interface BoundariesGetOverlapQueryParamProperties { @@ -354,30 +394,30 @@ export interface BoundariesGetOverlapQueryParam { queryParameters: BoundariesGetOverlapQueryParamProperties; } -export type BoundariesGetOverlapParameters = RequestParameters & BoundariesGetOverlapQueryParam; +export type BoundariesGetOverlapParameters = BoundariesGetOverlapQueryParam & RequestParameters; export interface CropsListQueryParamProperties { /** Crop phenotypes of the resource. */ - phenotypes?: string[]; + phenotypes?: Array; /** Ids of the resource. */ - ids?: string[]; + ids?: Array; /** Names of the resource. */ - names?: string[]; + names?: Array; /** * Filters on key-value pairs within the Properties object. - * eg. "\{testKey\} eq \{testValue\}". + * eg. "{testKey} eq {testValue}". */ - propertyFilters?: string[]; + propertyFilters?: Array; /** Statuses of the resource. */ - statuses?: string[]; + statuses?: Array; /** Minimum creation date of resource (inclusive). */ - minCreatedDateTime?: Date; + minCreatedDateTime?: Date | string; /** Maximum creation date of resource (inclusive). */ - maxCreatedDateTime?: Date; + maxCreatedDateTime?: Date | string; /** Minimum last modified date of resource (inclusive). */ - minLastModifiedDateTime?: Date; + minLastModifiedDateTime?: Date | string; /** Maximum last modified date of resource (inclusive). */ - maxLastModifiedDateTime?: Date; + maxLastModifiedDateTime?: Date | string; /** * Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. @@ -391,42 +431,50 @@ export interface CropsListQueryParam { queryParameters?: CropsListQueryParamProperties; } -export type CropsListParameters = RequestParameters & CropsListQueryParam; +export type CropsListParameters = CropsListQueryParam & RequestParameters; export type CropsGetParameters = RequestParameters; export interface CropsCreateOrUpdateBodyParam { + /** Crop resource payload to create or update. */ body?: Crop; } -export type CropsCreateOrUpdateParameters = RequestParameters & CropsCreateOrUpdateBodyParam; +export interface CropsCreateOrUpdateMediaTypesParam { + /** Request content type */ + contentType?: "application/merge-patch+json"; +} + +export type CropsCreateOrUpdateParameters = CropsCreateOrUpdateMediaTypesParam & + CropsCreateOrUpdateBodyParam & + RequestParameters; export type CropsDeleteParameters = RequestParameters; export interface CropVarietiesListByCropIdQueryParamProperties { /** CropIds of the resource. */ - cropIds?: string[]; + cropIds?: Array; /** Brands of the resource. */ - brands?: string[]; + brands?: Array; /** Products of the resource. */ - products?: string[]; + products?: Array; /** Ids of the resource. */ - ids?: string[]; + ids?: Array; /** Names of the resource. */ - names?: string[]; + names?: Array; /** * Filters on key-value pairs within the Properties object. - * eg. "\{testKey\} eq \{testValue\}". + * eg. "{testKey} eq {testValue}". */ - propertyFilters?: string[]; + propertyFilters?: Array; /** Statuses of the resource. */ - statuses?: string[]; + statuses?: Array; /** Minimum creation date of resource (inclusive). */ - minCreatedDateTime?: Date; + minCreatedDateTime?: Date | string; /** Maximum creation date of resource (inclusive). */ - maxCreatedDateTime?: Date; + maxCreatedDateTime?: Date | string; /** Minimum last modified date of resource (inclusive). */ - minLastModifiedDateTime?: Date; + minLastModifiedDateTime?: Date | string; /** Maximum last modified date of resource (inclusive). */ - maxLastModifiedDateTime?: Date; + maxLastModifiedDateTime?: Date | string; /** * Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. @@ -440,35 +488,35 @@ export interface CropVarietiesListByCropIdQueryParam { queryParameters?: CropVarietiesListByCropIdQueryParamProperties; } -export type CropVarietiesListByCropIdParameters = RequestParameters & - CropVarietiesListByCropIdQueryParam; +export type CropVarietiesListByCropIdParameters = CropVarietiesListByCropIdQueryParam & + RequestParameters; export interface CropVarietiesListQueryParamProperties { /** CropIds of the resource. */ - cropIds?: string[]; + cropIds?: Array; /** Brands of the resource. */ - brands?: string[]; + brands?: Array; /** Products of the resource. */ - products?: string[]; + products?: Array; /** Ids of the resource. */ - ids?: string[]; + ids?: Array; /** Names of the resource. */ - names?: string[]; + names?: Array; /** * Filters on key-value pairs within the Properties object. - * eg. "\{testKey\} eq \{testValue\}". + * eg. "{testKey} eq {testValue}". */ - propertyFilters?: string[]; + propertyFilters?: Array; /** Statuses of the resource. */ - statuses?: string[]; + statuses?: Array; /** Minimum creation date of resource (inclusive). */ - minCreatedDateTime?: Date; + minCreatedDateTime?: Date | string; /** Maximum creation date of resource (inclusive). */ - maxCreatedDateTime?: Date; + maxCreatedDateTime?: Date | string; /** Minimum last modified date of resource (inclusive). */ - minLastModifiedDateTime?: Date; + minLastModifiedDateTime?: Date | string; /** Maximum last modified date of resource (inclusive). */ - maxLastModifiedDateTime?: Date; + maxLastModifiedDateTime?: Date | string; /** * Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. @@ -482,37 +530,44 @@ export interface CropVarietiesListQueryParam { queryParameters?: CropVarietiesListQueryParamProperties; } -export type CropVarietiesListParameters = RequestParameters & CropVarietiesListQueryParam; +export type CropVarietiesListParameters = CropVarietiesListQueryParam & RequestParameters; export type CropVarietiesGetParameters = RequestParameters; export interface CropVarietiesCreateOrUpdateBodyParam { + /** Crop variety resource payload to create or update. */ body?: CropVariety; } -export type CropVarietiesCreateOrUpdateParameters = RequestParameters & - CropVarietiesCreateOrUpdateBodyParam; +export interface CropVarietiesCreateOrUpdateMediaTypesParam { + /** Request content type */ + contentType?: "application/merge-patch+json"; +} + +export type CropVarietiesCreateOrUpdateParameters = CropVarietiesCreateOrUpdateMediaTypesParam & + CropVarietiesCreateOrUpdateBodyParam & + RequestParameters; export type CropVarietiesDeleteParameters = RequestParameters; export interface FarmersListQueryParamProperties { /** Ids of the resource. */ - ids?: string[]; + ids?: Array; /** Names of the resource. */ - names?: string[]; + names?: Array; /** * Filters on key-value pairs within the Properties object. - * eg. "\{testKey\} eq \{testValue\}". + * eg. "{testKey} eq {testValue}". */ - propertyFilters?: string[]; + propertyFilters?: Array; /** Statuses of the resource. */ - statuses?: string[]; + statuses?: Array; /** Minimum creation date of resource (inclusive). */ - minCreatedDateTime?: Date; + minCreatedDateTime?: Date | string; /** Maximum creation date of resource (inclusive). */ - maxCreatedDateTime?: Date; + maxCreatedDateTime?: Date | string; /** Minimum last modified date of resource (inclusive). */ - minLastModifiedDateTime?: Date; + minLastModifiedDateTime?: Date | string; /** Maximum last modified date of resource (inclusive). */ - maxLastModifiedDateTime?: Date; + maxLastModifiedDateTime?: Date | string; /** * Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. @@ -526,14 +581,22 @@ export interface FarmersListQueryParam { queryParameters?: FarmersListQueryParamProperties; } -export type FarmersListParameters = RequestParameters & FarmersListQueryParam; +export type FarmersListParameters = FarmersListQueryParam & RequestParameters; export type FarmersGetParameters = RequestParameters; export interface FarmersCreateOrUpdateBodyParam { + /** Farmer resource payload to create or update. */ body?: Farmer; } -export type FarmersCreateOrUpdateParameters = RequestParameters & FarmersCreateOrUpdateBodyParam; +export interface FarmersCreateOrUpdateMediaTypesParam { + /** Request content type */ + contentType?: "application/merge-patch+json"; +} + +export type FarmersCreateOrUpdateParameters = FarmersCreateOrUpdateMediaTypesParam & + FarmersCreateOrUpdateBodyParam & + RequestParameters; export type FarmersDeleteParameters = RequestParameters; export type FarmersGetCascadeDeleteJobDetailsParameters = RequestParameters; @@ -546,37 +609,45 @@ export interface FarmersCreateCascadeDeleteJobQueryParam { queryParameters: FarmersCreateCascadeDeleteJobQueryParamProperties; } -export type FarmersCreateCascadeDeleteJobParameters = RequestParameters & - FarmersCreateCascadeDeleteJobQueryParam; +export type FarmersCreateCascadeDeleteJobParameters = FarmersCreateCascadeDeleteJobQueryParam & + RequestParameters; export interface FarmOperationsCreateDataIngestionJobBodyParam { + /** Job parameters supplied by user. */ body?: FarmOperationDataIngestionJob; } -export type FarmOperationsCreateDataIngestionJobParameters = RequestParameters & - FarmOperationsCreateDataIngestionJobBodyParam; +export interface FarmOperationsCreateDataIngestionJobMediaTypesParam { + /** Request content type */ + contentType?: "application/json"; +} + +export type FarmOperationsCreateDataIngestionJobParameters = + FarmOperationsCreateDataIngestionJobMediaTypesParam & + FarmOperationsCreateDataIngestionJobBodyParam & + RequestParameters; export type FarmOperationsGetDataIngestionJobDetailsParameters = RequestParameters; export interface FarmsListByFarmerIdQueryParamProperties { /** Ids of the resource. */ - ids?: string[]; + ids?: Array; /** Names of the resource. */ - names?: string[]; + names?: Array; /** * Filters on key-value pairs within the Properties object. - * eg. "\{testKey\} eq \{testValue\}". + * eg. "{testKey} eq {testValue}". */ - propertyFilters?: string[]; + propertyFilters?: Array; /** Statuses of the resource. */ - statuses?: string[]; + statuses?: Array; /** Minimum creation date of resource (inclusive). */ - minCreatedDateTime?: Date; + minCreatedDateTime?: Date | string; /** Maximum creation date of resource (inclusive). */ - maxCreatedDateTime?: Date; + maxCreatedDateTime?: Date | string; /** Minimum last modified date of resource (inclusive). */ - minLastModifiedDateTime?: Date; + minLastModifiedDateTime?: Date | string; /** Maximum last modified date of resource (inclusive). */ - maxLastModifiedDateTime?: Date; + maxLastModifiedDateTime?: Date | string; /** * Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. @@ -590,28 +661,28 @@ export interface FarmsListByFarmerIdQueryParam { queryParameters?: FarmsListByFarmerIdQueryParamProperties; } -export type FarmsListByFarmerIdParameters = RequestParameters & FarmsListByFarmerIdQueryParam; +export type FarmsListByFarmerIdParameters = FarmsListByFarmerIdQueryParam & RequestParameters; export interface FarmsListQueryParamProperties { /** Ids of the resource. */ - ids?: string[]; + ids?: Array; /** Names of the resource. */ - names?: string[]; + names?: Array; /** * Filters on key-value pairs within the Properties object. - * eg. "\{testKey\} eq \{testValue\}". + * eg. "{testKey} eq {testValue}". */ - propertyFilters?: string[]; + propertyFilters?: Array; /** Statuses of the resource. */ - statuses?: string[]; + statuses?: Array; /** Minimum creation date of resource (inclusive). */ - minCreatedDateTime?: Date; + minCreatedDateTime?: Date | string; /** Maximum creation date of resource (inclusive). */ - maxCreatedDateTime?: Date; + maxCreatedDateTime?: Date | string; /** Minimum last modified date of resource (inclusive). */ - minLastModifiedDateTime?: Date; + minLastModifiedDateTime?: Date | string; /** Maximum last modified date of resource (inclusive). */ - maxLastModifiedDateTime?: Date; + maxLastModifiedDateTime?: Date | string; /** * Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. @@ -625,14 +696,22 @@ export interface FarmsListQueryParam { queryParameters?: FarmsListQueryParamProperties; } -export type FarmsListParameters = RequestParameters & FarmsListQueryParam; +export type FarmsListParameters = FarmsListQueryParam & RequestParameters; export type FarmsGetParameters = RequestParameters; export interface FarmsCreateOrUpdateBodyParam { + /** Farm resource payload to create or update. */ body?: Farm; } -export type FarmsCreateOrUpdateParameters = RequestParameters & FarmsCreateOrUpdateBodyParam; +export interface FarmsCreateOrUpdateMediaTypesParam { + /** Request content type */ + contentType?: "application/merge-patch+json"; +} + +export type FarmsCreateOrUpdateParameters = FarmsCreateOrUpdateMediaTypesParam & + FarmsCreateOrUpdateBodyParam & + RequestParameters; export type FarmsDeleteParameters = RequestParameters; export type FarmsGetCascadeDeleteJobDetailsParameters = RequestParameters; @@ -647,31 +726,31 @@ export interface FarmsCreateCascadeDeleteJobQueryParam { queryParameters: FarmsCreateCascadeDeleteJobQueryParamProperties; } -export type FarmsCreateCascadeDeleteJobParameters = RequestParameters & - FarmsCreateCascadeDeleteJobQueryParam; +export type FarmsCreateCascadeDeleteJobParameters = FarmsCreateCascadeDeleteJobQueryParam & + RequestParameters; export interface FieldsListByFarmerIdQueryParamProperties { /** Farm Ids of the resource. */ - farmIds?: string[]; + farmIds?: Array; /** Ids of the resource. */ - ids?: string[]; + ids?: Array; /** Names of the resource. */ - names?: string[]; + names?: Array; /** * Filters on key-value pairs within the Properties object. - * eg. "\{testKey\} eq \{testValue\}". + * eg. "{testKey} eq {testValue}". */ - propertyFilters?: string[]; + propertyFilters?: Array; /** Statuses of the resource. */ - statuses?: string[]; + statuses?: Array; /** Minimum creation date of resource (inclusive). */ - minCreatedDateTime?: Date; + minCreatedDateTime?: Date | string; /** Maximum creation date of resource (inclusive). */ - maxCreatedDateTime?: Date; + maxCreatedDateTime?: Date | string; /** Minimum last modified date of resource (inclusive). */ - minLastModifiedDateTime?: Date; + minLastModifiedDateTime?: Date | string; /** Maximum last modified date of resource (inclusive). */ - maxLastModifiedDateTime?: Date; + maxLastModifiedDateTime?: Date | string; /** * Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. @@ -685,30 +764,30 @@ export interface FieldsListByFarmerIdQueryParam { queryParameters?: FieldsListByFarmerIdQueryParamProperties; } -export type FieldsListByFarmerIdParameters = RequestParameters & FieldsListByFarmerIdQueryParam; +export type FieldsListByFarmerIdParameters = FieldsListByFarmerIdQueryParam & RequestParameters; export interface FieldsListQueryParamProperties { /** Farm Ids of the resource. */ - farmIds?: string[]; + farmIds?: Array; /** Ids of the resource. */ - ids?: string[]; + ids?: Array; /** Names of the resource. */ - names?: string[]; + names?: Array; /** * Filters on key-value pairs within the Properties object. - * eg. "\{testKey\} eq \{testValue\}". + * eg. "{testKey} eq {testValue}". */ - propertyFilters?: string[]; + propertyFilters?: Array; /** Statuses of the resource. */ - statuses?: string[]; + statuses?: Array; /** Minimum creation date of resource (inclusive). */ - minCreatedDateTime?: Date; + minCreatedDateTime?: Date | string; /** Maximum creation date of resource (inclusive). */ - maxCreatedDateTime?: Date; + maxCreatedDateTime?: Date | string; /** Minimum last modified date of resource (inclusive). */ - minLastModifiedDateTime?: Date; + minLastModifiedDateTime?: Date | string; /** Maximum last modified date of resource (inclusive). */ - maxLastModifiedDateTime?: Date; + maxLastModifiedDateTime?: Date | string; /** * Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. @@ -722,14 +801,22 @@ export interface FieldsListQueryParam { queryParameters?: FieldsListQueryParamProperties; } -export type FieldsListParameters = RequestParameters & FieldsListQueryParam; +export type FieldsListParameters = FieldsListQueryParam & RequestParameters; export type FieldsGetParameters = RequestParameters; export interface FieldsCreateOrUpdateBodyParam { + /** Field resource payload to create or update. */ body?: Field; } -export type FieldsCreateOrUpdateParameters = RequestParameters & FieldsCreateOrUpdateBodyParam; +export interface FieldsCreateOrUpdateMediaTypesParam { + /** Request content type */ + contentType?: "application/merge-patch+json"; +} + +export type FieldsCreateOrUpdateParameters = FieldsCreateOrUpdateMediaTypesParam & + FieldsCreateOrUpdateBodyParam & + RequestParameters; export type FieldsDeleteParameters = RequestParameters; export type FieldsGetCascadeDeleteJobDetailsParameters = RequestParameters; @@ -744,8 +831,8 @@ export interface FieldsCreateCascadeDeleteJobQueryParam { queryParameters: FieldsCreateCascadeDeleteJobQueryParamProperties; } -export type FieldsCreateCascadeDeleteJobParameters = RequestParameters & - FieldsCreateCascadeDeleteJobQueryParam; +export type FieldsCreateCascadeDeleteJobParameters = FieldsCreateCascadeDeleteJobQueryParam & + RequestParameters; export interface HarvestDataListByFarmerIdQueryParamProperties { /** Minimum Yield value(inclusive). */ @@ -773,46 +860,46 @@ export interface HarvestDataListByFarmerIdQueryParamProperties { /** Maximum AvgSpeed value (inclusive). */ maxAvgSpeed?: number; /** Sources of the operation data. */ - sources?: string[]; + sources?: Array; /** Boundary IDs associated with operation data. */ - associatedBoundaryIds?: string[]; + associatedBoundaryIds?: Array; /** Operation boundary IDs associated with operation data. */ - operationBoundaryIds?: string[]; + operationBoundaryIds?: Array; /** Minimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - minOperationStartDateTime?: Date; + minOperationStartDateTime?: Date | string; /** Maximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - maxOperationStartDateTime?: Date; + maxOperationStartDateTime?: Date | string; /** Minimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - minOperationEndDateTime?: Date; + minOperationEndDateTime?: Date | string; /** Maximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - maxOperationEndDateTime?: Date; + maxOperationEndDateTime?: Date | string; /** Minimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - minOperationModifiedDateTime?: Date; + minOperationModifiedDateTime?: Date | string; /** Maximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - maxOperationModifiedDateTime?: Date; + maxOperationModifiedDateTime?: Date | string; /** Minimum area for which operation was applied (inclusive). */ minArea?: number; /** Maximum area for which operation was applied (inclusive). */ maxArea?: number; /** Ids of the resource. */ - ids?: string[]; + ids?: Array; /** Names of the resource. */ - names?: string[]; + names?: Array; /** * Filters on key-value pairs within the Properties object. - * eg. "\{testKey\} eq \{testValue\}". + * eg. "{testKey} eq {testValue}". */ - propertyFilters?: string[]; + propertyFilters?: Array; /** Statuses of the resource. */ - statuses?: string[]; + statuses?: Array; /** Minimum creation date of resource (inclusive). */ - minCreatedDateTime?: Date; + minCreatedDateTime?: Date | string; /** Maximum creation date of resource (inclusive). */ - maxCreatedDateTime?: Date; + maxCreatedDateTime?: Date | string; /** Minimum last modified date of resource (inclusive). */ - minLastModifiedDateTime?: Date; + minLastModifiedDateTime?: Date | string; /** Maximum last modified date of resource (inclusive). */ - maxLastModifiedDateTime?: Date; + maxLastModifiedDateTime?: Date | string; /** * Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. @@ -826,8 +913,8 @@ export interface HarvestDataListByFarmerIdQueryParam { queryParameters?: HarvestDataListByFarmerIdQueryParamProperties; } -export type HarvestDataListByFarmerIdParameters = RequestParameters & - HarvestDataListByFarmerIdQueryParam; +export type HarvestDataListByFarmerIdParameters = HarvestDataListByFarmerIdQueryParam & + RequestParameters; export interface HarvestDataListQueryParamProperties { /** Minimum Yield value(inclusive). */ @@ -855,46 +942,46 @@ export interface HarvestDataListQueryParamProperties { /** Maximum AvgSpeed value (inclusive). */ maxAvgSpeed?: number; /** Sources of the operation data. */ - sources?: string[]; + sources?: Array; /** Boundary IDs associated with operation data. */ - associatedBoundaryIds?: string[]; + associatedBoundaryIds?: Array; /** Operation boundary IDs associated with operation data. */ - operationBoundaryIds?: string[]; + operationBoundaryIds?: Array; /** Minimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - minOperationStartDateTime?: Date; + minOperationStartDateTime?: Date | string; /** Maximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - maxOperationStartDateTime?: Date; + maxOperationStartDateTime?: Date | string; /** Minimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - minOperationEndDateTime?: Date; + minOperationEndDateTime?: Date | string; /** Maximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - maxOperationEndDateTime?: Date; + maxOperationEndDateTime?: Date | string; /** Minimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - minOperationModifiedDateTime?: Date; + minOperationModifiedDateTime?: Date | string; /** Maximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - maxOperationModifiedDateTime?: Date; + maxOperationModifiedDateTime?: Date | string; /** Minimum area for which operation was applied (inclusive). */ minArea?: number; /** Maximum area for which operation was applied (inclusive). */ maxArea?: number; /** Ids of the resource. */ - ids?: string[]; + ids?: Array; /** Names of the resource. */ - names?: string[]; + names?: Array; /** * Filters on key-value pairs within the Properties object. - * eg. "\{testKey\} eq \{testValue\}". + * eg. "{testKey} eq {testValue}". */ - propertyFilters?: string[]; + propertyFilters?: Array; /** Statuses of the resource. */ - statuses?: string[]; + statuses?: Array; /** Minimum creation date of resource (inclusive). */ - minCreatedDateTime?: Date; + minCreatedDateTime?: Date | string; /** Maximum creation date of resource (inclusive). */ - maxCreatedDateTime?: Date; + maxCreatedDateTime?: Date | string; /** Minimum last modified date of resource (inclusive). */ - minLastModifiedDateTime?: Date; + minLastModifiedDateTime?: Date | string; /** Maximum last modified date of resource (inclusive). */ - maxLastModifiedDateTime?: Date; + maxLastModifiedDateTime?: Date | string; /** * Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. @@ -908,45 +995,60 @@ export interface HarvestDataListQueryParam { queryParameters?: HarvestDataListQueryParamProperties; } -export type HarvestDataListParameters = RequestParameters & HarvestDataListQueryParam; +export type HarvestDataListParameters = HarvestDataListQueryParam & RequestParameters; export type HarvestDataGetParameters = RequestParameters; export interface HarvestDataCreateOrUpdateBodyParam { + /** Harvest data resource payload to create or update. */ body?: HarvestData; } -export type HarvestDataCreateOrUpdateParameters = RequestParameters & - HarvestDataCreateOrUpdateBodyParam; +export interface HarvestDataCreateOrUpdateMediaTypesParam { + /** Request content type */ + contentType?: "application/merge-patch+json"; +} + +export type HarvestDataCreateOrUpdateParameters = HarvestDataCreateOrUpdateMediaTypesParam & + HarvestDataCreateOrUpdateBodyParam & + RequestParameters; export type HarvestDataDeleteParameters = RequestParameters; export interface ImageProcessingCreateRasterizeJobBodyParam { + /** Job parameters supplied by user. */ body?: ImageProcessingRasterizeJob; } -export type ImageProcessingCreateRasterizeJobParameters = RequestParameters & - ImageProcessingCreateRasterizeJobBodyParam; +export interface ImageProcessingCreateRasterizeJobMediaTypesParam { + /** Request content type */ + contentType?: "application/json"; +} + +export type ImageProcessingCreateRasterizeJobParameters = + ImageProcessingCreateRasterizeJobMediaTypesParam & + ImageProcessingCreateRasterizeJobBodyParam & + RequestParameters; export type ImageProcessingGetRasterizeJobParameters = RequestParameters; export interface OAuthProvidersListQueryParamProperties { /** Ids of the resource. */ - ids?: string[]; + ids?: Array; /** Names of the resource. */ - names?: string[]; + names?: Array; /** * Filters on key-value pairs within the Properties object. - * eg. "\{testKey\} eq \{testValue\}". + * eg. "{testKey} eq {testValue}". */ - propertyFilters?: string[]; + propertyFilters?: Array; /** Statuses of the resource. */ - statuses?: string[]; + statuses?: Array; /** Minimum creation date of resource (inclusive). */ - minCreatedDateTime?: Date; + minCreatedDateTime?: Date | string; /** Maximum creation date of resource (inclusive). */ - maxCreatedDateTime?: Date; + maxCreatedDateTime?: Date | string; /** Minimum last modified date of resource (inclusive). */ - minLastModifiedDateTime?: Date; + minLastModifiedDateTime?: Date | string; /** Maximum last modified date of resource (inclusive). */ - maxLastModifiedDateTime?: Date; + maxLastModifiedDateTime?: Date | string; /** * Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. @@ -960,32 +1062,39 @@ export interface OAuthProvidersListQueryParam { queryParameters?: OAuthProvidersListQueryParamProperties; } -export type OAuthProvidersListParameters = RequestParameters & OAuthProvidersListQueryParam; +export type OAuthProvidersListParameters = OAuthProvidersListQueryParam & RequestParameters; export type OAuthProvidersGetParameters = RequestParameters; export interface OAuthProvidersCreateOrUpdateBodyParam { + /** OauthProvider resource payload to create or update. */ body?: OAuthProvider; } -export type OAuthProvidersCreateOrUpdateParameters = RequestParameters & - OAuthProvidersCreateOrUpdateBodyParam; +export interface OAuthProvidersCreateOrUpdateMediaTypesParam { + /** Request content type */ + contentType?: "application/merge-patch+json"; +} + +export type OAuthProvidersCreateOrUpdateParameters = OAuthProvidersCreateOrUpdateMediaTypesParam & + OAuthProvidersCreateOrUpdateBodyParam & + RequestParameters; export type OAuthProvidersDeleteParameters = RequestParameters; export interface OAuthTokensListQueryParamProperties { /** Name of AuthProvider. */ - authProviderIds?: string[]; + authProviderIds?: Array; /** List of farmers. */ - farmerIds?: string[]; + farmerIds?: Array; /** If the token object is valid. */ isValid?: boolean; /** Minimum creation date of resource (inclusive). */ - minCreatedDateTime?: Date; + minCreatedDateTime?: Date | string; /** Maximum creation date of resource (inclusive). */ - maxCreatedDateTime?: Date; + maxCreatedDateTime?: Date | string; /** Minimum last modified date of resource (inclusive). */ - minLastModifiedDateTime?: Date; + minLastModifiedDateTime?: Date | string; /** Maximum last modified date of resource (inclusive). */ - maxLastModifiedDateTime?: Date; + maxLastModifiedDateTime?: Date | string; /** * Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. @@ -999,14 +1108,22 @@ export interface OAuthTokensListQueryParam { queryParameters?: OAuthTokensListQueryParamProperties; } -export type OAuthTokensListParameters = RequestParameters & OAuthTokensListQueryParam; +export type OAuthTokensListParameters = OAuthTokensListQueryParam & RequestParameters; export interface OAuthTokensGetOAuthConnectionLinkBodyParam { + /** OAuth Connect Request. */ body?: OAuthConnectRequest; } -export type OAuthTokensGetOAuthConnectionLinkParameters = RequestParameters & - OAuthTokensGetOAuthConnectionLinkBodyParam; +export interface OAuthTokensGetOAuthConnectionLinkMediaTypesParam { + /** Request content type */ + contentType?: "application/json"; +} + +export type OAuthTokensGetOAuthConnectionLinkParameters = + OAuthTokensGetOAuthConnectionLinkMediaTypesParam & + OAuthTokensGetOAuthConnectionLinkBodyParam & + RequestParameters; export type OAuthTokensGetCascadeDeleteJobDetailsParameters = RequestParameters; export interface OAuthTokensCreateCascadeDeleteJobQueryParamProperties { @@ -1020,8 +1137,8 @@ export interface OAuthTokensCreateCascadeDeleteJobQueryParam { queryParameters: OAuthTokensCreateCascadeDeleteJobQueryParamProperties; } -export type OAuthTokensCreateCascadeDeleteJobParameters = RequestParameters & - OAuthTokensCreateCascadeDeleteJobQueryParam; +export type OAuthTokensCreateCascadeDeleteJobParameters = + OAuthTokensCreateCascadeDeleteJobQueryParam & RequestParameters; export interface PlantingDataListByFarmerIdQueryParamProperties { /** Minimum AvgPlantingRate value(inclusive). */ @@ -1037,46 +1154,46 @@ export interface PlantingDataListByFarmerIdQueryParamProperties { /** Maximum AvgMaterial value (inclusive). */ maxAvgMaterial?: number; /** Sources of the operation data. */ - sources?: string[]; + sources?: Array; /** Boundary IDs associated with operation data. */ - associatedBoundaryIds?: string[]; + associatedBoundaryIds?: Array; /** Operation boundary IDs associated with operation data. */ - operationBoundaryIds?: string[]; + operationBoundaryIds?: Array; /** Minimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - minOperationStartDateTime?: Date; + minOperationStartDateTime?: Date | string; /** Maximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - maxOperationStartDateTime?: Date; + maxOperationStartDateTime?: Date | string; /** Minimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - minOperationEndDateTime?: Date; + minOperationEndDateTime?: Date | string; /** Maximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - maxOperationEndDateTime?: Date; + maxOperationEndDateTime?: Date | string; /** Minimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - minOperationModifiedDateTime?: Date; + minOperationModifiedDateTime?: Date | string; /** Maximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - maxOperationModifiedDateTime?: Date; + maxOperationModifiedDateTime?: Date | string; /** Minimum area for which operation was applied (inclusive). */ minArea?: number; /** Maximum area for which operation was applied (inclusive). */ maxArea?: number; /** Ids of the resource. */ - ids?: string[]; + ids?: Array; /** Names of the resource. */ - names?: string[]; + names?: Array; /** * Filters on key-value pairs within the Properties object. - * eg. "\{testKey\} eq \{testValue\}". + * eg. "{testKey} eq {testValue}". */ - propertyFilters?: string[]; + propertyFilters?: Array; /** Statuses of the resource. */ - statuses?: string[]; + statuses?: Array; /** Minimum creation date of resource (inclusive). */ - minCreatedDateTime?: Date; + minCreatedDateTime?: Date | string; /** Maximum creation date of resource (inclusive). */ - maxCreatedDateTime?: Date; + maxCreatedDateTime?: Date | string; /** Minimum last modified date of resource (inclusive). */ - minLastModifiedDateTime?: Date; + minLastModifiedDateTime?: Date | string; /** Maximum last modified date of resource (inclusive). */ - maxLastModifiedDateTime?: Date; + maxLastModifiedDateTime?: Date | string; /** * Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. @@ -1090,8 +1207,8 @@ export interface PlantingDataListByFarmerIdQueryParam { queryParameters?: PlantingDataListByFarmerIdQueryParamProperties; } -export type PlantingDataListByFarmerIdParameters = RequestParameters & - PlantingDataListByFarmerIdQueryParam; +export type PlantingDataListByFarmerIdParameters = PlantingDataListByFarmerIdQueryParam & + RequestParameters; export interface PlantingDataListQueryParamProperties { /** Minimum AvgPlantingRate value(inclusive). */ @@ -1107,46 +1224,46 @@ export interface PlantingDataListQueryParamProperties { /** Maximum AvgMaterial value (inclusive). */ maxAvgMaterial?: number; /** Sources of the operation data. */ - sources?: string[]; + sources?: Array; /** Boundary IDs associated with operation data. */ - associatedBoundaryIds?: string[]; + associatedBoundaryIds?: Array; /** Operation boundary IDs associated with operation data. */ - operationBoundaryIds?: string[]; + operationBoundaryIds?: Array; /** Minimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - minOperationStartDateTime?: Date; + minOperationStartDateTime?: Date | string; /** Maximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - maxOperationStartDateTime?: Date; + maxOperationStartDateTime?: Date | string; /** Minimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - minOperationEndDateTime?: Date; + minOperationEndDateTime?: Date | string; /** Maximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - maxOperationEndDateTime?: Date; + maxOperationEndDateTime?: Date | string; /** Minimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - minOperationModifiedDateTime?: Date; + minOperationModifiedDateTime?: Date | string; /** Maximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - maxOperationModifiedDateTime?: Date; + maxOperationModifiedDateTime?: Date | string; /** Minimum area for which operation was applied (inclusive). */ minArea?: number; /** Maximum area for which operation was applied (inclusive). */ maxArea?: number; /** Ids of the resource. */ - ids?: string[]; + ids?: Array; /** Names of the resource. */ - names?: string[]; + names?: Array; /** * Filters on key-value pairs within the Properties object. - * eg. "\{testKey\} eq \{testValue\}". + * eg. "{testKey} eq {testValue}". */ - propertyFilters?: string[]; + propertyFilters?: Array; /** Statuses of the resource. */ - statuses?: string[]; + statuses?: Array; /** Minimum creation date of resource (inclusive). */ - minCreatedDateTime?: Date; + minCreatedDateTime?: Date | string; /** Maximum creation date of resource (inclusive). */ - maxCreatedDateTime?: Date; + maxCreatedDateTime?: Date | string; /** Minimum last modified date of resource (inclusive). */ - minLastModifiedDateTime?: Date; + minLastModifiedDateTime?: Date | string; /** Maximum last modified date of resource (inclusive). */ - maxLastModifiedDateTime?: Date; + maxLastModifiedDateTime?: Date | string; /** * Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. @@ -1160,15 +1277,22 @@ export interface PlantingDataListQueryParam { queryParameters?: PlantingDataListQueryParamProperties; } -export type PlantingDataListParameters = RequestParameters & PlantingDataListQueryParam; +export type PlantingDataListParameters = PlantingDataListQueryParam & RequestParameters; export type PlantingDataGetParameters = RequestParameters; export interface PlantingDataCreateOrUpdateBodyParam { + /** Planting data resource payload to create or update. */ body?: PlantingData; } -export type PlantingDataCreateOrUpdateParameters = RequestParameters & - PlantingDataCreateOrUpdateBodyParam; +export interface PlantingDataCreateOrUpdateMediaTypesParam { + /** Request content type */ + contentType?: "application/merge-patch+json"; +} + +export type PlantingDataCreateOrUpdateParameters = PlantingDataCreateOrUpdateMediaTypesParam & + PlantingDataCreateOrUpdateBodyParam & + RequestParameters; export type PlantingDataDeleteParameters = RequestParameters; export interface ScenesListQueryParamProperties { @@ -1181,19 +1305,19 @@ export interface ScenesListQueryParamProperties { /** Source name of scene data, default value Sentinel_2_L2A (Sentinel 2 L2A). */ source?: string; /** Scene start UTC datetime (inclusive), sample format: yyyy-MM-ddThh:mm:ssZ. */ - startDateTime?: Date; + startDateTime?: Date | string; /** Scene end UTC datetime (inclusive), sample format: yyyy-MM-dThh:mm:ssZ. */ - endDateTime?: Date; + endDateTime?: Date | string; /** Filter scenes with cloud coverage percentage less than max value. Range [0 to 100.0]. */ maxCloudCoveragePercentage?: number; /** Filter scenes with dark pixel coverage percentage less than max value. Range [0 to 100.0]. */ maxDarkPixelCoveragePercentage?: number; /** List of image names to be filtered. */ - imageNames?: string[]; + imageNames?: Array; /** List of image resolutions in meters to be filtered. */ - imageResolutions?: number[]; + imageResolutions?: Array; /** List of image formats to be filtered. */ - imageFormats?: string[]; + imageFormats?: Array; /** * Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. @@ -1207,14 +1331,22 @@ export interface ScenesListQueryParam { queryParameters: ScenesListQueryParamProperties; } -export type ScenesListParameters = RequestParameters & ScenesListQueryParam; +export type ScenesListParameters = ScenesListQueryParam & RequestParameters; export interface ScenesCreateSatelliteDataIngestionJobBodyParam { + /** Job parameters supplied by user. */ body?: SatelliteDataIngestionJob; } -export type ScenesCreateSatelliteDataIngestionJobParameters = RequestParameters & - ScenesCreateSatelliteDataIngestionJobBodyParam; +export interface ScenesCreateSatelliteDataIngestionJobMediaTypesParam { + /** Request content type */ + contentType?: "application/json"; +} + +export type ScenesCreateSatelliteDataIngestionJobParameters = + ScenesCreateSatelliteDataIngestionJobMediaTypesParam & + ScenesCreateSatelliteDataIngestionJobBodyParam & + RequestParameters; export type ScenesGetSatelliteDataIngestionJobDetailsParameters = RequestParameters; export interface ScenesDownloadQueryParamProperties { @@ -1226,19 +1358,19 @@ export interface ScenesDownloadQueryParam { queryParameters: ScenesDownloadQueryParamProperties; } -export type ScenesDownloadParameters = RequestParameters & ScenesDownloadQueryParam; +export type ScenesDownloadParameters = ScenesDownloadQueryParam & RequestParameters; export interface SeasonalFieldsListByFarmerIdQueryParamProperties { /** Farm Ids of the resource. */ - farmIds?: string[]; + farmIds?: Array; /** Field Ids of the resource. */ - fieldIds?: string[]; + fieldIds?: Array; /** Season Ids of the resource. */ - seasonIds?: string[]; + seasonIds?: Array; /** CropVarietyIds of the resource. */ - cropVarietyIds?: string[]; + cropVarietyIds?: Array; /** Ids of the crop it belongs to. */ - cropIds?: string[]; + cropIds?: Array; /** Minimum average yield value of the seasonal field(inclusive). */ minAvgYieldValue?: number; /** Maximum average yield value of the seasonal field(inclusive). */ @@ -1252,28 +1384,28 @@ export interface SeasonalFieldsListByFarmerIdQueryParamProperties { /** Unit of average seed population value attribute. */ avgSeedPopulationUnit?: string; /** Minimum planting datetime, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - minPlantingDateTime?: Date; + minPlantingDateTime?: Date | string; /** Maximum planting datetime, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - maxPlantingDateTime?: Date; + maxPlantingDateTime?: Date | string; /** Ids of the resource. */ - ids?: string[]; + ids?: Array; /** Names of the resource. */ - names?: string[]; + names?: Array; /** * Filters on key-value pairs within the Properties object. - * eg. "\{testKey\} eq \{testValue\}". + * eg. "{testKey} eq {testValue}". */ - propertyFilters?: string[]; + propertyFilters?: Array; /** Statuses of the resource. */ - statuses?: string[]; + statuses?: Array; /** Minimum creation date of resource (inclusive). */ - minCreatedDateTime?: Date; + minCreatedDateTime?: Date | string; /** Maximum creation date of resource (inclusive). */ - maxCreatedDateTime?: Date; + maxCreatedDateTime?: Date | string; /** Minimum last modified date of resource (inclusive). */ - minLastModifiedDateTime?: Date; + minLastModifiedDateTime?: Date | string; /** Maximum last modified date of resource (inclusive). */ - maxLastModifiedDateTime?: Date; + maxLastModifiedDateTime?: Date | string; /** * Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. @@ -1287,20 +1419,20 @@ export interface SeasonalFieldsListByFarmerIdQueryParam { queryParameters?: SeasonalFieldsListByFarmerIdQueryParamProperties; } -export type SeasonalFieldsListByFarmerIdParameters = RequestParameters & - SeasonalFieldsListByFarmerIdQueryParam; +export type SeasonalFieldsListByFarmerIdParameters = SeasonalFieldsListByFarmerIdQueryParam & + RequestParameters; export interface SeasonalFieldsListQueryParamProperties { /** Farm Ids of the resource. */ - farmIds?: string[]; + farmIds?: Array; /** Field Ids of the resource. */ - fieldIds?: string[]; + fieldIds?: Array; /** Season Ids of the resource. */ - seasonIds?: string[]; + seasonIds?: Array; /** CropVarietyIds of the resource. */ - cropVarietyIds?: string[]; + cropVarietyIds?: Array; /** Ids of the crop it belongs to. */ - cropIds?: string[]; + cropIds?: Array; /** Minimum average yield value of the seasonal field(inclusive). */ minAvgYieldValue?: number; /** Maximum average yield value of the seasonal field(inclusive). */ @@ -1314,28 +1446,28 @@ export interface SeasonalFieldsListQueryParamProperties { /** Unit of average seed population value attribute. */ avgSeedPopulationUnit?: string; /** Minimum planting datetime, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - minPlantingDateTime?: Date; + minPlantingDateTime?: Date | string; /** Maximum planting datetime, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - maxPlantingDateTime?: Date; + maxPlantingDateTime?: Date | string; /** Ids of the resource. */ - ids?: string[]; + ids?: Array; /** Names of the resource. */ - names?: string[]; + names?: Array; /** * Filters on key-value pairs within the Properties object. - * eg. "\{testKey\} eq \{testValue\}". + * eg. "{testKey} eq {testValue}". */ - propertyFilters?: string[]; + propertyFilters?: Array; /** Statuses of the resource. */ - statuses?: string[]; + statuses?: Array; /** Minimum creation date of resource (inclusive). */ - minCreatedDateTime?: Date; + minCreatedDateTime?: Date | string; /** Maximum creation date of resource (inclusive). */ - maxCreatedDateTime?: Date; + maxCreatedDateTime?: Date | string; /** Minimum last modified date of resource (inclusive). */ - minLastModifiedDateTime?: Date; + minLastModifiedDateTime?: Date | string; /** Maximum last modified date of resource (inclusive). */ - maxLastModifiedDateTime?: Date; + maxLastModifiedDateTime?: Date | string; /** * Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. @@ -1349,15 +1481,22 @@ export interface SeasonalFieldsListQueryParam { queryParameters?: SeasonalFieldsListQueryParamProperties; } -export type SeasonalFieldsListParameters = RequestParameters & SeasonalFieldsListQueryParam; +export type SeasonalFieldsListParameters = SeasonalFieldsListQueryParam & RequestParameters; export type SeasonalFieldsGetParameters = RequestParameters; export interface SeasonalFieldsCreateOrUpdateBodyParam { + /** Seasonal field resource payload to create or update. */ body?: SeasonalField; } -export type SeasonalFieldsCreateOrUpdateParameters = RequestParameters & - SeasonalFieldsCreateOrUpdateBodyParam; +export interface SeasonalFieldsCreateOrUpdateMediaTypesParam { + /** Request content type */ + contentType?: "application/merge-patch+json"; +} + +export type SeasonalFieldsCreateOrUpdateParameters = SeasonalFieldsCreateOrUpdateMediaTypesParam & + SeasonalFieldsCreateOrUpdateBodyParam & + RequestParameters; export type SeasonalFieldsDeleteParameters = RequestParameters; export type SeasonalFieldsGetCascadeDeleteJobDetailsParameters = RequestParameters; @@ -1372,39 +1511,39 @@ export interface SeasonalFieldsCreateCascadeDeleteJobQueryParam { queryParameters: SeasonalFieldsCreateCascadeDeleteJobQueryParamProperties; } -export type SeasonalFieldsCreateCascadeDeleteJobParameters = RequestParameters & - SeasonalFieldsCreateCascadeDeleteJobQueryParam; +export type SeasonalFieldsCreateCascadeDeleteJobParameters = + SeasonalFieldsCreateCascadeDeleteJobQueryParam & RequestParameters; export interface SeasonsListQueryParamProperties { /** Minimum season start datetime, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - minStartDateTime?: Date; + minStartDateTime?: Date | string; /** Maximum season start datetime, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - maxStartDateTime?: Date; + maxStartDateTime?: Date | string; /** Minimum season end datetime, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - minEndDateTime?: Date; + minEndDateTime?: Date | string; /** Maximum season end datetime, sample format: yyyy-MM-ddTHH:mm:ssZ. */ - maxEndDateTime?: Date; + maxEndDateTime?: Date | string; /** Years of the resource. */ - years?: number[]; + years?: Array; /** Ids of the resource. */ - ids?: string[]; + ids?: Array; /** Names of the resource. */ - names?: string[]; + names?: Array; /** * Filters on key-value pairs within the Properties object. - * eg. "\{testKey\} eq \{testValue\}". + * eg. "{testKey} eq {testValue}". */ - propertyFilters?: string[]; + propertyFilters?: Array; /** Statuses of the resource. */ - statuses?: string[]; + statuses?: Array; /** Minimum creation date of resource (inclusive). */ - minCreatedDateTime?: Date; + minCreatedDateTime?: Date | string; /** Maximum creation date of resource (inclusive). */ - maxCreatedDateTime?: Date; + maxCreatedDateTime?: Date | string; /** Minimum last modified date of resource (inclusive). */ - minLastModifiedDateTime?: Date; + minLastModifiedDateTime?: Date | string; /** Maximum last modified date of resource (inclusive). */ - maxLastModifiedDateTime?: Date; + maxLastModifiedDateTime?: Date | string; /** * Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. @@ -1418,14 +1557,22 @@ export interface SeasonsListQueryParam { queryParameters?: SeasonsListQueryParamProperties; } -export type SeasonsListParameters = RequestParameters & SeasonsListQueryParam; +export type SeasonsListParameters = SeasonsListQueryParam & RequestParameters; export type SeasonsGetParameters = RequestParameters; export interface SeasonsCreateOrUpdateBodyParam { + /** Season resource payload to create or update. */ body?: Season; } -export type SeasonsCreateOrUpdateParameters = RequestParameters & SeasonsCreateOrUpdateBodyParam; +export interface SeasonsCreateOrUpdateMediaTypesParam { + /** Request content type */ + contentType?: "application/merge-patch+json"; +} + +export type SeasonsCreateOrUpdateParameters = SeasonsCreateOrUpdateMediaTypesParam & + SeasonsCreateOrUpdateBodyParam & + RequestParameters; export type SeasonsDeleteParameters = RequestParameters; export interface TillageDataListByFarmerIdQueryParamProperties { @@ -1438,46 +1585,46 @@ export interface TillageDataListByFarmerIdQueryParamProperties { /** Maximum pressure applied by a tillage implement (inclusive). */ maxTillagePressure?: number; /** Sources of the operation data. */ - sources?: string[]; + sources?: Array; /** Boundary IDs associated with operation data. */ - associatedBoundaryIds?: string[]; + associatedBoundaryIds?: Array; /** Operation boundary IDs associated with operation data. */ - operationBoundaryIds?: string[]; + operationBoundaryIds?: Array; /** Minimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - minOperationStartDateTime?: Date; + minOperationStartDateTime?: Date | string; /** Maximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - maxOperationStartDateTime?: Date; + maxOperationStartDateTime?: Date | string; /** Minimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - minOperationEndDateTime?: Date; + minOperationEndDateTime?: Date | string; /** Maximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - maxOperationEndDateTime?: Date; + maxOperationEndDateTime?: Date | string; /** Minimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - minOperationModifiedDateTime?: Date; + minOperationModifiedDateTime?: Date | string; /** Maximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - maxOperationModifiedDateTime?: Date; + maxOperationModifiedDateTime?: Date | string; /** Minimum area for which operation was applied (inclusive). */ minArea?: number; /** Maximum area for which operation was applied (inclusive). */ maxArea?: number; /** Ids of the resource. */ - ids?: string[]; + ids?: Array; /** Names of the resource. */ - names?: string[]; + names?: Array; /** * Filters on key-value pairs within the Properties object. - * eg. "\{testKey\} eq \{testValue\}". + * eg. "{testKey} eq {testValue}". */ - propertyFilters?: string[]; + propertyFilters?: Array; /** Statuses of the resource. */ - statuses?: string[]; + statuses?: Array; /** Minimum creation date of resource (inclusive). */ - minCreatedDateTime?: Date; + minCreatedDateTime?: Date | string; /** Maximum creation date of resource (inclusive). */ - maxCreatedDateTime?: Date; + maxCreatedDateTime?: Date | string; /** Minimum last modified date of resource (inclusive). */ - minLastModifiedDateTime?: Date; + minLastModifiedDateTime?: Date | string; /** Maximum last modified date of resource (inclusive). */ - maxLastModifiedDateTime?: Date; + maxLastModifiedDateTime?: Date | string; /** * Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. @@ -1491,8 +1638,8 @@ export interface TillageDataListByFarmerIdQueryParam { queryParameters?: TillageDataListByFarmerIdQueryParamProperties; } -export type TillageDataListByFarmerIdParameters = RequestParameters & - TillageDataListByFarmerIdQueryParam; +export type TillageDataListByFarmerIdParameters = TillageDataListByFarmerIdQueryParam & + RequestParameters; export interface TillageDataListQueryParamProperties { /** Minimum measured tillage depth (inclusive). */ @@ -1504,46 +1651,46 @@ export interface TillageDataListQueryParamProperties { /** Maximum pressure applied by a tillage implement (inclusive). */ maxTillagePressure?: number; /** Sources of the operation data. */ - sources?: string[]; + sources?: Array; /** Boundary IDs associated with operation data. */ - associatedBoundaryIds?: string[]; + associatedBoundaryIds?: Array; /** Operation boundary IDs associated with operation data. */ - operationBoundaryIds?: string[]; + operationBoundaryIds?: Array; /** Minimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - minOperationStartDateTime?: Date; + minOperationStartDateTime?: Date | string; /** Maximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - maxOperationStartDateTime?: Date; + maxOperationStartDateTime?: Date | string; /** Minimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - minOperationEndDateTime?: Date; + minOperationEndDateTime?: Date | string; /** Maximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - maxOperationEndDateTime?: Date; + maxOperationEndDateTime?: Date | string; /** Minimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - minOperationModifiedDateTime?: Date; + minOperationModifiedDateTime?: Date | string; /** Maximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive). */ - maxOperationModifiedDateTime?: Date; + maxOperationModifiedDateTime?: Date | string; /** Minimum area for which operation was applied (inclusive). */ minArea?: number; /** Maximum area for which operation was applied (inclusive). */ maxArea?: number; /** Ids of the resource. */ - ids?: string[]; + ids?: Array; /** Names of the resource. */ - names?: string[]; + names?: Array; /** * Filters on key-value pairs within the Properties object. - * eg. "\{testKey\} eq \{testValue\}". + * eg. "{testKey} eq {testValue}". */ - propertyFilters?: string[]; + propertyFilters?: Array; /** Statuses of the resource. */ - statuses?: string[]; + statuses?: Array; /** Minimum creation date of resource (inclusive). */ - minCreatedDateTime?: Date; + minCreatedDateTime?: Date | string; /** Maximum creation date of resource (inclusive). */ - maxCreatedDateTime?: Date; + maxCreatedDateTime?: Date | string; /** Minimum last modified date of resource (inclusive). */ - minLastModifiedDateTime?: Date; + minLastModifiedDateTime?: Date | string; /** Maximum last modified date of resource (inclusive). */ - maxLastModifiedDateTime?: Date; + maxLastModifiedDateTime?: Date | string; /** * Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. @@ -1557,15 +1704,22 @@ export interface TillageDataListQueryParam { queryParameters?: TillageDataListQueryParamProperties; } -export type TillageDataListParameters = RequestParameters & TillageDataListQueryParam; +export type TillageDataListParameters = TillageDataListQueryParam & RequestParameters; export type TillageDataGetParameters = RequestParameters; export interface TillageDataCreateOrUpdateBodyParam { + /** Tillage data resource payload to create or update. */ body?: TillageData; } -export type TillageDataCreateOrUpdateParameters = RequestParameters & - TillageDataCreateOrUpdateBodyParam; +export interface TillageDataCreateOrUpdateMediaTypesParam { + /** Request content type */ + contentType?: "application/merge-patch+json"; +} + +export type TillageDataCreateOrUpdateParameters = TillageDataCreateOrUpdateMediaTypesParam & + TillageDataCreateOrUpdateBodyParam & + RequestParameters; export type TillageDataDeleteParameters = RequestParameters; export interface WeatherListQueryParamProperties { @@ -1580,9 +1734,9 @@ export interface WeatherListQueryParamProperties { /** Granularity of weather data (daily/hourly). */ granularity: string; /** Weather data start UTC date-time (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ. */ - startDateTime?: Date; + startDateTime?: Date | string; /** Weather data end UTC date-time (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ. */ - endDateTime?: Date; + endDateTime?: Date | string; /** * Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. @@ -1596,20 +1750,34 @@ export interface WeatherListQueryParam { queryParameters: WeatherListQueryParamProperties; } -export type WeatherListParameters = RequestParameters & WeatherListQueryParam; +export type WeatherListParameters = WeatherListQueryParam & RequestParameters; export type WeatherGetDataIngestionJobDetailsParameters = RequestParameters; export interface WeatherCreateDataIngestionJobBodyParam { + /** Job parameters supplied by user. */ body?: WeatherDataIngestionJob; } -export type WeatherCreateDataIngestionJobParameters = RequestParameters & - WeatherCreateDataIngestionJobBodyParam; +export interface WeatherCreateDataIngestionJobMediaTypesParam { + /** Request content type */ + contentType?: "application/json"; +} + +export type WeatherCreateDataIngestionJobParameters = WeatherCreateDataIngestionJobMediaTypesParam & + WeatherCreateDataIngestionJobBodyParam & + RequestParameters; export type WeatherGetDataDeleteJobDetailsParameters = RequestParameters; export interface WeatherCreateDataDeleteJobBodyParam { + /** Job parameters supplied by user. */ body?: WeatherDataDeleteJob; } -export type WeatherCreateDataDeleteJobParameters = RequestParameters & - WeatherCreateDataDeleteJobBodyParam; +export interface WeatherCreateDataDeleteJobMediaTypesParam { + /** Request content type */ + contentType?: "application/json"; +} + +export type WeatherCreateDataDeleteJobParameters = WeatherCreateDataDeleteJobMediaTypesParam & + WeatherCreateDataDeleteJobBodyParam & + RequestParameters; diff --git a/sdk/agrifood/agrifood-farming-rest/src/pollingHelper.ts b/sdk/agrifood/agrifood-farming-rest/src/pollingHelper.ts new file mode 100644 index 000000000000..4868774b8c3b --- /dev/null +++ b/sdk/agrifood/agrifood-farming-rest/src/pollingHelper.ts @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { Client, HttpResponse } from "@azure-rest/core-client"; +import { + LongRunningOperation, + LroEngine, + LroEngineOptions, + LroResponse, + PollerLike, + PollOperationState, +} from "@azure/core-lro"; + +/** + * Helper function that builds a Poller object to help polling a long running operation. + * @param client - Client to use for sending the request to get additional pages. + * @param initialResponse - The initial response. + * @param options - Options to set a resume state or custom polling interval. + * @returns - A poller object to poll for operation state updates and eventually get the final response. + */ +export function getLongRunningPoller( + client: Client, + initialResponse: TResult, + options: LroEngineOptions> = {} +): PollerLike, TResult> { + const poller: LongRunningOperation = { + requestMethod: initialResponse.request.method, + requestPath: initialResponse.request.url, + sendInitialRequest: async () => { + // In the case of Rest Clients we are building the LRO poller object from a response that's the reason + // we are not triggering the initial request here, just extracting the information from the + // response we were provided. + return getLroResponse(initialResponse); + }, + sendPollRequest: async (path) => { + // This is the callback that is going to be called to poll the service + // to get the latest status. We use the client provided and the polling path + // which is an opaque URL provided by caller, the service sends this in one of the following headers: operation-location, azure-asyncoperation or location + // depending on the lro pattern that the service implements. If non is provided we default to the initial path. + const response = await client.pathUnchecked(path ?? initialResponse.request.url).get(); + return getLroResponse(response as TResult); + }, + }; + + return new LroEngine(poller, options); +} + +/** + * Converts a Rest Client response to a response that the LRO engine knows about + * @param response - a rest client http response + * @returns - An LRO response that the LRO engine can work with + */ +function getLroResponse(response: TResult): LroResponse { + if (Number.isNaN(response.status)) { + throw new TypeError(`Status code of the response is not a number. Value: ${response.status}`); + } + + return { + flatResponse: response, + rawResponse: { + ...response, + statusCode: Number.parseInt(response.status), + body: response.body, + }, + }; +} diff --git a/sdk/agrifood/agrifood-farming-rest/src/responses.ts b/sdk/agrifood/agrifood-farming-rest/src/responses.ts index ad5e3f9632c1..2ba9576fe707 100644 --- a/sdk/agrifood/agrifood-farming-rest/src/responses.ts +++ b/sdk/agrifood/agrifood-farming-rest/src/responses.ts @@ -1,845 +1,857 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { - ApplicationDataListResponse, - ErrorResponse, - ApplicationData, - AttachmentListResponse, - Attachment, - BoundaryListResponse, - CascadeDeleteJob, - Boundary, - BoundaryOverlapResponse, - CropListResponse, - Crop, - CropVarietyListResponse, - CropVariety, - FarmerListResponse, - Farmer, - FarmOperationDataIngestionJob, - FarmListResponse, - Farm, - FieldListResponse, - Field, - HarvestDataListResponse, - HarvestData, - ImageProcessingRasterizeJob, - OAuthProviderListResponse, - OAuthProvider, - OAuthTokenListResponse, - PlantingDataListResponse, - PlantingData, - SceneListResponse, - SatelliteDataIngestionJob, - SeasonalFieldListResponse, - SeasonalField, - SeasonListResponse, - Season, - TillageDataListResponse, - TillageData, - WeatherDataListResponse, - WeatherDataIngestionJob, - WeatherDataDeleteJob, -} from "./models"; import { HttpResponse } from "@azure-rest/core-client"; +import { + ApplicationDataListResponseOutput, + ErrorResponseOutput, + ApplicationDataOutput, + AttachmentListResponseOutput, + AttachmentOutput, + BoundaryListResponseOutput, + CascadeDeleteJobOutput, + BoundaryOutput, + BoundaryOverlapResponseOutput, + CropListResponseOutput, + CropOutput, + CropVarietyListResponseOutput, + CropVarietyOutput, + FarmerListResponseOutput, + FarmerOutput, + FarmOperationDataIngestionJobOutput, + FarmListResponseOutput, + FarmOutput, + FieldListResponseOutput, + FieldOutput, + HarvestDataListResponseOutput, + HarvestDataOutput, + ImageProcessingRasterizeJobOutput, + OAuthProviderListResponseOutput, + OAuthProviderOutput, + OAuthTokenListResponseOutput, + PlantingDataListResponseOutput, + PlantingDataOutput, + SceneListResponseOutput, + SatelliteDataIngestionJobOutput, + SeasonalFieldListResponseOutput, + SeasonalFieldOutput, + SeasonListResponseOutput, + SeasonOutput, + TillageDataListResponseOutput, + TillageDataOutput, + WeatherDataListResponseOutput, + WeatherDataIngestionJobOutput, + WeatherDataDeleteJobOutput, +} from "./outputModels"; /** Returns a paginated list of application data resources under a particular farm. */ export interface ApplicationDataListByFarmerId200Response extends HttpResponse { status: "200"; - body: ApplicationDataListResponse; + body: ApplicationDataListResponseOutput; } /** Returns a paginated list of application data resources under a particular farm. */ export interface ApplicationDataListByFarmerIddefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Returns a paginated list of application data resources across all farmers. */ export interface ApplicationDataList200Response extends HttpResponse { status: "200"; - body: ApplicationDataListResponse; + body: ApplicationDataListResponseOutput; } /** Returns a paginated list of application data resources across all farmers. */ export interface ApplicationDataListdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Get a specified application data resource under a particular farmer. */ export interface ApplicationDataGet200Response extends HttpResponse { status: "200"; - body: ApplicationData; + body: ApplicationDataOutput; } /** Get a specified application data resource under a particular farmer. */ export interface ApplicationDataGetdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Creates or updates an application data resource under a particular farmer. */ export interface ApplicationDataCreateOrUpdate200Response extends HttpResponse { status: "200"; - body: ApplicationData; + body: ApplicationDataOutput; } /** Creates or updates an application data resource under a particular farmer. */ export interface ApplicationDataCreateOrUpdate201Response extends HttpResponse { status: "201"; - body: ApplicationData; + body: ApplicationDataOutput; } /** Creates or updates an application data resource under a particular farmer. */ export interface ApplicationDataCreateOrUpdatedefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Deletes a specified application data resource under a particular farmer. */ export interface ApplicationDataDelete204Response extends HttpResponse { status: "204"; + body: Record; } /** Deletes a specified application data resource under a particular farmer. */ export interface ApplicationDataDeletedefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Returns a paginated list of attachment resources under a particular farmer. */ export interface AttachmentsListByFarmerId200Response extends HttpResponse { status: "200"; - body: AttachmentListResponse; + body: AttachmentListResponseOutput; } /** Returns a paginated list of attachment resources under a particular farmer. */ export interface AttachmentsListByFarmerIddefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Gets a specified attachment resource under a particular farmer. */ export interface AttachmentsGet200Response extends HttpResponse { status: "200"; - body: Attachment; + body: AttachmentOutput; } /** Gets a specified attachment resource under a particular farmer. */ export interface AttachmentsGetdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Creates or updates an attachment resource under a particular farmer. */ export interface AttachmentsCreateOrUpdate200Response extends HttpResponse { status: "200"; - body: Attachment; + body: AttachmentOutput; } /** Creates or updates an attachment resource under a particular farmer. */ export interface AttachmentsCreateOrUpdate201Response extends HttpResponse { status: "201"; - body: Attachment; + body: AttachmentOutput; } /** Creates or updates an attachment resource under a particular farmer. */ export interface AttachmentsCreateOrUpdatedefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Deletes a specified attachment resource under a particular farmer. */ export interface AttachmentsDelete204Response extends HttpResponse { status: "204"; + body: Record; } /** Deletes a specified attachment resource under a particular farmer. */ export interface AttachmentsDeletedefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Downloads and returns attachment as response for the given input filePath. */ export interface AttachmentsDownload200Response extends HttpResponse { status: "200"; + body: Record; } /** Downloads and returns attachment as response for the given input filePath. */ export interface AttachmentsDownloaddefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Returns a paginated list of boundary resources under a particular farmer. */ export interface BoundariesListByFarmerId200Response extends HttpResponse { status: "200"; - body: BoundaryListResponse; + body: BoundaryListResponseOutput; } /** Returns a paginated list of boundary resources under a particular farmer. */ export interface BoundariesListByFarmerIddefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Search for boundaries by fields and intersecting geometry. */ export interface BoundariesSearchByFarmerId200Response extends HttpResponse { status: "200"; - body: BoundaryListResponse; + body: BoundaryListResponseOutput; } /** Search for boundaries by fields and intersecting geometry. */ export interface BoundariesSearchByFarmerIddefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Returns a paginated list of boundary resources across all farmers. */ export interface BoundariesList200Response extends HttpResponse { status: "200"; - body: BoundaryListResponse; + body: BoundaryListResponseOutput; } /** Returns a paginated list of boundary resources across all farmers. */ export interface BoundariesListdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Search for boundaries across all farmers by fields and intersecting geometry. */ export interface BoundariesSearch200Response extends HttpResponse { status: "200"; - body: BoundaryListResponse; + body: BoundaryListResponseOutput; } /** Search for boundaries across all farmers by fields and intersecting geometry. */ export interface BoundariesSearchdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Get cascade delete job for specified boundary. */ export interface BoundariesGetCascadeDeleteJobDetails200Response extends HttpResponse { status: "200"; - body: CascadeDeleteJob; + body: CascadeDeleteJobOutput; } /** Get cascade delete job for specified boundary. */ export interface BoundariesGetCascadeDeleteJobDetailsdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Create a cascade delete job for specified boundary. */ export interface BoundariesCreateCascadeDeleteJob202Response extends HttpResponse { status: "202"; - body: CascadeDeleteJob; + body: CascadeDeleteJobOutput; } /** Create a cascade delete job for specified boundary. */ export interface BoundariesCreateCascadeDeleteJobdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Gets a specified boundary resource under a particular farmer. */ export interface BoundariesGet200Response extends HttpResponse { status: "200"; - body: Boundary; + body: BoundaryOutput; } /** Gets a specified boundary resource under a particular farmer. */ export interface BoundariesGetdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Creates or updates a boundary resource. */ export interface BoundariesCreateOrUpdate200Response extends HttpResponse { status: "200"; - body: Boundary; + body: BoundaryOutput; } /** Creates or updates a boundary resource. */ export interface BoundariesCreateOrUpdate201Response extends HttpResponse { status: "201"; - body: Boundary; + body: BoundaryOutput; } /** Creates or updates a boundary resource. */ export interface BoundariesCreateOrUpdatedefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Deletes a specified boundary resource under a particular farmer. */ export interface BoundariesDelete204Response extends HttpResponse { status: "204"; + body: Record; } /** Deletes a specified boundary resource under a particular farmer. */ export interface BoundariesDeletedefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Returns overlapping acreage between two boundary Ids. */ export interface BoundariesGetOverlap200Response extends HttpResponse { status: "200"; - body: BoundaryOverlapResponse; + body: BoundaryOverlapResponseOutput; } /** Returns overlapping acreage between two boundary Ids. */ export interface BoundariesGetOverlapdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Returns a paginated list of crop resources. */ export interface CropsList200Response extends HttpResponse { status: "200"; - body: CropListResponse; + body: CropListResponseOutput; } /** Returns a paginated list of crop resources. */ export interface CropsListdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Gets a specified crop resource. */ export interface CropsGet200Response extends HttpResponse { status: "200"; - body: Crop; + body: CropOutput; } /** Gets a specified crop resource. */ export interface CropsGetdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Creates or updates a crop resource. */ export interface CropsCreateOrUpdate200Response extends HttpResponse { status: "200"; - body: Crop; + body: CropOutput; } /** Creates or updates a crop resource. */ export interface CropsCreateOrUpdate201Response extends HttpResponse { status: "201"; - body: Crop; + body: CropOutput; } /** Creates or updates a crop resource. */ export interface CropsCreateOrUpdatedefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Deletes Crop for given crop id. */ export interface CropsDelete204Response extends HttpResponse { status: "204"; + body: Record; } /** Deletes Crop for given crop id. */ export interface CropsDeletedefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Returns a paginated list of crop variety resources under a particular crop. */ export interface CropVarietiesListByCropId200Response extends HttpResponse { status: "200"; - body: CropVarietyListResponse; + body: CropVarietyListResponseOutput; } /** Returns a paginated list of crop variety resources under a particular crop. */ export interface CropVarietiesListByCropIddefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Returns a paginated list of crop variety resources across all crops. */ export interface CropVarietiesList200Response extends HttpResponse { status: "200"; - body: CropVarietyListResponse; + body: CropVarietyListResponseOutput; } /** Returns a paginated list of crop variety resources across all crops. */ export interface CropVarietiesListdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Gets a specified crop variety resource under a particular crop. */ export interface CropVarietiesGet200Response extends HttpResponse { status: "200"; - body: CropVariety; + body: CropVarietyOutput; } /** Gets a specified crop variety resource under a particular crop. */ export interface CropVarietiesGetdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Creates or updates a crop variety resource. */ export interface CropVarietiesCreateOrUpdate200Response extends HttpResponse { status: "200"; - body: CropVariety; + body: CropVarietyOutput; } /** Creates or updates a crop variety resource. */ export interface CropVarietiesCreateOrUpdate201Response extends HttpResponse { status: "201"; - body: CropVariety; + body: CropVarietyOutput; } /** Creates or updates a crop variety resource. */ export interface CropVarietiesCreateOrUpdatedefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Deletes a specified crop variety resource under a particular crop. */ export interface CropVarietiesDelete204Response extends HttpResponse { status: "204"; + body: Record; } /** Deletes a specified crop variety resource under a particular crop. */ export interface CropVarietiesDeletedefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Returns a paginated list of farmer resources. */ export interface FarmersList200Response extends HttpResponse { status: "200"; - body: FarmerListResponse; + body: FarmerListResponseOutput; } /** Returns a paginated list of farmer resources. */ export interface FarmersListdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Gets a specified farmer resource. */ export interface FarmersGet200Response extends HttpResponse { status: "200"; - body: Farmer; + body: FarmerOutput; } /** Gets a specified farmer resource. */ export interface FarmersGetdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Creates or updates a farmer resource. */ export interface FarmersCreateOrUpdate200Response extends HttpResponse { status: "200"; - body: Farmer; + body: FarmerOutput; } /** Creates or updates a farmer resource. */ export interface FarmersCreateOrUpdate201Response extends HttpResponse { status: "201"; - body: Farmer; + body: FarmerOutput; } /** Creates or updates a farmer resource. */ export interface FarmersCreateOrUpdatedefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Deletes a specified farmer resource. */ export interface FarmersDelete204Response extends HttpResponse { status: "204"; + body: Record; } /** Deletes a specified farmer resource. */ export interface FarmersDeletedefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Get a cascade delete job for specified farmer. */ export interface FarmersGetCascadeDeleteJobDetails200Response extends HttpResponse { status: "200"; - body: CascadeDeleteJob; + body: CascadeDeleteJobOutput; } /** Get a cascade delete job for specified farmer. */ export interface FarmersGetCascadeDeleteJobDetailsdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Create a cascade delete job for specified farmer. */ export interface FarmersCreateCascadeDeleteJob202Response extends HttpResponse { status: "202"; - body: CascadeDeleteJob; + body: CascadeDeleteJobOutput; } /** Create a cascade delete job for specified farmer. */ export interface FarmersCreateCascadeDeleteJobdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Create a farm operation data ingestion job. */ export interface FarmOperationsCreateDataIngestionJob202Response extends HttpResponse { status: "202"; - body: FarmOperationDataIngestionJob; + body: FarmOperationDataIngestionJobOutput; } /** Create a farm operation data ingestion job. */ export interface FarmOperationsCreateDataIngestionJobdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Get a farm operation data ingestion job. */ export interface FarmOperationsGetDataIngestionJobDetails200Response extends HttpResponse { status: "200"; - body: FarmOperationDataIngestionJob; + body: FarmOperationDataIngestionJobOutput; } /** Get a farm operation data ingestion job. */ export interface FarmOperationsGetDataIngestionJobDetailsdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Returns a paginated list of farm resources under a particular farmer. */ export interface FarmsListByFarmerId200Response extends HttpResponse { status: "200"; - body: FarmListResponse; + body: FarmListResponseOutput; } /** Returns a paginated list of farm resources under a particular farmer. */ export interface FarmsListByFarmerIddefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Returns a paginated list of farm resources across all farmers. */ export interface FarmsList200Response extends HttpResponse { status: "200"; - body: FarmListResponse; + body: FarmListResponseOutput; } /** Returns a paginated list of farm resources across all farmers. */ export interface FarmsListdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Gets a specified farm resource under a particular farmer. */ export interface FarmsGet200Response extends HttpResponse { status: "200"; - body: Farm; + body: FarmOutput; } /** Gets a specified farm resource under a particular farmer. */ export interface FarmsGetdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Creates or updates a farm resource under a particular farmer. */ export interface FarmsCreateOrUpdate200Response extends HttpResponse { status: "200"; - body: Farm; + body: FarmOutput; } /** Creates or updates a farm resource under a particular farmer. */ export interface FarmsCreateOrUpdate201Response extends HttpResponse { status: "201"; - body: Farm; + body: FarmOutput; } /** Creates or updates a farm resource under a particular farmer. */ export interface FarmsCreateOrUpdatedefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Deletes a specified farm resource under a particular farmer. */ export interface FarmsDelete204Response extends HttpResponse { status: "204"; + body: Record; } /** Deletes a specified farm resource under a particular farmer. */ export interface FarmsDeletedefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Get a cascade delete job for specified farm. */ export interface FarmsGetCascadeDeleteJobDetails200Response extends HttpResponse { status: "200"; - body: CascadeDeleteJob; + body: CascadeDeleteJobOutput; } /** Get a cascade delete job for specified farm. */ export interface FarmsGetCascadeDeleteJobDetailsdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Create a cascade delete job for specified farm. */ export interface FarmsCreateCascadeDeleteJob202Response extends HttpResponse { status: "202"; - body: CascadeDeleteJob; + body: CascadeDeleteJobOutput; } /** Create a cascade delete job for specified farm. */ export interface FarmsCreateCascadeDeleteJobdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Returns a paginated list of field resources under a particular farmer. */ export interface FieldsListByFarmerId200Response extends HttpResponse { status: "200"; - body: FieldListResponse; + body: FieldListResponseOutput; } /** Returns a paginated list of field resources under a particular farmer. */ export interface FieldsListByFarmerIddefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Returns a paginated list of field resources across all farmers. */ export interface FieldsList200Response extends HttpResponse { status: "200"; - body: FieldListResponse; + body: FieldListResponseOutput; } /** Returns a paginated list of field resources across all farmers. */ export interface FieldsListdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Gets a specified field resource under a particular farmer. */ export interface FieldsGet200Response extends HttpResponse { status: "200"; - body: Field; + body: FieldOutput; } /** Gets a specified field resource under a particular farmer. */ export interface FieldsGetdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Creates or Updates a field resource under a particular farmer. */ export interface FieldsCreateOrUpdate200Response extends HttpResponse { status: "200"; - body: Field; + body: FieldOutput; } /** Creates or Updates a field resource under a particular farmer. */ export interface FieldsCreateOrUpdate201Response extends HttpResponse { status: "201"; - body: Field; + body: FieldOutput; } /** Creates or Updates a field resource under a particular farmer. */ export interface FieldsCreateOrUpdatedefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Deletes a specified field resource under a particular farmer. */ export interface FieldsDelete204Response extends HttpResponse { status: "204"; + body: Record; } /** Deletes a specified field resource under a particular farmer. */ export interface FieldsDeletedefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Get a cascade delete job for specified field. */ export interface FieldsGetCascadeDeleteJobDetails200Response extends HttpResponse { status: "200"; - body: CascadeDeleteJob; + body: CascadeDeleteJobOutput; } /** Get a cascade delete job for specified field. */ export interface FieldsGetCascadeDeleteJobDetailsdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Create a cascade delete job for specified field. */ export interface FieldsCreateCascadeDeleteJob202Response extends HttpResponse { status: "202"; - body: CascadeDeleteJob; + body: CascadeDeleteJobOutput; } /** Create a cascade delete job for specified field. */ export interface FieldsCreateCascadeDeleteJobdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Returns a paginated list of harvest data resources under a particular farm. */ export interface HarvestDataListByFarmerId200Response extends HttpResponse { status: "200"; - body: HarvestDataListResponse; + body: HarvestDataListResponseOutput; } /** Returns a paginated list of harvest data resources under a particular farm. */ export interface HarvestDataListByFarmerIddefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Returns a paginated list of harvest data resources across all farmers. */ export interface HarvestDataList200Response extends HttpResponse { status: "200"; - body: HarvestDataListResponse; + body: HarvestDataListResponseOutput; } /** Returns a paginated list of harvest data resources across all farmers. */ export interface HarvestDataListdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Get a specified harvest data resource under a particular farmer. */ export interface HarvestDataGet200Response extends HttpResponse { status: "200"; - body: HarvestData; + body: HarvestDataOutput; } /** Get a specified harvest data resource under a particular farmer. */ export interface HarvestDataGetdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Creates or updates harvest data resource under a particular farmer. */ export interface HarvestDataCreateOrUpdate200Response extends HttpResponse { status: "200"; - body: HarvestData; + body: HarvestDataOutput; } /** Creates or updates harvest data resource under a particular farmer. */ export interface HarvestDataCreateOrUpdate201Response extends HttpResponse { status: "201"; - body: HarvestData; + body: HarvestDataOutput; } /** Creates or updates harvest data resource under a particular farmer. */ export interface HarvestDataCreateOrUpdatedefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Deletes a specified harvest data resource under a particular farmer. */ export interface HarvestDataDelete204Response extends HttpResponse { status: "204"; + body: Record; } /** Deletes a specified harvest data resource under a particular farmer. */ export interface HarvestDataDeletedefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Create a ImageProcessing Rasterize job. */ export interface ImageProcessingCreateRasterizeJob202Response extends HttpResponse { status: "202"; - body: ImageProcessingRasterizeJob; + body: ImageProcessingRasterizeJobOutput; } /** Create a ImageProcessing Rasterize job. */ export interface ImageProcessingCreateRasterizeJobdefaultResponse extends HttpResponse { status: "500"; + body: Record; } /** Get ImageProcessing Rasterize job's details. */ export interface ImageProcessingGetRasterizeJob200Response extends HttpResponse { status: "200"; - body: ImageProcessingRasterizeJob; + body: ImageProcessingRasterizeJobOutput; } /** Returns a paginated list of oauthProvider resources. */ export interface OAuthProvidersList200Response extends HttpResponse { status: "200"; - body: OAuthProviderListResponse; + body: OAuthProviderListResponseOutput; } /** Returns a paginated list of oauthProvider resources. */ export interface OAuthProvidersListdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Get a specified oauthProvider resource. */ export interface OAuthProvidersGet200Response extends HttpResponse { status: "200"; - body: OAuthProvider; + body: OAuthProviderOutput; } /** Get a specified oauthProvider resource. */ export interface OAuthProvidersGetdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Creates or updates an oauthProvider resource. */ export interface OAuthProvidersCreateOrUpdate200Response extends HttpResponse { status: "200"; - body: OAuthProvider; + body: OAuthProviderOutput; } /** Creates or updates an oauthProvider resource. */ export interface OAuthProvidersCreateOrUpdate201Response extends HttpResponse { status: "201"; - body: OAuthProvider; + body: OAuthProviderOutput; } /** Creates or updates an oauthProvider resource. */ export interface OAuthProvidersCreateOrUpdatedefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Deletes an specified oauthProvider resource. */ export interface OAuthProvidersDelete204Response extends HttpResponse { status: "204"; + body: Record; } /** Deletes an specified oauthProvider resource. */ export interface OAuthProvidersDeletedefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Returns a list of OAuthToken documents. */ export interface OAuthTokensList200Response extends HttpResponse { status: "200"; - body: OAuthTokenListResponse; + body: OAuthTokenListResponseOutput; } /** Returns a list of OAuthToken documents. */ export interface OAuthTokensListdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Returns Connection link needed in the OAuth flow. */ @@ -851,408 +863,413 @@ export interface OAuthTokensGetOAuthConnectionLink200Response extends HttpRespon /** Returns Connection link needed in the OAuth flow. */ export interface OAuthTokensGetOAuthConnectionLinkdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Get cascade delete job details for OAuth tokens for specified job ID. */ export interface OAuthTokensGetCascadeDeleteJobDetails200Response extends HttpResponse { status: "200"; - body: CascadeDeleteJob; + body: CascadeDeleteJobOutput; } /** Get cascade delete job details for OAuth tokens for specified job ID. */ export interface OAuthTokensGetCascadeDeleteJobDetailsdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Create a cascade delete job for OAuth tokens. */ export interface OAuthTokensCreateCascadeDeleteJob202Response extends HttpResponse { status: "202"; - body: CascadeDeleteJob; + body: CascadeDeleteJobOutput; } /** Create a cascade delete job for OAuth tokens. */ export interface OAuthTokensCreateCascadeDeleteJobdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Returns a paginated list of planting data resources under a particular farm. */ export interface PlantingDataListByFarmerId200Response extends HttpResponse { status: "200"; - body: PlantingDataListResponse; + body: PlantingDataListResponseOutput; } /** Returns a paginated list of planting data resources under a particular farm. */ export interface PlantingDataListByFarmerIddefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Returns a paginated list of planting data resources across all farmers. */ export interface PlantingDataList200Response extends HttpResponse { status: "200"; - body: PlantingDataListResponse; + body: PlantingDataListResponseOutput; } /** Returns a paginated list of planting data resources across all farmers. */ export interface PlantingDataListdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Get a specified planting data resource under a particular farmer. */ export interface PlantingDataGet200Response extends HttpResponse { status: "200"; - body: PlantingData; + body: PlantingDataOutput; } /** Get a specified planting data resource under a particular farmer. */ export interface PlantingDataGetdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Creates or updates an planting data resource under a particular farmer. */ export interface PlantingDataCreateOrUpdate200Response extends HttpResponse { status: "200"; - body: PlantingData; + body: PlantingDataOutput; } /** Creates or updates an planting data resource under a particular farmer. */ export interface PlantingDataCreateOrUpdate201Response extends HttpResponse { status: "201"; - body: PlantingData; + body: PlantingDataOutput; } /** Creates or updates an planting data resource under a particular farmer. */ export interface PlantingDataCreateOrUpdatedefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Deletes a specified planting data resource under a particular farmer. */ export interface PlantingDataDelete204Response extends HttpResponse { status: "204"; + body: Record; } /** Deletes a specified planting data resource under a particular farmer. */ export interface PlantingDataDeletedefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Returns a paginated list of scene resources. */ export interface ScenesList200Response extends HttpResponse { status: "200"; - body: SceneListResponse; + body: SceneListResponseOutput; } /** Returns a paginated list of scene resources. */ export interface ScenesListdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Create a satellite data ingestion job. */ export interface ScenesCreateSatelliteDataIngestionJob202Response extends HttpResponse { status: "202"; - body: SatelliteDataIngestionJob; + body: SatelliteDataIngestionJobOutput; } /** Create a satellite data ingestion job. */ export interface ScenesCreateSatelliteDataIngestionJobdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Get a satellite data ingestion job. */ export interface ScenesGetSatelliteDataIngestionJobDetails200Response extends HttpResponse { status: "200"; - body: SatelliteDataIngestionJob; + body: SatelliteDataIngestionJobOutput; } /** Get a satellite data ingestion job. */ export interface ScenesGetSatelliteDataIngestionJobDetailsdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Downloads and returns file stream as response for the given input filePath. */ export interface ScenesDownload200Response extends HttpResponse { status: "200"; + body: Record; } /** Downloads and returns file stream as response for the given input filePath. */ export interface ScenesDownloaddefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Returns a paginated list of seasonal field resources under a particular farmer. */ export interface SeasonalFieldsListByFarmerId200Response extends HttpResponse { status: "200"; - body: SeasonalFieldListResponse; + body: SeasonalFieldListResponseOutput; } /** Returns a paginated list of seasonal field resources under a particular farmer. */ export interface SeasonalFieldsListByFarmerIddefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Returns a paginated list of seasonal field resources across all farmers. */ export interface SeasonalFieldsList200Response extends HttpResponse { status: "200"; - body: SeasonalFieldListResponse; + body: SeasonalFieldListResponseOutput; } /** Returns a paginated list of seasonal field resources across all farmers. */ export interface SeasonalFieldsListdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Gets a specified seasonal field resource under a particular farmer. */ export interface SeasonalFieldsGet200Response extends HttpResponse { status: "200"; - body: SeasonalField; + body: SeasonalFieldOutput; } /** Gets a specified seasonal field resource under a particular farmer. */ export interface SeasonalFieldsGetdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Creates or Updates a seasonal field resource under a particular farmer. */ export interface SeasonalFieldsCreateOrUpdate200Response extends HttpResponse { status: "200"; - body: SeasonalField; + body: SeasonalFieldOutput; } /** Creates or Updates a seasonal field resource under a particular farmer. */ export interface SeasonalFieldsCreateOrUpdate201Response extends HttpResponse { status: "201"; - body: SeasonalField; + body: SeasonalFieldOutput; } /** Creates or Updates a seasonal field resource under a particular farmer. */ export interface SeasonalFieldsCreateOrUpdatedefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Deletes a specified seasonal-field resource under a particular farmer. */ export interface SeasonalFieldsDelete204Response extends HttpResponse { status: "204"; + body: Record; } /** Deletes a specified seasonal-field resource under a particular farmer. */ export interface SeasonalFieldsDeletedefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Get cascade delete job for specified seasonal field. */ export interface SeasonalFieldsGetCascadeDeleteJobDetails200Response extends HttpResponse { status: "200"; - body: CascadeDeleteJob; + body: CascadeDeleteJobOutput; } /** Get cascade delete job for specified seasonal field. */ export interface SeasonalFieldsGetCascadeDeleteJobDetailsdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Create a cascade delete job for specified seasonal field. */ export interface SeasonalFieldsCreateCascadeDeleteJob202Response extends HttpResponse { status: "202"; - body: CascadeDeleteJob; + body: CascadeDeleteJobOutput; } /** Create a cascade delete job for specified seasonal field. */ export interface SeasonalFieldsCreateCascadeDeleteJobdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Returns a paginated list of season resources. */ export interface SeasonsList200Response extends HttpResponse { status: "200"; - body: SeasonListResponse; + body: SeasonListResponseOutput; } /** Returns a paginated list of season resources. */ export interface SeasonsListdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Gets a specified season resource. */ export interface SeasonsGet200Response extends HttpResponse { status: "200"; - body: Season; + body: SeasonOutput; } /** Gets a specified season resource. */ export interface SeasonsGetdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Creates or updates a season resource. */ export interface SeasonsCreateOrUpdate200Response extends HttpResponse { status: "200"; - body: Season; + body: SeasonOutput; } /** Creates or updates a season resource. */ export interface SeasonsCreateOrUpdate201Response extends HttpResponse { status: "201"; - body: Season; + body: SeasonOutput; } /** Creates or updates a season resource. */ export interface SeasonsCreateOrUpdatedefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Deletes a specified season resource. */ export interface SeasonsDelete204Response extends HttpResponse { status: "204"; + body: Record; } /** Deletes a specified season resource. */ export interface SeasonsDeletedefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Returns a paginated list of tillage data resources under a particular farm. */ export interface TillageDataListByFarmerId200Response extends HttpResponse { status: "200"; - body: TillageDataListResponse; + body: TillageDataListResponseOutput; } /** Returns a paginated list of tillage data resources under a particular farm. */ export interface TillageDataListByFarmerIddefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Returns a paginated list of tillage data resources across all farmers. */ export interface TillageDataList200Response extends HttpResponse { status: "200"; - body: TillageDataListResponse; + body: TillageDataListResponseOutput; } /** Returns a paginated list of tillage data resources across all farmers. */ export interface TillageDataListdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Get a specified tillage data resource under a particular farmer. */ export interface TillageDataGet200Response extends HttpResponse { status: "200"; - body: TillageData; + body: TillageDataOutput; } /** Get a specified tillage data resource under a particular farmer. */ export interface TillageDataGetdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Creates or updates an tillage data resource under a particular farmer. */ export interface TillageDataCreateOrUpdate200Response extends HttpResponse { status: "200"; - body: TillageData; + body: TillageDataOutput; } /** Creates or updates an tillage data resource under a particular farmer. */ export interface TillageDataCreateOrUpdate201Response extends HttpResponse { status: "201"; - body: TillageData; + body: TillageDataOutput; } /** Creates or updates an tillage data resource under a particular farmer. */ export interface TillageDataCreateOrUpdatedefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Deletes a specified tillage data resource under a particular farmer. */ export interface TillageDataDelete204Response extends HttpResponse { status: "204"; + body: Record; } /** Deletes a specified tillage data resource under a particular farmer. */ export interface TillageDataDeletedefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Returns a paginated list of weather data. */ export interface WeatherList200Response extends HttpResponse { status: "200"; - body: WeatherDataListResponse; + body: WeatherDataListResponseOutput; } /** Returns a paginated list of weather data. */ export interface WeatherListdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Get weather ingestion job. */ export interface WeatherGetDataIngestionJobDetails200Response extends HttpResponse { status: "200"; - body: WeatherDataIngestionJob; + body: WeatherDataIngestionJobOutput; } /** Get weather ingestion job. */ export interface WeatherGetDataIngestionJobDetailsdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Create a weather data ingestion job. */ export interface WeatherCreateDataIngestionJob202Response extends HttpResponse { status: "202"; - body: WeatherDataIngestionJob; + body: WeatherDataIngestionJobOutput; } /** Create a weather data ingestion job. */ export interface WeatherCreateDataIngestionJobdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Get weather data delete job. */ export interface WeatherGetDataDeleteJobDetails200Response extends HttpResponse { status: "200"; - body: WeatherDataDeleteJob; + body: WeatherDataDeleteJobOutput; } /** Get weather data delete job. */ export interface WeatherGetDataDeleteJobDetailsdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } /** Create a weather data delete job. */ export interface WeatherCreateDataDeleteJob202Response extends HttpResponse { status: "202"; - body: WeatherDataDeleteJob; + body: WeatherDataDeleteJobOutput; } /** Create a weather data delete job. */ export interface WeatherCreateDataDeleteJobdefaultResponse extends HttpResponse { status: "500"; - body: ErrorResponse; + body: ErrorResponseOutput; } diff --git a/sdk/agrifood/agrifood-farming-rest/swagger/README.md b/sdk/agrifood/agrifood-farming-rest/swagger/README.md index c681ac492bd6..b28f46e257f1 100644 --- a/sdk/agrifood/agrifood-farming-rest/swagger/README.md +++ b/sdk/agrifood/agrifood-farming-rest/swagger/README.md @@ -12,11 +12,14 @@ generate-metadata: false license-header: MICROSOFT_MIT_NO_VERSION output-folder: ../ source-code-folder-path: ./src -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/agfood/data-plane/Microsoft.AgFoodPlatform/preview/2021-03-31-preview/agfood.json +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/683e3f4849ee1d84629d0d0fa17789e80a9cee08/specification/agfood/data-plane/Microsoft.AgFoodPlatform/preview/2021-03-31-preview/agfood.json package-version: 1.0.0-beta.2 rest-level-client: true add-credentials: true credential-scopes: https://farmbeats.azure.net/.default use-extension: - "@autorest/typescript": "~/Microsoft/autorest.typescript" + "@autorest/typescript": "latest" + +modelerfour: + treat-type-object-as-anything: true ``` diff --git a/sdk/agrifood/agrifood-farming-rest/test/public/farmHeirarchy.spec.ts b/sdk/agrifood/agrifood-farming-rest/test/public/farmHeirarchy.spec.ts index 64c49963fcc5..95b8af53bf24 100644 --- a/sdk/agrifood/agrifood-farming-rest/test/public/farmHeirarchy.spec.ts +++ b/sdk/agrifood/agrifood-farming-rest/test/public/farmHeirarchy.spec.ts @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { FarmBeatsRestClient, getPoller } from "../../src"; +import { FarmBeatsRestClient, getLongRunningPoller } from "../../src"; import { Recorder } from "@azure-tools/test-recorder"; import { isNode } from "@azure/core-util"; @@ -108,7 +108,7 @@ describe("Farmer Operations", () => { throw initialResponse.body.error; } - const poller = getPoller(client, initialResponse); + const poller = getLongRunningPoller(client, initialResponse); const result = await poller.pollUntilDone(); assert.equal(result.body.boundaryId, boundaryId); From 3a148ec388d429a275165516b26f612c10f115d6 Mon Sep 17 00:00:00 2001 From: Deyaaeldeen Almahallawi Date: Thu, 27 Jan 2022 15:17:57 -0500 Subject: [PATCH 17/26] [Schema Registry Avro] Support backward compatibility for old preamble format (#20091) * [Schema Registry Avro] Support backward compatibility for old preamble format * fix linting * address feedback --- .../schema-registry-avro/CHANGELOG.md | 2 +- .../schema-registry-avro/README.md | 10 ++++ .../src/schemaRegistryAvroEncoder.ts | 59 ++++++++++++++++--- .../test/schemaRegistryAvroEncoder.spec.ts | 18 ++++++ 4 files changed, 81 insertions(+), 8 deletions(-) diff --git a/sdk/schemaregistry/schema-registry-avro/CHANGELOG.md b/sdk/schemaregistry/schema-registry-avro/CHANGELOG.md index c78610a6c888..aa4a585844a3 100644 --- a/sdk/schemaregistry/schema-registry-avro/CHANGELOG.md +++ b/sdk/schemaregistry/schema-registry-avro/CHANGELOG.md @@ -4,7 +4,7 @@ ### Features Added -- The serializer APIs have been revamped to work on messages instead of buffers where the payload is the pure encoded-data. The schema ID became part of the content type of that message. This change will improve the experience of using this encoder with the other messaging clients (e.g. Event Hubs, Service Bus, and Event Grid clients). +- The encoder APIs have been revamped to work on messages instead of buffers where the payload is the pure encoded-data. The schema ID became part of the content type of that message. This change will improve the experience of using this encoder with the other messaging clients (e.g. Event Hubs, Service Bus, and Event Grid clients). The encoder also supports decoding messages with payloads that follow the old format where the schema ID was part of the payload. - `decodeMessageData` now supports decoding using a different but compatible schema ### Breaking Changes diff --git a/sdk/schemaregistry/schema-registry-avro/README.md b/sdk/schemaregistry/schema-registry-avro/README.md index ce80a3b04e8c..2491527608e9 100644 --- a/sdk/schemaregistry/schema-registry-avro/README.md +++ b/sdk/schemaregistry/schema-registry-avro/README.md @@ -58,6 +58,16 @@ by setting the `messageAdapter` option in the constructor with a corresponding message producer and consumer. Azure messaging client libraries export default adapters for their message types. +### Backward Compatibility + +The encoder v1.0.0-beta.5 and under encodes data into binary arrays. Starting from +v1.0.0-beta.6, the encoder returns messages instead that contain the encoded payload. +For a smooth transition to using the newer versions, the encoder also supports +decoding messages with payloads that follow the old format where the schema ID +is part of the payload. + +This backward compatibility is temporary and will be removed in v1.0.0. + ## Examples ### Encode and decode an `@azure/event-hubs`'s `EventData` diff --git a/sdk/schemaregistry/schema-registry-avro/src/schemaRegistryAvroEncoder.ts b/sdk/schemaregistry/schema-registry-avro/src/schemaRegistryAvroEncoder.ts index 1ac215029a63..7eb2126288b0 100644 --- a/sdk/schemaregistry/schema-registry-avro/src/schemaRegistryAvroEncoder.ts +++ b/sdk/schemaregistry/schema-registry-avro/src/schemaRegistryAvroEncoder.ts @@ -95,7 +95,7 @@ export class SchemaRegistryAvroEncoder { options: DecodeMessageDataOptions = {} ): Promise { const { schema: readerSchema } = options; - const { body, contentType } = getPayloadAndContent(message, this.messageAdapter); + const { body, contentType } = convertMessage(message, this.messageAdapter); const buffer = Buffer.from(body); const writerSchemaId = getSchemaId(contentType); const writerSchema = await this.getSchema(writerSchemaId); @@ -201,18 +201,63 @@ function getSchemaId(contentType: string): string { return contentTypeParts[1]; } -function getPayloadAndContent( +/** + * Tries to decode a body in the preamble format. If that does not succeed, it + * returns it as is. + * @param body - The message body + * @param contentType - The message content type + * @returns a message with metadata + */ +function convertPayload(body: Uint8Array, contentType: string): MessageWithMetadata { + try { + return tryReadingPreambleFormat(Buffer.from(body)); + } catch (_e: unknown) { + return { + body, + contentType, + }; + } +} + +function convertMessage( message: MessageT, - messageAdapter?: MessageAdapter + adapter?: MessageAdapter ): MessageWithMetadata { - const messageConsumer = messageAdapter?.consumeMessage; + const messageConsumer = adapter?.consumeMessage; if (messageConsumer) { - return messageConsumer(message); + const { body, contentType } = messageConsumer(message); + return convertPayload(body, contentType); } else if (isMessageWithMetadata(message)) { - return message; + return convertPayload(message.body, message.contentType); } else { throw new Error( - `Either the messageConsumer option should be defined or the message should have body and contentType fields` + `Expected either a message adapter to be provided to the encoder or the input message to have body and contentType fields` ); } } + +/** + * Maintains backward compatability by supporting the encoded value format created + * by earlier beta serializers + * @param buffer - The input buffer + * @returns a message that contains the body and content type with the schema ID + */ +function tryReadingPreambleFormat(buffer: Buffer): MessageWithMetadata { + const FORMAT_INDICATOR = 0; + const SCHEMA_ID_OFFSET = 4; + const PAYLOAD_OFFSET = 36; + if (buffer.length < PAYLOAD_OFFSET) { + throw new RangeError("Buffer is too small to have the correct format."); + } + const format = buffer.readUInt32BE(0); + if (format !== FORMAT_INDICATOR) { + throw new TypeError(`Buffer has unknown format indicator.`); + } + const schemaIdBuffer = buffer.slice(SCHEMA_ID_OFFSET, PAYLOAD_OFFSET); + const schemaId = schemaIdBuffer.toString("utf-8"); + const payloadBuffer = buffer.slice(PAYLOAD_OFFSET); + return { + body: payloadBuffer, + contentType: `${avroMimeType}+${schemaId}`, + }; +} diff --git a/sdk/schemaregistry/schema-registry-avro/test/schemaRegistryAvroEncoder.spec.ts b/sdk/schemaregistry/schema-registry-avro/test/schemaRegistryAvroEncoder.spec.ts index 4deb210f1278..0969d094ad5e 100644 --- a/sdk/schemaregistry/schema-registry-avro/test/schemaRegistryAvroEncoder.spec.ts +++ b/sdk/schemaregistry/schema-registry-avro/test/schemaRegistryAvroEncoder.spec.ts @@ -189,4 +189,22 @@ describe("SchemaRegistryAvroEncoder", function () { /no matching field for default-less com.azure.schemaregistry.samples.AvroUser.age/ ); }); + + it("decodes from the old format", async () => { + const registry = createTestRegistry(); + const schemaId = await registerTestSchema(registry); + const encoder = await createTestEncoder(false, registry); + const payload = testAvroType.toBuffer(testValue); + const buffer = Buffer.alloc(36 + payload.length); + + buffer.write(schemaId, 4, 32, "utf-8"); + payload.copy(buffer, 36); + assert.deepStrictEqual( + await encoder.decodeMessageData({ + body: buffer, + contentType: "avro/binary+000", + }), + testValue + ); + }); }); From e9a3ec017871f3809ff0dccdc8592f5ecccdb49b Mon Sep 17 00:00:00 2001 From: Timo van Veenendaal Date: Thu, 27 Jan 2022 12:53:33 -0800 Subject: [PATCH 18/26] [Unified recorder] String sanitizer support + sanitizer refactor (#19954) - Fixes #19809 - Part of work towards #18223 The main motivation of this PR was to add support for the new string sanitizers introduced in https://github.com/Azure/azure-sdk-tools/pull/2530. As part of this, I've also tackled some refactoring that will be required for session-level sanitizer support (#18223) where we will be wanting to enable adding sanitizers without access to an instance of the `Recorder` class. While implementing the new sanitizer logic, I refactored the `addSanitizers` method into smaller chunks to make adding additional sanitizers easier. To summarize the changes: * Removed the `Sanitizer` class, instead making the `addSanitizers` function in `sanitizer.ts` take in a `HttpClient` and recording ID as parameter. * Refactored the `addSanitizers` function to call smaller functions for each sanitizer (some of which are a bit FP-style) instead of using if statements + special cases. Hopefully this will make things a bit easier to maintain. * Some other minor refactors (e.g. extracting duplicated `createRecordingRequest` function into a utility). * Add support for the string sanitizers in what I think is the most logical way, but there is a **breaking change**: * When calling `addSanitizers`, instead of specifying `generalRegexSanitizers: [...]` etc., you now specify `generalSanitizers: [...]`. Both regex sanitizers and string sanitizers can be used in this way, for example: ```ts recorder.addSanitizers({ generalSanitizers: [ { regex: true, // Regex matching is enabled by setting the 'regex' option to true. target: ".*regex", value: "sanitized", }, { // Note that `regex` defaults to false and doesn't need to be specified when working with bare strings. // In my experience, this is the most common scenario anyway. target: "Not a regex", value: "sanitized", } ], }); ``` --- sdk/test-utils/recorder/CHANGELOG.md | 30 ++ sdk/test-utils/recorder/MIGRATION.md | 19 +- sdk/test-utils/recorder/src/recorder.ts | 52 +- sdk/test-utils/recorder/src/sanitizer.ts | 467 ++++++++++-------- .../src/utils/createRecordingRequest.ts | 26 + .../recorder/src/utils/envSetupForPlayback.ts | 24 +- sdk/test-utils/recorder/src/utils/utils.ts | 151 +++--- .../recorder/test/sanitizers.spec.ts | 123 ++--- .../recorder/test/testProxyClient.spec.ts | 12 +- .../recorder/test/testProxyTests.spec.ts | 11 +- .../test/core-v1-test.spec.ts | 6 +- .../test/core-v2-test.spec.ts | 2 +- .../test/noOpCredentialTest.spec.ts | 4 +- 13 files changed, 539 insertions(+), 388 deletions(-) create mode 100644 sdk/test-utils/recorder/src/utils/createRecordingRequest.ts diff --git a/sdk/test-utils/recorder/CHANGELOG.md b/sdk/test-utils/recorder/CHANGELOG.md index 46e731205c25..930e98c0fb3f 100644 --- a/sdk/test-utils/recorder/CHANGELOG.md +++ b/sdk/test-utils/recorder/CHANGELOG.md @@ -2,6 +2,36 @@ ## 2.0.0 (Unreleased) +## 2022-01-27 + +Add support for the new string sanitizers, including **breaking changes**: + +- Removed the `Sanitizer` class, instead making the `addSanitizers` function in `sanitizer.ts` take in a `HttpClient` and recording ID as parameter. +- Refactored the `addSanitizers` function to call smaller functions for each sanitizer (some of which are a bit FP-style) instead of using if statements + special cases. Hopefully this will make things a bit easier to maintain. +- Some other minor refactors (e.g. extracting duplicated `createRecordingRequest` function into a utility). +- Add support for the string sanitizers in what I think is the most logical way, but there is a **breaking change**: + - When calling `addSanitizers`, instead of specifying `generalRegexSanitizers: [...]` etc., you now specify `generalSanitizers: [...]`. Both regex sanitizers and string sanitizers can be used in this way, for example: + +```ts +recorder.addSanitizers({ + generalSanitizers: [ + { + regex: true, // Regex matching is enabled by setting the 'regex' option to true. + target: ".*regex", + value: "sanitized", + }, + { + // Note that `regex` defaults to false and doesn't need to be specified when working with bare strings. + // In my experience, this is the most common scenario anyway. + target: "Not a regex", + value: "sanitized", + }, + ], +}); +``` + +[#19954](https://github.com/Azure/azure-sdk-for-js/pull/19954) + ## 2022-01-06 - Renaming the package `@azure-tools/test-recorder-new@1.0.0` as `@azure-tools/test-recorder@2.0.0`. diff --git a/sdk/test-utils/recorder/MIGRATION.md b/sdk/test-utils/recorder/MIGRATION.md index 9456dfba50f5..32cc9bb9a4e8 100644 --- a/sdk/test-utils/recorder/MIGRATION.md +++ b/sdk/test-utils/recorder/MIGRATION.md @@ -15,7 +15,7 @@ The new recorder is version 2.0.0 of the `@azure-tools/test-recorder` package. U // ... "devDependencies": { // ... - "@azure-tools/test-recorder": "^2.0.0", + "@azure-tools/test-recorder": "^2.0.0" } } ``` @@ -152,15 +152,20 @@ In this example, the name of the queue used in the recording is randomized. Howe A powerful feature of the legacy recorder was its `customizationsOnRecordings` option, which allowed for arbitrary replacements to be made to recordings. The new recorder's analog to this is the sanitizer functionality. -### GeneralRegexSanitizer +### General sanitizers -For a simple find/replace, a `GeneralRegexSanitizer` can be used. For example: +For a simple find/replace, `generalSanitizers` can be used. For example: ```ts await recorder.addSanitizers({ - generalRegexSanitizers: [ + generalSanitizers: [ { - regex: "find", // This should be a .NET regular expression as it is passed to the .NET proxy tool + target: "find", // With `regex` unspecified, this matches a plaintext string + value: "replace", + }, + { + regex: true, // Enable regex matching + target: "[Rr]egex", // This is a .NET regular expression that will be compiled by the proxy tool. value: "replace", }, // add additional sanitizers here as required @@ -168,7 +173,9 @@ await recorder.addSanitizers({ }); ``` -This example would replace all instances of `find` in the recording with `replace`. +This example has two sanitizers: +- The first sanitizer replaces all instances of "find" in the recording with "replace". +- The second example demonstrates the use of a regular expression for replacement, where anything matching the .NET regular expression `[Rr]egex` (i.e. "Regex" and "regex") would be replaced with "replace". ### ConnectionStringSanitizer diff --git a/sdk/test-utils/recorder/src/recorder.ts b/sdk/test-utils/recorder/src/recorder.ts index a94fbca7e6c6..6f3168df1551 100644 --- a/sdk/test-utils/recorder/src/recorder.ts +++ b/sdk/test-utils/recorder/src/recorder.ts @@ -3,9 +3,7 @@ import { createDefaultHttpClient, - createPipelineRequest, HttpClient, - HttpMethods, Pipeline, PipelinePolicy, PipelineRequest, @@ -27,7 +25,7 @@ import { Test } from "mocha"; import { sessionFilePath } from "./utils/sessionFilePath"; import { SanitizerOptions } from "./utils/utils"; import { paths } from "./utils/paths"; -import { Sanitizer } from "./sanitizer"; +import { addSanitizers, transformsInfo } from "./sanitizer"; import { handleEnvSetup } from "./utils/envSetupForPlayback"; import { Matcher, setMatcher } from "./matcher"; import { @@ -37,6 +35,7 @@ import { WebResource, WebResourceLike, } from "@azure/core-http"; +import { createRecordingRequest } from "./utils/createRecordingRequest"; /** * This client manages the recorder life cycle and interacts with the proxy-tool to do the recording, @@ -55,7 +54,6 @@ export class Recorder { private stateManager = new RecordingStateManager(); private httpClient?: HttpClient; private sessionFile?: string; - private sanitizer?: Sanitizer; private variables: Record; constructor(private testContext?: Test | undefined) { @@ -68,7 +66,6 @@ export class Recorder { "Unable to determine the recording file path, testContext provided is not defined." ); } - this.sanitizer = new Sanitizer(this.url, this.httpClient); } this.variables = {}; } @@ -113,8 +110,12 @@ export class Recorder { */ async addSanitizers(options: SanitizerOptions): Promise { // If check needed because we only sanitize when the recording is being generated, and we need a recording to apply the sanitizers on. - if (isRecordMode() && ensureExistence(this.sanitizer, "this.sanitizer")) { - return this.sanitizer.addSanitizers(options); + if ( + isRecordMode() && + ensureExistence(this.httpClient, "this.httpClient") && + ensureExistence(this.recordingId, "this.recordingId") + ) { + return addSanitizers(this.httpClient, this.url, this.recordingId, options); } } @@ -135,7 +136,7 @@ export class Recorder { const startUri = `${this.url}${isPlaybackMode() ? paths.playback : paths.record}${ paths.start }`; - const req = this._createRecordingRequest(startUri); + const req = createRecordingRequest(startUri, this.sessionFile, this.recordingId); if (ensureExistence(this.httpClient, "TestProxyHttpClient.httpClient")) { const rsp = await this.httpClient.sendRequest({ @@ -153,12 +154,14 @@ export class Recorder { if (isPlaybackMode()) { this.variables = rsp.bodyAsText ? JSON.parse(rsp.bodyAsText) : {}; } - if (ensureExistence(this.sanitizer, "TestProxyHttpClient.sanitizer")) { - // Setting the recordingId in the sanitizer, - // the sanitizers added will take the recording id and only be part of the current test - this.sanitizer.setRecordingId(this.recordingId); - await handleEnvSetup(options.envSetupForPlayback, this.sanitizer); - } + + await handleEnvSetup( + this.httpClient, + this.url, + this.recordingId, + options.envSetupForPlayback + ); + // Sanitizers to be added only in record mode if (isRecordMode() && options.sanitizerOptions) { // Makes a call to the proxy-tool to add the sanitizers for the current recording id @@ -177,7 +180,7 @@ export class Recorder { this.stateManager.state = "stopped"; if (this.recordingId !== undefined) { const stopUri = `${this.url}${isPlaybackMode() ? paths.playback : paths.record}${paths.stop}`; - const req = this._createRecordingRequest(stopUri); + const req = createRecordingRequest(stopUri, undefined, this.recordingId); req.headers.set("x-recording-save", "true"); if (isRecordMode()) { @@ -211,19 +214,16 @@ export class Recorder { } } - /** - * Adds the recording file and the recording id headers to the requests that are sent to the proxy tool. - * These are required to appropriately save the recordings in the record mode and picking them up in playback. - */ - private _createRecordingRequest(url: string, method: HttpMethods = "POST") { - const req = createPipelineRequest({ url, method }); - if (ensureExistence(this.sessionFile, "sessionFile")) { - req.body = JSON.stringify({ "x-recording-file": this.sessionFile }); + async transformsInfo(): Promise { + if (isLiveMode()) { + throw new RecorderError("Cannot call transformsInfo in live mode"); } - if (this.recordingId !== undefined) { - req.headers.set("x-recording-id", this.recordingId); + + if (ensureExistence(this.httpClient, "this.httpClient")) { + return await transformsInfo(this.httpClient, this.url, this.recordingId!); } - return req; + + throw new RecorderError("Expected httpClient to be defined"); } /** diff --git a/sdk/test-utils/recorder/src/sanitizer.ts b/sdk/test-utils/recorder/src/sanitizer.ts index 9039754ec3ed..b3d29440b2f6 100644 --- a/sdk/test-utils/recorder/src/sanitizer.ts +++ b/sdk/test-utils/recorder/src/sanitizer.ts @@ -1,230 +1,305 @@ import { HttpClient } from "@azure/core-rest-pipeline"; -import { createPipelineRequest, HttpMethods } from "@azure/core-rest-pipeline"; import { getRealAndFakePairs } from "./utils/connectionStringHelpers"; +import { createRecordingRequest } from "./utils/createRecordingRequest"; import { paths } from "./utils/paths"; import { + ConnectionStringSanitizer, + ContinuationSanitizer, + FindReplaceSanitizer, getTestMode, + HeaderSanitizer, isRecordMode, + isStringSanitizer, ProxyToolSanitizers, RecorderError, - RegexSanitizer, - sanitizerKeywordMapping, + RemoveHeaderSanitizer, SanitizerOptions, } from "./utils/utils"; /** - * Sanitizer class to handle communication with the proxy-tool relating to the sanitizers adding/resetting, etc. + * Signature of a function that adds a sanitizer of type T. */ -export class Sanitizer { - constructor(private url: string, private httpClient: HttpClient) {} - private recordingId: string | undefined; - - setRecordingId(recordingId: string): void { - this.recordingId = recordingId; - } - - /** - * Returns the html document of all the available transforms in the proxy-tool - */ - async transformsInfo(): Promise { - if (this.recordingId) { - const infoUri = `${this.url}${paths.info}${paths.available}`; - const req = this._createRecordingRequest(infoUri, "GET"); - if (!this.httpClient) { - throw new RecorderError( - `Something went wrong, Sanitizer.httpClient should not have been undefined in ${getTestMode()} mode.` - ); - } - const rsp = await this.httpClient.sendRequest({ - ...req, - allowInsecureConnection: true, - }); - if (rsp.status !== 200) { - throw new RecorderError("Info request failed."); - } - return rsp.bodyAsText; - } else { - throw new RecorderError( - "Bad state, recordingId is not defined when called transformsInfo()." - ); - } - } - - /** - * addSanitizers adds sanitizers to the current recording. Sanitizers will be applied before recordings are saved. - * - * Takes SanitizerOptions as the input, passes on to the proxy-tool. - */ - async addSanitizers(options: SanitizerOptions): Promise { - if (options.connectionStringSanitizers) { - await Promise.all( - options.connectionStringSanitizers.map((replacer) => - this.addConnectionStringSanitizer(replacer.actualConnString, replacer.fakeConnString) - ) - ); - } +type AddSanitizer = ( + httpClient: HttpClient, + url: string, + recordingId: string, + sanitizer: T +) => Promise; +/** + * Given an AddSanitizer function, create an AddSanitizer function that operates on an array of T, adding + * each sanitizer in the array individually. + */ +const pluralize = + (singular: AddSanitizer): AddSanitizer => + async (httpClient: HttpClient, url: string, recordingId: string, sanitizers: T[]) => { await Promise.all( - ( - [ - // The following sanitizers have similar request bodies and this abstraction avoids duplication - "generalRegexSanitizers", - "bodyKeySanitizers", - "bodyRegexSanitizers", - "headerRegexSanitizers", - "uriRegexSanitizers", - ] as const - ).map((prop) => { - const replacers = options[prop]; - if (replacers) { - return Promise.all( - replacers.map((replacer: RegexSanitizer) => { - if ( - // sanitizers where the "regex" is a required attribute - [ - "bodyKeySanitizers", - "bodyRegexSanitizers", - "generalRegexSanitizers", - "uriRegexSanitizers", - ].includes(prop) && - !replacer.regex - ) { - if (!isRecordMode()) return; - throw new RecorderError( - `Attempted to add an invalid sanitizer - ${JSON.stringify(replacer)}` - ); - } - return this.addSanitizer({ - sanitizer: sanitizerKeywordMapping[prop], - body: JSON.stringify(replacer), - }); - }) - ); - } else return; - }) + sanitizers.map((sanitizer) => singular(httpClient, url, recordingId, sanitizer)) ); + }; - await Promise.all( - ( - [ - // The following sanitizers have similar request bodies and this abstraction avoids duplication - "resetSanitizer", - "oAuthResponseSanitizer", - ] as const - ).map((prop) => { - // TODO: Test - if (options[prop]) { - return this.addSanitizer({ - sanitizer: sanitizerKeywordMapping[prop], - body: undefined, - }); - } else return; - }) - ); +/** + * Makes an AddSanitizer function that passes the sanitizer content directly to the test proxy request body. + */ +const makeAddSanitizer = + (sanitizerName: ProxyToolSanitizers): AddSanitizer> => + async ( + httpClient: HttpClient, + url: string, + recordingId: string, + sanitizer: Record + ) => { + await addSanitizer(httpClient, url, recordingId, { + sanitizer: sanitizerName, + body: sanitizer, + }); + }; - if (options.removeHeaderSanitizer) { - this.addSanitizer({ - sanitizer: "RemoveHeaderSanitizer", - body: JSON.stringify({ - headersForRemoval: options.removeHeaderSanitizer.headersForRemoval.toString(), - }), +/** + * Makes an AddSanitizer function that adds the sanitizer if the value is set to true, + * and otherwise makes no request to the server. Used for ResetSanitizer and OAuthResponseSanitizer. + */ +const makeAddBodilessSanitizer = + (sanitizerName: ProxyToolSanitizers): AddSanitizer => + async (httpClient: HttpClient, url: string, recordingId: string, enable: boolean) => { + if (enable) { + await addSanitizer(httpClient, url, recordingId, { + sanitizer: sanitizerName, + body: undefined, }); } + }; - if (options.continuationSanitizers) { - // TODO: Test - await Promise.all( - options.continuationSanitizers.map((replacer) => - this.addSanitizer({ - sanitizer: "ContinuationSanitizer", - body: JSON.stringify({ - ...replacer, - resetAfterFirst: replacer.resetAfterFirst.toString(), - }), - }) - ) - ); - } - - if (options.uriSubscriptionIdSanitizer) { - await this.addSanitizer({ - sanitizer: "UriSubscriptionIdSanitizer", - body: JSON.stringify(options.uriSubscriptionIdSanitizer), +/** + * Makes an AddSanitizer function for a FindReplaceSanitizer, for example a bodySanitizer. + * Depending on the input FindReplaceSanitizer options, either adds a sanitizer named `regexSanitizerName` + * or `stringSanitizerName`. + */ +const makeAddFindReplaceSanitizer = + ( + regexSanitizerName: ProxyToolSanitizers, + stringSanitizerName: ProxyToolSanitizers + ): AddSanitizer => + async ( + httpClient: HttpClient, + url: string, + recordingId: string, + sanitizer: FindReplaceSanitizer + ): Promise => { + if (isStringSanitizer(sanitizer)) { + await addSanitizer(httpClient, url, recordingId, { + sanitizer: stringSanitizerName, + body: { + target: sanitizer.target, + value: sanitizer.value, + }, + }); + } else { + await addSanitizer(httpClient, url, recordingId, { + sanitizer: regexSanitizerName, + body: { + regex: sanitizer.target, + value: sanitizer.value, + groupForReplace: sanitizer.groupForReplace, + }, }); } + }; + +/** + * Internally, + * - connection strings are parsed and + * - each part of the connection string is mapped with its corresponding fake value + * - GeneralStringSanitizer is applied for each of the parts with the real and fake values that are parsed + */ +async function addConnectionStringSanitizer( + httpClient: HttpClient, + url: string, + recordingId: string, + { actualConnString, fakeConnString }: ConnectionStringSanitizer +): Promise { + if (!actualConnString) { + if (!isRecordMode()) return; + throw new RecorderError( + `Attempted to add an invalid sanitizer - ${JSON.stringify({ + actualConnString: actualConnString, + fakeConnString: fakeConnString, + })}` + ); } + // extract connection string parts and match call + const pairsMatched = getRealAndFakePairs(actualConnString, fakeConnString); + await addSanitizers(httpClient, url, recordingId, { + generalSanitizers: Object.entries(pairsMatched).map(([key, value]) => { + return { value, target: key }; + }), + }); +} - /** - * Internally, - * - connection strings are parsed and - * - each part of the connection string is mapped with its corresponding fake value - * - generalRegexSanitizer is applied for each of the parts with the real and fake values that are parsed - */ - async addConnectionStringSanitizer( - actualConnString: string | undefined, - fakeConnString: string - ): Promise { - if (!actualConnString) { - if (!isRecordMode()) return; - throw new RecorderError( - `Attempted to add an invalid sanitizer - ${JSON.stringify({ - actualConnString: actualConnString, - fakeConnString: fakeConnString, - })}` - ); - } - // extract connection string parts and match call - const pairsMatched = getRealAndFakePairs(actualConnString, fakeConnString); - await this.addSanitizers({ - generalRegexSanitizers: Object.entries(pairsMatched).map(([key, value]) => { - return { value, regex: key }; - }), +/** + * Adds a ContinuationSanitizer with the given options. + */ +async function addContinuationSanitizer( + httpClient: HttpClient, + url: string, + recordingId: string, + sanitizer: ContinuationSanitizer +) { + await addSanitizer(httpClient, url, recordingId, { + sanitizer: "ContinuationSanitizer", + body: { + ...sanitizer, + resetAfterFirst: sanitizer.resetAfterFirst.toString(), + }, + }); +} + +/** + * Adds a RemoveHeaderSanitizer with the given options. + */ +async function addRemoveHeaderSanitizer( + httpClient: HttpClient, + url: string, + recordingId: string, + sanitizer: RemoveHeaderSanitizer +) { + await addSanitizer(httpClient, url, recordingId, { + sanitizer: "RemoveHeaderSanitizer", + body: { + headersForRemoval: sanitizer.headersForRemoval.toString(), + }, + }); +} + +/** + * Adds a HeaderRegexSanitizer or HeaderStringSanitizer. + * + * HeaderSanitizer is a special case of FindReplaceSanitizer where a header name ('key') must be provided. + * Additionally, the 'target' option is not required. If target is unspecified, the header's value will always + * be replaced. + */ +async function addHeaderSanitizer( + httpClient: HttpClient, + url: string, + recordingId: string, + sanitizer: HeaderSanitizer +) { + if (sanitizer.regex || !sanitizer.target) { + await addSanitizer(httpClient, url, recordingId, { + sanitizer: "HeaderRegexSanitizer", + body: { + key: sanitizer.key, + value: sanitizer.value, + regex: sanitizer.target, + groupForReplace: sanitizer.groupForReplace, + }, + }); + } else { + await addSanitizer(httpClient, url, recordingId, { + sanitizer: "HeaderStringSanitizer", + body: { + key: sanitizer.key, + target: sanitizer.target, + value: sanitizer.value, + }, }); } +} - /** - * Atomic method to add a simple sanitizer. - */ - private async addSanitizer(options: { - sanitizer: ProxyToolSanitizers; - body: string | undefined; - }): Promise { - if (this.recordingId !== undefined) { - const uri = `${this.url}${paths.admin}${ - options.sanitizer !== "Reset" ? paths.addSanitizer : paths.reset - }`; - const req = this._createRecordingRequest(uri); - if (options.sanitizer !== "Reset") { - req.headers.set("x-abstraction-identifier", options.sanitizer); - } - req.headers.set("Content-Type", "application/json"); - req.body = options.body; - if (!this.httpClient) { - throw new RecorderError( - `Something went wrong, Recorder.httpClient should not have been undefined in ${getTestMode()} mode.` - ); - } - const rsp = await this.httpClient.sendRequest({ - ...req, - allowInsecureConnection: true, - }); - if (rsp.status !== 200) { - throw new RecorderError("addSanitizer request failed."); +const addSanitizersActions: { + [K in keyof SanitizerOptions]: AddSanitizer>; +} = { + generalSanitizers: pluralize( + makeAddFindReplaceSanitizer("GeneralRegexSanitizer", "GeneralStringSanitizer") + ), + bodySanitizers: pluralize( + makeAddFindReplaceSanitizer("BodyRegexSanitizer", "BodyStringSanitizer") + ), + headerSanitizers: pluralize(addHeaderSanitizer), + uriSanitizers: pluralize(makeAddFindReplaceSanitizer("UriRegexSanitizer", "UriStringSanitizer")), + connectionStringSanitizers: pluralize(addConnectionStringSanitizer), + bodyKeySanitizers: pluralize(makeAddSanitizer("BodyKeySanitizer")), + continuationSanitizers: pluralize(addContinuationSanitizer), + removeHeaderSanitizer: addRemoveHeaderSanitizer, + oAuthResponseSanitizer: makeAddBodilessSanitizer("OAuthResponseSanitizer"), + uriSubscriptionIdSanitizer: makeAddSanitizer("UriSubscriptionIdSanitizer"), + resetSanitizer: makeAddBodilessSanitizer("Reset"), +}; + +export async function addSanitizers( + httpClient: HttpClient, + url: string, + recordingId: string, + options: SanitizerOptions +): Promise { + await Promise.all( + Object.entries(options).map(([key, sanitizer]) => { + const action = addSanitizersActions[key as keyof SanitizerOptions]; + if (!action) { + throw new RecorderError(`Sanitizer ${key} not implemented`); } - } else { - throw new RecorderError("Bad state, recordingId is not defined when called addSanitizer()."); - } + + return action(httpClient, url, recordingId, sanitizer); + }) + ); +} + +/** + * Atomic method to add a simple sanitizer. + */ +async function addSanitizer( + httpClient: HttpClient, + url: string, + recordingId: string, + options: { + sanitizer: ProxyToolSanitizers; + body: Record | undefined; + } +): Promise { + const uri = `${url}${paths.admin}${ + options.sanitizer !== "Reset" ? paths.addSanitizer : paths.reset + }`; + const req = createRecordingRequest(uri, recordingId); + if (options.sanitizer !== "Reset") { + req.headers.set("x-abstraction-identifier", options.sanitizer); } + req.headers.set("Content-Type", "application/json"); + req.body = options.body !== undefined ? JSON.stringify(options.body) : undefined; - /** - * Adds the recording id headers to the requests that are sent to the proxy tool. - * These are required to appropriately save the recordings in the record mode and picking them up in playback. - */ - private _createRecordingRequest(url: string, method: HttpMethods = "POST") { - const req = createPipelineRequest({ url: url, method }); - if (this.recordingId !== undefined) { - req.headers.set("x-recording-id", this.recordingId); + const rsp = await httpClient.sendRequest({ + ...req, + allowInsecureConnection: true, + }); + if (rsp.status !== 200) { + throw new RecorderError("addSanitizer request failed."); + } +} + +/** + * Returns the html document of all the available transforms in the proxy-tool + */ +export async function transformsInfo( + httpClient: HttpClient, + url: string, + recordingId: string +): Promise { + if (recordingId) { + const infoUri = `${url}${paths.info}${paths.available}`; + const req = createRecordingRequest(infoUri, undefined, recordingId, "GET"); + if (!httpClient) { + throw new RecorderError( + `Something went wrong, Sanitizer.httpClient should not have been undefined in ${getTestMode()} mode.` + ); + } + const rsp = await httpClient.sendRequest({ + ...req, + allowInsecureConnection: true, + }); + if (rsp.status !== 200) { + throw new RecorderError("Info request failed."); } - return req; + return rsp.bodyAsText; + } else { + throw new RecorderError("Bad state, recordingId is not defined when called transformsInfo()."); } } diff --git a/sdk/test-utils/recorder/src/utils/createRecordingRequest.ts b/sdk/test-utils/recorder/src/utils/createRecordingRequest.ts new file mode 100644 index 000000000000..74ffb6ec59c7 --- /dev/null +++ b/sdk/test-utils/recorder/src/utils/createRecordingRequest.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { createPipelineRequest, HttpMethods } from "@azure/core-rest-pipeline"; + +/** + * Adds the recording id headers to the requests that are sent to the proxy tool. + * These are required to appropriately save the recordings in the record mode and picking them up in playback. + */ +export function createRecordingRequest( + url: string, + sessionFile?: string, + recordingId?: string, + method: HttpMethods = "POST" +) { + const req = createPipelineRequest({ url: url, method }); + + if (sessionFile !== undefined) { + req.body = JSON.stringify({ "x-recording-file": sessionFile }); + } + + if (recordingId !== undefined) { + req.headers.set("x-recording-id", recordingId); + } + return req; +} diff --git a/sdk/test-utils/recorder/src/utils/envSetupForPlayback.ts b/sdk/test-utils/recorder/src/utils/envSetupForPlayback.ts index b15c08d9ad11..08c375daf054 100644 --- a/sdk/test-utils/recorder/src/utils/envSetupForPlayback.ts +++ b/sdk/test-utils/recorder/src/utils/envSetupForPlayback.ts @@ -1,9 +1,15 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { Sanitizer } from "../sanitizer"; +import { HttpClient } from "@azure/core-rest-pipeline"; +import { addSanitizers } from "../sanitizer"; import { env } from "./env"; -import { isPlaybackMode, isRecordMode, setEnvironmentVariables, RegexSanitizer } from "./utils"; +import { + isPlaybackMode, + isRecordMode, + setEnvironmentVariables, + FindReplaceSanitizer, +} from "./utils"; /** * Supposed to be used in record and playback modes. @@ -13,8 +19,10 @@ import { isPlaybackMode, isRecordMode, setEnvironmentVariables, RegexSanitizer } * 2. If the env variables are present in the recordings as plain strings, they will be replaced with the provided values in record mode */ export async function handleEnvSetup( - envSetupForPlayback: Record, - sanitizer: Sanitizer + httpClient: HttpClient, + url: string, + recordingId: string, + envSetupForPlayback: Record ): Promise { if (envSetupForPlayback) { if (isPlaybackMode()) { @@ -23,15 +31,15 @@ export async function handleEnvSetup( } else if (isRecordMode()) { // If the env variables are present in the recordings as plain strings, they will be replaced with the provided values in record mode - const generalRegexSanitizers: RegexSanitizer[] = []; + const generalSanitizers: FindReplaceSanitizer[] = []; for (const [key, value] of Object.entries(envSetupForPlayback)) { const envKey = env[key]; if (envKey) { - generalRegexSanitizers.push({ regex: envKey, value }); + generalSanitizers.push({ target: envKey, value }); } } - await sanitizer.addSanitizers({ - generalRegexSanitizers, + await addSanitizers(httpClient, url, recordingId, { + generalSanitizers, }); } } diff --git a/sdk/test-utils/recorder/src/utils/utils.ts b/sdk/test-utils/recorder/src/utils/utils.ts index 8e9d8dcc99b8..8e88c4ed1bf8 100644 --- a/sdk/test-utils/recorder/src/utils/utils.ts +++ b/sdk/test-utils/recorder/src/utils/utils.ts @@ -54,56 +54,70 @@ export class RecordingStateManager { */ export type ProxyToolSanitizers = | "GeneralRegexSanitizer" + | "GeneralStringSanitizer" | "RemoveHeaderSanitizer" | "BodyKeySanitizer" | "BodyRegexSanitizer" + | "BodyStringSanitizer" | "ContinuationSanitizer" | "HeaderRegexSanitizer" + | "HeaderStringSanitizer" | "OAuthResponseSanitizer" | "UriRegexSanitizer" + | "UriStringSanitizer" | "UriSubscriptionIdSanitizer" | "Reset"; -/** - * Maps the sanitizer options to the header value expected by the proxy-tool - * - * Keys = Keys of the SanitizerOptions(excluding `connectionStringSanitizers`) - * Values = Keywords that should be passed as part of the headers to the proxy-tool to be able to leverage the sanitizer. - */ -export const sanitizerKeywordMapping: Record< - Exclude, - ProxyToolSanitizers -> = { - bodyKeySanitizers: "BodyKeySanitizer", - bodyRegexSanitizers: "BodyRegexSanitizer", - continuationSanitizers: "ContinuationSanitizer", - generalRegexSanitizers: "GeneralRegexSanitizer", - headerRegexSanitizers: "HeaderRegexSanitizer", - oAuthResponseSanitizer: "OAuthResponseSanitizer", - removeHeaderSanitizer: "RemoveHeaderSanitizer", - resetSanitizer: "Reset", - uriRegexSanitizers: "UriRegexSanitizer", - uriSubscriptionIdSanitizer: "UriSubscriptionIdSanitizer", -}; - /** * This sanitizer offers a general regex replace across request/response Body, Headers, and URI. For the body, this means regex applying to the raw JSON. */ export interface RegexSanitizer { + /** + * Set to true to show that regex replacement is to be used. + */ + regex: true; + /** * The substitution value. */ value: string; + /** * A regex. Can be defined as a simple regex replace OR if groupForReplace is set, a substitution operation. */ - regex?: string; + target: string; /** * The capture group that needs to be operated upon. Do not set if you're invoking a simple replacement operation. */ groupForReplace?: string; } +/** + * A sanitizer that performs a simple find/replace based on a plain string. + */ +export interface StringSanitizer { + /** + * If regex is set to false or is not specified, plain-text matching will be performed. + */ + regex?: false; + + /** + * The string to be replaced. + */ + target: string; + + /** + * The value that the string should be replaced with. + */ + value: string; +} + +export type FindReplaceSanitizer = RegexSanitizer | StringSanitizer; + +export function isStringSanitizer(sanitizer: FindReplaceSanitizer): sanitizer is StringSanitizer { + return !sanitizer.regex; +} + /** * This sanitizer offers regex update of a specific JTokenPath. * @@ -115,12 +129,18 @@ export interface RegexSanitizer { * * If the body is NOT a JSON object, this sanitizer will NOT be applied. */ -interface BodyKeySanitizer extends RegexSanitizer { +type BodyKeySanitizer = { + regex?: string; + + value?: string; + + groupForReplace?: string; + /** * The SelectToken path (which could possibly match multiple entries) that will be used to select JTokens for value replacement. */ jsonPath: string; -} +}; /** * Can be used for multiple purposes: @@ -129,19 +149,22 @@ interface BodyKeySanitizer extends RegexSanitizer { * 2) To do a simple regex replace operation, define arguments "key", "value", and "regex" * 3) To do a targeted substitution of a specific group, define all arguments "key", "value", and "regex" */ -interface HeaderRegexSanitizer extends RegexSanitizer { - /** - * The name of the header we're operating against. - */ +export interface HeaderSanitizer { key: string; + + regex?: boolean; + target?: string; + value?: string; + groupForReplace?: string; } + /** * Internally, * - connection strings are parsed and * - each part of the connection string is mapped with its corresponding fake value * - `generalRegexSanitizer` is applied for each of the parts with the real and fake values that are parsed */ -interface ConnectionStringSanitizer { +export interface ConnectionStringSanitizer { /** * Real connection string with all the secrets */ @@ -152,6 +175,16 @@ interface ConnectionStringSanitizer { fakeConnString: string; } +export interface ContinuationSanitizer { + key: string; + method?: string; + resetAfterFirst: boolean; +} + +export interface RemoveHeaderSanitizer { + headersForRemoval: string[]; +} + /** * Test-proxy tool supports "extensions" or "customizations" to the recording experience. * This means that non-default sanitizations such as the generalized regex find/replace on different parts of the recordings in various ways are possible. @@ -160,14 +193,8 @@ export interface SanitizerOptions { /** * This sanitizer offers a general regex replace across request/response Body, Headers, and URI. For the body, this means regex applying to the raw JSON. */ - generalRegexSanitizers?: RegexSanitizer[]; - /** - * Internally, - * - connection strings are parsed and - * - each part of the connection string is mapped with its corresponding fake value - * - `generalRegexSanitizer` is applied for each of the parts with the real and fake values that are parsed - */ - connectionStringSanitizers?: ConnectionStringSanitizer[]; + generalSanitizers?: FindReplaceSanitizer[]; + /** * This sanitizer offers regex replace within a returned body. * @@ -176,7 +203,27 @@ export interface SanitizerOptions { * * Regardless, there are examples present in `recorder-new/test/testProxyTests.spec.ts`. */ - bodyRegexSanitizers?: RegexSanitizer[]; + bodySanitizers?: FindReplaceSanitizer[]; + /** + * Can be used for multiple purposes: + * + * 1) To replace a key with a specific value, do not set "regex" value. + * 2) To do a simple regex replace operation, define arguments "key", "value", and "regex" + * 3) To do a targeted substitution of a specific group, define all arguments "key", "value", and "regex" + */ + headerSanitizers?: HeaderSanitizer[]; + /** + * General use sanitizer for cleaning URIs via regex. Runs a regex replace on the member of your choice. + */ + uriSanitizers?: FindReplaceSanitizer[]; + /** + * Internally, + * - connection strings are parsed and + * - each part of the connection string is mapped with its corresponding fake value + * - `generalRegexSanitizer` is applied for each of the parts with the real and fake values that are parsed + */ + connectionStringSanitizers?: ConnectionStringSanitizer[]; + /** * This sanitizer offers regex update of a specific JTokenPath. * @@ -189,37 +236,24 @@ export interface SanitizerOptions { * If the body is NOT a JSON object, this sanitizer will NOT be applied. */ bodyKeySanitizers?: BodyKeySanitizer[]; + /** * TODO * Has a bug, not implemented fully. */ - continuationSanitizers?: Array<{ key: string; method?: string; resetAfterFirst: boolean }>; - /** - * Can be used for multiple purposes: - * - * 1) To replace a key with a specific value, do not set "regex" value. - * 2) To do a simple regex replace operation, define arguments "key", "value", and "regex" - * 3) To do a targeted substitution of a specific group, define all arguments "key", "value", and "regex" - */ - headerRegexSanitizers?: HeaderRegexSanitizer[]; - /** - * General use sanitizer for cleaning URIs via regex. Runs a regex replace on the member of your choice. - */ - uriRegexSanitizers?: RegexSanitizer[]; + continuationSanitizers?: ContinuationSanitizer[]; + /** * A simple sanitizer that should be used to clean out one or multiple headers by their key. * Removes headers from before saving a recording. */ - removeHeaderSanitizer?: { - /** - * Array of header names. - */ - headersForRemoval: string[]; - }; + removeHeaderSanitizer?: RemoveHeaderSanitizer; + /** * TODO: To be tested with scenarios, not to be used yet. */ oAuthResponseSanitizer?: boolean; + /** * This sanitizer relies on UriRegexSanitizer to replace real subscriptionIds within a URI w/ a default or configured fake value. * This sanitizer is targeted using the regex "/subscriptions/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})". This is not a setting that can be changed for this sanitizer. For full regex support, take a look at UriRegexSanitizer. You CAN modify the value that the subscriptionId is replaced WITH however. @@ -230,6 +264,7 @@ export interface SanitizerOptions { */ value: string; }; + /** * This clears the sanitizers that are added. */ diff --git a/sdk/test-utils/recorder/test/sanitizers.spec.ts b/sdk/test-utils/recorder/test/sanitizers.spec.ts index 937d79dbf4e2..17b4ff498423 100644 --- a/sdk/test-utils/recorder/test/sanitizers.spec.ts +++ b/sdk/test-utils/recorder/test/sanitizers.spec.ts @@ -2,9 +2,8 @@ // Licensed under the MIT license. import { ServiceClient } from "@azure/core-client"; -import { expect } from "chai"; -import { env, isPlaybackMode, Recorder } from "../src"; -import { isRecordMode, RecorderError, TestMode } from "../src/utils/utils"; +import { isPlaybackMode, Recorder } from "../src"; +import { TestMode } from "../src/utils/utils"; import { getTestServerUrl, makeRequestAndVerifyResponse, setTestMode } from "./utils/utils"; // These tests require the following to be running in parallel @@ -31,17 +30,46 @@ import { getTestServerUrl, makeRequestAndVerifyResponse, setTestMode } from "./u describe("Sanitizers - functionalities", () => { it("GeneralRegexSanitizer", async () => { - env.SECRET_INFO = "abcdef"; - const fakeSecretInfo = "fake_secret_info"; await recorder.start({ - envSetupForPlayback: { - SECRET_INFO: fakeSecretInfo, + envSetupForPlayback: {}, + sanitizerOptions: { + generalSanitizers: [ + { + regex: true, + target: "abc+def", + value: "fake_secret_info", + }, + ], + }, + }); + await makeRequestAndVerifyResponse( + client, + { + path: `/sample_response/abcdef`, + body: "abcdef", + method: "GET", + }, + { val: "I am the answer!" } + ); + }); + + it("GeneralStringSanitizer", async () => { + await recorder.start({ + envSetupForPlayback: {}, + sanitizerOptions: { + generalSanitizers: [ + { + target: "abcdef", + value: "fake_secret_info", + }, + ], }, - }); // Adds generalRegexSanitizers by default based on envSetupForPlayback + }); await makeRequestAndVerifyResponse( client, { - path: `/sample_response/${env.SECRET_INFO}`, + path: `/sample_response/abcdef`, + body: "abcdef", method: "GET", }, { val: "I am the answer!" } @@ -105,9 +133,10 @@ import { getTestServerUrl, makeRequestAndVerifyResponse, setTestMode } from "./u await recorder.start({ envSetupForPlayback: {}, sanitizerOptions: { - bodyRegexSanitizers: [ + bodySanitizers: [ { - regex: "(.*)&SECRET=(?[^&]*)&(.*)", + regex: true, + target: "(.*)&SECRET=(?[^&]*)&(.*)", value: fakeSecretValue, groupForReplace: "secret_content", }, @@ -129,15 +158,15 @@ import { getTestServerUrl, makeRequestAndVerifyResponse, setTestMode } from "./u ); }); - it("UriRegexSanitizer", async () => { + it("UriSanitizer", async () => { const secretEndpoint = "host.docker.internal"; const fakeEndpoint = "fake_endpoint"; await recorder.start({ envSetupForPlayback: {}, sanitizerOptions: { - uriRegexSanitizers: [ + uriSanitizers: [ { - regex: secretEndpoint, + target: secretEndpoint, value: fakeEndpoint, }, ], @@ -224,7 +253,7 @@ import { getTestServerUrl, makeRequestAndVerifyResponse, setTestMode } from "./u await recorder.start({ envSetupForPlayback: {}, sanitizerOptions: { - headerRegexSanitizers: [ + headerSanitizers: [ { key: "your_uuid", value: sanitizedValue, @@ -266,9 +295,10 @@ import { getTestServerUrl, makeRequestAndVerifyResponse, setTestMode } from "./u await recorder.start({ envSetupForPlayback: {}, sanitizerOptions: { - bodyRegexSanitizers: [ + bodySanitizers: [ { - regex: "(.*)&SECRET=(?[^&]*)&(.*)", + regex: true, + target: "(.*)&SECRET=(?[^&]*)&(.*)", value: fakeSecretValue, groupForReplace: "secret_content", }, @@ -307,64 +337,5 @@ import { getTestServerUrl, makeRequestAndVerifyResponse, setTestMode } from "./u ); }); }); - - describe("Sanitizers - handling undefined", () => { - beforeEach(async () => { - await recorder.start({ envSetupForPlayback: {} }); - }); - - const cases = [ - { - options: { - connectionStringSanitizers: [ - { actualConnString: undefined, fakeConnString: "a=b;c=d" }, - ], - generalRegexSanitizers: [{ regex: undefined, value: "fake-value" }], - }, - title: "all sanitizers are undefined", - type: "negative", - }, - { - options: { - connectionStringSanitizers: [ - { actualConnString: undefined, fakeConnString: "a=b;c=d" }, - { actualConnString: "1=2,3=4", fakeConnString: "a=b;c=d" }, - ], - generalRegexSanitizers: [{ regex: undefined, value: "fake-value" }], - }, - title: "partial sanitizers are undefined", - type: "negative", - }, - { - options: { - connectionStringSanitizers: [ - { actualConnString: "1=2,3=4", fakeConnString: "a=b;c=d" }, - ], - generalRegexSanitizers: [{ regex: "value", value: "fake-value" }], - }, - title: "all sanitizers are defined", - type: "positive", - }, - ]; - - cases.forEach((testCase) => { - it(`case - ${testCase.title}`, async () => { - try { - await recorder.addSanitizers(testCase.options); - throw new Error("error was not thrown from addSanitizers call"); - } catch (error) { - if (isRecordMode() && testCase.type === "negative") { - expect((error as RecorderError).message).includes( - `Attempted to add an invalid sanitizer` - ); - } else { - expect((error as RecorderError).message).includes( - `error was not thrown from addSanitizers call` - ); - } - } - }); - }); - }); }); }); diff --git a/sdk/test-utils/recorder/test/testProxyClient.spec.ts b/sdk/test-utils/recorder/test/testProxyClient.spec.ts index ca31b1e547ca..7d8294e099fa 100644 --- a/sdk/test-utils/recorder/test/testProxyClient.spec.ts +++ b/sdk/test-utils/recorder/test/testProxyClient.spec.ts @@ -9,6 +9,7 @@ import { } from "@azure/core-rest-pipeline"; import { expect } from "chai"; import { env, Recorder } from "../src"; +import { createRecordingRequest } from "../src/utils/createRecordingRequest"; import { getTestMode, isLiveMode, RecorderError, RecordingStateManager } from "../src/utils/utils"; const testRedirectedRequest = ( @@ -275,10 +276,13 @@ describe("TestProxyClient functions", () => { }); }); - describe("_createRecordingRequest", () => { - it("_createRecordingRequest adds the recording-file and recording-id headers", () => { - client.recordingId = "dummy-recording-id"; - const returnedRequest = client["_createRecordingRequest"](initialRequest.url); + describe("createRecordingRequest", () => { + it("createRecordingRequest adds the recording-file and recording-id headers", () => { + const returnedRequest = createRecordingRequest( + initialRequest.url, + client["sessionFile"], + client.recordingId + ); expect(returnedRequest.url).to.equal(initialRequest.url); expect(returnedRequest.method).to.equal("POST"); expect(returnedRequest.body).not.to.be.undefined; diff --git a/sdk/test-utils/recorder/test/testProxyTests.spec.ts b/sdk/test-utils/recorder/test/testProxyTests.spec.ts index 5a7c239621b8..a9cb6f3d6f05 100644 --- a/sdk/test-utils/recorder/test/testProxyTests.spec.ts +++ b/sdk/test-utils/recorder/test/testProxyTests.spec.ts @@ -2,8 +2,8 @@ // Licensed under the MIT license. import { ServiceClient } from "@azure/core-client"; -import { isLiveMode, isPlaybackMode, Recorder } from "../src"; -import { TestMode } from "../src/utils/utils"; +import { isPlaybackMode, Recorder } from "../src"; +import { isLiveMode, TestMode } from "../src/utils/utils"; import { getTestServerUrl, makeRequestAndVerifyResponse, setTestMode } from "./utils/utils"; // These tests require the following to be running in parallel @@ -111,12 +111,7 @@ import { getTestServerUrl, makeRequestAndVerifyResponse, setTestMode } from "./u it("transformsInfo()", async () => { if (!isLiveMode()) { await recorder.start({ envSetupForPlayback: {} }); - - if (!recorder["sanitizer"]) { - throw new Error("expected recorder.sanitizer to be defined at this point"); - } - - await recorder["sanitizer"].transformsInfo(); + await recorder.transformsInfo(); } }); }); diff --git a/sdk/test-utils/testing-recorder-new/test/core-v1-test.spec.ts b/sdk/test-utils/testing-recorder-new/test/core-v1-test.spec.ts index 32d9f0396cc7..8c7ec7ca5971 100644 --- a/sdk/test-utils/testing-recorder-new/test/core-v1-test.spec.ts +++ b/sdk/test-utils/testing-recorder-new/test/core-v1-test.spec.ts @@ -16,13 +16,13 @@ const recorderOptions: RecorderStartOptions = { const getSanitizerOptions = () => { return { - generalRegexSanitizers: [ + generalSanitizers: [ { - regex: assertEnvironmentVariable("STORAGE_SAS_URL").split("/")[2], + target: assertEnvironmentVariable("STORAGE_SAS_URL").split("/")[2], value: fakeSASUrl.split("/")[2], }, { - regex: assertEnvironmentVariable("STORAGE_SAS_URL").split("/")[3].split("?")[1], + target: assertEnvironmentVariable("STORAGE_SAS_URL").split("/")[3].split("?")[1], value: fakeSASUrl.split("/")[3].split("?")[1], }, ], diff --git a/sdk/test-utils/testing-recorder-new/test/core-v2-test.spec.ts b/sdk/test-utils/testing-recorder-new/test/core-v2-test.spec.ts index 99293a53e441..0a8eda0a4a42 100644 --- a/sdk/test-utils/testing-recorder-new/test/core-v2-test.spec.ts +++ b/sdk/test-utils/testing-recorder-new/test/core-v2-test.spec.ts @@ -15,7 +15,7 @@ const sanitizerOptions: SanitizerOptions = { }, ], removeHeaderSanitizer: { headersForRemoval: ["X-Content-Type-Options"] }, - generalRegexSanitizers: [{ regex: "abc", value: "fake_abc" }], + generalSanitizers: [{ target: "abc", value: "fake_abc" }], }; const recorderOptions: RecorderStartOptions = { diff --git a/sdk/test-utils/testing-recorder-new/test/noOpCredentialTest.spec.ts b/sdk/test-utils/testing-recorder-new/test/noOpCredentialTest.spec.ts index a34afb135df0..2238820bbd75 100644 --- a/sdk/test-utils/testing-recorder-new/test/noOpCredentialTest.spec.ts +++ b/sdk/test-utils/testing-recorder-new/test/noOpCredentialTest.spec.ts @@ -16,9 +16,9 @@ const getRecorderStartOptions = (): RecorderStartOptions => { AZURE_TENANT_ID: "azuretenantid", }, sanitizerOptions: { - bodyRegexSanitizers: [ + bodySanitizers: [ { - regex: env.TABLES_URL ? encodeURIComponent(env.TABLES_URL) : undefined, + target: encodeURIComponent(env.TABLES_URL ?? ""), value: encodeURIComponent(`https://fakeaccount.table.core.windows.net`), }, ], From e8569bb4678d45ce4a06ad6d4922032d43dd79e0 Mon Sep 17 00:00:00 2001 From: Maor Leger Date: Thu, 27 Jan 2022 12:59:05 -0800 Subject: [PATCH 19/26] [KeyVault] - Added immutable flag to key release policy (#20090) ### Packages impacted by this PR @azure/keyvault-keys ### Issues associated with this PR Resolves #19857 ### Describe the problem that is addressed by this PR Now that this flag has been added we can regenerate code and add support for immutable key release policies. Once a policy is marked immutable it can no longer be modified. ### Are there test cases added in this PR? _(If not, why?)_ Yes, I debated whether I should also add a test case for "create a key, then update the release policy to be immutable, then try to change it" but it wouldn't drive any code so I skipped it. Do note that since MHSM does not currently support this flag I was unable to add a test for it for MHSM, but I will create an issue to add that in later. --- sdk/keyvault/keyvault-keys/CHANGELOG.md | 2 + ..._updating_an_immutable_release_policy.json | 133 +++++++ ...en_updating_an_immutable_release_policy.js | 244 +++++++++++++ .../keyvault-keys/review/keyvault-keys.api.md | 1 + .../src/cryptographyClientModels.ts | 36 +- .../src/generated/keyVaultClient.ts | 329 ++++++++---------- .../src/generated/keyVaultClientContext.ts | 2 +- .../src/generated/models/index.ts | 194 ++++------- .../src/generated/models/mappers.ts | 65 ++-- .../src/generated/models/parameters.ts | 22 +- sdk/keyvault/keyvault-keys/src/index.ts | 8 +- sdk/keyvault/keyvault-keys/src/keysModels.ts | 3 + sdk/keyvault/keyvault-keys/swagger/README.md | 4 +- .../test/public/keyClient.spec.ts | 38 ++ 14 files changed, 709 insertions(+), 372 deletions(-) create mode 100644 sdk/keyvault/keyvault-keys/recordings/browsers/keys_client__create_read_update_and_delete_operations_releasekey/recording_errors_when_updating_an_immutable_release_policy.json create mode 100644 sdk/keyvault/keyvault-keys/recordings/node/keys_client__create_read_update_and_delete_operations_releasekey/recording_errors_when_updating_an_immutable_release_policy.js diff --git a/sdk/keyvault/keyvault-keys/CHANGELOG.md b/sdk/keyvault/keyvault-keys/CHANGELOG.md index 8f62730f26d7..bc1740bcfc1e 100644 --- a/sdk/keyvault/keyvault-keys/CHANGELOG.md +++ b/sdk/keyvault/keyvault-keys/CHANGELOG.md @@ -4,6 +4,8 @@ ### Features Added +- Added `KeyReleasePolicy#immutable` flag to support immutable release policies. Once a release policy is marked as immutable, it can no longer be modified. + ### Breaking Changes ### Bugs Fixed diff --git a/sdk/keyvault/keyvault-keys/recordings/browsers/keys_client__create_read_update_and_delete_operations_releasekey/recording_errors_when_updating_an_immutable_release_policy.json b/sdk/keyvault/keyvault-keys/recordings/browsers/keys_client__create_read_update_and_delete_operations_releasekey/recording_errors_when_updating_an_immutable_release_policy.json new file mode 100644 index 000000000000..aa2dda82f73b --- /dev/null +++ b/sdk/keyvault/keyvault-keys/recordings/browsers/keys_client__create_read_update_and_delete_operations_releasekey/recording_errors_when_updating_an_immutable_release_policy.json @@ -0,0 +1,133 @@ +{ + "recordings": [ + { + "method": "GET", + "url": "https://skr_attestation.azure.net//generate-test-token", + "query": {}, + "requestBody": null, + "status": 200, + "response": "{\"token\":\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjYybHRKM0dSa3hWVC1fdkQ2dWJ4LWdHWUZIWU5pWE1WZ29sSzU5NzEyVzAiLCJqa3UiOiJodHRwczovL21hbGVnZWltbXV0YWJsZTJzaXRlLmF6dXJld2Vic2l0ZXMubmV0L2tleXMifQ.eyJpc3MiOiJodHRwczovL21hbGVnZWltbXV0YWJsZTJzaXRlLmF6dXJld2Vic2l0ZXMubmV0LyIsInNkay10ZXN0Ijp0cnVlLCJ4LW1zLWluaXR0aW1lIjp7fSwieC1tcy1ydW50aW1lIjp7ImtleXMiOlt7Imt0eSI6IlJTQSIsImtpZCI6ImZha2UtcmVsZWFzZS1rZXkiLCJ1c2UiOiJlbmMiLCJlIjoiQVFBQiIsIm4iOiJuaVNVajF1OC1MTEpVNUlyQmJhUjRvZlRoNWdpdjN1eGt1OWNCX01RUmZnb245WW5MdmtpS1V1b1lWaHljNW5TNlBlVGdSdTE3eTU3MUUtU3BidTF2Qm1iUDhQVXEwOTlLS085YTAxTzJCVFVaU0xFRWljdEgtcDl4Z293ck5ibFVUUndydGxKTEFaelBwTmt3eFpRcVp2Tk5XVVdPWEZSVDNHdE1XZjhUeVIzUGVKUTNBeVdqRFRXZlhuNzA1MzVoM3RWWFlfUkN3emZiSm93SUxsT21QSV9qYVpKb2dYLXRzTUM4WVl6YnRIQ1FCYVItX21yS3puQmtodUpQRW0zZWRwSWJGSWNaNmR1a2tneDFBVDNWeHlNTExZNEdyX3dQOU1Pc3paTHRSa0xidjJkcWl0TEtjTmpZclVEM002aUhQRHM4S3hsTUVDOGUtV2E0eVhVaXcifV19LCJtYWEtZWhkIjoic2RrLXRlc3QiLCJpYXQiOjE2NDMyNDMxNjQsImV4cCI6MTY0Mzg0Nzk2NH0.rPB5v_dqjxbACcSNa6E6GYJ0sKAQGRXTBK2ORh3uHyAqA-dY2A8qMG5YIsSGu9fEgGzcuzrZWQ_drXDuh7XT9QaLvQcB9Sf8hneNIxH0Ta1g0ZT_zRSThogUenkTQkrjCNT_NP8XEZEzkNkiVxHoqkyyeF6bEXC4J2oQqIeDaS7dVo8kAUSIguk8HpEg8-1l6lyHyqi2b6dRRweOL6i1vum7mWH-nARTzhHSgWw-9S16EMwgrecnkRbDChzlks5UkY2H9xjX7CUguu9y9KKnS-FNE_5pudTZrTmKxNKEttQXyFWvFAS92e43zDDjHJpINNip_QRitLRsYkj4LqctVw\"}", + "responseHeaders": { + "content-length": "1321", + "content-type": "application/json; charset=utf-8", + "date": "Thu, 27 Jan 2022 00:26:03 GMT", + "etag": "W/\"529-Vb6JWe49+bPeOvodsLjMDMMZXJ0\"", + "x-powered-by": "Express" + } + }, + { + "method": "POST", + "url": "https://keyvault_name.vault.azure.net/keys/immutablerelease164324316470603193/create", + "query": { + "api-version": "7.3-preview" + }, + "requestBody": "", + "status": 401, + "response": "{\"error\":{\"code\":\"Unauthorized\",\"message\":\"AKV10000: Request is missing a Bearer or PoP token.\"}}", + "responseHeaders": { + "cache-control": "no-cache", + "content-length": "97", + "content-type": "application/json; charset=utf-8", + "date": "Thu, 27 Jan 2022 00:26:04 GMT", + "expires": "-1", + "pragma": "no-cache", + "strict-transport-security": "max-age=31536000;includeSubDomains", + "www-authenticate": "Bearer authorization=\"https://login.windows.net/12345678-1234-1234-1234-123456789012\", resource=\"https://vault.azure.net\"", + "x-content-type-options": "nosniff", + "x-ms-client-request-id": "125ae0a6-2110-45ef-b1b5-6fbae734d8ee", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=50.35.229.43;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus2", + "x-ms-keyvault-service-version": "1.9.264.2", + "x-ms-request-id": "fbd62c14-39bb-48bf-8fe0-0e06e33ed5b2", + "x-powered-by": "ASP.NET" + } + }, + { + "method": "POST", + "url": "https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/oauth2/v2.0/token", + "query": {}, + "requestBody": "response_type=token&grant_type=client_credentials&client_id=azure_client_id&client_secret=azure_client_secret&scope=https%3A%2F%2Fsanitized%2F", + "status": 200, + "response": "{\"token_type\":\"Bearer\",\"expires_in\":86399,\"ext_expires_in\":86399,\"access_token\":\"access_token\"}", + "responseHeaders": { + "cache-control": "no-store, no-cache", + "content-length": "1315", + "content-type": "application/json; charset=utf-8", + "date": "Thu, 27 Jan 2022 00:26:03 GMT", + "expires": "-1", + "nel": "{\"report_to\":\"network-errors\",\"max_age\":86400,\"success_fraction\":0.001,\"failure_fraction\":1.0}", + "p3p": "CP=\"DSP CUR OTPi IND OTRi ONL FIN\"", + "pragma": "no-cache", + "referrer-policy": "strict-origin-when-cross-origin", + "report-to": "{\"group\":\"network-errors\",\"max_age\":86400,\"endpoints\":[{\"url\":\"https://identity.nel.measure.office.net/api/report?catId=GW+estsfd+est\"}]}", + "strict-transport-security": "max-age=31536000; includeSubDomains", + "x-content-type-options": "nosniff", + "x-ms-ests-server": "2.1.12381.21 - WUS2 ProdSlices", + "x-ms-request-id": "8a6baa24-2c78-4c1c-8eaf-f009af920900" + } + }, + { + "method": "POST", + "url": "https://keyvault_name.vault.azure.net/keys/immutablerelease164324316470603193/create", + "query": { + "api-version": "7.3-preview" + }, + "requestBody": "{\"kty\":\"RSA-HSM\",\"key_ops\":[\"encrypt\",\"decrypt\"],\"attributes\":{\"exportable\":true},\"release_policy\":{\"immutable\":true,\"data\":\"eyJhbnlPZiI6W3siYWxsT2YiOlt7ImNsYWltIjoic2RrLXRlc3QiLCJlcXVhbHMiOiJ0cnVlIn1dLCJhdXRob3JpdHkiOiJodHRwczovL3Nrcl9hdHRlc3RhdGlvbi5henVyZS5uZXQvIn1dLCJ2ZXJzaW9uIjoiMS4wLjAifQ\"}}", + "status": 200, + "response": "{\"key\":{\"kid\":\"https://keyvault_name.vault.azure.net/keys/immutablerelease164324316470603193/509b54f2152c48469c12e06595985d4e\",\"kty\":\"RSA-HSM\",\"key_ops\":[\"encrypt\",\"decrypt\"],\"n\":\"tFw_OcUC3OpLj6SZ2HerJF7RuWOF7g3yke-G0Qp0M4lZaurq5FDzixPoqiU1U-IYy6j_Kin2-x4N6t7lmaMK0hoFh_IWn4YW2hXSw3OxptpmT5QTel8yvz3V062TQPVaolPYiBfImODvIowmP1Snkw9CzaiIyf2F58gva61zVj28ZO-1rAMUWuJhMhixJCnkSfUpoomdZR-Okh6RCueCkec_vZT_227CRm_OGyiJTwMRiB8Q_CEMQnP2mII7gZ_C-u-IsRiV4oTIxDCI9doQGKNdECsBA0-c5FInEiepZk6s9M0U52u1m4dlx9SyP_TCx-diHG2SXD3opohs9e40-w\",\"e\":\"AAEAAQ\"},\"attributes\":{\"enabled\":true,\"created\":1643243165,\"updated\":1643243165,\"recoveryLevel\":\"CustomizedRecoverable+Purgeable\",\"recoverableDays\":7,\"exportable\":true},\"release_policy\":{\"contentType\":\"application/json; charset=utf-8\",\"data\":\"eyJ2ZXJzaW9uIjoiMS4wLjAiLCJhbnlPZiI6W3siYXV0aG9yaXR5IjoiaHR0cHM6Ly9za3JfYXR0ZXN0YXRpb24uYXp1cmUubmV0LyIsImFsbE9mIjpbeyJjbGFpbSI6InNkay10ZXN0IiwiZXF1YWxzIjoidHJ1ZSJ9XX1dfQ\",\"immutable\":true}}", + "responseHeaders": { + "cache-control": "no-cache", + "content-length": "982", + "content-type": "application/json; charset=utf-8", + "date": "Thu, 27 Jan 2022 00:26:05 GMT", + "expires": "-1", + "pragma": "no-cache", + "strict-transport-security": "max-age=31536000;includeSubDomains", + "x-content-type-options": "nosniff", + "x-ms-client-request-id": "125ae0a6-2110-45ef-b1b5-6fbae734d8ee", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=50.35.229.43;act_addr_fam=InterNetwork;", + "x-ms-keyvault-rbac-assignment-id": "0b7bb9bd-b488-5634-b80b-e2b4c4bd48cd", + "x-ms-keyvault-rbac-cache": "ra_age=1355;da_age=7613;rd_age=7613;brd_age=6107;ra_notif_age=1662;dec_lev=2;", + "x-ms-keyvault-region": "westus2", + "x-ms-keyvault-service-version": "1.9.264.2", + "x-ms-request-id": "414e91e6-f36f-4fbb-9eed-349d6cac82cf", + "x-powered-by": "ASP.NET" + } + }, + { + "method": "PATCH", + "url": "https://keyvault_name.vault.azure.net/keys/immutablerelease164324316470603193/", + "query": { + "api-version": "7.3-preview" + }, + "requestBody": "{\"attributes\":{},\"release_policy\":{\"immutable\":true,\"data\":\"eyJhbnlPZiI6W3siYW55T2YiOlt7ImNsYWltIjoic2RrLXRlc3QiLCJlcXVhbHMiOiJmYWxzZSJ9XSwiYXV0aG9yaXR5IjoiaHR0cHM6Ly9za3JfYXR0ZXN0YXRpb24uYXp1cmUubmV0LyJ9XSwidmVyc2lvbiI6IjEuMCJ9\"}}", + "status": 400, + "response": "{\"error\":{\"code\":\"BadParameter\",\"message\":\"AKV.SKR.1020: Immutable Key Release Policy cannot be modified.\"}}", + "responseHeaders": { + "cache-control": "no-cache", + "content-length": "108", + "content-type": "application/json; charset=utf-8", + "date": "Thu, 27 Jan 2022 00:26:06 GMT", + "expires": "-1", + "pragma": "no-cache", + "strict-transport-security": "max-age=31536000;includeSubDomains", + "x-content-type-options": "nosniff", + "x-ms-client-request-id": "e935a810-1fbc-4b30-9f0a-85891f766fcd", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=50.35.229.43;act_addr_fam=InterNetwork;", + "x-ms-keyvault-rbac-assignment-id": "0b7bb9bd-b488-5634-b80b-e2b4c4bd48cd", + "x-ms-keyvault-rbac-cache": "ra_age=1356;da_age=7614;rd_age=7614;brd_age=6108;ra_notif_age=1663;dec_lev=1;", + "x-ms-keyvault-region": "westus2", + "x-ms-keyvault-service-version": "1.9.264.2", + "x-ms-request-id": "c98b7b3d-9b70-4b85-a4b1-dc293528d4c6", + "x-powered-by": "ASP.NET" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "immutablerelease": "immutablerelease164324316470603193" + }, + "newDate": {} + }, + "hash": "8b272c69990aec75985f8afdc7061ca4" +} \ No newline at end of file diff --git a/sdk/keyvault/keyvault-keys/recordings/node/keys_client__create_read_update_and_delete_operations_releasekey/recording_errors_when_updating_an_immutable_release_policy.js b/sdk/keyvault/keyvault-keys/recordings/node/keys_client__create_read_update_and_delete_operations_releasekey/recording_errors_when_updating_an_immutable_release_policy.js new file mode 100644 index 000000000000..3491d4694906 --- /dev/null +++ b/sdk/keyvault/keyvault-keys/recordings/node/keys_client__create_read_update_and_delete_operations_releasekey/recording_errors_when_updating_an_immutable_release_policy.js @@ -0,0 +1,244 @@ +let nock = require('nock'); + +module.exports.hash = "e97f1dfeea8e9af2bdefa65e65864790"; + +module.exports.testInfo = {"uniqueName":{"immutablerelease":"immutablerelease164324315726004693"},"newDate":{}} + +nock('https://skr_attestation.azure.net:443', {"encodedQueryParams":true}) + .get('//generate-test-token') + .reply(200, {"token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjYybHRKM0dSa3hWVC1fdkQ2dWJ4LWdHWUZIWU5pWE1WZ29sSzU5NzEyVzAiLCJqa3UiOiJodHRwczovL21hbGVnZWltbXV0YWJsZTJzaXRlLmF6dXJld2Vic2l0ZXMubmV0L2tleXMifQ.eyJpc3MiOiJodHRwczovL21hbGVnZWltbXV0YWJsZTJzaXRlLmF6dXJld2Vic2l0ZXMubmV0LyIsInNkay10ZXN0Ijp0cnVlLCJ4LW1zLWluaXR0aW1lIjp7fSwieC1tcy1ydW50aW1lIjp7ImtleXMiOlt7Imt0eSI6IlJTQSIsImtpZCI6ImZha2UtcmVsZWFzZS1rZXkiLCJ1c2UiOiJlbmMiLCJlIjoiQVFBQiIsIm4iOiJwWkxQcllyRWVNZFR6a2F6TVhNOEpZWkF1R0Zmc290VjdKVEhvYTFDQUVRVXR0MkxPc29aM1lKZ2o2TE5tajBaUFk2ZHdRWU1BNXBXSkhSQkM3cXBBY2xBb1VNalJ3cmZuUGZ5aFBaMWM1OEo3VTB2czNzeHktSG1lMl94eEtsUHNzYVZ2b1haNXEwYVp4RXhxYnlWQXZZekZSVl9JS1Z5bUxDaXhzalZmaEE4azBkWXdaeU9UYzVxQkFiTnlwU0tXb2NSd0c0UTdMZTVGeUtCRDB5eVJJTUFkazhQdjVsOHV0b2dMcEVMakRLZERQcTJuTE9iZ1NMRTFKSjlNUHdvQVRaaHZMbE1fV3lYODFocGs1NWp2Y1JoZzAzcUtyUVE2OFNBZ1pZeFN5QktVYWxDa3loSVB1RmVic1lIeWFFUXZGbTNPa2hfdlcwMzZuSTQ3U2x4UVEifV19LCJtYWEtZWhkIjoic2RrLXRlc3QiLCJpYXQiOjE2NDMyNDMxNTYsImV4cCI6MTY0Mzg0Nzk1Nn0.mW_9PdjNEXw8_62KeeN_LW_DL-cMWuEXazg3RtToFv8go4iGg5bZWDVTSjEd2ToU80Pc1EA7IB_o6vimNpZWb7a3irZQfTHYXvljpj5NV_xJ3piY_neNSi-Fojskyd3Kuih5oJOjvQPE_aWiBpbU1_3knE8w-X7TRcfCGdS1COpooxObYD2tIQE8On3M0c1WnihrMJ5opNoKK_2DnSDHWbjZagOWsQ5J0Du68hV0J6jHDD0f5gQ-tE8Eje2Bcx3PkZrsgiBVzdfCbTNUquqyOmWBRHC1WC-hFnfk2ybbba31xDDPc-uBD1f3AEMSQSguyAx9f-y6gD-2vEPtXPz1wg"}, [ + 'Content-Length', + '1321', + 'Content-Type', + 'application/json; charset=utf-8', + 'ETag', + 'W/"529-AAmzVN1XDmKC9ghr6gpRoJh8t+M"', + 'X-Powered-By', + 'Express', + 'Set-Cookie', + 'ARRAffinity=619d5cd37d5df35ce07c198c9a607841d32e50136529316925bc0449d5dc307e;Path=/;HttpOnly;Secure;Domain=skr_attestation.azure.net', + 'Set-Cookie', + 'ARRAffinitySameSite=619d5cd37d5df35ce07c198c9a607841d32e50136529316925bc0449d5dc307e;Path=/;HttpOnly;SameSite=None;Secure;Domain=skr_attestation.azure.net', + 'Date', + 'Thu, 27 Jan 2022 00:25:56 GMT', + 'Connection', + 'close' +]); + +nock('https://keyvault_name.vault.azure.net:443', {"encodedQueryParams":true}) + .post('/keys/immutablerelease164324315726004693/create') + .query(true) + .reply(401, {"error":{"code":"Unauthorized","message":"AKV10000: Request is missing a Bearer or PoP token."}}, [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Content-Length', + '97', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'WWW-Authenticate', + 'Bearer authorization="https://login.windows.net/12345678-1234-1234-1234-123456789012", resource="https://vault.azure.net"', + 'x-ms-keyvault-region', + 'westus2', + 'x-ms-client-request-id', + '81d2405d-bf75-4675-9649-c0b8a0c1efff', + 'x-ms-request-id', + '869b4f9e-3148-4a7b-a2b2-8c532c752a7a', + 'x-ms-keyvault-service-version', + '1.9.264.2', + 'x-ms-keyvault-network-info', + 'conn_type=Ipv4;addr=50.35.229.43;act_addr_fam=InterNetwork;', + 'X-Powered-By', + 'ASP.NET', + 'Strict-Transport-Security', + 'max-age=31536000;includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Thu, 27 Jan 2022 00:25:56 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '2a05c435-525f-4b81-a831-d8f082d1d600', + 'x-ms-ests-server', + '2.1.12261.22 - SCUS ProdSlices', + 'Set-Cookie', + 'fpc=Ah7n2UgkIXhIm3ad91RlIaA; expires=Sat, 26-Feb-2022 00:25:57 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrXVik3wp-eVppHSHcE00JgeuQXGb8Fun1LlixwXvussFS3iAVxEe8baKdSyz1i_hVu6ptMk6S2xVSt0pUoNoXH2Nq4sKC_qrQVA4ZvdRQmUQ3C0H6SVJr73_bQeS1t6C4CI9tCkxaAogZPxv9qMu4bCLWTybmamsndNsN4Ymio74gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 27 Jan 2022 00:25:56 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/12345678-1234-1234-1234-123456789012/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'bf9272a6-c51f-4182-930d-e85db17fb300', + 'x-ms-ests-server', + '2.1.12381.20 - SCUS ProdSlices', + 'Set-Cookie', + 'fpc=AsRhkoSPkC9MtG62dWPouBs; expires=Sat, 26-Feb-2022 00:25:57 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevriEIoTWyr4E_Xr9bbLz7EDCq4Df3RMNCrbQ_2m0P3UsJomXhit3pFFdeupNiDVqOpmgcPhZ_Uz2IOuJt-9NjZQyZkY_LzzPo8RHJ-0v-MVeqbX3334CvAmItSpp31w62cTcfOqkEPvhFrl5CqhJakfbVGPnwBjWPu-BSowTvNgMMgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 27 Jan 2022 00:25:56 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/12345678-1234-1234-1234-123456789012/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.4.0&x-client-OS=linux&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=1d7b1a6c-8560-4f1d-940a-e5ee5872a027&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'a60a590f-1ef5-4951-ac92-684a74f14500', + 'x-ms-ests-server', + '2.1.12381.20 - NCUS ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Set-Cookie', + 'fpc=Anle2XEa-ypCqlgaVvpyKeLiImrFAQAAAJTdg9kOAAAA; expires=Sat, 26-Feb-2022 00:25:57 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 27 Jan 2022 00:25:56 GMT', + 'Content-Length', + '1315' +]); + +nock('https://keyvault_name.vault.azure.net:443', {"encodedQueryParams":true}) + .post('/keys/immutablerelease164324315726004693/create', {"kty":"RSA-HSM","key_ops":["encrypt","decrypt"],"attributes":{"exportable":true},"release_policy":{"immutable":true,"data":"eyJhbnlPZiI6W3siYWxsT2YiOlt7ImNsYWltIjoic2RrLXRlc3QiLCJlcXVhbHMiOiJ0cnVlIn1dLCJhdXRob3JpdHkiOiJodHRwczovL3Nrcl9hdHRlc3RhdGlvbi5henVyZS5uZXQvIn1dLCJ2ZXJzaW9uIjoiMS4wLjAifQ"}}) + .query(true) + .reply(200, {"key":{"kid":"https://keyvault_name.vault.azure.net/keys/immutablerelease164324315726004693/6825c4e6414e44288f2188fbc0fa6a83","kty":"RSA-HSM","key_ops":["encrypt","decrypt"],"n":"tW-exH9m5cGOkEhlnDbNfekox-qRY9ik129IFXCzVSJ3rT-EvuFrvEfEg31lg2aUcPthA5mkcyQK63r84q5-lgSAhy3RurpF38THuSgdOtR7124Moh2Xmxi7dvX5EK0HUYECalKdYBYInPCSFNn9munJe1wqmReFTE-r_sgkCznliiHHgt2WXNBZv0UvB8T4P9XTngz4gEXtEpM2X8om77NgjfNZ6b8TqreBRcHIzGHgOJYZiJbigMBOkvajFlxH9qjPcsNgrzSB1GTq5Xh-mF62h5zRPWcAJ2WvO6q7_qEBAvVcG-ilQjYW-EJCP1gKxpc4AoaJpin-YSfDM6tqbQ","e":"AAEAAQ"},"attributes":{"enabled":true,"created":1643243158,"updated":1643243158,"recoveryLevel":"CustomizedRecoverable+Purgeable","recoverableDays":7,"exportable":true},"release_policy":{"contentType":"application/json; charset=utf-8","data":"eyJ2ZXJzaW9uIjoiMS4wLjAiLCJhbnlPZiI6W3siYXV0aG9yaXR5IjoiaHR0cHM6Ly9za3JfYXR0ZXN0YXRpb24uYXp1cmUubmV0LyIsImFsbE9mIjpbeyJjbGFpbSI6InNkay10ZXN0IiwiZXF1YWxzIjoidHJ1ZSJ9XX1dfQ","immutable":true}}, [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'x-ms-keyvault-region', + 'westus2', + 'x-ms-client-request-id', + '81d2405d-bf75-4675-9649-c0b8a0c1efff', + 'x-ms-request-id', + '3654926c-9306-4558-8277-e8c628078893', + 'x-ms-keyvault-service-version', + '1.9.264.2', + 'x-ms-keyvault-network-info', + 'conn_type=Ipv4;addr=50.35.229.43;act_addr_fam=InterNetwork;', + 'x-ms-keyvault-rbac-assignment-id', + '0b7bb9bd-b488-5634-b80b-e2b4c4bd48cd', + 'x-ms-keyvault-rbac-cache', + 'ra_age=1348;da_age=7606;rd_age=7606;brd_age=6100;ra_notif_age=1655;dec_lev=2;', + 'X-Powered-By', + 'ASP.NET', + 'Strict-Transport-Security', + 'max-age=31536000;includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Thu, 27 Jan 2022 00:25:58 GMT', + 'Content-Length', + '982' +]); + +nock('https://keyvault_name.vault.azure.net:443', {"encodedQueryParams":true}) + .patch('/keys/immutablerelease164324315726004693/', {"attributes":{},"release_policy":{"immutable":true,"data":"eyJhbnlPZiI6W3siYW55T2YiOlt7ImNsYWltIjoic2RrLXRlc3QiLCJlcXVhbHMiOiJmYWxzZSJ9XSwiYXV0aG9yaXR5IjoiaHR0cHM6Ly9za3JfYXR0ZXN0YXRpb24uYXp1cmUubmV0LyJ9XSwidmVyc2lvbiI6IjEuMCJ9"}}) + .query(true) + .reply(400, {"error":{"code":"BadParameter","message":"AKV.SKR.1020: Immutable Key Release Policy cannot be modified."}}, [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Content-Length', + '108', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'x-ms-keyvault-region', + 'westus2', + 'x-ms-client-request-id', + '3aa3b281-2b8a-4bfa-a3a0-1300fad5ccb9', + 'x-ms-request-id', + '8315bc52-75a8-4ad0-a84f-695e79083b11', + 'x-ms-keyvault-service-version', + '1.9.264.2', + 'x-ms-keyvault-network-info', + 'conn_type=Ipv4;addr=50.35.229.43;act_addr_fam=InterNetwork;', + 'x-ms-keyvault-rbac-assignment-id', + '0b7bb9bd-b488-5634-b80b-e2b4c4bd48cd', + 'x-ms-keyvault-rbac-cache', + 'ra_age=1349;da_age=7607;rd_age=7607;brd_age=6101;ra_notif_age=1656;dec_lev=1;', + 'X-Powered-By', + 'ASP.NET', + 'Strict-Transport-Security', + 'max-age=31536000;includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Thu, 27 Jan 2022 00:25:58 GMT' +]); diff --git a/sdk/keyvault/keyvault-keys/review/keyvault-keys.api.md b/sdk/keyvault/keyvault-keys/review/keyvault-keys.api.md index 334e3c6bf4b0..d8bbeded9444 100644 --- a/sdk/keyvault/keyvault-keys/review/keyvault-keys.api.md +++ b/sdk/keyvault/keyvault-keys/review/keyvault-keys.api.md @@ -301,6 +301,7 @@ export interface KeyProperties { export interface KeyReleasePolicy { contentType?: string; encodedPolicy?: Uint8Array; + immutable?: boolean; } // @public diff --git a/sdk/keyvault/keyvault-keys/src/cryptographyClientModels.ts b/sdk/keyvault/keyvault-keys/src/cryptographyClientModels.ts index 42bf507c1c83..bcd6928bf0d8 100644 --- a/sdk/keyvault/keyvault-keys/src/cryptographyClientModels.ts +++ b/sdk/keyvault/keyvault-keys/src/cryptographyClientModels.ts @@ -8,7 +8,6 @@ import { JsonWebKeyCurveName as KeyCurveName, KnownJsonWebKeyCurveName as KnownKeyCurveNames, JsonWebKeyEncryptionAlgorithm as EncryptionAlgorithm, - KnownJsonWebKeyEncryptionAlgorithm as KnownEncryptionAlgorithms, JsonWebKeySignatureAlgorithm as SignatureAlgorithm, KnownJsonWebKeySignatureAlgorithm as KnownSignatureAlgorithms, } from "./generated/models"; @@ -17,11 +16,44 @@ export { KeyCurveName, KnownKeyCurveNames, EncryptionAlgorithm, - KnownEncryptionAlgorithms, SignatureAlgorithm, KnownSignatureAlgorithms, }; +/** Known values of {@link EncryptionAlgorithm} that the service accepts. */ +export enum KnownEncryptionAlgorithms { + /** Encryption Algorithm - RSA-OAEP */ + RSAOaep = "RSA-OAEP", + /** Encryption Algorithm - RSA-OAEP-256 */ + RSAOaep256 = "RSA-OAEP-256", + /** Encryption Algorithm - RSA1_5 */ + RSA15 = "RSA1_5", + /** Encryption Algorithm - A128GCM */ + A128GCM = "A128GCM", + /** Encryption Algorithm - A192GCM */ + A192GCM = "A192GCM", + /** Encryption Algorithm - A256GCM */ + A256GCM = "A256GCM", + /** Encryption Algorithm - A128KW */ + A128KW = "A128KW", + /** Encryption Algorithm - A192KW */ + A192KW = "A192KW", + /** Encryption Algorithm - A256KW */ + A256KW = "A256KW", + /** Encryption Algorithm - A128CBC */ + A128CBC = "A128CBC", + /** Encryption Algorithm - A192CBC */ + A192CBC = "A192CBC", + /** Encryption Algorithm - A256CBC */ + A256CBC = "A256CBC", + /** Encryption Algorithm - A128CBCPAD */ + A128Cbcpad = "A128CBCPAD", + /** Encryption Algorithm - A192CBCPAD */ + A192Cbcpad = "A192CBCPAD", + /** Encryption Algorithm - A256CBCPAD */ + A256Cbcpad = "A256CBCPAD", +} + /** * Supported algorithms for key wrapping/unwrapping */ diff --git a/sdk/keyvault/keyvault-keys/src/generated/keyVaultClient.ts b/sdk/keyvault/keyvault-keys/src/generated/keyVaultClient.ts index a32918baf189..b0e098fa88eb 100644 --- a/sdk/keyvault/keyvault-keys/src/generated/keyVaultClient.ts +++ b/sdk/keyvault/keyvault-keys/src/generated/keyVaultClient.ts @@ -14,65 +14,63 @@ import { KeyVaultClientOptionalParams, ApiVersion73Preview, JsonWebKeyType, - KeyVaultClientCreateKeyOptionalParams, - KeyVaultClientCreateKeyResponse, - KeyVaultClientRotateKeyOptionalParams, - KeyVaultClientRotateKeyResponse, + CreateKeyOptionalParams, + CreateKeyResponse, + RotateKeyOptionalParams, + RotateKeyResponse, JsonWebKey, - KeyVaultClientImportKeyOptionalParams, - KeyVaultClientImportKeyResponse, - KeyVaultClientDeleteKeyOptionalParams, - KeyVaultClientDeleteKeyResponse, - KeyVaultClientUpdateKeyOptionalParams, - KeyVaultClientUpdateKeyResponse, - KeyVaultClientGetKeyOptionalParams, - KeyVaultClientGetKeyResponse, - KeyVaultClientGetKeyVersionsOptionalParams, - KeyVaultClientGetKeyVersionsResponse, - KeyVaultClientGetKeysOptionalParams, - KeyVaultClientGetKeysResponse, - KeyVaultClientBackupKeyOptionalParams, - KeyVaultClientBackupKeyResponse, - KeyVaultClientRestoreKeyOptionalParams, - KeyVaultClientRestoreKeyResponse, + ImportKeyOptionalParams, + ImportKeyResponse, + DeleteKeyOptionalParams, + DeleteKeyResponse, + UpdateKeyOptionalParams, + UpdateKeyResponse, + GetKeyOptionalParams, + GetKeyResponse, + GetKeyVersionsOptionalParams, + GetKeyVersionsResponse, + GetKeysOptionalParams, + GetKeysResponse, + BackupKeyOptionalParams, + BackupKeyResponse, + RestoreKeyOptionalParams, + RestoreKeyResponse, JsonWebKeyEncryptionAlgorithm, - KeyVaultClientEncryptOptionalParams, - KeyVaultClientEncryptResponse, - KeyVaultClientDecryptOptionalParams, - KeyVaultClientDecryptResponse, + EncryptOptionalParams, + EncryptResponse, + DecryptOptionalParams, + DecryptResponse, JsonWebKeySignatureAlgorithm, - KeyVaultClientSignOptionalParams, - KeyVaultClientSignResponse, - KeyVaultClientVerifyOptionalParams, - KeyVaultClientVerifyResponse, - KeyVaultClientWrapKeyOptionalParams, - KeyVaultClientWrapKeyResponse, - KeyVaultClientUnwrapKeyOptionalParams, - KeyVaultClientUnwrapKeyResponse, - KeyVaultClientExportOptionalParams, - KeyVaultClientExportResponse, - KeyVaultClientReleaseOptionalParams, - KeyVaultClientReleaseResponse, - KeyVaultClientGetDeletedKeysOptionalParams, - KeyVaultClientGetDeletedKeysResponse, - KeyVaultClientGetDeletedKeyOptionalParams, - KeyVaultClientGetDeletedKeyResponse, - KeyVaultClientPurgeDeletedKeyOptionalParams, - KeyVaultClientRecoverDeletedKeyOptionalParams, - KeyVaultClientRecoverDeletedKeyResponse, - KeyVaultClientGetKeyRotationPolicyOptionalParams, - KeyVaultClientGetKeyRotationPolicyResponse, + SignOptionalParams, + SignResponse, + VerifyOptionalParams, + VerifyResponse, + WrapKeyOptionalParams, + WrapKeyResponse, + UnwrapKeyOptionalParams, + UnwrapKeyResponse, + ReleaseOptionalParams, + ReleaseResponse, + GetDeletedKeysOptionalParams, + GetDeletedKeysResponse, + GetDeletedKeyOptionalParams, + GetDeletedKeyResponse, + PurgeDeletedKeyOptionalParams, + RecoverDeletedKeyOptionalParams, + RecoverDeletedKeyResponse, + GetKeyRotationPolicyOptionalParams, + GetKeyRotationPolicyResponse, KeyRotationPolicy, - KeyVaultClientUpdateKeyRotationPolicyOptionalParams, - KeyVaultClientUpdateKeyRotationPolicyResponse, - KeyVaultClientGetRandomBytesOptionalParams, - KeyVaultClientGetRandomBytesResponse, - KeyVaultClientGetKeyVersionsNextOptionalParams, - KeyVaultClientGetKeyVersionsNextResponse, - KeyVaultClientGetKeysNextOptionalParams, - KeyVaultClientGetKeysNextResponse, - KeyVaultClientGetDeletedKeysNextOptionalParams, - KeyVaultClientGetDeletedKeysNextResponse + UpdateKeyRotationPolicyOptionalParams, + UpdateKeyRotationPolicyResponse, + GetRandomBytesOptionalParams, + GetRandomBytesResponse, + GetKeyVersionsNextOptionalParams, + GetKeyVersionsNextResponse, + GetKeysNextOptionalParams, + GetKeysNextResponse, + GetDeletedKeysNextOptionalParams, + GetDeletedKeysNextResponse } from "./models"; export class KeyVaultClient extends KeyVaultClientContext { @@ -101,8 +99,8 @@ export class KeyVaultClient extends KeyVaultClientContext { vaultBaseUrl: string, keyName: string, kty: JsonWebKeyType, - options?: KeyVaultClientCreateKeyOptionalParams - ): Promise { + options?: CreateKeyOptionalParams + ): Promise { const operationArguments: coreHttp.OperationArguments = { vaultBaseUrl, keyName, @@ -112,7 +110,7 @@ export class KeyVaultClient extends KeyVaultClientContext { return this.sendOperationRequest( operationArguments, createKeyOperationSpec - ) as Promise; + ) as Promise; } /** @@ -125,8 +123,8 @@ export class KeyVaultClient extends KeyVaultClientContext { rotateKey( vaultBaseUrl: string, keyName: string, - options?: KeyVaultClientRotateKeyOptionalParams - ): Promise { + options?: RotateKeyOptionalParams + ): Promise { const operationArguments: coreHttp.OperationArguments = { vaultBaseUrl, keyName, @@ -135,7 +133,7 @@ export class KeyVaultClient extends KeyVaultClientContext { return this.sendOperationRequest( operationArguments, rotateKeyOperationSpec - ) as Promise; + ) as Promise; } /** @@ -151,8 +149,8 @@ export class KeyVaultClient extends KeyVaultClientContext { vaultBaseUrl: string, keyName: string, key: JsonWebKey, - options?: KeyVaultClientImportKeyOptionalParams - ): Promise { + options?: ImportKeyOptionalParams + ): Promise { const operationArguments: coreHttp.OperationArguments = { vaultBaseUrl, keyName, @@ -162,7 +160,7 @@ export class KeyVaultClient extends KeyVaultClientContext { return this.sendOperationRequest( operationArguments, importKeyOperationSpec - ) as Promise; + ) as Promise; } /** @@ -177,8 +175,8 @@ export class KeyVaultClient extends KeyVaultClientContext { deleteKey( vaultBaseUrl: string, keyName: string, - options?: KeyVaultClientDeleteKeyOptionalParams - ): Promise { + options?: DeleteKeyOptionalParams + ): Promise { const operationArguments: coreHttp.OperationArguments = { vaultBaseUrl, keyName, @@ -187,7 +185,7 @@ export class KeyVaultClient extends KeyVaultClientContext { return this.sendOperationRequest( operationArguments, deleteKeyOperationSpec - ) as Promise; + ) as Promise; } /** @@ -203,8 +201,8 @@ export class KeyVaultClient extends KeyVaultClientContext { vaultBaseUrl: string, keyName: string, keyVersion: string, - options?: KeyVaultClientUpdateKeyOptionalParams - ): Promise { + options?: UpdateKeyOptionalParams + ): Promise { const operationArguments: coreHttp.OperationArguments = { vaultBaseUrl, keyName, @@ -214,7 +212,7 @@ export class KeyVaultClient extends KeyVaultClientContext { return this.sendOperationRequest( operationArguments, updateKeyOperationSpec - ) as Promise; + ) as Promise; } /** @@ -230,8 +228,8 @@ export class KeyVaultClient extends KeyVaultClientContext { vaultBaseUrl: string, keyName: string, keyVersion: string, - options?: KeyVaultClientGetKeyOptionalParams - ): Promise { + options?: GetKeyOptionalParams + ): Promise { const operationArguments: coreHttp.OperationArguments = { vaultBaseUrl, keyName, @@ -241,7 +239,7 @@ export class KeyVaultClient extends KeyVaultClientContext { return this.sendOperationRequest( operationArguments, getKeyOperationSpec - ) as Promise; + ) as Promise; } /** @@ -254,8 +252,8 @@ export class KeyVaultClient extends KeyVaultClientContext { getKeyVersions( vaultBaseUrl: string, keyName: string, - options?: KeyVaultClientGetKeyVersionsOptionalParams - ): Promise { + options?: GetKeyVersionsOptionalParams + ): Promise { const operationArguments: coreHttp.OperationArguments = { vaultBaseUrl, keyName, @@ -264,7 +262,7 @@ export class KeyVaultClient extends KeyVaultClientContext { return this.sendOperationRequest( operationArguments, getKeyVersionsOperationSpec - ) as Promise; + ) as Promise; } /** @@ -277,8 +275,8 @@ export class KeyVaultClient extends KeyVaultClientContext { */ getKeys( vaultBaseUrl: string, - options?: KeyVaultClientGetKeysOptionalParams - ): Promise { + options?: GetKeysOptionalParams + ): Promise { const operationArguments: coreHttp.OperationArguments = { vaultBaseUrl, options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) @@ -286,7 +284,7 @@ export class KeyVaultClient extends KeyVaultClientContext { return this.sendOperationRequest( operationArguments, getKeysOperationSpec - ) as Promise; + ) as Promise; } /** @@ -307,8 +305,8 @@ export class KeyVaultClient extends KeyVaultClientContext { backupKey( vaultBaseUrl: string, keyName: string, - options?: KeyVaultClientBackupKeyOptionalParams - ): Promise { + options?: BackupKeyOptionalParams + ): Promise { const operationArguments: coreHttp.OperationArguments = { vaultBaseUrl, keyName, @@ -317,7 +315,7 @@ export class KeyVaultClient extends KeyVaultClientContext { return this.sendOperationRequest( operationArguments, backupKeyOperationSpec - ) as Promise; + ) as Promise; } /** @@ -338,8 +336,8 @@ export class KeyVaultClient extends KeyVaultClientContext { restoreKey( vaultBaseUrl: string, keyBundleBackup: Uint8Array, - options?: KeyVaultClientRestoreKeyOptionalParams - ): Promise { + options?: RestoreKeyOptionalParams + ): Promise { const operationArguments: coreHttp.OperationArguments = { vaultBaseUrl, keyBundleBackup, @@ -348,7 +346,7 @@ export class KeyVaultClient extends KeyVaultClientContext { return this.sendOperationRequest( operationArguments, restoreKeyOperationSpec - ) as Promise; + ) as Promise; } /** @@ -372,8 +370,8 @@ export class KeyVaultClient extends KeyVaultClientContext { keyVersion: string, algorithm: JsonWebKeyEncryptionAlgorithm, value: Uint8Array, - options?: KeyVaultClientEncryptOptionalParams - ): Promise { + options?: EncryptOptionalParams + ): Promise { const operationArguments: coreHttp.OperationArguments = { vaultBaseUrl, keyName, @@ -385,7 +383,7 @@ export class KeyVaultClient extends KeyVaultClientContext { return this.sendOperationRequest( operationArguments, encryptOperationSpec - ) as Promise; + ) as Promise; } /** @@ -407,8 +405,8 @@ export class KeyVaultClient extends KeyVaultClientContext { keyVersion: string, algorithm: JsonWebKeyEncryptionAlgorithm, value: Uint8Array, - options?: KeyVaultClientDecryptOptionalParams - ): Promise { + options?: DecryptOptionalParams + ): Promise { const operationArguments: coreHttp.OperationArguments = { vaultBaseUrl, keyName, @@ -420,7 +418,7 @@ export class KeyVaultClient extends KeyVaultClientContext { return this.sendOperationRequest( operationArguments, decryptOperationSpec - ) as Promise; + ) as Promise; } /** @@ -441,8 +439,8 @@ export class KeyVaultClient extends KeyVaultClientContext { keyVersion: string, algorithm: JsonWebKeySignatureAlgorithm, value: Uint8Array, - options?: KeyVaultClientSignOptionalParams - ): Promise { + options?: SignOptionalParams + ): Promise { const operationArguments: coreHttp.OperationArguments = { vaultBaseUrl, keyName, @@ -454,7 +452,7 @@ export class KeyVaultClient extends KeyVaultClientContext { return this.sendOperationRequest( operationArguments, signOperationSpec - ) as Promise; + ) as Promise; } /** @@ -479,8 +477,8 @@ export class KeyVaultClient extends KeyVaultClientContext { algorithm: JsonWebKeySignatureAlgorithm, digest: Uint8Array, signature: Uint8Array, - options?: KeyVaultClientVerifyOptionalParams - ): Promise { + options?: VerifyOptionalParams + ): Promise { const operationArguments: coreHttp.OperationArguments = { vaultBaseUrl, keyName, @@ -493,7 +491,7 @@ export class KeyVaultClient extends KeyVaultClientContext { return this.sendOperationRequest( operationArguments, verifyOperationSpec - ) as Promise; + ) as Promise; } /** @@ -516,8 +514,8 @@ export class KeyVaultClient extends KeyVaultClientContext { keyVersion: string, algorithm: JsonWebKeyEncryptionAlgorithm, value: Uint8Array, - options?: KeyVaultClientWrapKeyOptionalParams - ): Promise { + options?: WrapKeyOptionalParams + ): Promise { const operationArguments: coreHttp.OperationArguments = { vaultBaseUrl, keyName, @@ -529,7 +527,7 @@ export class KeyVaultClient extends KeyVaultClientContext { return this.sendOperationRequest( operationArguments, wrapKeyOperationSpec - ) as Promise; + ) as Promise; } /** @@ -550,8 +548,8 @@ export class KeyVaultClient extends KeyVaultClientContext { keyVersion: string, algorithm: JsonWebKeyEncryptionAlgorithm, value: Uint8Array, - options?: KeyVaultClientUnwrapKeyOptionalParams - ): Promise { + options?: UnwrapKeyOptionalParams + ): Promise { const operationArguments: coreHttp.OperationArguments = { vaultBaseUrl, keyName, @@ -563,33 +561,7 @@ export class KeyVaultClient extends KeyVaultClientContext { return this.sendOperationRequest( operationArguments, unwrapKeyOperationSpec - ) as Promise; - } - - /** - * The export key operation is applicable to all key types. The target key must be marked exportable. - * This operation requires the keys/export permission. - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param keyName The name of the key to get. - * @param keyVersion Adding the version parameter retrieves a specific version of a key. - * @param options The options parameters. - */ - export( - vaultBaseUrl: string, - keyName: string, - keyVersion: string, - options?: KeyVaultClientExportOptionalParams - ): Promise { - const operationArguments: coreHttp.OperationArguments = { - vaultBaseUrl, - keyName, - keyVersion, - options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.sendOperationRequest( - operationArguments, - exportOperationSpec - ) as Promise; + ) as Promise; } /** @@ -598,27 +570,27 @@ export class KeyVaultClient extends KeyVaultClientContext { * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. * @param keyName The name of the key to get. * @param keyVersion Adding the version parameter retrieves a specific version of a key. - * @param target The attestation assertion for the target of the key release. + * @param targetAttestationToken The attestation assertion for the target of the key release. * @param options The options parameters. */ release( vaultBaseUrl: string, keyName: string, keyVersion: string, - target: string, - options?: KeyVaultClientReleaseOptionalParams - ): Promise { + targetAttestationToken: string, + options?: ReleaseOptionalParams + ): Promise { const operationArguments: coreHttp.OperationArguments = { vaultBaseUrl, keyName, keyVersion, - target, + targetAttestationToken, options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) }; return this.sendOperationRequest( operationArguments, releaseOperationSpec - ) as Promise; + ) as Promise; } /** @@ -632,8 +604,8 @@ export class KeyVaultClient extends KeyVaultClientContext { */ getDeletedKeys( vaultBaseUrl: string, - options?: KeyVaultClientGetDeletedKeysOptionalParams - ): Promise { + options?: GetDeletedKeysOptionalParams + ): Promise { const operationArguments: coreHttp.OperationArguments = { vaultBaseUrl, options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) @@ -641,7 +613,7 @@ export class KeyVaultClient extends KeyVaultClientContext { return this.sendOperationRequest( operationArguments, getDeletedKeysOperationSpec - ) as Promise; + ) as Promise; } /** @@ -655,8 +627,8 @@ export class KeyVaultClient extends KeyVaultClientContext { getDeletedKey( vaultBaseUrl: string, keyName: string, - options?: KeyVaultClientGetDeletedKeyOptionalParams - ): Promise { + options?: GetDeletedKeyOptionalParams + ): Promise { const operationArguments: coreHttp.OperationArguments = { vaultBaseUrl, keyName, @@ -665,7 +637,7 @@ export class KeyVaultClient extends KeyVaultClientContext { return this.sendOperationRequest( operationArguments, getDeletedKeyOperationSpec - ) as Promise; + ) as Promise; } /** @@ -679,7 +651,7 @@ export class KeyVaultClient extends KeyVaultClientContext { purgeDeletedKey( vaultBaseUrl: string, keyName: string, - options?: KeyVaultClientPurgeDeletedKeyOptionalParams + options?: PurgeDeletedKeyOptionalParams ): Promise { const operationArguments: coreHttp.OperationArguments = { vaultBaseUrl, @@ -704,8 +676,8 @@ export class KeyVaultClient extends KeyVaultClientContext { recoverDeletedKey( vaultBaseUrl: string, keyName: string, - options?: KeyVaultClientRecoverDeletedKeyOptionalParams - ): Promise { + options?: RecoverDeletedKeyOptionalParams + ): Promise { const operationArguments: coreHttp.OperationArguments = { vaultBaseUrl, keyName, @@ -714,7 +686,7 @@ export class KeyVaultClient extends KeyVaultClientContext { return this.sendOperationRequest( operationArguments, recoverDeletedKeyOperationSpec - ) as Promise; + ) as Promise; } /** @@ -727,8 +699,8 @@ export class KeyVaultClient extends KeyVaultClientContext { getKeyRotationPolicy( vaultBaseUrl: string, keyName: string, - options?: KeyVaultClientGetKeyRotationPolicyOptionalParams - ): Promise { + options?: GetKeyRotationPolicyOptionalParams + ): Promise { const operationArguments: coreHttp.OperationArguments = { vaultBaseUrl, keyName, @@ -737,7 +709,7 @@ export class KeyVaultClient extends KeyVaultClientContext { return this.sendOperationRequest( operationArguments, getKeyRotationPolicyOperationSpec - ) as Promise; + ) as Promise; } /** @@ -752,8 +724,8 @@ export class KeyVaultClient extends KeyVaultClientContext { vaultBaseUrl: string, keyName: string, keyRotationPolicy: KeyRotationPolicy, - options?: KeyVaultClientUpdateKeyRotationPolicyOptionalParams - ): Promise { + options?: UpdateKeyRotationPolicyOptionalParams + ): Promise { const operationArguments: coreHttp.OperationArguments = { vaultBaseUrl, keyName, @@ -763,7 +735,7 @@ export class KeyVaultClient extends KeyVaultClientContext { return this.sendOperationRequest( operationArguments, updateKeyRotationPolicyOperationSpec - ) as Promise; + ) as Promise; } /** @@ -775,8 +747,8 @@ export class KeyVaultClient extends KeyVaultClientContext { getRandomBytes( vaultBaseUrl: string, count: number, - options?: KeyVaultClientGetRandomBytesOptionalParams - ): Promise { + options?: GetRandomBytesOptionalParams + ): Promise { const operationArguments: coreHttp.OperationArguments = { vaultBaseUrl, count, @@ -785,7 +757,7 @@ export class KeyVaultClient extends KeyVaultClientContext { return this.sendOperationRequest( operationArguments, getRandomBytesOperationSpec - ) as Promise; + ) as Promise; } /** @@ -799,8 +771,8 @@ export class KeyVaultClient extends KeyVaultClientContext { vaultBaseUrl: string, keyName: string, nextLink: string, - options?: KeyVaultClientGetKeyVersionsNextOptionalParams - ): Promise { + options?: GetKeyVersionsNextOptionalParams + ): Promise { const operationArguments: coreHttp.OperationArguments = { vaultBaseUrl, keyName, @@ -810,7 +782,7 @@ export class KeyVaultClient extends KeyVaultClientContext { return this.sendOperationRequest( operationArguments, getKeyVersionsNextOperationSpec - ) as Promise; + ) as Promise; } /** @@ -822,8 +794,8 @@ export class KeyVaultClient extends KeyVaultClientContext { getKeysNext( vaultBaseUrl: string, nextLink: string, - options?: KeyVaultClientGetKeysNextOptionalParams - ): Promise { + options?: GetKeysNextOptionalParams + ): Promise { const operationArguments: coreHttp.OperationArguments = { vaultBaseUrl, nextLink, @@ -832,7 +804,7 @@ export class KeyVaultClient extends KeyVaultClientContext { return this.sendOperationRequest( operationArguments, getKeysNextOperationSpec - ) as Promise; + ) as Promise; } /** @@ -844,8 +816,8 @@ export class KeyVaultClient extends KeyVaultClientContext { getDeletedKeysNext( vaultBaseUrl: string, nextLink: string, - options?: KeyVaultClientGetDeletedKeysNextOptionalParams - ): Promise { + options?: GetDeletedKeysNextOptionalParams + ): Promise { const operationArguments: coreHttp.OperationArguments = { vaultBaseUrl, nextLink, @@ -854,7 +826,7 @@ export class KeyVaultClient extends KeyVaultClientContext { return this.sendOperationRequest( operationArguments, getDeletedKeysNextOperationSpec - ) as Promise; + ) as Promise; } } // Operation Specifications @@ -1246,35 +1218,6 @@ const unwrapKeyOperationSpec: coreHttp.OperationSpec = { mediaType: "json", serializer }; -const exportOperationSpec: coreHttp.OperationSpec = { - path: "/keys/{key-name}/{key-version}/export", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.KeyBundle - }, - default: { - bodyMapper: Mappers.KeyVaultError - } - }, - requestBody: { - parameterPath: { - wrappingKey: ["options", "wrappingKey"], - wrappingKid: ["options", "wrappingKid"], - enc: ["options", "enc"] - }, - mapper: { ...Mappers.KeyExportParameters, required: true } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.vaultBaseUrl, - Parameters.keyName1, - Parameters.keyVersion - ], - headerParameters: [Parameters.contentType, Parameters.accept], - mediaType: "json", - serializer -}; const releaseOperationSpec: coreHttp.OperationSpec = { path: "/keys/{key-name}/{key-version}/release", httpMethod: "POST", @@ -1288,7 +1231,7 @@ const releaseOperationSpec: coreHttp.OperationSpec = { }, requestBody: { parameterPath: { - target: ["target"], + targetAttestationToken: ["targetAttestationToken"], nonce: ["options", "nonce"], enc: ["options", "enc"] }, diff --git a/sdk/keyvault/keyvault-keys/src/generated/keyVaultClientContext.ts b/sdk/keyvault/keyvault-keys/src/generated/keyVaultClientContext.ts index 5c49fa2b1032..8f2d7f3126dd 100644 --- a/sdk/keyvault/keyvault-keys/src/generated/keyVaultClientContext.ts +++ b/sdk/keyvault/keyvault-keys/src/generated/keyVaultClientContext.ts @@ -34,7 +34,7 @@ export class KeyVaultClientContext extends coreHttp.ServiceClient { } const defaultUserAgent = `azsdk-js-${packageName.replace( - "@azure/", + /@.*\//, "" )}/${packageVersion} ${coreHttp.getDefaultUserAgentValue()}`; diff --git a/sdk/keyvault/keyvault-keys/src/generated/models/index.ts b/sdk/keyvault/keyvault-keys/src/generated/models/index.ts index 02363ee03b7a..615f6e7e0851 100644 --- a/sdk/keyvault/keyvault-keys/src/generated/models/index.ts +++ b/sdk/keyvault/keyvault-keys/src/generated/models/index.ts @@ -50,6 +50,8 @@ export interface Attributes { export interface KeyReleasePolicy { /** Content type and version of key release policy */ contentType?: string; + /** Defines the mutability state of the policy. Once marked immutable, this flag cannot be reset and the policy cannot be changed under any circumstances. */ + immutable?: boolean; /** Blob encoding the policy rules under which the key can be released. */ encodedPolicy?: Uint8Array; } @@ -260,20 +262,10 @@ export interface KeyVerifyResult { readonly value?: boolean; } -/** The export key parameters. */ -export interface KeyExportParameters { - /** The export key encryption Json web key. This key MUST be a RSA key that supports encryption. */ - wrappingKey?: JsonWebKey; - /** The export key encryption key identifier. This key MUST be a RSA key that supports encryption. */ - wrappingKid?: string; - /** The encryption algorithm to use to protected the exported key material */ - enc?: KeyEncryptionAlgorithm; -} - /** The release key parameters. */ export interface KeyReleaseParameters { /** The attestation assertion for the target of the key release. */ - target: string; + targetAttestationToken: string; /** A client provided nonce for freshness. */ nonce?: string; /** The encryption algorithm to use to protected the exported key material */ @@ -326,9 +318,9 @@ export interface LifetimeActions { /** A condition to be satisfied for an action to be executed. */ export interface LifetimeActionsTrigger { - /** Time after creation to attempt rotate. It will be in ISO 8601 format. Example: 90 days : "P90D" */ + /** Time after creation to attempt to rotate. It only applies to rotate. It will be in ISO 8601 duration format. Example: 90 days : "P90D" */ timeAfterCreate?: string; - /** Time before expiry to attempt rotate. It will be in ISO 8601 format. Example: 90 days : "P90D" */ + /** Time before expiry to attempt to rotate or notify. It will be in ISO 8601 duration format. Example: 90 days : "P90D" */ timeBeforeExpiry?: string; } @@ -363,7 +355,7 @@ export interface GetRandomBytesRequest { /** The get random bytes response object containing the bytes. */ export interface RandomBytes { /** The bytes encoded as a base64url string. */ - value?: Uint8Array; + value: Uint8Array; } /** Properties of the key pair backing a certificate. */ @@ -380,6 +372,16 @@ export interface KeyProperties { curve?: JsonWebKeyCurveName; } +/** The export key parameters. */ +export interface KeyExportParameters { + /** The export key encryption Json web key. This key MUST be a RSA key that supports encryption. */ + wrappingKey?: JsonWebKey; + /** The export key encryption key identifier. This key MUST be a RSA key that supports encryption. */ + wrappingKid?: string; + /** The encryption algorithm to use to protected the exported key material */ + enc?: KeyEncryptionAlgorithm; +} + /** The attributes of a key managed by the key vault service. */ export type KeyAttributes = Attributes & { /** @@ -554,41 +556,27 @@ export enum KnownJsonWebKeyCurveName { * **P-256**: The NIST P-256 elliptic curve, AKA SECG curve SECP256R1. \ * **P-384**: The NIST P-384 elliptic curve, AKA SECG curve SECP384R1. \ * **P-521**: The NIST P-521 elliptic curve, AKA SECG curve SECP521R1. \ - * **P-256K**: The SECG SECP256K1 elliptic curve. + * **P-256K**: The SECG SECP256K1 elliptic curve. \ + * **Ed25519**: The Ed25519 Edwards curve. */ export type JsonWebKeyCurveName = string; /** Known values of {@link JsonWebKeyEncryptionAlgorithm} that the service accepts. */ export enum KnownJsonWebKeyEncryptionAlgorithm { - /** Encryption Algorithm - RSA-OAEP */ RSAOaep = "RSA-OAEP", - /** Encryption Algorithm - RSA-OAEP-256 */ RSAOaep256 = "RSA-OAEP-256", - /** Encryption Algorithm - RSA1_5 */ RSA15 = "RSA1_5", - /** Encryption Algorithm - A128GCM */ A128GCM = "A128GCM", - /** Encryption Algorithm - A192GCM */ A192GCM = "A192GCM", - /** Encryption Algorithm - A256GCM */ A256GCM = "A256GCM", - /** Encryption Algorithm - A128KW */ A128KW = "A128KW", - /** Encryption Algorithm - A192KW */ A192KW = "A192KW", - /** Encryption Algorithm - A256KW */ A256KW = "A256KW", - /** Encryption Algorithm - A128CBC */ A128CBC = "A128CBC", - /** Encryption Algorithm - A192CBC */ A192CBC = "A192CBC", - /** Encryption Algorithm - A256CBC */ A256CBC = "A256CBC", - /** Encryption Algorithm - A128CBCPAD */ A128Cbcpad = "A128CBCPAD", - /** Encryption Algorithm - A192CBCPAD */ A192Cbcpad = "A192CBCPAD", - /** Encryption Algorithm - A256CBCPAD */ A256Cbcpad = "A256CBCPAD" } @@ -681,8 +669,7 @@ export type KeyEncryptionAlgorithm = string; export type ActionType = "Rotate" | "Notify"; /** Optional parameters. */ -export interface KeyVaultClientCreateKeyOptionalParams - extends coreHttp.OperationOptions { +export interface CreateKeyOptionalParams extends coreHttp.OperationOptions { /** The key size in bits. For example: 2048, 3072, or 4096 for RSA. */ keySize?: number; /** The public exponent for a RSA key. */ @@ -700,7 +687,7 @@ export interface KeyVaultClientCreateKeyOptionalParams } /** Contains response data for the createKey operation. */ -export type KeyVaultClientCreateKeyResponse = KeyBundle & { +export type CreateKeyResponse = KeyBundle & { /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { /** The response body as text (string format) */ @@ -712,11 +699,10 @@ export type KeyVaultClientCreateKeyResponse = KeyBundle & { }; /** Optional parameters. */ -export interface KeyVaultClientRotateKeyOptionalParams - extends coreHttp.OperationOptions {} +export interface RotateKeyOptionalParams extends coreHttp.OperationOptions {} /** Contains response data for the rotateKey operation. */ -export type KeyVaultClientRotateKeyResponse = KeyBundle & { +export type RotateKeyResponse = KeyBundle & { /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { /** The response body as text (string format) */ @@ -728,8 +714,7 @@ export type KeyVaultClientRotateKeyResponse = KeyBundle & { }; /** Optional parameters. */ -export interface KeyVaultClientImportKeyOptionalParams - extends coreHttp.OperationOptions { +export interface ImportKeyOptionalParams extends coreHttp.OperationOptions { /** Whether to import as a hardware key (HSM) or software key. */ hsm?: boolean; /** The key management attributes. */ @@ -741,7 +726,7 @@ export interface KeyVaultClientImportKeyOptionalParams } /** Contains response data for the importKey operation. */ -export type KeyVaultClientImportKeyResponse = KeyBundle & { +export type ImportKeyResponse = KeyBundle & { /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { /** The response body as text (string format) */ @@ -753,11 +738,10 @@ export type KeyVaultClientImportKeyResponse = KeyBundle & { }; /** Optional parameters. */ -export interface KeyVaultClientDeleteKeyOptionalParams - extends coreHttp.OperationOptions {} +export interface DeleteKeyOptionalParams extends coreHttp.OperationOptions {} /** Contains response data for the deleteKey operation. */ -export type KeyVaultClientDeleteKeyResponse = DeletedKeyBundle & { +export type DeleteKeyResponse = DeletedKeyBundle & { /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { /** The response body as text (string format) */ @@ -769,8 +753,7 @@ export type KeyVaultClientDeleteKeyResponse = DeletedKeyBundle & { }; /** Optional parameters. */ -export interface KeyVaultClientUpdateKeyOptionalParams - extends coreHttp.OperationOptions { +export interface UpdateKeyOptionalParams extends coreHttp.OperationOptions { /** Json web key operations. For more information on possible key operations, see JsonWebKeyOperation. */ keyOps?: JsonWebKeyOperation[]; /** The attributes of a key managed by the key vault service. */ @@ -782,7 +765,7 @@ export interface KeyVaultClientUpdateKeyOptionalParams } /** Contains response data for the updateKey operation. */ -export type KeyVaultClientUpdateKeyResponse = KeyBundle & { +export type UpdateKeyResponse = KeyBundle & { /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { /** The response body as text (string format) */ @@ -794,11 +777,10 @@ export type KeyVaultClientUpdateKeyResponse = KeyBundle & { }; /** Optional parameters. */ -export interface KeyVaultClientGetKeyOptionalParams - extends coreHttp.OperationOptions {} +export interface GetKeyOptionalParams extends coreHttp.OperationOptions {} /** Contains response data for the getKey operation. */ -export type KeyVaultClientGetKeyResponse = KeyBundle & { +export type GetKeyResponse = KeyBundle & { /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { /** The response body as text (string format) */ @@ -810,14 +792,14 @@ export type KeyVaultClientGetKeyResponse = KeyBundle & { }; /** Optional parameters. */ -export interface KeyVaultClientGetKeyVersionsOptionalParams +export interface GetKeyVersionsOptionalParams extends coreHttp.OperationOptions { /** Maximum number of results to return in a page. If not specified the service will return up to 25 results. */ maxresults?: number; } /** Contains response data for the getKeyVersions operation. */ -export type KeyVaultClientGetKeyVersionsResponse = KeyListResult & { +export type GetKeyVersionsResponse = KeyListResult & { /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { /** The response body as text (string format) */ @@ -829,14 +811,13 @@ export type KeyVaultClientGetKeyVersionsResponse = KeyListResult & { }; /** Optional parameters. */ -export interface KeyVaultClientGetKeysOptionalParams - extends coreHttp.OperationOptions { +export interface GetKeysOptionalParams extends coreHttp.OperationOptions { /** Maximum number of results to return in a page. If not specified the service will return up to 25 results. */ maxresults?: number; } /** Contains response data for the getKeys operation. */ -export type KeyVaultClientGetKeysResponse = KeyListResult & { +export type GetKeysResponse = KeyListResult & { /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { /** The response body as text (string format) */ @@ -848,11 +829,10 @@ export type KeyVaultClientGetKeysResponse = KeyListResult & { }; /** Optional parameters. */ -export interface KeyVaultClientBackupKeyOptionalParams - extends coreHttp.OperationOptions {} +export interface BackupKeyOptionalParams extends coreHttp.OperationOptions {} /** Contains response data for the backupKey operation. */ -export type KeyVaultClientBackupKeyResponse = BackupKeyResult & { +export type BackupKeyResponse = BackupKeyResult & { /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { /** The response body as text (string format) */ @@ -864,11 +844,10 @@ export type KeyVaultClientBackupKeyResponse = BackupKeyResult & { }; /** Optional parameters. */ -export interface KeyVaultClientRestoreKeyOptionalParams - extends coreHttp.OperationOptions {} +export interface RestoreKeyOptionalParams extends coreHttp.OperationOptions {} /** Contains response data for the restoreKey operation. */ -export type KeyVaultClientRestoreKeyResponse = KeyBundle & { +export type RestoreKeyResponse = KeyBundle & { /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { /** The response body as text (string format) */ @@ -880,8 +859,7 @@ export type KeyVaultClientRestoreKeyResponse = KeyBundle & { }; /** Optional parameters. */ -export interface KeyVaultClientEncryptOptionalParams - extends coreHttp.OperationOptions { +export interface EncryptOptionalParams extends coreHttp.OperationOptions { /** Initialization vector for symmetric algorithms. */ iv?: Uint8Array; /** Additional data to authenticate but not encrypt/decrypt when using authenticated crypto algorithms. */ @@ -891,7 +869,7 @@ export interface KeyVaultClientEncryptOptionalParams } /** Contains response data for the encrypt operation. */ -export type KeyVaultClientEncryptResponse = KeyOperationResult & { +export type EncryptResponse = KeyOperationResult & { /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { /** The response body as text (string format) */ @@ -903,8 +881,7 @@ export type KeyVaultClientEncryptResponse = KeyOperationResult & { }; /** Optional parameters. */ -export interface KeyVaultClientDecryptOptionalParams - extends coreHttp.OperationOptions { +export interface DecryptOptionalParams extends coreHttp.OperationOptions { /** Initialization vector for symmetric algorithms. */ iv?: Uint8Array; /** Additional data to authenticate but not encrypt/decrypt when using authenticated crypto algorithms. */ @@ -914,7 +891,7 @@ export interface KeyVaultClientDecryptOptionalParams } /** Contains response data for the decrypt operation. */ -export type KeyVaultClientDecryptResponse = KeyOperationResult & { +export type DecryptResponse = KeyOperationResult & { /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { /** The response body as text (string format) */ @@ -926,11 +903,10 @@ export type KeyVaultClientDecryptResponse = KeyOperationResult & { }; /** Optional parameters. */ -export interface KeyVaultClientSignOptionalParams - extends coreHttp.OperationOptions {} +export interface SignOptionalParams extends coreHttp.OperationOptions {} /** Contains response data for the sign operation. */ -export type KeyVaultClientSignResponse = KeyOperationResult & { +export type SignResponse = KeyOperationResult & { /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { /** The response body as text (string format) */ @@ -942,11 +918,10 @@ export type KeyVaultClientSignResponse = KeyOperationResult & { }; /** Optional parameters. */ -export interface KeyVaultClientVerifyOptionalParams - extends coreHttp.OperationOptions {} +export interface VerifyOptionalParams extends coreHttp.OperationOptions {} /** Contains response data for the verify operation. */ -export type KeyVaultClientVerifyResponse = KeyVerifyResult & { +export type VerifyResponse = KeyVerifyResult & { /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { /** The response body as text (string format) */ @@ -958,8 +933,7 @@ export type KeyVaultClientVerifyResponse = KeyVerifyResult & { }; /** Optional parameters. */ -export interface KeyVaultClientWrapKeyOptionalParams - extends coreHttp.OperationOptions { +export interface WrapKeyOptionalParams extends coreHttp.OperationOptions { /** Initialization vector for symmetric algorithms. */ iv?: Uint8Array; /** Additional data to authenticate but not encrypt/decrypt when using authenticated crypto algorithms. */ @@ -969,7 +943,7 @@ export interface KeyVaultClientWrapKeyOptionalParams } /** Contains response data for the wrapKey operation. */ -export type KeyVaultClientWrapKeyResponse = KeyOperationResult & { +export type WrapKeyResponse = KeyOperationResult & { /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { /** The response body as text (string format) */ @@ -981,8 +955,7 @@ export type KeyVaultClientWrapKeyResponse = KeyOperationResult & { }; /** Optional parameters. */ -export interface KeyVaultClientUnwrapKeyOptionalParams - extends coreHttp.OperationOptions { +export interface UnwrapKeyOptionalParams extends coreHttp.OperationOptions { /** Initialization vector for symmetric algorithms. */ iv?: Uint8Array; /** Additional data to authenticate but not encrypt/decrypt when using authenticated crypto algorithms. */ @@ -992,7 +965,7 @@ export interface KeyVaultClientUnwrapKeyOptionalParams } /** Contains response data for the unwrapKey operation. */ -export type KeyVaultClientUnwrapKeyResponse = KeyOperationResult & { +export type UnwrapKeyResponse = KeyOperationResult & { /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { /** The response body as text (string format) */ @@ -1004,31 +977,7 @@ export type KeyVaultClientUnwrapKeyResponse = KeyOperationResult & { }; /** Optional parameters. */ -export interface KeyVaultClientExportOptionalParams - extends coreHttp.OperationOptions { - /** The export key encryption Json web key. This key MUST be a RSA key that supports encryption. */ - wrappingKey?: JsonWebKey; - /** The export key encryption key identifier. This key MUST be a RSA key that supports encryption. */ - wrappingKid?: string; - /** The encryption algorithm to use to protected the exported key material */ - enc?: KeyEncryptionAlgorithm; -} - -/** Contains response data for the export operation. */ -export type KeyVaultClientExportResponse = KeyBundle & { - /** The underlying HTTP response. */ - _response: coreHttp.HttpResponse & { - /** The response body as text (string format) */ - bodyAsText: string; - - /** The response body as parsed JSON or XML */ - parsedBody: KeyBundle; - }; -}; - -/** Optional parameters. */ -export interface KeyVaultClientReleaseOptionalParams - extends coreHttp.OperationOptions { +export interface ReleaseOptionalParams extends coreHttp.OperationOptions { /** A client provided nonce for freshness. */ nonce?: string; /** The encryption algorithm to use to protected the exported key material */ @@ -1036,7 +985,7 @@ export interface KeyVaultClientReleaseOptionalParams } /** Contains response data for the release operation. */ -export type KeyVaultClientReleaseResponse = KeyReleaseResult & { +export type ReleaseResponse = KeyReleaseResult & { /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { /** The response body as text (string format) */ @@ -1048,14 +997,14 @@ export type KeyVaultClientReleaseResponse = KeyReleaseResult & { }; /** Optional parameters. */ -export interface KeyVaultClientGetDeletedKeysOptionalParams +export interface GetDeletedKeysOptionalParams extends coreHttp.OperationOptions { /** Maximum number of results to return in a page. If not specified the service will return up to 25 results. */ maxresults?: number; } /** Contains response data for the getDeletedKeys operation. */ -export type KeyVaultClientGetDeletedKeysResponse = DeletedKeyListResult & { +export type GetDeletedKeysResponse = DeletedKeyListResult & { /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { /** The response body as text (string format) */ @@ -1067,11 +1016,11 @@ export type KeyVaultClientGetDeletedKeysResponse = DeletedKeyListResult & { }; /** Optional parameters. */ -export interface KeyVaultClientGetDeletedKeyOptionalParams +export interface GetDeletedKeyOptionalParams extends coreHttp.OperationOptions {} /** Contains response data for the getDeletedKey operation. */ -export type KeyVaultClientGetDeletedKeyResponse = DeletedKeyBundle & { +export type GetDeletedKeyResponse = DeletedKeyBundle & { /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { /** The response body as text (string format) */ @@ -1083,15 +1032,15 @@ export type KeyVaultClientGetDeletedKeyResponse = DeletedKeyBundle & { }; /** Optional parameters. */ -export interface KeyVaultClientPurgeDeletedKeyOptionalParams +export interface PurgeDeletedKeyOptionalParams extends coreHttp.OperationOptions {} /** Optional parameters. */ -export interface KeyVaultClientRecoverDeletedKeyOptionalParams +export interface RecoverDeletedKeyOptionalParams extends coreHttp.OperationOptions {} /** Contains response data for the recoverDeletedKey operation. */ -export type KeyVaultClientRecoverDeletedKeyResponse = KeyBundle & { +export type RecoverDeletedKeyResponse = KeyBundle & { /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { /** The response body as text (string format) */ @@ -1103,11 +1052,11 @@ export type KeyVaultClientRecoverDeletedKeyResponse = KeyBundle & { }; /** Optional parameters. */ -export interface KeyVaultClientGetKeyRotationPolicyOptionalParams +export interface GetKeyRotationPolicyOptionalParams extends coreHttp.OperationOptions {} /** Contains response data for the getKeyRotationPolicy operation. */ -export type KeyVaultClientGetKeyRotationPolicyResponse = KeyRotationPolicy & { +export type GetKeyRotationPolicyResponse = KeyRotationPolicy & { /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { /** The response body as text (string format) */ @@ -1119,11 +1068,11 @@ export type KeyVaultClientGetKeyRotationPolicyResponse = KeyRotationPolicy & { }; /** Optional parameters. */ -export interface KeyVaultClientUpdateKeyRotationPolicyOptionalParams +export interface UpdateKeyRotationPolicyOptionalParams extends coreHttp.OperationOptions {} /** Contains response data for the updateKeyRotationPolicy operation. */ -export type KeyVaultClientUpdateKeyRotationPolicyResponse = KeyRotationPolicy & { +export type UpdateKeyRotationPolicyResponse = KeyRotationPolicy & { /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { /** The response body as text (string format) */ @@ -1135,11 +1084,11 @@ export type KeyVaultClientUpdateKeyRotationPolicyResponse = KeyRotationPolicy & }; /** Optional parameters. */ -export interface KeyVaultClientGetRandomBytesOptionalParams +export interface GetRandomBytesOptionalParams extends coreHttp.OperationOptions {} /** Contains response data for the getRandomBytes operation. */ -export type KeyVaultClientGetRandomBytesResponse = RandomBytes & { +export type GetRandomBytesResponse = RandomBytes & { /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { /** The response body as text (string format) */ @@ -1151,14 +1100,14 @@ export type KeyVaultClientGetRandomBytesResponse = RandomBytes & { }; /** Optional parameters. */ -export interface KeyVaultClientGetKeyVersionsNextOptionalParams +export interface GetKeyVersionsNextOptionalParams extends coreHttp.OperationOptions { /** Maximum number of results to return in a page. If not specified the service will return up to 25 results. */ maxresults?: number; } /** Contains response data for the getKeyVersionsNext operation. */ -export type KeyVaultClientGetKeyVersionsNextResponse = KeyListResult & { +export type GetKeyVersionsNextResponse = KeyListResult & { /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { /** The response body as text (string format) */ @@ -1170,14 +1119,13 @@ export type KeyVaultClientGetKeyVersionsNextResponse = KeyListResult & { }; /** Optional parameters. */ -export interface KeyVaultClientGetKeysNextOptionalParams - extends coreHttp.OperationOptions { +export interface GetKeysNextOptionalParams extends coreHttp.OperationOptions { /** Maximum number of results to return in a page. If not specified the service will return up to 25 results. */ maxresults?: number; } /** Contains response data for the getKeysNext operation. */ -export type KeyVaultClientGetKeysNextResponse = KeyListResult & { +export type GetKeysNextResponse = KeyListResult & { /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { /** The response body as text (string format) */ @@ -1189,14 +1137,14 @@ export type KeyVaultClientGetKeysNextResponse = KeyListResult & { }; /** Optional parameters. */ -export interface KeyVaultClientGetDeletedKeysNextOptionalParams +export interface GetDeletedKeysNextOptionalParams extends coreHttp.OperationOptions { /** Maximum number of results to return in a page. If not specified the service will return up to 25 results. */ maxresults?: number; } /** Contains response data for the getDeletedKeysNext operation. */ -export type KeyVaultClientGetDeletedKeysNextResponse = DeletedKeyListResult & { +export type GetDeletedKeysNextResponse = DeletedKeyListResult & { /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { /** The response body as text (string format) */ diff --git a/sdk/keyvault/keyvault-keys/src/generated/models/mappers.ts b/sdk/keyvault/keyvault-keys/src/generated/models/mappers.ts index 7e8eba5d0db5..4539f79ffe54 100644 --- a/sdk/keyvault/keyvault-keys/src/generated/models/mappers.ts +++ b/sdk/keyvault/keyvault-keys/src/generated/models/mappers.ts @@ -127,6 +127,12 @@ export const KeyReleasePolicy: coreHttp.CompositeMapper = { name: "String" } }, + immutable: { + serializedName: "immutable", + type: { + name: "Boolean" + } + }, encodedPolicy: { serializedName: "data", type: { @@ -672,40 +678,12 @@ export const KeyVerifyResult: coreHttp.CompositeMapper = { } }; -export const KeyExportParameters: coreHttp.CompositeMapper = { - type: { - name: "Composite", - className: "KeyExportParameters", - modelProperties: { - wrappingKey: { - serializedName: "wrappingKey", - type: { - name: "Composite", - className: "JsonWebKey" - } - }, - wrappingKid: { - serializedName: "wrappingKid", - type: { - name: "String" - } - }, - enc: { - serializedName: "enc", - type: { - name: "String" - } - } - } - } -}; - export const KeyReleaseParameters: coreHttp.CompositeMapper = { type: { name: "Composite", className: "KeyReleaseParameters", modelProperties: { - target: { + targetAttestationToken: { constraints: { MinLength: 1 }, @@ -927,6 +905,7 @@ export const RandomBytes: coreHttp.CompositeMapper = { modelProperties: { value: { serializedName: "value", + required: true, type: { name: "Base64Url" } @@ -974,6 +953,34 @@ export const KeyProperties: coreHttp.CompositeMapper = { } }; +export const KeyExportParameters: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "KeyExportParameters", + modelProperties: { + wrappingKey: { + serializedName: "wrappingKey", + type: { + name: "Composite", + className: "JsonWebKey" + } + }, + wrappingKid: { + serializedName: "wrappingKid", + type: { + name: "String" + } + }, + enc: { + serializedName: "enc", + type: { + name: "String" + } + } + } + } +}; + export const KeyAttributes: coreHttp.CompositeMapper = { type: { name: "Composite", diff --git a/sdk/keyvault/keyvault-keys/src/generated/models/parameters.ts b/sdk/keyvault/keyvault-keys/src/generated/models/parameters.ts index 0d8fce9f470f..d8ecd2c96ed8 100644 --- a/sdk/keyvault/keyvault-keys/src/generated/models/parameters.ts +++ b/sdk/keyvault/keyvault-keys/src/generated/models/parameters.ts @@ -19,7 +19,6 @@ import { KeyOperationsParameters as KeyOperationsParametersMapper, KeySignParameters as KeySignParametersMapper, KeyVerifyParameters as KeyVerifyParametersMapper, - KeyExportParameters as KeyExportParametersMapper, KeyReleaseParameters as KeyReleaseParametersMapper, KeyRotationPolicy as KeyRotationPolicyMapper, GetRandomBytesRequest as GetRandomBytesRequestMapper @@ -262,23 +261,8 @@ export const signature: OperationParameter = { mapper: KeyVerifyParametersMapper }; -export const wrappingKey: OperationParameter = { - parameterPath: ["options", "wrappingKey"], - mapper: KeyExportParametersMapper -}; - -export const wrappingKid: OperationParameter = { - parameterPath: ["options", "wrappingKid"], - mapper: KeyExportParametersMapper -}; - -export const enc: OperationParameter = { - parameterPath: ["options", "enc"], - mapper: KeyExportParametersMapper -}; - -export const target: OperationParameter = { - parameterPath: "target", +export const targetAttestationToken: OperationParameter = { + parameterPath: "targetAttestationToken", mapper: KeyReleaseParametersMapper }; @@ -287,7 +271,7 @@ export const nonce: OperationParameter = { mapper: KeyReleaseParametersMapper }; -export const enc1: OperationParameter = { +export const enc: OperationParameter = { parameterPath: ["options", "enc"], mapper: KeyReleaseParametersMapper }; diff --git a/sdk/keyvault/keyvault-keys/src/index.ts b/sdk/keyvault/keyvault-keys/src/index.ts index d66517a77581..c76544614978 100644 --- a/sdk/keyvault/keyvault-keys/src/index.ts +++ b/sdk/keyvault/keyvault-keys/src/index.ts @@ -20,7 +20,7 @@ import { PollerLike, PollOperationState } from "@azure/core-lro"; import { DeletionRecoveryLevel, KnownDeletionRecoveryLevel, - KeyVaultClientGetKeysOptionalParams, + GetKeysOptionalParams, KnownJsonWebKeyType, } from "./generated/models"; import { KeyVaultClient } from "./generated/keyVaultClient"; @@ -909,7 +909,7 @@ export class KeyClient { options?: ListPropertiesOfKeyVersionsOptions ): AsyncIterableIterator { if (continuationState.continuationToken == null) { - const optionsComplete: KeyVaultClientGetKeysOptionalParams = { + const optionsComplete: GetKeysOptionalParams = { maxresults: continuationState.maxPageSize, ...options, }; @@ -1001,7 +1001,7 @@ export class KeyClient { options?: ListPropertiesOfKeysOptions ): AsyncIterableIterator { if (continuationState.continuationToken == null) { - const optionsComplete: KeyVaultClientGetKeysOptionalParams = { + const optionsComplete: GetKeysOptionalParams = { maxresults: continuationState.maxPageSize, ...options, }; @@ -1089,7 +1089,7 @@ export class KeyClient { options?: ListDeletedKeysOptions ): AsyncIterableIterator { if (continuationState.continuationToken == null) { - const optionsComplete: KeyVaultClientGetKeysOptionalParams = { + const optionsComplete: GetKeysOptionalParams = { maxresults: continuationState.maxPageSize, ...options, }; diff --git a/sdk/keyvault/keyvault-keys/src/keysModels.ts b/sdk/keyvault/keyvault-keys/src/keysModels.ts index e877c4418872..3c58934160ca 100644 --- a/sdk/keyvault/keyvault-keys/src/keysModels.ts +++ b/sdk/keyvault/keyvault-keys/src/keysModels.ts @@ -287,6 +287,9 @@ export interface KeyReleasePolicy { /** Blob encoding the policy rules under which the key can be released. */ encodedPolicy?: Uint8Array; + + /** Marks a release policy as immutable. An immutable release policy cannot be changed or updated after marked immutable. */ + immutable?: boolean; } /** diff --git a/sdk/keyvault/keyvault-keys/swagger/README.md b/sdk/keyvault/keyvault-keys/swagger/README.md index 24ce06973658..0db99fa8c1b3 100644 --- a/sdk/keyvault/keyvault-keys/swagger/README.md +++ b/sdk/keyvault/keyvault-keys/swagger/README.md @@ -9,12 +9,14 @@ generate-metadata: false add-credentials: false use-core-v2: false license-header: MICROSOFT_MIT_NO_VERSION -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/f4a4badda9e19dca5cab216f3dd8b45362aeb90b/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.3-preview/keys.json +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/b7d6b00a7f388f048772ea249114a63773312538/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.3-preview/keys.json output-folder: ../ source-code-folder-path: ./src/generated disable-async-iterators: true api-version-parameter: choice package-version: 4.4.0-beta.4 +use-extension: + "@autorest/typescript": "6.0.0-beta.15" ``` ## Customizations for Track 2 Generator diff --git a/sdk/keyvault/keyvault-keys/test/public/keyClient.spec.ts b/sdk/keyvault/keyvault-keys/test/public/keyClient.spec.ts index 860917804ac9..4e007b8a8420 100644 --- a/sdk/keyvault/keyvault-keys/test/public/keyClient.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/public/keyClient.spec.ts @@ -609,5 +609,43 @@ describe("Keys client - create, read, update and delete operations", () => { /exportable/i ); }); + + it("errors when updating an immutable release policy", async () => { + const keyName = recorder.getUniqueName("immutablerelease"); + const createdKey = await client.createRsaKey(keyName, { + exportable: true, + hsm: true, + releasePolicy: { + encodedPolicy: encodedReleasePolicy, + immutable: true, + }, + keyOps: ["encrypt", "decrypt"], + }); + + const newReleasePolicy = { + anyOf: [ + { + anyOf: [ + { + claim: "sdk-test", + equals: "false", + }, + ], + authority: env.AZURE_KEYVAULT_ATTESTATION_URI, + }, + ], + version: "1.0", + }; + + await assert.isRejected( + client.updateKeyProperties(createdKey.name, { + releasePolicy: { + encodedPolicy: stringToUint8Array(JSON.stringify(newReleasePolicy)), + immutable: true, + }, + }), + /Immutable Key Release/ + ); + }); }); }); From b3b2744fe1e003b45c668842a06ffe27d699e464 Mon Sep 17 00:00:00 2001 From: KarishmaGhiya Date: Thu, 27 Jan 2022 16:34:01 -0800 Subject: [PATCH 20/26] fix the local time zone bug in the test (#20096) --- .../test/internal/unit/modelConverters.unittest.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/monitor/monitor-query/test/internal/unit/modelConverters.unittest.spec.ts b/sdk/monitor/monitor-query/test/internal/unit/modelConverters.unittest.spec.ts index b64d07286e12..3be80867318a 100644 --- a/sdk/monitor/monitor-query/test/internal/unit/modelConverters.unittest.spec.ts +++ b/sdk/monitor/monitor-query/test/internal/unit/modelConverters.unittest.spec.ts @@ -354,8 +354,8 @@ describe("Model unit tests", () => { it("convertTimespanToInterval", () => { const res1 = convertTimespanToInterval({ - startTime: new Date("2007-11-13T08:00:00"), - endTime: new Date("2007-11-16T08:00:00"), + startTime: new Date("2007-11-13T08:00:00Z"), + endTime: new Date("2007-11-16T08:00:00Z"), }); assert.equal(res1, "2007-11-13T08:00:00.000Z/2007-11-16T08:00:00.000Z"); From 5a793ee5059a735b18ca6aeee1fa924b9b869911 Mon Sep 17 00:00:00 2001 From: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com> Date: Fri, 28 Jan 2022 08:51:00 +0800 Subject: [PATCH 21/26] Update CredScanSuppression.json (#20098) --- eng/CredScanSuppression.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eng/CredScanSuppression.json b/eng/CredScanSuppression.json index 2b16a97b7098..2a4a76ebfbe2 100644 --- a/eng/CredScanSuppression.json +++ b/eng/CredScanSuppression.json @@ -31,7 +31,8 @@ "SecretPlaceholder", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjM2MDB9.adM-ddBZZlQ1WlN3pdPBOF5G4Wh9iZpxNP_fSvpF4cWs", "Resource", - "sanitized.${expiryReplacement}.sanitized" + "sanitized.${expiryReplacement}.sanitized", + "123456789" ], "_justification": "Secret used by test code, it is fake." }, From 72a7f15976c27e0c3b545a118d5b1b8f3a322a14 Mon Sep 17 00:00:00 2001 From: Ben Zhang <42699471+bzhang0@users.noreply.github.com> Date: Thu, 27 Jan 2022 19:33:44 -0800 Subject: [PATCH 22/26] [sort-imports] enforce ```sort-imports``` rule in ```eventhubs-checkpointstore-table``` (#20106) * enforce sort-imports * prettier --- .../eventhubs-checkpointstore-table/.eslintrc.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 sdk/eventhub/eventhubs-checkpointstore-table/.eslintrc.json diff --git a/sdk/eventhub/eventhubs-checkpointstore-table/.eslintrc.json b/sdk/eventhub/eventhubs-checkpointstore-table/.eslintrc.json new file mode 100644 index 000000000000..1a065ea7f1a3 --- /dev/null +++ b/sdk/eventhub/eventhubs-checkpointstore-table/.eslintrc.json @@ -0,0 +1,7 @@ +{ + "plugins": ["@azure/azure-sdk"], + "extends": ["plugin:@azure/azure-sdk/azure-sdk-base"], + "rules": { + "sort-imports": "error" + } +} From 98d66afd0a686a878a60b2d710a1b059b593c232 Mon Sep 17 00:00:00 2001 From: Harsha Nalluru Date: Fri, 28 Jan 2022 12:25:04 -0700 Subject: [PATCH 23/26] Set "TestProxy: true" for template and identity pipelines (#20122) --- sdk/identity/ci.yml | 1 + sdk/template/ci.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/sdk/identity/ci.yml b/sdk/identity/ci.yml index 855f8e9c53e6..af2d52cf39e8 100644 --- a/sdk/identity/ci.yml +++ b/sdk/identity/ci.yml @@ -25,6 +25,7 @@ extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: ServiceDirectory: identity + TestProxy: true Artifacts: - name: azure-identity safeName: azureidentity diff --git a/sdk/template/ci.yml b/sdk/template/ci.yml index aab1e47402c0..e89c102c63ca 100644 --- a/sdk/template/ci.yml +++ b/sdk/template/ci.yml @@ -25,6 +25,7 @@ extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: ServiceDirectory: template + TestProxy: true Artifacts: - name: azure-template safeName: azuretemplate From 82345de0b2652fa8ed75a9460195ec406db586f2 Mon Sep 17 00:00:00 2001 From: Ben Zhang <42699471+bzhang0@users.noreply.github.com> Date: Fri, 28 Jan 2022 11:30:23 -0800 Subject: [PATCH 24/26] enforce sort-imports (#20119) --- sdk/eventhub/mock-hub/.eslintrc.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 sdk/eventhub/mock-hub/.eslintrc.json diff --git a/sdk/eventhub/mock-hub/.eslintrc.json b/sdk/eventhub/mock-hub/.eslintrc.json new file mode 100644 index 000000000000..1a065ea7f1a3 --- /dev/null +++ b/sdk/eventhub/mock-hub/.eslintrc.json @@ -0,0 +1,7 @@ +{ + "plugins": ["@azure/azure-sdk"], + "extends": ["plugin:@azure/azure-sdk/azure-sdk-base"], + "rules": { + "sort-imports": "error" + } +} From 8d063af0b0cc984907c11437b0e5a970529850bb Mon Sep 17 00:00:00 2001 From: Daniel Rodriguez Date: Fri, 28 Jan 2022 21:18:53 +0000 Subject: [PATCH 25/26] using error.name instead of instanceof --- sdk/keyvault/keyvault-keys/test/public/keyClient.spec.ts | 5 ++--- sdk/keyvault/keyvault-keys/test/public/lro.delete.spec.ts | 3 +-- .../keyvault-keys/test/public/lro.recoverDelete.spec.ts | 3 +-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/sdk/keyvault/keyvault-keys/test/public/keyClient.spec.ts b/sdk/keyvault/keyvault-keys/test/public/keyClient.spec.ts index 4e007b8a8420..bafba11d3adc 100644 --- a/sdk/keyvault/keyvault-keys/test/public/keyClient.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/public/keyClient.spec.ts @@ -7,7 +7,6 @@ import chaiAsPromised from "chai-as-promised"; chai.use(chaiExclude); chai.use(chaiAsPromised); import { Context } from "mocha"; -import { RestError } from "@azure/core-http"; import { AbortController } from "@azure/abort-controller"; import { env, isPlaybackMode, isRecordMode, Recorder } from "@azure-tools/test-recorder"; @@ -287,7 +286,7 @@ describe("Keys client - create, read, update and delete operations", () => { await client.getKey(keyName); throw Error("Expecting an error but not catching one."); } catch (e) { - if (e instanceof RestError) { + if (e.name === "RestError") { assert.equal(e.code, "KeyNotFound"); assert.equal(e.statusCode, 404); } else { @@ -318,7 +317,7 @@ describe("Keys client - create, read, update and delete operations", () => { await client.getKey(keyName); throw Error("Expecting an error but not catching one."); } catch (e) { - if (e instanceof RestError) { + if (e.name === "RestError") { assert.equal(e.code, "KeyNotFound"); assert.equal(e.statusCode, 404); } else { diff --git a/sdk/keyvault/keyvault-keys/test/public/lro.delete.spec.ts b/sdk/keyvault/keyvault-keys/test/public/lro.delete.spec.ts index 6bd70c9949e9..6c6f56d33cf2 100644 --- a/sdk/keyvault/keyvault-keys/test/public/lro.delete.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/public/lro.delete.spec.ts @@ -4,7 +4,6 @@ import { assert } from "chai"; import { Context } from "mocha"; import { env, Recorder } from "@azure-tools/test-recorder"; -import { PollerStoppedError } from "@azure/core-lro"; import { KeyClient, DeletedKey } from "../../src"; import { testPollerProperties } from "./utils/recorderUtils"; @@ -59,7 +58,7 @@ describe("Keys client - Long Running Operations - delete", () => { assert.ok(poller.getOperationState().isStarted); poller.pollUntilDone().catch((e) => { - assert.ok(e instanceof PollerStoppedError); + assert.ok(e.name === "PollerStoppedError"); assert.equal(e.name, "PollerStoppedError"); assert.equal(e.message, "This poller is already stopped"); }); diff --git a/sdk/keyvault/keyvault-keys/test/public/lro.recoverDelete.spec.ts b/sdk/keyvault/keyvault-keys/test/public/lro.recoverDelete.spec.ts index 365ca6bc6b2e..01a0289c035f 100644 --- a/sdk/keyvault/keyvault-keys/test/public/lro.recoverDelete.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/public/lro.recoverDelete.spec.ts @@ -4,7 +4,6 @@ import { assert } from "chai"; import { Context } from "mocha"; import { env, Recorder } from "@azure-tools/test-recorder"; -import { PollerStoppedError } from "@azure/core-lro"; import { KeyClient, DeletedKey } from "../../src"; import { assertThrowsAbortError, getServiceVersion } from "./utils/common"; @@ -66,7 +65,7 @@ describe("Keys client - Long Running Operations - recoverDelete", () => { assert.ok(poller.getOperationState().isStarted); poller.pollUntilDone().catch((e) => { - assert.ok(e instanceof PollerStoppedError); + assert.ok(e.name === "PollerStoppedError"); assert.equal(e.name, "PollerStoppedError"); assert.equal(e.message, "This poller is already stopped"); }); From f92122ee5f6b00d1b5c2b864e0512680e4006fec Mon Sep 17 00:00:00 2001 From: Daniel Rodriguez Date: Fri, 28 Jan 2022 21:51:15 +0000 Subject: [PATCH 26/26] formatting in schema registry --- .../src/schemaRegistryAvroEncoder.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sdk/schemaregistry/schema-registry-avro/src/schemaRegistryAvroEncoder.ts b/sdk/schemaregistry/schema-registry-avro/src/schemaRegistryAvroEncoder.ts index 6fedfde2e9e4..237a9d565ebf 100644 --- a/sdk/schemaregistry/schema-registry-avro/src/schemaRegistryAvroEncoder.ts +++ b/sdk/schemaregistry/schema-registry-avro/src/schemaRegistryAvroEncoder.ts @@ -73,18 +73,18 @@ export class SchemaRegistryAvroEncoder { const contentType = `${avroMimeType}+${entry.id}`; return this.messageAdapter ? this.messageAdapter.produceMessage({ - contentType, - body: payload, - }) + contentType, + body: payload, + }) : /** * If no message consumer was provided, then a MessageWithMetadata will be * returned. This should work because the MessageT type parameter defaults * to MessageWithMetadata. */ - ({ - body: payload, - contentType: contentType, - } as unknown as MessageT); + ({ + body: payload, + contentType: contentType, + } as unknown as MessageT); } /**