From 1cd9fcca393d9d669996918b1a8731a70f00dd9e Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 21 Nov 2024 06:34:24 +0000 Subject: [PATCH] CodeGen from PR 31523 in Azure/azure-rest-api-specs Merge cc19ba55548366ed82b990f661e374e84882c53c into 48777d9eec339e02f463acc12bc8622949e93523 --- common/config/rush/pnpm-lock.yaml | 30 + rush.json | 9 +- .../CHANGELOG.md | 7 + .../LICENSE | 21 + .../README.md | 109 + .../_meta.json | 8 + .../api-extractor.json | 31 + .../package.json | 109 + ...tesconfiguration-fluxconfigurations.api.md | 601 +++++ .../sample.env | 1 + .../src/fluxConfigurationClient.ts | 149 ++ .../src/index.ts | 13 + .../src/lroImpl.ts | 42 + .../src/models/index.ts | 939 ++++++++ .../src/models/mappers.ts | 1983 +++++++++++++++++ .../src/models/parameters.ts | 187 ++ .../operations/fluxConfigOperationStatus.ts | 95 + .../src/operations/fluxConfigurations.ts | 769 +++++++ .../src/operations/index.ts | 10 + .../fluxConfigOperationStatus.ts | 37 + .../fluxConfigurations.ts | 197 ++ .../src/operationsInterfaces/index.ts | 10 + .../src/pagingHelper.ts | 39 + .../test/sampleTest.ts | 43 + .../tsconfig.json | 27 + sdk/kubernetesconfiguration/ci.mgmt.yml | 4 + 26 files changed, 5468 insertions(+), 2 deletions(-) create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/CHANGELOG.md create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/LICENSE create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/README.md create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/_meta.json create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/api-extractor.json create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/package.json create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/review/arm-kubernetesconfiguration-fluxconfigurations.api.md create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/sample.env create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/fluxConfigurationClient.ts create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/index.ts create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/lroImpl.ts create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/models/index.ts create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/models/mappers.ts create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/models/parameters.ts create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/operations/fluxConfigOperationStatus.ts create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/operations/fluxConfigurations.ts create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/operations/index.ts create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/operationsInterfaces/fluxConfigOperationStatus.ts create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/operationsInterfaces/fluxConfigurations.ts create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/operationsInterfaces/index.ts create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/pagingHelper.ts create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/test/sampleTest.ts create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/tsconfig.json diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index eb9c875f7727..235dc7861134 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -440,6 +440,9 @@ dependencies: '@rush-temp/arm-kubernetesconfiguration': specifier: file:./projects/arm-kubernetesconfiguration.tgz version: file:projects/arm-kubernetesconfiguration.tgz + '@rush-temp/arm-kubernetesconfiguration-fluxconfigurations': + specifier: file:./projects/arm-kubernetesconfiguration-fluxconfigurations.tgz + version: file:projects/arm-kubernetesconfiguration-fluxconfigurations.tgz '@rush-temp/arm-kusto': specifier: file:./projects/arm-kusto.tgz version: file:projects/arm-kusto.tgz @@ -15362,6 +15365,33 @@ packages: - supports-color dev: false + file:projects/arm-kubernetesconfiguration-fluxconfigurations.tgz: + resolution: {integrity: sha512-JI5xv3IWAeLf259Nsw06jXSnNlrLNBohu855ksxvjzgnn0ojkFGJcFIjsGiGSuKhqLof19ia6hL08XtfjS8wgA==, tarball: file:projects/arm-kubernetesconfiguration-fluxconfigurations.tgz} + name: '@rush-temp/arm-kubernetesconfiguration-fluxconfigurations' + version: 0.0.0 + dependencies: + '@azure-tools/test-credential': 1.3.1 + '@azure-tools/test-recorder': 3.5.2 + '@azure/core-lro': 2.7.2 + '@microsoft/api-extractor': 7.47.11(@types/node@18.19.64) + '@types/chai': 4.3.20 + '@types/mocha': 10.0.9 + '@types/node': 18.19.64 + chai: 4.3.10 + cross-env: 7.0.3 + dotenv: 16.4.5 + mocha: 10.8.2 + ts-node: 10.9.2(@types/node@18.19.64)(typescript@5.6.3) + tslib: 2.8.1 + tsx: 4.19.2 + typescript: 5.6.3 + uglify-js: 3.19.3 + transitivePeerDependencies: + - '@swc/core' + - '@swc/wasm' + - supports-color + dev: false + file:projects/arm-kubernetesconfiguration.tgz: resolution: {integrity: sha512-FS2Wh1SRGyCAjRiE6MHcYEanZ8xXG765WyfHkdOMHnYlzSspQ4lkP5vU+4qfG7Q9ikSlQGFiWPvyzuCiHj0Eog==, tarball: file:projects/arm-kubernetesconfiguration.tgz} name: '@rush-temp/arm-kubernetesconfiguration' diff --git a/rush.json b/rush.json index a3f65d835cf8..7f981e9ef032 100644 --- a/rush.json +++ b/rush.json @@ -1,7 +1,7 @@ /** * This is the main configuration file for Rush. * For full documentation, please see https://rushjs.io - */ { + */{ "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush.schema.json", /** * (Required) This specifies the version of the Rush engine to be used in this repo. @@ -2316,6 +2316,11 @@ "packageName": "@azure/arm-connectedcache", "projectFolder": "sdk/connectedcache/arm-connectedcache", "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-kubernetesconfiguration-fluxconfigurations", + "projectFolder": "sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations", + "versionPolicyName": "management" } ] -} +} \ No newline at end of file diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/CHANGELOG.md b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/CHANGELOG.md new file mode 100644 index 000000000000..1cb6103dbedf --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/CHANGELOG.md @@ -0,0 +1,7 @@ +# Release History + +## 1.0.0 (2024-11-21) + +### Features Added + +The package of @azure/arm-kubernetesconfiguration-fluxconfigurations is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart). diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/LICENSE b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/LICENSE new file mode 100644 index 000000000000..7d5934740965 --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2024 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/README.md b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/README.md new file mode 100644 index 000000000000..0c09c91df957 --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/README.md @@ -0,0 +1,109 @@ +# Azure FluxConfiguration client library for JavaScript + +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure FluxConfiguration client. + +KubernetesConfiguration Flux Client + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-kubernetesconfiguration-fluxconfigurations) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-kubernetesconfiguration-fluxconfigurations) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started + +### Currently supported environments + +- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) +- Latest versions of Safari, Chrome, Edge and Firefox. + +See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details. + +### Prerequisites + +- An [Azure subscription][azure_sub]. + +### Install the `@azure/arm-kubernetesconfiguration-fluxconfigurations` package + +Install the Azure FluxConfiguration client library for JavaScript with `npm`: + +```bash +npm install @azure/arm-kubernetesconfiguration-fluxconfigurations +``` + +### Create and authenticate a `FluxConfigurationClient` + +To create a client object to access the Azure FluxConfiguration API, you will need the `endpoint` of your Azure FluxConfiguration resource and a `credential`. The Azure FluxConfiguration client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure FluxConfiguration resource in the [Azure Portal][azure_portal]. + +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). + +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: + +```bash +npm install @azure/identity +``` + +You will also need to **register a new AAD application and grant access to Azure FluxConfiguration** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. + +For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). + +```javascript +const { FluxConfigurationClient } = require("@azure/arm-kubernetesconfiguration-fluxconfigurations"); +const { DefaultAzureCredential } = require("@azure/identity"); +// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. + +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new FluxConfigurationClient(new DefaultAzureCredential(), subscriptionId); + +// For client-side applications running in the browser, use this code instead: +// const credential = new InteractiveBrowserCredential({ +// tenantId: "", +// clientId: "" +// }); +// const client = new FluxConfigurationClient(credential, subscriptionId); +``` + + +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). + +## Key concepts + +### FluxConfigurationClient + +`FluxConfigurationClient` is the primary interface for developers using the Azure FluxConfiguration client library. Explore the methods on this client object to understand the different features of the Azure FluxConfiguration service that you can access. + +## Troubleshooting + +### Logging + +Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: + +```javascript +const { setLogLevel } = require("@azure/logger"); +setLogLevel("info"); +``` + +For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger). + +## Next steps + +Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. + +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. + +## Related projects + +- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fkubernetesconfiguration%2Farm-kubernetesconfiguration-fluxconfigurations%2FREADME.png) + +[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_sub]: https://azure.microsoft.com/free/ +[azure_sub]: https://azure.microsoft.com/free/ +[azure_portal]: https://portal.azure.com +[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity +[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/_meta.json b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/_meta.json new file mode 100644 index 000000000000..a9b37c620e21 --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/_meta.json @@ -0,0 +1,8 @@ +{ + "commit": "5dfb10f4156489fd0617114600abc1627b3c0f0e", + "readme": "specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/fluxConfigurations/readme.md", + "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/fluxConfigurations/readme.md --use=@autorest/typescript@^6.0.12", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.16", + "use": "@autorest/typescript@^6.0.12" +} \ No newline at end of file diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/api-extractor.json b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/api-extractor.json new file mode 100644 index 000000000000..f599cfcbaba9 --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/api-extractor.json @@ -0,0 +1,31 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", + "docModel": { + "enabled": true + }, + "apiReport": { + "enabled": true, + "reportFolder": "./review" + }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "./types/arm-kubernetesconfiguration-fluxconfigurations.d.ts" + }, + "messages": { + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, + "extractorMessageReporting": { + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } + } + } +} \ No newline at end of file diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/package.json b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/package.json new file mode 100644 index 000000000000..4dbeea780fbd --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/package.json @@ -0,0 +1,109 @@ +{ + "name": "@azure/arm-kubernetesconfiguration-fluxconfigurations", + "sdk-type": "mgmt", + "author": "Microsoft Corporation", + "description": "A generated SDK for FluxConfigurationClient.", + "version": "1.0.0", + "engines": { + "node": ">=18.0.0" + }, + "dependencies": { + "@azure/core-lro": "^2.5.4", + "@azure/abort-controller": "^2.1.2", + "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.7.0", + "@azure/core-auth": "^1.6.0", + "@azure/core-rest-pipeline": "^1.14.0", + "tslib": "^2.2.0" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "license": "MIT", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-kubernetesconfiguration-fluxconfigurations.d.ts", + "devDependencies": { + "@microsoft/api-extractor": "^7.31.1", + "typescript": "~5.6.2", + "uglify-js": "^3.4.9", + "dotenv": "^16.0.0", + "@azure/dev-tool": "^1.0.0", + "@azure/identity": "^4.2.1", + "@azure-tools/test-recorder": "^3.0.0", + "@azure-tools/test-credential": "^1.1.0", + "mocha": "^10.0.0", + "@types/mocha": "^10.0.0", + "tsx": "^4.7.1", + "@types/chai": "^4.2.8", + "chai": "^4.2.0", + "cross-env": "^7.0.2", + "@types/node": "^18.0.0", + "ts-node": "^10.0.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/Azure/azure-sdk-for-js.git" + }, + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "files": [ + "dist/**/*.js", + "dist/**/*.js.map", + "dist/**/*.d.ts", + "dist/**/*.d.ts.map", + "dist-esm/**/*.js", + "dist-esm/**/*.js.map", + "dist-esm/**/*.d.ts", + "dist-esm/**/*.d.ts.map", + "src/**/*.ts", + "README.md", + "LICENSE", + "tsconfig.json", + "review/*", + "CHANGELOG.md", + "types/*" + ], + "scripts": { + "build": "npm run clean && tsc && dev-tool run bundle && npm run minify && dev-tool run vendored mkdirp ./review && npm run extract-api", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "dev-tool run extract-api", + "lint": "echo skipped", + "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "build:node": "echo skipped", + "build:browser": "echo skipped", + "build:test": "echo skipped", + "build:samples": "echo skipped.", + "check-format": "echo skipped", + "execute:samples": "echo skipped", + "format": "echo skipped", + "test": "npm run integration-test", + "test:node": "echo skipped", + "test:browser": "echo skipped", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", + "integration-test:browser": "echo skipped", + "update-snippets": "echo skipped" + }, + "sideEffects": false, + "//metadata": { + "constantPaths": [ + { + "path": "src/fluxConfigurationClient.ts", + "prefix": "packageDetails" + } + ] + }, + "autoPublish": true, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations" +} \ No newline at end of file diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/review/arm-kubernetesconfiguration-fluxconfigurations.api.md b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/review/arm-kubernetesconfiguration-fluxconfigurations.api.md new file mode 100644 index 000000000000..911fec8b0d43 --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/review/arm-kubernetesconfiguration-fluxconfigurations.api.md @@ -0,0 +1,601 @@ +## API Report File for "@azure/arm-kubernetesconfiguration-fluxconfigurations" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import * as coreAuth from '@azure/core-auth'; +import * as coreClient from '@azure/core-client'; +import { OperationState } from '@azure/core-lro'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; +import { SimplePollerLike } from '@azure/core-lro'; + +// @public +export interface AzureBlobDefinition { + accountKey?: string; + containerName?: string; + localAuthRef?: string; + managedIdentity?: ManagedIdentityDefinition; + sasToken?: string; + servicePrincipal?: ServicePrincipalDefinition; + syncIntervalInSeconds?: number; + timeoutInSeconds?: number; + url?: string; +} + +// @public +export interface AzureBlobPatchDefinition { + accountKey?: string; + containerName?: string; + localAuthRef?: string; + managedIdentity?: ManagedIdentityPatchDefinition; + sasToken?: string; + servicePrincipal?: ServicePrincipalPatchDefinition; + syncIntervalInSeconds?: number; + timeoutInSeconds?: number; + url?: string; +} + +// @public +export interface BucketDefinition { + accessKey?: string; + bucketName?: string; + insecure?: boolean; + localAuthRef?: string; + syncIntervalInSeconds?: number; + timeoutInSeconds?: number; + url?: string; +} + +// @public +export interface BucketPatchDefinition { + accessKey?: string; + bucketName?: string; + insecure?: boolean; + localAuthRef?: string; + syncIntervalInSeconds?: number; + timeoutInSeconds?: number; + url?: string; +} + +// @public +export type CreatedByType = string; + +// @public +export interface ErrorAdditionalInfo { + readonly info?: Record; + readonly type?: string; +} + +// @public +export interface ErrorDetail { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetail[]; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface ErrorResponse { + error?: ErrorDetail; +} + +// @public +export type FluxComplianceState = string; + +// @public +export interface FluxConfigOperationStatus { + get(resourceGroupName: string, clusterRp: string, clusterResourceName: string, clusterName: string, fluxConfigurationName: string, operationId: string, options?: FluxConfigOperationStatusGetOptionalParams): Promise; +} + +// @public +export interface FluxConfigOperationStatusGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FluxConfigOperationStatusGetResponse = OperationStatusResult; + +// @public +export interface FluxConfiguration extends ProxyResource { + azureBlob?: AzureBlobDefinition; + bucket?: BucketDefinition; + readonly complianceState?: FluxComplianceState; + configurationProtectedSettings?: { + [propertyName: string]: string; + }; + readonly errorMessage?: string; + gitRepository?: GitRepositoryDefinition; + kustomizations?: { + [propertyName: string]: KustomizationDefinition | null; + }; + namespace?: string; + ociRepository?: OCIRepositoryDefinition; + readonly provisioningState?: ProvisioningState; + reconciliationWaitDuration?: string; + readonly repositoryPublicKey?: string; + scope?: ScopeType; + sourceKind?: SourceKindType; + readonly sourceSyncedCommitId?: string; + readonly sourceUpdatedAt?: Date; + readonly statuses?: (ObjectStatusDefinition | null)[]; + readonly statusUpdatedAt?: Date; + suspend?: boolean; + readonly systemData?: SystemData; + waitForReconciliation?: boolean; +} + +// @public (undocumented) +export class FluxConfigurationClient extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: FluxConfigurationClientOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + fluxConfigOperationStatus: FluxConfigOperationStatus; + // (undocumented) + fluxConfigurations: FluxConfigurations; + // (undocumented) + subscriptionId: string; +} + +// @public +export interface FluxConfigurationClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface FluxConfigurationPatch { + azureBlob?: AzureBlobPatchDefinition; + bucket?: BucketPatchDefinition; + configurationProtectedSettings?: { + [propertyName: string]: string; + }; + gitRepository?: GitRepositoryPatchDefinition; + kustomizations?: { + [propertyName: string]: KustomizationPatchDefinition | null; + }; + ociRepository?: OCIRepositoryPatchDefinition; + sourceKind?: SourceKindType; + suspend?: boolean; +} + +// @public +export interface FluxConfigurations { + beginCreateOrUpdate(resourceGroupName: string, clusterRp: string, clusterResourceName: string, clusterName: string, fluxConfigurationName: string, fluxConfiguration: FluxConfiguration, options?: FluxConfigurationsCreateOrUpdateOptionalParams): Promise, FluxConfigurationsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, clusterRp: string, clusterResourceName: string, clusterName: string, fluxConfigurationName: string, fluxConfiguration: FluxConfiguration, options?: FluxConfigurationsCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, clusterRp: string, clusterResourceName: string, clusterName: string, fluxConfigurationName: string, options?: FluxConfigurationsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, clusterRp: string, clusterResourceName: string, clusterName: string, fluxConfigurationName: string, options?: FluxConfigurationsDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, clusterRp: string, clusterResourceName: string, clusterName: string, fluxConfigurationName: string, fluxConfigurationPatch: FluxConfigurationPatch, options?: FluxConfigurationsUpdateOptionalParams): Promise, FluxConfigurationsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, clusterRp: string, clusterResourceName: string, clusterName: string, fluxConfigurationName: string, fluxConfigurationPatch: FluxConfigurationPatch, options?: FluxConfigurationsUpdateOptionalParams): Promise; + get(resourceGroupName: string, clusterRp: string, clusterResourceName: string, clusterName: string, fluxConfigurationName: string, options?: FluxConfigurationsGetOptionalParams): Promise; + list(resourceGroupName: string, clusterRp: string, clusterResourceName: string, clusterName: string, options?: FluxConfigurationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface FluxConfigurationsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type FluxConfigurationsCreateOrUpdateResponse = FluxConfiguration; + +// @public +export interface FluxConfigurationsDeleteOptionalParams extends coreClient.OperationOptions { + forceDelete?: boolean; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface FluxConfigurationsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FluxConfigurationsGetResponse = FluxConfiguration; + +// @public +export interface FluxConfigurationsList { + readonly nextLink?: string; + readonly value?: FluxConfiguration[]; +} + +// @public +export interface FluxConfigurationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FluxConfigurationsListNextResponse = FluxConfigurationsList; + +// @public +export interface FluxConfigurationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FluxConfigurationsListResponse = FluxConfigurationsList; + +// @public +export interface FluxConfigurationsUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type FluxConfigurationsUpdateResponse = FluxConfiguration; + +// @public +export function getContinuationToken(page: unknown): string | undefined; + +// @public +export interface GitRepositoryDefinition { + httpsCACert?: string; + httpsUser?: string; + localAuthRef?: string; + provider?: ProviderType; + repositoryRef?: RepositoryRefDefinition; + sshKnownHosts?: string; + syncIntervalInSeconds?: number; + timeoutInSeconds?: number; + url?: string; +} + +// @public +export interface GitRepositoryPatchDefinition { + httpsCACert?: string; + httpsUser?: string; + localAuthRef?: string; + provider?: ProviderType; + repositoryRef?: RepositoryRefDefinition; + sshKnownHosts?: string; + syncIntervalInSeconds?: number; + timeoutInSeconds?: number; + url?: string; +} + +// @public +export interface HelmReleasePropertiesDefinition { + failureCount?: number; + helmChartRef?: ObjectReferenceDefinition; + installFailureCount?: number; + lastRevisionApplied?: number; + upgradeFailureCount?: number; +} + +// @public +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" +} + +// @public +export enum KnownFluxComplianceState { + Compliant = "Compliant", + NonCompliant = "Non-Compliant", + Pending = "Pending", + Suspended = "Suspended", + Unknown = "Unknown" +} + +// @public +export enum KnownKustomizationValidationType { + Client = "client", + None = "none", + Server = "server" +} + +// @public +export enum KnownOperationType { + Copy = "copy", + Extract = "extract" +} + +// @public +export enum KnownProviderType { + Azure = "Azure", + Generic = "Generic" +} + +// @public +export enum KnownProvisioningState { + Canceled = "Canceled", + Creating = "Creating", + Deleting = "Deleting", + Failed = "Failed", + Succeeded = "Succeeded", + Updating = "Updating" +} + +// @public +export enum KnownScopeType { + Cluster = "cluster", + Namespace = "namespace" +} + +// @public +export enum KnownSourceKindType { + AzureBlob = "AzureBlob", + Bucket = "Bucket", + GitRepository = "GitRepository", + OCIRepository = "OCIRepository" +} + +// @public +export interface KustomizationDefinition { + dependsOn?: string[]; + force?: boolean; + readonly name?: string; + path?: string; + postBuild?: PostBuildDefinition; + prune?: boolean; + retryIntervalInSeconds?: number; + syncIntervalInSeconds?: number; + timeoutInSeconds?: number; + wait?: boolean; +} + +// @public +export interface KustomizationPatchDefinition { + dependsOn?: string[]; + force?: boolean; + path?: string; + postBuild?: PostBuildPatchDefinition; + prune?: boolean; + retryIntervalInSeconds?: number; + syncIntervalInSeconds?: number; + timeoutInSeconds?: number; + wait?: boolean; +} + +// @public +export type KustomizationValidationType = string; + +// @public +export interface LayerSelectorDefinition { + mediaType?: string; + operation?: OperationType; +} + +// @public +export interface LayerSelectorPatchDefinition { + mediaType?: string; + operation?: OperationType; +} + +// @public +export interface ManagedIdentityDefinition { + clientId?: string; +} + +// @public +export interface ManagedIdentityPatchDefinition { + clientId?: string; +} + +// @public +export interface MatchOidcIdentityDefinition { + issuer?: string; + subject?: string; +} + +// @public +export interface MatchOidcIdentityPatchDefinition { + issuer?: string; + subject?: string; +} + +// @public +export interface ObjectReferenceDefinition { + name?: string; + namespace?: string; +} + +// @public +export interface ObjectStatusConditionDefinition { + lastTransitionTime?: Date; + message?: string; + reason?: string; + status?: string; + type?: string; +} + +// @public +export interface ObjectStatusDefinition { + appliedBy?: ObjectReferenceDefinition; + complianceState?: FluxComplianceState; + helmReleaseProperties?: HelmReleasePropertiesDefinition; + kind?: string; + name?: string; + namespace?: string; + statusConditions?: ObjectStatusConditionDefinition[]; +} + +// @public +export interface OCIRepositoryDefinition { + insecure?: boolean; + layerSelector?: LayerSelectorDefinition; + localAuthRef?: string; + repositoryRef?: OCIRepositoryRefDefinition; + serviceAccountName?: string; + syncIntervalInSeconds?: number; + timeoutInSeconds?: number; + tlsConfig?: TlsConfigDefinition; + url?: string; + useWorkloadIdentity?: boolean; + verify?: VerifyDefinition; +} + +// @public +export interface OCIRepositoryPatchDefinition { + insecure?: boolean; + layerSelector?: LayerSelectorPatchDefinition; + localAuthRef?: string; + repositoryRef?: OCIRepositoryRefPatchDefinition; + serviceAccountName?: string; + syncIntervalInSeconds?: number; + timeoutInSeconds?: number; + tlsConfig?: TlsConfigPatchDefinition; + url?: string; + useWorkloadIdentity?: boolean; + verify?: VerifyPatchDefinition; +} + +// @public +export interface OCIRepositoryRefDefinition { + digest?: string; + semver?: string; + tag?: string; +} + +// @public +export interface OCIRepositoryRefPatchDefinition { + digest?: string; + semver?: string; + tag?: string; +} + +// @public +export interface OperationStatusResult { + readonly error?: ErrorDetail; + id?: string; + name?: string; + properties?: { + [propertyName: string]: string; + }; + status: string; +} + +// @public +export type OperationType = string; + +// @public +export interface PostBuildDefinition { + substitute?: { + [propertyName: string]: string; + }; + substituteFrom?: (SubstituteFromDefinition | null)[]; +} + +// @public +export interface PostBuildPatchDefinition { + substitute?: { + [propertyName: string]: string; + }; + substituteFrom?: (SubstituteFromPatchDefinition | null)[]; +} + +// @public +export type ProviderType = string; + +// @public +export type ProvisioningState = string; + +// @public +export interface ProxyResource extends Resource { +} + +// @public +export interface RepositoryRefDefinition { + branch?: string; + commit?: string; + semver?: string; + tag?: string; +} + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +// @public +export type ScopeType = string; + +// @public +export interface ServicePrincipalDefinition { + clientCertificate?: string; + clientCertificatePassword?: string; + clientCertificateSendChain?: boolean; + clientId?: string; + clientSecret?: string; + tenantId?: string; +} + +// @public +export interface ServicePrincipalPatchDefinition { + clientCertificate?: string; + clientCertificatePassword?: string; + clientCertificateSendChain?: boolean; + clientId?: string; + clientSecret?: string; + tenantId?: string; +} + +// @public +export type SourceKindType = string; + +// @public +export interface SubstituteFromDefinition { + kind?: string; + name?: string; + optional?: boolean; +} + +// @public +export interface SubstituteFromPatchDefinition { + kind?: string; + name?: string; + optional?: boolean; +} + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export interface TlsConfigDefinition { + caCertificate?: string; + clientCertificate?: string; + privateKey?: string; +} + +// @public +export interface TlsConfigPatchDefinition { + caCertificate?: string; + clientCertificate?: string; + privateKey?: string; +} + +// @public +export interface VerifyDefinition { + matchOidcIdentity?: (MatchOidcIdentityDefinition | null)[]; + provider?: string; + verificationConfig?: { + [propertyName: string]: string; + }; +} + +// @public +export interface VerifyPatchDefinition { + matchOidcIdentity?: (MatchOidcIdentityPatchDefinition | null)[]; + provider?: string; + verificationConfig?: { + [propertyName: string]: string; + }; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/sample.env b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/sample.env new file mode 100644 index 000000000000..508439fc7d62 --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/fluxConfigurationClient.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/fluxConfigurationClient.ts new file mode 100644 index 000000000000..b482b8b13b69 --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/fluxConfigurationClient.ts @@ -0,0 +1,149 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import * as coreRestPipeline from "@azure/core-rest-pipeline"; +import { + PipelineRequest, + PipelineResponse, + SendRequest, +} from "@azure/core-rest-pipeline"; +import * as coreAuth from "@azure/core-auth"; +import { + FluxConfigurationsImpl, + FluxConfigOperationStatusImpl, +} from "./operations"; +import { + FluxConfigurations, + FluxConfigOperationStatus, +} from "./operationsInterfaces"; +import { FluxConfigurationClientOptionalParams } from "./models"; + +export class FluxConfigurationClient extends coreClient.ServiceClient { + $host: string; + subscriptionId: string; + apiVersion: string; + + /** + * Initializes a new instance of the FluxConfigurationClient class. + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param subscriptionId The ID of the target subscription. + * @param options The parameter options + */ + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: FluxConfigurationClientOptionalParams, + ) { + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: FluxConfigurationClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials, + }; + + const packageDetails = `azsdk-js-arm-kubernetesconfiguration-fluxconfigurations/1.0.0`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix, + }, + endpoint: + options.endpoint ?? options.baseUri ?? "https://management.azure.com", + }; + super(optionsWithDefaults); + + let bearerTokenAuthenticationPolicyFound: boolean = false; + if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = + options.pipeline.getOrderedPolicies(); + bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( + (pipelinePolicy) => + pipelinePolicy.name === + coreRestPipeline.bearerTokenAuthenticationPolicyName, + ); + } + if ( + !options || + !options.pipeline || + options.pipeline.getOrderedPolicies().length == 0 || + !bearerTokenAuthenticationPolicyFound + ) { + this.pipeline.removePolicy({ + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, + }); + this.pipeline.addPolicy( + coreRestPipeline.bearerTokenAuthenticationPolicy({ + credential: credentials, + scopes: + optionsWithDefaults.credentialScopes ?? + `${optionsWithDefaults.endpoint}/.default`, + challengeCallbacks: { + authorizeRequestOnChallenge: + coreClient.authorizeRequestOnClaimChallenge, + }, + }), + ); + } + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2024-11-01"; + this.fluxConfigurations = new FluxConfigurationsImpl(this); + this.fluxConfigOperationStatus = new FluxConfigOperationStatusImpl(this); + this.addCustomApiVersionPolicy(options.apiVersion); + } + + /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */ + private addCustomApiVersionPolicy(apiVersion?: string) { + if (!apiVersion) { + return; + } + const apiVersionPolicy = { + name: "CustomApiVersionPolicy", + async sendRequest( + request: PipelineRequest, + next: SendRequest, + ): Promise { + const param = request.url.split("?"); + if (param.length > 1) { + const newParams = param[1].split("&").map((item) => { + if (item.indexOf("api-version") > -1) { + return "api-version=" + apiVersion; + } else { + return item; + } + }); + request.url = param[0] + "?" + newParams.join("&"); + } + return next(request); + }, + }; + this.pipeline.addPolicy(apiVersionPolicy); + } + + fluxConfigurations: FluxConfigurations; + fluxConfigOperationStatus: FluxConfigOperationStatus; +} diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/index.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/index.ts new file mode 100644 index 000000000000..899d5d0b8197 --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/index.ts @@ -0,0 +1,13 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +/// +export { getContinuationToken } from "./pagingHelper"; +export * from "./models"; +export { FluxConfigurationClient } from "./fluxConfigurationClient"; +export * from "./operationsInterfaces"; diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/lroImpl.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/lroImpl.ts new file mode 100644 index 000000000000..5f88efab981b --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/lroImpl.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AbortSignalLike } from "@azure/abort-controller"; +import { LongRunningOperation, LroResponse } from "@azure/core-lro"; + +export function createLroSpec(inputs: { + sendOperationFn: (args: any, spec: any) => Promise>; + args: Record; + spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record; +}): LongRunningOperation { + const { args, spec, sendOperationFn } = inputs; + return { + requestMethod: spec.httpMethod, + requestPath: spec.path!, + sendInitialRequest: () => sendOperationFn(args, spec), + sendPollRequest: ( + path: string, + options?: { abortSignal?: AbortSignalLike }, + ) => { + const { requestBody, ...restSpec } = spec; + return sendOperationFn(args, { + ...restSpec, + httpMethod: "GET", + path, + abortSignal: options?.abortSignal, + }); + }, + }; +} diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/models/index.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/models/index.ts new file mode 100644 index 000000000000..b7f288920bc2 --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/models/index.ts @@ -0,0 +1,939 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; + +/** Parameters to reconcile to the GitRepository source kind type. */ +export interface GitRepositoryDefinition { + /** The URL to sync for the flux configuration git repository. */ + url?: string; + /** The maximum time to attempt to reconcile the cluster git repository source with the remote. */ + timeoutInSeconds?: number; + /** The interval at which to re-reconcile the cluster git repository source with the remote. */ + syncIntervalInSeconds?: number; + /** The source reference for the GitRepository object. */ + repositoryRef?: RepositoryRefDefinition; + /** Base64-encoded known_hosts value containing public SSH keys required to access private git repositories over SSH */ + sshKnownHosts?: string; + /** Plaintext HTTPS username used to access private git repositories over HTTPS */ + httpsUser?: string; + /** Base64-encoded HTTPS certificate authority contents used to access git private git repositories over HTTPS */ + httpsCACert?: string; + /** Name of a local secret on the Kubernetes cluster to use as the authentication secret rather than the managed or user-provided configuration secrets. */ + localAuthRef?: string; + /** Name of the provider used for authentication. */ + provider?: ProviderType; +} + +/** The source reference for the GitRepository object. */ +export interface RepositoryRefDefinition { + /** The git repository branch name to checkout. */ + branch?: string; + /** The git repository tag name to checkout. This takes precedence over branch. */ + tag?: string; + /** The semver range used to match against git repository tags. This takes precedence over tag. */ + semver?: string; + /** The commit SHA to checkout. This value must be combined with the branch name to be valid. This takes precedence over semver. */ + commit?: string; +} + +/** Parameters to reconcile to the Bucket source kind type. */ +export interface BucketDefinition { + /** The URL to sync for the flux configuration S3 bucket. */ + url?: string; + /** The bucket name to sync from the url endpoint for the flux configuration. */ + bucketName?: string; + /** Specify whether to use insecure communication when puling data from the S3 bucket. */ + insecure?: boolean; + /** The maximum time to attempt to reconcile the cluster bucket source with the remote. */ + timeoutInSeconds?: number; + /** The interval at which to re-reconcile the cluster bucket source with the remote. */ + syncIntervalInSeconds?: number; + /** Plaintext access key used to securely access the S3 bucket */ + accessKey?: string; + /** Name of a local secret on the Kubernetes cluster to use as the authentication secret rather than the managed or user-provided configuration secrets. */ + localAuthRef?: string; +} + +/** Parameters to reconcile to the AzureBlob source kind type. */ +export interface AzureBlobDefinition { + /** The URL to sync for the flux configuration Azure Blob storage account. */ + url?: string; + /** The Azure Blob container name to sync from the url endpoint for the flux configuration. */ + containerName?: string; + /** The maximum time to attempt to reconcile the cluster Azure Blob source with the remote. */ + timeoutInSeconds?: number; + /** The interval at which to re-reconcile the cluster Azure Blob source with the remote. */ + syncIntervalInSeconds?: number; + /** Parameters to authenticate using Service Principal. */ + servicePrincipal?: ServicePrincipalDefinition; + /** The account key (shared key) to access the storage account */ + accountKey?: string; + /** The Shared Access token to access the storage container */ + sasToken?: string; + /** Parameters to authenticate using a Managed Identity. */ + managedIdentity?: ManagedIdentityDefinition; + /** Name of a local secret on the Kubernetes cluster to use as the authentication secret rather than the managed or user-provided configuration secrets. */ + localAuthRef?: string; +} + +/** Parameters to authenticate using Service Principal. */ +export interface ServicePrincipalDefinition { + /** The client Id for authenticating a Service Principal. */ + clientId?: string; + /** The tenant Id for authenticating a Service Principal */ + tenantId?: string; + /** The client secret for authenticating a Service Principal */ + clientSecret?: string; + /** Base64-encoded certificate used to authenticate a Service Principal */ + clientCertificate?: string; + /** The password for the certificate used to authenticate a Service Principal */ + clientCertificatePassword?: string; + /** Specifies whether to include x5c header in client claims when acquiring a token to enable subject name / issuer based authentication for the Client Certificate */ + clientCertificateSendChain?: boolean; +} + +/** Parameters to authenticate using a Managed Identity. */ +export interface ManagedIdentityDefinition { + /** The client Id for authenticating a Managed Identity. */ + clientId?: string; +} + +/** Parameters to reconcile to the OCIRepository source kind type. */ +export interface OCIRepositoryDefinition { + /** The URL to sync for the flux configuration OCI repository. */ + url?: string; + /** The maximum time to attempt to reconcile the cluster OCI repository source with the remote. */ + timeoutInSeconds?: number; + /** The interval at which to re-reconcile the cluster OCI repository source with the remote. */ + syncIntervalInSeconds?: number; + /** The source reference for the OCIRepository object. */ + repositoryRef?: OCIRepositoryRefDefinition; + /** The layer to be pulled from the OCI artifact. */ + layerSelector?: LayerSelectorDefinition; + /** Verification of the authenticity of an OCI Artifact. */ + verify?: VerifyDefinition; + /** Specify whether to allow connecting to a non-TLS HTTP container registry. */ + insecure?: boolean; + /** Specifies whether to use Workload Identity to authenticate with the OCI repository. */ + useWorkloadIdentity?: boolean; + /** The service account name to authenticate with the OCI repository. */ + serviceAccountName?: string; + /** Parameters to authenticate using TLS config for OCI repository. */ + tlsConfig?: TlsConfigDefinition; + /** Name of a local secret on the Kubernetes cluster to use as the authentication secret rather than the managed or user-provided configuration secrets. */ + localAuthRef?: string; +} + +/** The source reference for the OCIRepository object. */ +export interface OCIRepositoryRefDefinition { + /** The OCI repository image tag name to pull. This defaults to 'latest'. */ + tag?: string; + /** The semver range used to match against OCI repository tags. This takes precedence over tag. */ + semver?: string; + /** The image digest to pull from OCI repository, the value should be in the format ‘sha256:’. This takes precedence over semver. */ + digest?: string; +} + +/** Parameters to specify which layer to pull from the OCI artifact. By default, the first layer in the artifact is pulled. */ +export interface LayerSelectorDefinition { + /** The first layer matching the specified media type will be used. */ + mediaType?: string; + /** The operation to be performed on the selected layer. The default value is 'extract', but it can be set to 'copy'. */ + operation?: OperationType; +} + +/** Parameters to verify the authenticity of an OCI Artifact. */ +export interface VerifyDefinition { + /** Verification provider name. */ + provider?: string; + /** An object containing trusted public keys of trusted authors. */ + verificationConfig?: { [propertyName: string]: string }; + /** Array defining the criteria for matching the identity while verifying an OCI artifact. */ + matchOidcIdentity?: (MatchOidcIdentityDefinition | null)[]; +} + +/** MatchOIDCIdentity defines the criteria for matching the identity while verifying an OCI artifact. */ +export interface MatchOidcIdentityDefinition { + /** The regex pattern to match against to verify the OIDC issuer. */ + issuer?: string; + /** The regex pattern to match against to verify the identity subject. */ + subject?: string; +} + +/** Parameters to authenticate using TLS config for OCI repository. */ +export interface TlsConfigDefinition { + /** Base64-encoded certificate used to authenticate a client with the OCI repository. */ + clientCertificate?: string; + /** Base64-encoded private key used to authenticate a client with the OCI repository. */ + privateKey?: string; + /** Base64-encoded CA certificate used to verify the server. */ + caCertificate?: string; +} + +/** The Kustomization defining how to reconcile the artifact pulled by the source type on the cluster. */ +export interface KustomizationDefinition { + /** + * Name of the Kustomization, matching the key in the Kustomizations object map. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** The path in the source reference to reconcile on the cluster. */ + path?: string; + /** Specifies other Kustomizations that this Kustomization depends on. This Kustomization will not reconcile until all dependencies have completed their reconciliation. */ + dependsOn?: string[]; + /** The maximum time to attempt to reconcile the Kustomization on the cluster. */ + timeoutInSeconds?: number; + /** The interval at which to re-reconcile the Kustomization on the cluster. */ + syncIntervalInSeconds?: number; + /** The interval at which to re-reconcile the Kustomization on the cluster in the event of failure on reconciliation. */ + retryIntervalInSeconds?: number; + /** Enable/disable garbage collections of Kubernetes objects created by this Kustomization. */ + prune?: boolean; + /** Enable/disable re-creating Kubernetes resources on the cluster when patching fails due to an immutable field change. */ + force?: boolean; + /** Enable/disable health check for all Kubernetes objects created by this Kustomization. */ + wait?: boolean; + /** Used for variable substitution for this Kustomization after kustomize build. */ + postBuild?: PostBuildDefinition; +} + +/** The postBuild definitions defining variable substitutions for this Kustomization after kustomize build. */ +export interface PostBuildDefinition { + /** Key/value pairs holding the variables to be substituted in this Kustomization. */ + substitute?: { [propertyName: string]: string }; + /** Array of ConfigMaps/Secrets from which the variables are substituted for this Kustomization. */ + substituteFrom?: (SubstituteFromDefinition | null)[]; +} + +/** Array of ConfigMaps/Secrets from which the variables are substituted for this Kustomization. */ +export interface SubstituteFromDefinition { + /** Define whether it is ConfigMap or Secret that holds the variables to be used in substitution. */ + kind?: string; + /** Name of the ConfigMap/Secret that holds the variables to be used in substitution. */ + name?: string; + /** Set to True to proceed without ConfigMap/Secret, if it is not present. */ + optional?: boolean; +} + +/** Statuses of objects deployed by the user-specified kustomizations from the git repository. */ +export interface ObjectStatusDefinition { + /** Name of the applied object */ + name?: string; + /** Namespace of the applied object */ + namespace?: string; + /** Kind of the applied object */ + kind?: string; + /** Compliance state of the applied object showing whether the applied object has come into a ready state on the cluster. */ + complianceState?: FluxComplianceState; + /** Object reference to the Kustomization that applied this object */ + appliedBy?: ObjectReferenceDefinition; + /** List of Kubernetes object status conditions present on the cluster */ + statusConditions?: ObjectStatusConditionDefinition[]; + /** Additional properties that are provided from objects of the HelmRelease kind */ + helmReleaseProperties?: HelmReleasePropertiesDefinition; +} + +/** Object reference to a Kubernetes object on a cluster */ +export interface ObjectReferenceDefinition { + /** Name of the object */ + name?: string; + /** Namespace of the object */ + namespace?: string; +} + +/** Status condition of Kubernetes object */ +export interface ObjectStatusConditionDefinition { + /** Last time this status condition has changed */ + lastTransitionTime?: Date; + /** A more verbose description of the object status condition */ + message?: string; + /** Reason for the specified status condition type status */ + reason?: string; + /** Status of the Kubernetes object condition type */ + status?: string; + /** Object status condition type for this object */ + type?: string; +} + +/** Properties for HelmRelease objects */ +export interface HelmReleasePropertiesDefinition { + /** The revision number of the last released object change */ + lastRevisionApplied?: number; + /** The reference to the HelmChart object used as the source to this HelmRelease */ + helmChartRef?: ObjectReferenceDefinition; + /** Total number of times that the HelmRelease failed to install or upgrade */ + failureCount?: number; + /** Number of times that the HelmRelease failed to install */ + installFailureCount?: number; + /** Number of times that the HelmRelease failed to upgrade */ + upgradeFailureCount?: number; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { + /** + * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; +} + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; +} + +/** The error detail. */ +export interface ErrorDetail { + /** + * The error code. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly code?: string; + /** + * The error message. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; + /** + * The error target. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly target?: string; + /** + * The error details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly details?: ErrorDetail[]; + /** + * The error additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** + * The additional info type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * The additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly info?: Record; +} + +/** The Flux Configuration Patch Request object. */ +export interface FluxConfigurationPatch { + /** Source Kind to pull the configuration data from. */ + sourceKind?: SourceKindType; + /** Whether this configuration should suspend its reconciliation of its kustomizations and sources. */ + suspend?: boolean; + /** Parameters to reconcile to the GitRepository source kind type. */ + gitRepository?: GitRepositoryPatchDefinition; + /** Parameters to reconcile to the Bucket source kind type. */ + bucket?: BucketPatchDefinition; + /** Parameters to reconcile to the AzureBlob source kind type. */ + azureBlob?: AzureBlobPatchDefinition; + /** Parameters to reconcile to the OCIRepository source kind type. */ + ociRepository?: OCIRepositoryPatchDefinition; + /** Array of kustomizations used to reconcile the artifact pulled by the source type on the cluster. */ + kustomizations?: { + [propertyName: string]: KustomizationPatchDefinition | null; + }; + /** Key-value pairs of protected configuration settings for the configuration */ + configurationProtectedSettings?: { [propertyName: string]: string }; +} + +/** Parameters to reconcile to the GitRepository source kind type. */ +export interface GitRepositoryPatchDefinition { + /** The URL to sync for the flux configuration git repository. */ + url?: string; + /** The maximum time to attempt to reconcile the cluster git repository source with the remote. */ + timeoutInSeconds?: number; + /** The interval at which to re-reconcile the cluster git repository source with the remote. */ + syncIntervalInSeconds?: number; + /** The source reference for the GitRepository object. */ + repositoryRef?: RepositoryRefDefinition; + /** Base64-encoded known_hosts value containing public SSH keys required to access private git repositories over SSH */ + sshKnownHosts?: string; + /** Plaintext HTTPS username used to access private git repositories over HTTPS */ + httpsUser?: string; + /** Base64-encoded HTTPS certificate authority contents used to access git private git repositories over HTTPS */ + httpsCACert?: string; + /** Name of a local secret on the Kubernetes cluster to use as the authentication secret rather than the managed or user-provided configuration secrets. */ + localAuthRef?: string; + /** Name of the provider used for authentication. */ + provider?: ProviderType; +} + +/** Parameters to reconcile to the Bucket source kind type. */ +export interface BucketPatchDefinition { + /** The URL to sync for the flux configuration S3 bucket. */ + url?: string; + /** The bucket name to sync from the url endpoint for the flux configuration. */ + bucketName?: string; + /** Specify whether to use insecure communication when puling data from the S3 bucket. */ + insecure?: boolean; + /** The maximum time to attempt to reconcile the cluster bucket source with the remote. */ + timeoutInSeconds?: number; + /** The interval at which to re-reconcile the cluster bucket source with the remote. */ + syncIntervalInSeconds?: number; + /** Plaintext access key used to securely access the S3 bucket */ + accessKey?: string; + /** Name of a local secret on the Kubernetes cluster to use as the authentication secret rather than the managed or user-provided configuration secrets. */ + localAuthRef?: string; +} + +/** Parameters to reconcile to the AzureBlob source kind type. */ +export interface AzureBlobPatchDefinition { + /** The URL to sync for the flux configuration Azure Blob storage account. */ + url?: string; + /** The Azure Blob container name to sync from the url endpoint for the flux configuration. */ + containerName?: string; + /** The maximum time to attempt to reconcile the cluster Azure Blob source with the remote. */ + timeoutInSeconds?: number; + /** The interval at which to re-reconcile the cluster Azure Blob source with the remote. */ + syncIntervalInSeconds?: number; + /** Parameters to authenticate using Service Principal. */ + servicePrincipal?: ServicePrincipalPatchDefinition; + /** The account key (shared key) to access the storage account */ + accountKey?: string; + /** The Shared Access token to access the storage container */ + sasToken?: string; + /** Parameters to authenticate using a Managed Identity. */ + managedIdentity?: ManagedIdentityPatchDefinition; + /** Name of a local secret on the Kubernetes cluster to use as the authentication secret rather than the managed or user-provided configuration secrets. */ + localAuthRef?: string; +} + +/** Parameters to authenticate using Service Principal. */ +export interface ServicePrincipalPatchDefinition { + /** The client Id for authenticating a Service Principal. */ + clientId?: string; + /** The tenant Id for authenticating a Service Principal */ + tenantId?: string; + /** The client secret for authenticating a Service Principal */ + clientSecret?: string; + /** Base64-encoded certificate used to authenticate a Service Principal */ + clientCertificate?: string; + /** The password for the certificate used to authenticate a Service Principal */ + clientCertificatePassword?: string; + /** Specifies whether to include x5c header in client claims when acquiring a token to enable subject name / issuer based authentication for the Client Certificate */ + clientCertificateSendChain?: boolean; +} + +/** Parameters to authenticate using a Managed Identity. */ +export interface ManagedIdentityPatchDefinition { + /** The client Id for authenticating a Managed Identity. */ + clientId?: string; +} + +/** Parameters to reconcile to the OCIRepository source kind type. */ +export interface OCIRepositoryPatchDefinition { + /** The URL to sync for the flux configuration OCI repository. */ + url?: string; + /** The maximum time to attempt to reconcile the cluster OCI repository source with the remote. */ + timeoutInSeconds?: number; + /** The interval at which to re-reconcile the cluster OCI repository source with the remote. */ + syncIntervalInSeconds?: number; + /** The source reference for the OCIRepository object. */ + repositoryRef?: OCIRepositoryRefPatchDefinition; + /** The layer to be pulled from the OCI artifact. */ + layerSelector?: LayerSelectorPatchDefinition; + /** Verification of the authenticity of an OCI Artifact. */ + verify?: VerifyPatchDefinition; + /** Specify whether to allow connecting to a non-TLS HTTP container registry. */ + insecure?: boolean; + /** Specifies whether to use Workload Identity to authenticate with the OCI repository. */ + useWorkloadIdentity?: boolean; + /** The service account name to authenticate with the OCI repository. */ + serviceAccountName?: string; + /** Parameters to authenticate using TLS config for OCI repository. */ + tlsConfig?: TlsConfigPatchDefinition; + /** Name of a local secret on the Kubernetes cluster to use as the authentication secret rather than the managed or user-provided configuration secrets. */ + localAuthRef?: string; +} + +/** The source reference for the OCIRepository object. */ +export interface OCIRepositoryRefPatchDefinition { + /** The OCI repository image tag name to pull. This defaults to 'latest'. */ + tag?: string; + /** The semver range used to match against OCI repository tags. This takes precedence over tag. */ + semver?: string; + /** The image digest to pull from OCI repository, the value should be in the format ‘sha256:’. This takes precedence over semver. */ + digest?: string; +} + +/** Parameters to specify which layer to pull from the OCI artifact. By default, the first layer in the artifact is pulled. */ +export interface LayerSelectorPatchDefinition { + /** The first layer matching the specified media type will be used. */ + mediaType?: string; + /** The operation to be performed on the selected layer. The default value is 'extract', but it can be set to 'copy'. */ + operation?: OperationType; +} + +/** Parameters to verify the authenticity of an OCI Artifact. */ +export interface VerifyPatchDefinition { + /** Verification provider name. */ + provider?: string; + /** An object containing trusted public keys of trusted authors. */ + verificationConfig?: { [propertyName: string]: string }; + /** Array defining the criteria for matching the OIDC identity while verifying an OCI artifact. */ + matchOidcIdentity?: (MatchOidcIdentityPatchDefinition | null)[]; +} + +/** MatchOIDCIdentity defines the criteria for matching the identity while verifying an OCI artifact. */ +export interface MatchOidcIdentityPatchDefinition { + /** The regex pattern to match against to verify the OIDC issuer. */ + issuer?: string; + /** The regex pattern to match against to verify the identity subject. */ + subject?: string; +} + +/** Parameters to authenticate using TLS config for OCI repository. */ +export interface TlsConfigPatchDefinition { + /** Base64-encoded certificate used to authenticate a client with the OCI repository. */ + clientCertificate?: string; + /** Base64-encoded private key used to authenticate a client with the OCI repository. */ + privateKey?: string; + /** Base64-encoded CA certificate used to verify the server. */ + caCertificate?: string; +} + +/** The Kustomization defining how to reconcile the artifact pulled by the source type on the cluster. */ +export interface KustomizationPatchDefinition { + /** The path in the source reference to reconcile on the cluster. */ + path?: string; + /** Specifies other Kustomizations that this Kustomization depends on. This Kustomization will not reconcile until all dependencies have completed their reconciliation. */ + dependsOn?: string[]; + /** The maximum time to attempt to reconcile the Kustomization on the cluster. */ + timeoutInSeconds?: number; + /** The interval at which to re-reconcile the Kustomization on the cluster. */ + syncIntervalInSeconds?: number; + /** The interval at which to re-reconcile the Kustomization on the cluster in the event of failure on reconciliation. */ + retryIntervalInSeconds?: number; + /** Enable/disable garbage collections of Kubernetes objects created by this Kustomization. */ + prune?: boolean; + /** Enable/disable re-creating Kubernetes resources on the cluster when patching fails due to an immutable field change. */ + force?: boolean; + /** Enable/disable health check for all Kubernetes objects created by this Kustomization. */ + wait?: boolean; + /** Used for variable substitution for this Kustomization after kustomize build. */ + postBuild?: PostBuildPatchDefinition; +} + +/** The postBuild definitions defining variable substitutions for this Kustomization after kustomize build. */ +export interface PostBuildPatchDefinition { + /** Key/value pairs holding the variables to be substituted in this Kustomization. */ + substitute?: { [propertyName: string]: string }; + /** Array of ConfigMaps/Secrets from which the variables are substituted for this Kustomization. */ + substituteFrom?: (SubstituteFromPatchDefinition | null)[]; +} + +/** Array of ConfigMaps/Secrets from which the variables are substituted for this Kustomization. */ +export interface SubstituteFromPatchDefinition { + /** Define whether it is ConfigMap or Secret that holds the variables to be used in substitution. */ + kind?: string; + /** Name of the ConfigMap/Secret that holds the variables to be used in substitution. */ + name?: string; + /** Set to True to proceed without ConfigMap/Secret, if it is not present. */ + optional?: boolean; +} + +/** Result of the request to list Flux Configurations. It contains a list of FluxConfiguration objects and a URL link to get the next set of results. */ +export interface FluxConfigurationsList { + /** + * List of Flux Configurations within a Kubernetes cluster. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: FluxConfiguration[]; + /** + * URL to get the next set of configuration objects, if any. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** The current status of an async operation. */ +export interface OperationStatusResult { + /** Fully qualified ID for the async operation. */ + id?: string; + /** Name of the async operation. */ + name?: string; + /** Operation status. */ + status: string; + /** Additional information, if available. */ + properties?: { [propertyName: string]: string }; + /** + * If present, details of the operation error. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly error?: ErrorDetail; +} + +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export interface ProxyResource extends Resource {} + +/** The Flux Configuration object returned in Get & Put response. */ +export interface FluxConfiguration extends ProxyResource { + /** + * Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** Scope at which the operator will be installed. */ + scope?: ScopeType; + /** The namespace to which this configuration is installed to. Maximum of 253 lower case alphanumeric characters, hyphen and period only. */ + namespace?: string; + /** Source Kind to pull the configuration data from. */ + sourceKind?: SourceKindType; + /** Whether this configuration should suspend its reconciliation of its kustomizations and sources. */ + suspend?: boolean; + /** Parameters to reconcile to the GitRepository source kind type. */ + gitRepository?: GitRepositoryDefinition; + /** Parameters to reconcile to the Bucket source kind type. */ + bucket?: BucketDefinition; + /** Parameters to reconcile to the AzureBlob source kind type. */ + azureBlob?: AzureBlobDefinition; + /** Parameters to reconcile to the OCIRepository source kind type. */ + ociRepository?: OCIRepositoryDefinition; + /** Array of kustomizations used to reconcile the artifact pulled by the source type on the cluster. */ + kustomizations?: { [propertyName: string]: KustomizationDefinition | null }; + /** Key-value pairs of protected configuration settings for the configuration */ + configurationProtectedSettings?: { [propertyName: string]: string }; + /** + * Statuses of the Flux Kubernetes resources created by the fluxConfiguration or created by the managed objects provisioned by the fluxConfiguration. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly statuses?: (ObjectStatusDefinition | null)[]; + /** + * Public Key associated with this fluxConfiguration (either generated within the cluster or provided by the user). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly repositoryPublicKey?: string; + /** + * Branch and/or SHA of the source commit synced with the cluster. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly sourceSyncedCommitId?: string; + /** + * Datetime the fluxConfiguration synced its source on the cluster. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly sourceUpdatedAt?: Date; + /** + * Datetime the fluxConfiguration synced its status on the cluster with Azure. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly statusUpdatedAt?: Date; + /** Whether flux configuration deployment should wait for cluster to reconcile the kustomizations. */ + waitForReconciliation?: boolean; + /** Maximum duration to wait for flux configuration reconciliation. E.g PT1H, PT5M, P1D */ + reconciliationWaitDuration?: string; + /** + * Combined status of the Flux Kubernetes resources created by the fluxConfiguration or created by the managed objects. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly complianceState?: FluxComplianceState; + /** + * Status of the creation of the fluxConfiguration. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** + * Error message returned to the user in the case of provisioning failure. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly errorMessage?: string; +} + +/** Known values of {@link ScopeType} that the service accepts. */ +export enum KnownScopeType { + /** Cluster */ + Cluster = "cluster", + /** Namespace */ + Namespace = "namespace", +} + +/** + * Defines values for ScopeType. \ + * {@link KnownScopeType} can be used interchangeably with ScopeType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **cluster** \ + * **namespace** + */ +export type ScopeType = string; + +/** Known values of {@link SourceKindType} that the service accepts. */ +export enum KnownSourceKindType { + /** GitRepository */ + GitRepository = "GitRepository", + /** Bucket */ + Bucket = "Bucket", + /** AzureBlob */ + AzureBlob = "AzureBlob", + /** OCIRepository */ + OCIRepository = "OCIRepository", +} + +/** + * Defines values for SourceKindType. \ + * {@link KnownSourceKindType} can be used interchangeably with SourceKindType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **GitRepository** \ + * **Bucket** \ + * **AzureBlob** \ + * **OCIRepository** + */ +export type SourceKindType = string; + +/** Known values of {@link ProviderType} that the service accepts. */ +export enum KnownProviderType { + /** Azure provider can be used to authenticate to Azure DevOps repositories using Managed Identity. */ + Azure = "Azure", + /** Generic is the default provider that indicates secret-based authentication mechanism. */ + Generic = "Generic", +} + +/** + * Defines values for ProviderType. \ + * {@link KnownProviderType} can be used interchangeably with ProviderType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Azure**: Azure provider can be used to authenticate to Azure DevOps repositories using Managed Identity. \ + * **Generic**: Generic is the default provider that indicates secret-based authentication mechanism. + */ +export type ProviderType = string; + +/** Known values of {@link OperationType} that the service accepts. */ +export enum KnownOperationType { + /** Extract */ + Extract = "extract", + /** Copy */ + Copy = "copy", +} + +/** + * Defines values for OperationType. \ + * {@link KnownOperationType} can be used interchangeably with OperationType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **extract** \ + * **copy** + */ +export type OperationType = string; + +/** Known values of {@link FluxComplianceState} that the service accepts. */ +export enum KnownFluxComplianceState { + /** Compliant */ + Compliant = "Compliant", + /** NonCompliant */ + NonCompliant = "Non-Compliant", + /** Pending */ + Pending = "Pending", + /** Suspended */ + Suspended = "Suspended", + /** Unknown */ + Unknown = "Unknown", +} + +/** + * Defines values for FluxComplianceState. \ + * {@link KnownFluxComplianceState} can be used interchangeably with FluxComplianceState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Compliant** \ + * **Non-Compliant** \ + * **Pending** \ + * **Suspended** \ + * **Unknown** + */ +export type FluxComplianceState = string; + +/** Known values of {@link ProvisioningState} that the service accepts. */ +export enum KnownProvisioningState { + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", + /** Canceled */ + Canceled = "Canceled", + /** Creating */ + Creating = "Creating", + /** Updating */ + Updating = "Updating", + /** Deleting */ + Deleting = "Deleting", +} + +/** + * Defines values for ProvisioningState. \ + * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Failed** \ + * **Canceled** \ + * **Creating** \ + * **Updating** \ + * **Deleting** + */ +export type ProvisioningState = string; + +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + /** User */ + User = "User", + /** Application */ + Application = "Application", + /** ManagedIdentity */ + ManagedIdentity = "ManagedIdentity", + /** Key */ + Key = "Key", +} + +/** + * Defines values for CreatedByType. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User** \ + * **Application** \ + * **ManagedIdentity** \ + * **Key** + */ +export type CreatedByType = string; + +/** Known values of {@link KustomizationValidationType} that the service accepts. */ +export enum KnownKustomizationValidationType { + /** None */ + None = "none", + /** Client */ + Client = "client", + /** Server */ + Server = "server", +} + +/** + * Defines values for KustomizationValidationType. \ + * {@link KnownKustomizationValidationType} can be used interchangeably with KustomizationValidationType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **none** \ + * **client** \ + * **server** + */ +export type KustomizationValidationType = string; + +/** Optional parameters. */ +export interface FluxConfigurationsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type FluxConfigurationsGetResponse = FluxConfiguration; + +/** Optional parameters. */ +export interface FluxConfigurationsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type FluxConfigurationsCreateOrUpdateResponse = FluxConfiguration; + +/** Optional parameters. */ +export interface FluxConfigurationsUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type FluxConfigurationsUpdateResponse = FluxConfiguration; + +/** Optional parameters. */ +export interface FluxConfigurationsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delete the extension resource in Azure - not the normal asynchronous delete. */ + forceDelete?: boolean; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface FluxConfigurationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type FluxConfigurationsListResponse = FluxConfigurationsList; + +/** Optional parameters. */ +export interface FluxConfigurationsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type FluxConfigurationsListNextResponse = FluxConfigurationsList; + +/** Optional parameters. */ +export interface FluxConfigOperationStatusGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type FluxConfigOperationStatusGetResponse = OperationStatusResult; + +/** Optional parameters. */ +export interface FluxConfigurationClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/models/mappers.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/models/mappers.ts new file mode 100644 index 000000000000..f0e63a68c701 --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/models/mappers.ts @@ -0,0 +1,1983 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; + +export const GitRepositoryDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GitRepositoryDefinition", + modelProperties: { + url: { + serializedName: "url", + nullable: true, + type: { + name: "String", + }, + }, + timeoutInSeconds: { + defaultValue: 600, + serializedName: "timeoutInSeconds", + nullable: true, + type: { + name: "Number", + }, + }, + syncIntervalInSeconds: { + defaultValue: 600, + serializedName: "syncIntervalInSeconds", + nullable: true, + type: { + name: "Number", + }, + }, + repositoryRef: { + serializedName: "repositoryRef", + type: { + name: "Composite", + className: "RepositoryRefDefinition", + }, + }, + sshKnownHosts: { + serializedName: "sshKnownHosts", + nullable: true, + type: { + name: "String", + }, + }, + httpsUser: { + serializedName: "httpsUser", + nullable: true, + type: { + name: "String", + }, + }, + httpsCACert: { + serializedName: "httpsCACert", + nullable: true, + type: { + name: "String", + }, + }, + localAuthRef: { + serializedName: "localAuthRef", + nullable: true, + type: { + name: "String", + }, + }, + provider: { + serializedName: "provider", + nullable: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const RepositoryRefDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RepositoryRefDefinition", + modelProperties: { + branch: { + serializedName: "branch", + nullable: true, + type: { + name: "String", + }, + }, + tag: { + serializedName: "tag", + nullable: true, + type: { + name: "String", + }, + }, + semver: { + serializedName: "semver", + nullable: true, + type: { + name: "String", + }, + }, + commit: { + serializedName: "commit", + nullable: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const BucketDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BucketDefinition", + modelProperties: { + url: { + serializedName: "url", + type: { + name: "String", + }, + }, + bucketName: { + serializedName: "bucketName", + type: { + name: "String", + }, + }, + insecure: { + defaultValue: true, + serializedName: "insecure", + type: { + name: "Boolean", + }, + }, + timeoutInSeconds: { + defaultValue: 600, + serializedName: "timeoutInSeconds", + nullable: true, + type: { + name: "Number", + }, + }, + syncIntervalInSeconds: { + defaultValue: 600, + serializedName: "syncIntervalInSeconds", + nullable: true, + type: { + name: "Number", + }, + }, + accessKey: { + serializedName: "accessKey", + nullable: true, + type: { + name: "String", + }, + }, + localAuthRef: { + serializedName: "localAuthRef", + nullable: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const AzureBlobDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AzureBlobDefinition", + modelProperties: { + url: { + serializedName: "url", + nullable: true, + type: { + name: "String", + }, + }, + containerName: { + serializedName: "containerName", + nullable: true, + type: { + name: "String", + }, + }, + timeoutInSeconds: { + defaultValue: 600, + serializedName: "timeoutInSeconds", + nullable: true, + type: { + name: "Number", + }, + }, + syncIntervalInSeconds: { + defaultValue: 600, + serializedName: "syncIntervalInSeconds", + nullable: true, + type: { + name: "Number", + }, + }, + servicePrincipal: { + serializedName: "servicePrincipal", + type: { + name: "Composite", + className: "ServicePrincipalDefinition", + }, + }, + accountKey: { + serializedName: "accountKey", + nullable: true, + type: { + name: "String", + }, + }, + sasToken: { + serializedName: "sasToken", + nullable: true, + type: { + name: "String", + }, + }, + managedIdentity: { + serializedName: "managedIdentity", + type: { + name: "Composite", + className: "ManagedIdentityDefinition", + }, + }, + localAuthRef: { + serializedName: "localAuthRef", + nullable: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ServicePrincipalDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ServicePrincipalDefinition", + modelProperties: { + clientId: { + serializedName: "clientId", + nullable: true, + type: { + name: "String", + }, + }, + tenantId: { + serializedName: "tenantId", + nullable: true, + type: { + name: "String", + }, + }, + clientSecret: { + serializedName: "clientSecret", + nullable: true, + type: { + name: "String", + }, + }, + clientCertificate: { + serializedName: "clientCertificate", + nullable: true, + type: { + name: "String", + }, + }, + clientCertificatePassword: { + serializedName: "clientCertificatePassword", + nullable: true, + type: { + name: "String", + }, + }, + clientCertificateSendChain: { + defaultValue: false, + serializedName: "clientCertificateSendChain", + type: { + name: "Boolean", + }, + }, + }, + }, +}; + +export const ManagedIdentityDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedIdentityDefinition", + modelProperties: { + clientId: { + serializedName: "clientId", + nullable: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const OCIRepositoryDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OCIRepositoryDefinition", + modelProperties: { + url: { + serializedName: "url", + nullable: true, + type: { + name: "String", + }, + }, + timeoutInSeconds: { + defaultValue: 600, + serializedName: "timeoutInSeconds", + nullable: true, + type: { + name: "Number", + }, + }, + syncIntervalInSeconds: { + defaultValue: 600, + serializedName: "syncIntervalInSeconds", + nullable: true, + type: { + name: "Number", + }, + }, + repositoryRef: { + serializedName: "repositoryRef", + type: { + name: "Composite", + className: "OCIRepositoryRefDefinition", + }, + }, + layerSelector: { + serializedName: "layerSelector", + type: { + name: "Composite", + className: "LayerSelectorDefinition", + }, + }, + verify: { + serializedName: "verify", + type: { + name: "Composite", + className: "VerifyDefinition", + }, + }, + insecure: { + defaultValue: false, + serializedName: "insecure", + type: { + name: "Boolean", + }, + }, + useWorkloadIdentity: { + defaultValue: false, + serializedName: "useWorkloadIdentity", + type: { + name: "Boolean", + }, + }, + serviceAccountName: { + serializedName: "serviceAccountName", + nullable: true, + type: { + name: "String", + }, + }, + tlsConfig: { + serializedName: "tlsConfig", + type: { + name: "Composite", + className: "TlsConfigDefinition", + }, + }, + localAuthRef: { + serializedName: "localAuthRef", + nullable: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const OCIRepositoryRefDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OCIRepositoryRefDefinition", + modelProperties: { + tag: { + serializedName: "tag", + nullable: true, + type: { + name: "String", + }, + }, + semver: { + serializedName: "semver", + nullable: true, + type: { + name: "String", + }, + }, + digest: { + serializedName: "digest", + nullable: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const LayerSelectorDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LayerSelectorDefinition", + modelProperties: { + mediaType: { + serializedName: "mediaType", + nullable: true, + type: { + name: "String", + }, + }, + operation: { + serializedName: "operation", + nullable: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const VerifyDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VerifyDefinition", + modelProperties: { + provider: { + serializedName: "provider", + type: { + name: "String", + }, + }, + verificationConfig: { + serializedName: "verificationConfig", + nullable: true, + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + matchOidcIdentity: { + serializedName: "matchOidcIdentity", + nullable: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MatchOidcIdentityDefinition", + }, + }, + }, + }, + }, + }, +}; + +export const MatchOidcIdentityDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MatchOidcIdentityDefinition", + modelProperties: { + issuer: { + serializedName: "issuer", + type: { + name: "String", + }, + }, + subject: { + serializedName: "subject", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const TlsConfigDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TlsConfigDefinition", + modelProperties: { + clientCertificate: { + serializedName: "clientCertificate", + nullable: true, + type: { + name: "String", + }, + }, + privateKey: { + serializedName: "privateKey", + nullable: true, + type: { + name: "String", + }, + }, + caCertificate: { + serializedName: "caCertificate", + nullable: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const KustomizationDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "KustomizationDefinition", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String", + }, + }, + path: { + defaultValue: "", + serializedName: "path", + type: { + name: "String", + }, + }, + dependsOn: { + serializedName: "dependsOn", + nullable: true, + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + timeoutInSeconds: { + defaultValue: 600, + serializedName: "timeoutInSeconds", + nullable: true, + type: { + name: "Number", + }, + }, + syncIntervalInSeconds: { + defaultValue: 600, + serializedName: "syncIntervalInSeconds", + nullable: true, + type: { + name: "Number", + }, + }, + retryIntervalInSeconds: { + serializedName: "retryIntervalInSeconds", + nullable: true, + type: { + name: "Number", + }, + }, + prune: { + defaultValue: false, + serializedName: "prune", + type: { + name: "Boolean", + }, + }, + force: { + defaultValue: false, + serializedName: "force", + type: { + name: "Boolean", + }, + }, + wait: { + defaultValue: true, + serializedName: "wait", + type: { + name: "Boolean", + }, + }, + postBuild: { + serializedName: "postBuild", + type: { + name: "Composite", + className: "PostBuildDefinition", + }, + }, + }, + }, +}; + +export const PostBuildDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PostBuildDefinition", + modelProperties: { + substitute: { + serializedName: "substitute", + nullable: true, + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + substituteFrom: { + serializedName: "substituteFrom", + nullable: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SubstituteFromDefinition", + }, + }, + }, + }, + }, + }, +}; + +export const SubstituteFromDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SubstituteFromDefinition", + modelProperties: { + kind: { + serializedName: "kind", + type: { + name: "String", + }, + }, + name: { + serializedName: "name", + type: { + name: "String", + }, + }, + optional: { + defaultValue: false, + serializedName: "optional", + type: { + name: "Boolean", + }, + }, + }, + }, +}; + +export const ObjectStatusDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ObjectStatusDefinition", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String", + }, + }, + namespace: { + serializedName: "namespace", + type: { + name: "String", + }, + }, + kind: { + serializedName: "kind", + type: { + name: "String", + }, + }, + complianceState: { + defaultValue: "Unknown", + serializedName: "complianceState", + type: { + name: "String", + }, + }, + appliedBy: { + serializedName: "appliedBy", + type: { + name: "Composite", + className: "ObjectReferenceDefinition", + }, + }, + statusConditions: { + serializedName: "statusConditions", + nullable: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ObjectStatusConditionDefinition", + }, + }, + }, + }, + helmReleaseProperties: { + serializedName: "helmReleaseProperties", + type: { + name: "Composite", + className: "HelmReleasePropertiesDefinition", + }, + }, + }, + }, +}; + +export const ObjectReferenceDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ObjectReferenceDefinition", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String", + }, + }, + namespace: { + serializedName: "namespace", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ObjectStatusConditionDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ObjectStatusConditionDefinition", + modelProperties: { + lastTransitionTime: { + serializedName: "lastTransitionTime", + type: { + name: "DateTime", + }, + }, + message: { + serializedName: "message", + type: { + name: "String", + }, + }, + reason: { + serializedName: "reason", + type: { + name: "String", + }, + }, + status: { + serializedName: "status", + type: { + name: "String", + }, + }, + type: { + serializedName: "type", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const HelmReleasePropertiesDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "HelmReleasePropertiesDefinition", + modelProperties: { + lastRevisionApplied: { + serializedName: "lastRevisionApplied", + nullable: true, + type: { + name: "Number", + }, + }, + helmChartRef: { + serializedName: "helmChartRef", + type: { + name: "Composite", + className: "ObjectReferenceDefinition", + }, + }, + failureCount: { + serializedName: "failureCount", + nullable: true, + type: { + name: "Number", + }, + }, + installFailureCount: { + serializedName: "installFailureCount", + nullable: true, + type: { + name: "Number", + }, + }, + upgradeFailureCount: { + serializedName: "upgradeFailureCount", + nullable: true, + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const SystemData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String", + }, + }, + createdByType: { + serializedName: "createdByType", + type: { + name: "String", + }, + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime", + }, + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String", + }, + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String", + }, + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime", + }, + }, + }, + }, +}; + +export const Resource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String", + }, + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String", + }, + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail", + }, + }, + }, + }, +}; + +export const ErrorDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorDetail", + modelProperties: { + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String", + }, + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String", + }, + }, + target: { + serializedName: "target", + readOnly: true, + type: { + name: "String", + }, + }, + details: { + serializedName: "details", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetail", + }, + }, + }, + }, + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + }, + }, + }, + }, + }, + }, +}; + +export const ErrorAdditionalInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + modelProperties: { + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String", + }, + }, + info: { + serializedName: "info", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "any" } }, + }, + }, + }, + }, +}; + +export const FluxConfigurationPatch: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FluxConfigurationPatch", + modelProperties: { + sourceKind: { + serializedName: "properties.sourceKind", + nullable: true, + type: { + name: "String", + }, + }, + suspend: { + serializedName: "properties.suspend", + nullable: true, + type: { + name: "Boolean", + }, + }, + gitRepository: { + serializedName: "properties.gitRepository", + type: { + name: "Composite", + className: "GitRepositoryPatchDefinition", + }, + }, + bucket: { + serializedName: "properties.bucket", + type: { + name: "Composite", + className: "BucketPatchDefinition", + }, + }, + azureBlob: { + serializedName: "properties.azureBlob", + type: { + name: "Composite", + className: "AzureBlobPatchDefinition", + }, + }, + ociRepository: { + serializedName: "properties.ociRepository", + type: { + name: "Composite", + className: "OCIRepositoryPatchDefinition", + }, + }, + kustomizations: { + serializedName: "properties.kustomizations", + nullable: true, + type: { + name: "Dictionary", + value: { + type: { + name: "Composite", + className: "KustomizationPatchDefinition", + }, + }, + }, + }, + configurationProtectedSettings: { + serializedName: "properties.configurationProtectedSettings", + nullable: true, + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + }, + }, +}; + +export const GitRepositoryPatchDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GitRepositoryPatchDefinition", + modelProperties: { + url: { + serializedName: "url", + nullable: true, + type: { + name: "String", + }, + }, + timeoutInSeconds: { + serializedName: "timeoutInSeconds", + nullable: true, + type: { + name: "Number", + }, + }, + syncIntervalInSeconds: { + serializedName: "syncIntervalInSeconds", + nullable: true, + type: { + name: "Number", + }, + }, + repositoryRef: { + serializedName: "repositoryRef", + type: { + name: "Composite", + className: "RepositoryRefDefinition", + }, + }, + sshKnownHosts: { + serializedName: "sshKnownHosts", + nullable: true, + type: { + name: "String", + }, + }, + httpsUser: { + serializedName: "httpsUser", + nullable: true, + type: { + name: "String", + }, + }, + httpsCACert: { + serializedName: "httpsCACert", + nullable: true, + type: { + name: "String", + }, + }, + localAuthRef: { + serializedName: "localAuthRef", + nullable: true, + type: { + name: "String", + }, + }, + provider: { + serializedName: "provider", + nullable: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const BucketPatchDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BucketPatchDefinition", + modelProperties: { + url: { + serializedName: "url", + nullable: true, + type: { + name: "String", + }, + }, + bucketName: { + serializedName: "bucketName", + nullable: true, + type: { + name: "String", + }, + }, + insecure: { + serializedName: "insecure", + nullable: true, + type: { + name: "Boolean", + }, + }, + timeoutInSeconds: { + serializedName: "timeoutInSeconds", + nullable: true, + type: { + name: "Number", + }, + }, + syncIntervalInSeconds: { + serializedName: "syncIntervalInSeconds", + nullable: true, + type: { + name: "Number", + }, + }, + accessKey: { + serializedName: "accessKey", + nullable: true, + type: { + name: "String", + }, + }, + localAuthRef: { + serializedName: "localAuthRef", + nullable: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const AzureBlobPatchDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AzureBlobPatchDefinition", + modelProperties: { + url: { + serializedName: "url", + nullable: true, + type: { + name: "String", + }, + }, + containerName: { + serializedName: "containerName", + nullable: true, + type: { + name: "String", + }, + }, + timeoutInSeconds: { + serializedName: "timeoutInSeconds", + nullable: true, + type: { + name: "Number", + }, + }, + syncIntervalInSeconds: { + serializedName: "syncIntervalInSeconds", + nullable: true, + type: { + name: "Number", + }, + }, + servicePrincipal: { + serializedName: "servicePrincipal", + type: { + name: "Composite", + className: "ServicePrincipalPatchDefinition", + }, + }, + accountKey: { + serializedName: "accountKey", + nullable: true, + type: { + name: "String", + }, + }, + sasToken: { + serializedName: "sasToken", + nullable: true, + type: { + name: "String", + }, + }, + managedIdentity: { + serializedName: "managedIdentity", + type: { + name: "Composite", + className: "ManagedIdentityPatchDefinition", + }, + }, + localAuthRef: { + serializedName: "localAuthRef", + nullable: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ServicePrincipalPatchDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ServicePrincipalPatchDefinition", + modelProperties: { + clientId: { + serializedName: "clientId", + nullable: true, + type: { + name: "String", + }, + }, + tenantId: { + serializedName: "tenantId", + nullable: true, + type: { + name: "String", + }, + }, + clientSecret: { + serializedName: "clientSecret", + nullable: true, + type: { + name: "String", + }, + }, + clientCertificate: { + serializedName: "clientCertificate", + nullable: true, + type: { + name: "String", + }, + }, + clientCertificatePassword: { + serializedName: "clientCertificatePassword", + nullable: true, + type: { + name: "String", + }, + }, + clientCertificateSendChain: { + serializedName: "clientCertificateSendChain", + type: { + name: "Boolean", + }, + }, + }, + }, +}; + +export const ManagedIdentityPatchDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedIdentityPatchDefinition", + modelProperties: { + clientId: { + serializedName: "clientId", + nullable: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const OCIRepositoryPatchDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OCIRepositoryPatchDefinition", + modelProperties: { + url: { + serializedName: "url", + nullable: true, + type: { + name: "String", + }, + }, + timeoutInSeconds: { + serializedName: "timeoutInSeconds", + nullable: true, + type: { + name: "Number", + }, + }, + syncIntervalInSeconds: { + serializedName: "syncIntervalInSeconds", + nullable: true, + type: { + name: "Number", + }, + }, + repositoryRef: { + serializedName: "repositoryRef", + type: { + name: "Composite", + className: "OCIRepositoryRefPatchDefinition", + }, + }, + layerSelector: { + serializedName: "layerSelector", + type: { + name: "Composite", + className: "LayerSelectorPatchDefinition", + }, + }, + verify: { + serializedName: "verify", + type: { + name: "Composite", + className: "VerifyPatchDefinition", + }, + }, + insecure: { + defaultValue: false, + serializedName: "insecure", + type: { + name: "Boolean", + }, + }, + useWorkloadIdentity: { + defaultValue: false, + serializedName: "useWorkloadIdentity", + type: { + name: "Boolean", + }, + }, + serviceAccountName: { + serializedName: "serviceAccountName", + nullable: true, + type: { + name: "String", + }, + }, + tlsConfig: { + serializedName: "tlsConfig", + type: { + name: "Composite", + className: "TlsConfigPatchDefinition", + }, + }, + localAuthRef: { + serializedName: "localAuthRef", + nullable: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const OCIRepositoryRefPatchDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OCIRepositoryRefPatchDefinition", + modelProperties: { + tag: { + serializedName: "tag", + nullable: true, + type: { + name: "String", + }, + }, + semver: { + serializedName: "semver", + nullable: true, + type: { + name: "String", + }, + }, + digest: { + serializedName: "digest", + nullable: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const LayerSelectorPatchDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LayerSelectorPatchDefinition", + modelProperties: { + mediaType: { + serializedName: "mediaType", + nullable: true, + type: { + name: "String", + }, + }, + operation: { + serializedName: "operation", + nullable: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const VerifyPatchDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VerifyPatchDefinition", + modelProperties: { + provider: { + serializedName: "provider", + type: { + name: "String", + }, + }, + verificationConfig: { + serializedName: "verificationConfig", + nullable: true, + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + matchOidcIdentity: { + serializedName: "matchOidcIdentity", + nullable: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MatchOidcIdentityPatchDefinition", + }, + }, + }, + }, + }, + }, +}; + +export const MatchOidcIdentityPatchDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MatchOidcIdentityPatchDefinition", + modelProperties: { + issuer: { + serializedName: "issuer", + type: { + name: "String", + }, + }, + subject: { + serializedName: "subject", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const TlsConfigPatchDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TlsConfigPatchDefinition", + modelProperties: { + clientCertificate: { + serializedName: "clientCertificate", + nullable: true, + type: { + name: "String", + }, + }, + privateKey: { + serializedName: "privateKey", + nullable: true, + type: { + name: "String", + }, + }, + caCertificate: { + serializedName: "caCertificate", + nullable: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const KustomizationPatchDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "KustomizationPatchDefinition", + modelProperties: { + path: { + serializedName: "path", + nullable: true, + type: { + name: "String", + }, + }, + dependsOn: { + serializedName: "dependsOn", + nullable: true, + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + timeoutInSeconds: { + serializedName: "timeoutInSeconds", + nullable: true, + type: { + name: "Number", + }, + }, + syncIntervalInSeconds: { + serializedName: "syncIntervalInSeconds", + nullable: true, + type: { + name: "Number", + }, + }, + retryIntervalInSeconds: { + serializedName: "retryIntervalInSeconds", + nullable: true, + type: { + name: "Number", + }, + }, + prune: { + serializedName: "prune", + nullable: true, + type: { + name: "Boolean", + }, + }, + force: { + serializedName: "force", + nullable: true, + type: { + name: "Boolean", + }, + }, + wait: { + serializedName: "wait", + nullable: true, + type: { + name: "Boolean", + }, + }, + postBuild: { + serializedName: "postBuild", + type: { + name: "Composite", + className: "PostBuildPatchDefinition", + }, + }, + }, + }, +}; + +export const PostBuildPatchDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PostBuildPatchDefinition", + modelProperties: { + substitute: { + serializedName: "substitute", + nullable: true, + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + substituteFrom: { + serializedName: "substituteFrom", + nullable: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SubstituteFromPatchDefinition", + }, + }, + }, + }, + }, + }, +}; + +export const SubstituteFromPatchDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SubstituteFromPatchDefinition", + modelProperties: { + kind: { + serializedName: "kind", + type: { + name: "String", + }, + }, + name: { + serializedName: "name", + type: { + name: "String", + }, + }, + optional: { + defaultValue: false, + serializedName: "optional", + type: { + name: "Boolean", + }, + }, + }, + }, +}; + +export const FluxConfigurationsList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FluxConfigurationsList", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "FluxConfiguration", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const OperationStatusResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationStatusResult", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String", + }, + }, + name: { + serializedName: "name", + type: { + name: "String", + }, + }, + status: { + serializedName: "status", + required: true, + type: { + name: "String", + }, + }, + properties: { + serializedName: "properties", + nullable: true, + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail", + }, + }, + }, + }, +}; + +export const ProxyResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties, + }, + }, +}; + +export const FluxConfiguration: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FluxConfiguration", + modelProperties: { + ...ProxyResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData", + }, + }, + scope: { + defaultValue: "cluster", + serializedName: "properties.scope", + type: { + name: "String", + }, + }, + namespace: { + defaultValue: "default", + serializedName: "properties.namespace", + type: { + name: "String", + }, + }, + sourceKind: { + serializedName: "properties.sourceKind", + type: { + name: "String", + }, + }, + suspend: { + defaultValue: false, + serializedName: "properties.suspend", + type: { + name: "Boolean", + }, + }, + gitRepository: { + serializedName: "properties.gitRepository", + type: { + name: "Composite", + className: "GitRepositoryDefinition", + }, + }, + bucket: { + serializedName: "properties.bucket", + type: { + name: "Composite", + className: "BucketDefinition", + }, + }, + azureBlob: { + serializedName: "properties.azureBlob", + type: { + name: "Composite", + className: "AzureBlobDefinition", + }, + }, + ociRepository: { + serializedName: "properties.ociRepository", + type: { + name: "Composite", + className: "OCIRepositoryDefinition", + }, + }, + kustomizations: { + serializedName: "properties.kustomizations", + nullable: true, + type: { + name: "Dictionary", + value: { + type: { name: "Composite", className: "KustomizationDefinition" }, + }, + }, + }, + configurationProtectedSettings: { + serializedName: "properties.configurationProtectedSettings", + nullable: true, + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + statuses: { + serializedName: "properties.statuses", + readOnly: true, + nullable: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ObjectStatusDefinition", + }, + }, + }, + }, + repositoryPublicKey: { + serializedName: "properties.repositoryPublicKey", + readOnly: true, + nullable: true, + type: { + name: "String", + }, + }, + sourceSyncedCommitId: { + serializedName: "properties.sourceSyncedCommitId", + readOnly: true, + nullable: true, + type: { + name: "String", + }, + }, + sourceUpdatedAt: { + serializedName: "properties.sourceUpdatedAt", + readOnly: true, + nullable: true, + type: { + name: "DateTime", + }, + }, + statusUpdatedAt: { + serializedName: "properties.statusUpdatedAt", + readOnly: true, + nullable: true, + type: { + name: "DateTime", + }, + }, + waitForReconciliation: { + serializedName: "properties.waitForReconciliation", + nullable: true, + type: { + name: "Boolean", + }, + }, + reconciliationWaitDuration: { + serializedName: "properties.reconciliationWaitDuration", + nullable: true, + type: { + name: "String", + }, + }, + complianceState: { + defaultValue: "Unknown", + serializedName: "properties.complianceState", + readOnly: true, + type: { + name: "String", + }, + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + errorMessage: { + serializedName: "properties.errorMessage", + readOnly: true, + nullable: true, + type: { + name: "String", + }, + }, + }, + }, +}; diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/models/parameters.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/models/parameters.ts new file mode 100644 index 000000000000..222baaaae35d --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/models/parameters.ts @@ -0,0 +1,187 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + OperationParameter, + OperationURLParameter, + OperationQueryParameter, +} from "@azure/core-client"; +import { + FluxConfiguration as FluxConfigurationMapper, + FluxConfigurationPatch as FluxConfigurationPatchMapper, +} from "../models/mappers"; + +export const accept: OperationParameter = { + parameterPath: "accept", + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", + type: { + name: "String", + }, + }, +}; + +export const $host: OperationURLParameter = { + parameterPath: "$host", + mapper: { + serializedName: "$host", + required: true, + type: { + name: "String", + }, + }, + skipEncoding: true, +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + constraints: { + MinLength: 1, + }, + serializedName: "subscriptionId", + required: true, + type: { + name: "String", + }, + }, +}; + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + constraints: { + MaxLength: 90, + MinLength: 1, + }, + serializedName: "resourceGroupName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const clusterRp: OperationURLParameter = { + parameterPath: "clusterRp", + mapper: { + serializedName: "clusterRp", + required: true, + type: { + name: "String", + }, + }, +}; + +export const clusterResourceName: OperationURLParameter = { + parameterPath: "clusterResourceName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z]*$"), + }, + serializedName: "clusterResourceName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const clusterName: OperationURLParameter = { + parameterPath: "clusterName", + mapper: { + constraints: { + Pattern: new RegExp("^.*"), + }, + serializedName: "clusterName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const fluxConfigurationName: OperationURLParameter = { + parameterPath: "fluxConfigurationName", + mapper: { + serializedName: "fluxConfigurationName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2024-11-01", + isConstant: true, + serializedName: "api-version", + type: { + name: "String", + }, + }, +}; + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String", + }, + }, +}; + +export const fluxConfiguration: OperationParameter = { + parameterPath: "fluxConfiguration", + mapper: FluxConfigurationMapper, +}; + +export const fluxConfigurationPatch: OperationParameter = { + parameterPath: "fluxConfigurationPatch", + mapper: FluxConfigurationPatchMapper, +}; + +export const forceDelete: OperationQueryParameter = { + parameterPath: ["options", "forceDelete"], + mapper: { + serializedName: "forceDelete", + type: { + name: "Boolean", + }, + }, +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String", + }, + }, + skipEncoding: true, +}; + +export const operationId: OperationURLParameter = { + parameterPath: "operationId", + mapper: { + serializedName: "operationId", + required: true, + type: { + name: "String", + }, + }, +}; diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/operations/fluxConfigOperationStatus.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/operations/fluxConfigOperationStatus.ts new file mode 100644 index 000000000000..8e3c80ab1112 --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/operations/fluxConfigOperationStatus.ts @@ -0,0 +1,95 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { FluxConfigOperationStatus } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { FluxConfigurationClient } from "../fluxConfigurationClient"; +import { + FluxConfigOperationStatusGetOptionalParams, + FluxConfigOperationStatusGetResponse, +} from "../models"; + +/** Class containing FluxConfigOperationStatus operations. */ +export class FluxConfigOperationStatusImpl + implements FluxConfigOperationStatus +{ + private readonly client: FluxConfigurationClient; + + /** + * Initialize a new instance of the class FluxConfigOperationStatus class. + * @param client Reference to the service client + */ + constructor(client: FluxConfigurationClient) { + this.client = client; + } + + /** + * Get Async Operation status + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param operationId operation Id + * @param options The options parameters. + */ + get( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + fluxConfigurationName: string, + operationId: string, + options?: FluxConfigOperationStatusGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + operationId, + options, + }, + getOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}/operations/{operationId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationStatusResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterRp, + Parameters.clusterResourceName, + Parameters.clusterName, + Parameters.fluxConfigurationName, + Parameters.operationId, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/operations/fluxConfigurations.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/operations/fluxConfigurations.ts new file mode 100644 index 000000000000..f4fd831c3c01 --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/operations/fluxConfigurations.ts @@ -0,0 +1,769 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { FluxConfigurations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { FluxConfigurationClient } from "../fluxConfigurationClient"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + FluxConfiguration, + FluxConfigurationsListNextOptionalParams, + FluxConfigurationsListOptionalParams, + FluxConfigurationsListResponse, + FluxConfigurationsGetOptionalParams, + FluxConfigurationsGetResponse, + FluxConfigurationsCreateOrUpdateOptionalParams, + FluxConfigurationsCreateOrUpdateResponse, + FluxConfigurationPatch, + FluxConfigurationsUpdateOptionalParams, + FluxConfigurationsUpdateResponse, + FluxConfigurationsDeleteOptionalParams, + FluxConfigurationsListNextResponse, +} from "../models"; + +/// +/** Class containing FluxConfigurations operations. */ +export class FluxConfigurationsImpl implements FluxConfigurations { + private readonly client: FluxConfigurationClient; + + /** + * Initialize a new instance of the class FluxConfigurations class. + * @param client Reference to the service client + */ + constructor(client: FluxConfigurationClient) { + this.client = client; + } + + /** + * List all Flux Configurations. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + options?: FluxConfigurationsListOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + options, + settings, + ); + }, + }; + } + + private async *listPagingPage( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + options?: FluxConfigurationsListOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: FluxConfigurationsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + options?: FluxConfigurationsListOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + options, + )) { + yield* page; + } + } + + /** + * Gets details of the Flux Configuration. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + fluxConfigurationName: string, + options?: FluxConfigurationsGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + options, + }, + getOperationSpec, + ); + } + + /** + * Create a new Kubernetes Flux Configuration. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfiguration Properties necessary to Create a FluxConfiguration. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + fluxConfigurationName: string, + fluxConfiguration: FluxConfiguration, + options?: FluxConfigurationsCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + FluxConfigurationsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + fluxConfiguration, + options, + }, + spec: createOrUpdateOperationSpec, + }); + const poller = await createHttpPoller< + FluxConfigurationsCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation", + }); + await poller.poll(); + return poller; + } + + /** + * Create a new Kubernetes Flux Configuration. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfiguration Properties necessary to Create a FluxConfiguration. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + fluxConfigurationName: string, + fluxConfiguration: FluxConfiguration, + options?: FluxConfigurationsCreateOrUpdateOptionalParams, + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + fluxConfiguration, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Update an existing Kubernetes Flux Configuration. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfigurationPatch Properties to Patch in an existing Flux Configuration. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + fluxConfigurationName: string, + fluxConfigurationPatch: FluxConfigurationPatch, + options?: FluxConfigurationsUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + FluxConfigurationsUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + fluxConfigurationPatch, + options, + }, + spec: updateOperationSpec, + }); + const poller = await createHttpPoller< + FluxConfigurationsUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation", + }); + await poller.poll(); + return poller; + } + + /** + * Update an existing Kubernetes Flux Configuration. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfigurationPatch Properties to Patch in an existing Flux Configuration. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + fluxConfigurationName: string, + fluxConfigurationPatch: FluxConfigurationPatch, + options?: FluxConfigurationsUpdateOptionalParams, + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + fluxConfigurationPatch, + options, + ); + return poller.pollUntilDone(); + } + + /** + * This will delete the YAML file used to set up the Flux Configuration, thus stopping future sync from + * the source repo. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + fluxConfigurationName: string, + options?: FluxConfigurationsDeleteOptionalParams, + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + options, + }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation", + }); + await poller.poll(); + return poller; + } + + /** + * This will delete the YAML file used to set up the Flux Configuration, thus stopping future sync from + * the source repo. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + fluxConfigurationName: string, + options?: FluxConfigurationsDeleteOptionalParams, + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + fluxConfigurationName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * List all Flux Configurations. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + options?: FluxConfigurationsListOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + options, + }, + listOperationSpec, + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + nextLink: string, + options?: FluxConfigurationsListNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + nextLink, + options, + }, + listNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.FluxConfiguration, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterRp, + Parameters.clusterResourceName, + Parameters.clusterName, + Parameters.fluxConfigurationName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.FluxConfiguration, + }, + 201: { + bodyMapper: Mappers.FluxConfiguration, + }, + 202: { + bodyMapper: Mappers.FluxConfiguration, + }, + 204: { + bodyMapper: Mappers.FluxConfiguration, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.fluxConfiguration, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterRp, + Parameters.clusterResourceName, + Parameters.clusterName, + Parameters.fluxConfigurationName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.FluxConfiguration, + }, + 201: { + bodyMapper: Mappers.FluxConfiguration, + }, + 202: { + bodyMapper: Mappers.FluxConfiguration, + }, + 204: { + bodyMapper: Mappers.FluxConfiguration, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.fluxConfigurationPatch, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterRp, + Parameters.clusterResourceName, + Parameters.clusterName, + Parameters.fluxConfigurationName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion, Parameters.forceDelete], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterRp, + Parameters.clusterResourceName, + Parameters.clusterName, + Parameters.fluxConfigurationName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.FluxConfigurationsList, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterRp, + Parameters.clusterResourceName, + Parameters.clusterName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.FluxConfigurationsList, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterRp, + Parameters.clusterResourceName, + Parameters.clusterName, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/operations/index.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/operations/index.ts new file mode 100644 index 000000000000..536593b1b438 --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/operations/index.ts @@ -0,0 +1,10 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./fluxConfigurations"; +export * from "./fluxConfigOperationStatus"; diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/operationsInterfaces/fluxConfigOperationStatus.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/operationsInterfaces/fluxConfigOperationStatus.ts new file mode 100644 index 000000000000..d02d1f654725 --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/operationsInterfaces/fluxConfigOperationStatus.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + FluxConfigOperationStatusGetOptionalParams, + FluxConfigOperationStatusGetResponse, +} from "../models"; + +/** Interface representing a FluxConfigOperationStatus. */ +export interface FluxConfigOperationStatus { + /** + * Get Async Operation status + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param operationId operation Id + * @param options The options parameters. + */ + get( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + fluxConfigurationName: string, + operationId: string, + options?: FluxConfigOperationStatusGetOptionalParams, + ): Promise; +} diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/operationsInterfaces/fluxConfigurations.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/operationsInterfaces/fluxConfigurations.ts new file mode 100644 index 000000000000..e980eb7f7a30 --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/operationsInterfaces/fluxConfigurations.ts @@ -0,0 +1,197 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + FluxConfiguration, + FluxConfigurationsListOptionalParams, + FluxConfigurationsGetOptionalParams, + FluxConfigurationsGetResponse, + FluxConfigurationsCreateOrUpdateOptionalParams, + FluxConfigurationsCreateOrUpdateResponse, + FluxConfigurationPatch, + FluxConfigurationsUpdateOptionalParams, + FluxConfigurationsUpdateResponse, + FluxConfigurationsDeleteOptionalParams, +} from "../models"; + +/// +/** Interface representing a FluxConfigurations. */ +export interface FluxConfigurations { + /** + * List all Flux Configurations. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + options?: FluxConfigurationsListOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Gets details of the Flux Configuration. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + fluxConfigurationName: string, + options?: FluxConfigurationsGetOptionalParams, + ): Promise; + /** + * Create a new Kubernetes Flux Configuration. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfiguration Properties necessary to Create a FluxConfiguration. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + fluxConfigurationName: string, + fluxConfiguration: FluxConfiguration, + options?: FluxConfigurationsCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + FluxConfigurationsCreateOrUpdateResponse + > + >; + /** + * Create a new Kubernetes Flux Configuration. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfiguration Properties necessary to Create a FluxConfiguration. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + fluxConfigurationName: string, + fluxConfiguration: FluxConfiguration, + options?: FluxConfigurationsCreateOrUpdateOptionalParams, + ): Promise; + /** + * Update an existing Kubernetes Flux Configuration. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfigurationPatch Properties to Patch in an existing Flux Configuration. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + fluxConfigurationName: string, + fluxConfigurationPatch: FluxConfigurationPatch, + options?: FluxConfigurationsUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + FluxConfigurationsUpdateResponse + > + >; + /** + * Update an existing Kubernetes Flux Configuration. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param fluxConfigurationPatch Properties to Patch in an existing Flux Configuration. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + fluxConfigurationName: string, + fluxConfigurationPatch: FluxConfigurationPatch, + options?: FluxConfigurationsUpdateOptionalParams, + ): Promise; + /** + * This will delete the YAML file used to set up the Flux Configuration, thus stopping future sync from + * the source repo. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + fluxConfigurationName: string, + options?: FluxConfigurationsDeleteOptionalParams, + ): Promise, void>>; + /** + * This will delete the YAML file used to set up the Flux Configuration, thus stopping future sync from + * the source repo. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param fluxConfigurationName Name of the Flux Configuration. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + fluxConfigurationName: string, + options?: FluxConfigurationsDeleteOptionalParams, + ): Promise; +} diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/operationsInterfaces/index.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..536593b1b438 --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/operationsInterfaces/index.ts @@ -0,0 +1,10 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./fluxConfigurations"; +export * from "./fluxConfigOperationStatus"; diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/pagingHelper.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/pagingHelper.ts new file mode 100644 index 000000000000..205cccc26592 --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/src/pagingHelper.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export interface PageInfo { + continuationToken?: string; +} + +const pageMap = new WeakMap(); + +/** + * Given the last `.value` produced by the `byPage` iterator, + * returns a continuation token that can be used to begin paging from + * that point later. + * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator. + * @returns The continuation token that can be passed into byPage() during future calls. + */ +export function getContinuationToken(page: unknown): string | undefined { + if (typeof page !== "object" || page === null) { + return undefined; + } + return pageMap.get(page)?.continuationToken; +} + +export function setContinuationToken( + page: unknown, + continuationToken: string | undefined, +): void { + if (typeof page !== "object" || page === null || !continuationToken) { + return; + } + const pageInfo = pageMap.get(page) ?? {}; + pageInfo.continuationToken = continuationToken; + pageMap.set(page, pageInfo); +} diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/test/sampleTest.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/test/sampleTest.ts new file mode 100644 index 000000000000..d64be981b694 --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Recorder, + RecorderStartOptions, + env, +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id", +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables, +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function (this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function () { + await recorder.stop(); + }); + + it("sample test", async function () { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/tsconfig.json b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/tsconfig.json new file mode 100644 index 000000000000..b35d05ad6e9d --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es6", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": [ + "es6", + "dom" + ], + "declaration": true, + "outDir": "./dist-esm", + "importHelpers": true + }, + "include": [ + "src/**/*.ts", + "test/**/*.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/sdk/kubernetesconfiguration/ci.mgmt.yml b/sdk/kubernetesconfiguration/ci.mgmt.yml index bac5cdc3afbb..deca71f87533 100644 --- a/sdk/kubernetesconfiguration/ci.mgmt.yml +++ b/sdk/kubernetesconfiguration/ci.mgmt.yml @@ -10,6 +10,7 @@ trigger: include: - sdk/kubernetesconfiguration/ci.mgmt.yml - sdk/kubernetesconfiguration/arm-kubernetesconfiguration + - sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations pr: branches: include: @@ -23,6 +24,7 @@ pr: include: - sdk/kubernetesconfiguration/ci.mgmt.yml - sdk/kubernetesconfiguration/arm-kubernetesconfiguration + - sdk/kubernetesconfiguration/arm-kubernetesconfiguration-fluxconfigurations extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: @@ -30,3 +32,5 @@ extends: Artifacts: - name: azure-arm-kubernetesconfiguration safeName: azurearmkubernetesconfiguration + - name: azure-arm-kubernetesconfiguration-fluxconfigurations + safeName: azurearmkubernetesconfigurationfluxconfigurations