diff --git a/sdk/datadog/arm-datadog/CHANGELOG.md b/sdk/datadog/arm-datadog/CHANGELOG.md index d8e71f90bb33..52ed0b9e7cbd 100644 --- a/sdk/datadog/arm-datadog/CHANGELOG.md +++ b/sdk/datadog/arm-datadog/CHANGELOG.md @@ -1,5 +1,84 @@ # Release History +## 4.0.0 (2025-05-09) + +### Features Added + + - Added operation group BillingInfo + - Added Interface BillingInfoGetOptionalParams + - Added Interface BillingInfoResponse + - Added Interface CreationSupportedListNextOptionalParams + - Added Interface MarketplaceSaaSInfo + - Added Interface MonitoredSubscriptionsCreateorUpdateHeaders + - Added Interface MonitoredSubscriptionsDeleteHeaders + - Added Interface MonitoredSubscriptionsListNextOptionalParams + - Added Interface MonitoredSubscriptionsUpdateHeaders + - Added Interface MonitorsCreateHeaders + - Added Interface MonitorsDeleteHeaders + - Added Interface MonitorsUpdateHeaders + - Added Interface PartnerBillingEntity + - Added Interface ProxyResource + - Added Interface Resource + - Added Interface SingleSignOnConfigurationsCreateOrUpdateHeaders + - Added Interface TrackedResource + - Added Type Alias BillingInfoGetResponse + - Added Type Alias CreationSupportedListNextResponse + - Added Type Alias MonitoredSubscriptionsListNextResponse + - Interface CreateResourceSupportedResponseList has a new optional parameter nextLink + - Interface LinkedResource has a new optional parameter location + - Interface MonitoredSubscriptionPropertiesList has a new optional parameter nextLink + - Interface MonitoringTagRulesProperties has a new optional parameter customMetrics + +### Breaking Changes + + - Operation MarketplaceAgreements.createOrUpdate has a new signature + - Operation MonitoredSubscriptions.beginCreateorUpdate has a new signature + - Operation MonitoredSubscriptions.beginCreateorUpdateAndWait has a new signature + - Operation MonitoredSubscriptions.beginUpdate has a new signature + - Operation MonitoredSubscriptions.beginUpdateAndWait has a new signature + - Operation Monitors.beginCreate has a new signature + - Operation Monitors.beginCreateAndWait has a new signature + - Operation Monitors.beginUpdate has a new signature + - Operation Monitors.beginUpdateAndWait has a new signature + - Operation SingleSignOnConfigurations.beginCreateOrUpdate has a new signature + - Operation SingleSignOnConfigurations.beginCreateOrUpdateAndWait has a new signature + - Operation TagRules.createOrUpdate has a new signature + - Interface DatadogMonitorResource no longer has parameter id + - Interface DatadogMonitorResource no longer has parameter name + - Interface DatadogMonitorResource no longer has parameter systemData + - Interface DatadogMonitorResource no longer has parameter type + - Interface DatadogSingleSignOnResource no longer has parameter id + - Interface DatadogSingleSignOnResource no longer has parameter name + - Interface DatadogSingleSignOnResource no longer has parameter systemData + - Interface DatadogSingleSignOnResource no longer has parameter type + - Interface MarketplaceAgreementsCreateOrUpdateOptionalParams no longer has parameter body + - Interface MonitoredSubscriptionProperties no longer has parameter id + - Interface MonitoredSubscriptionProperties no longer has parameter name + - Interface MonitoredSubscriptionProperties no longer has parameter type + - Interface MonitoredSubscriptionsCreateorUpdateOptionalParams no longer has parameter body + - Interface MonitoredSubscriptionsUpdateOptionalParams no longer has parameter body + - Interface MonitoringTagRules no longer has parameter id + - Interface MonitoringTagRules no longer has parameter name + - Interface MonitoringTagRules no longer has parameter systemData + - Interface MonitoringTagRules no longer has parameter type + - Interface MonitorsCreateOptionalParams no longer has parameter body + - Interface MonitorsUpdateOptionalParams no longer has parameter body + - Interface SingleSignOnConfigurationsCreateOrUpdateOptionalParams no longer has parameter body + - Interface TagRulesCreateOrUpdateOptionalParams no longer has parameter body + - Parameter value of interface CreateResourceSupportedResponseList is now required + - Parameter value of interface DatadogAgreementResourceListResponse is now required + - Parameter value of interface DatadogApiKeyListResponse is now required + - Parameter value of interface DatadogHostListResponse is now required + - Parameter value of interface DatadogMonitorResourceListResponse is now required + - Parameter value of interface DatadogSingleSignOnResourceListResponse is now required + - Parameter value of interface LinkedResourceListResponse is now required + - Parameter value of interface MonitoredResourceListResponse is now required + - Parameter subscriptionId of interface MonitoredSubscription is now required + - Parameter value of interface MonitoredSubscriptionPropertiesList is now required + - Parameter value of interface MonitoringTagRulesListResponse is now required + - Parameter value of interface OperationListResult is now required + + ## 3.1.0 (2023-10-09) ### Features Added @@ -46,7 +125,7 @@ ## 3.0.1 (2022-04-18) -### Features Added +**features** - bug fix diff --git a/sdk/datadog/arm-datadog/LICENSE b/sdk/datadog/arm-datadog/LICENSE index b2f52a2bad4e..63447fd8bbbf 100644 --- a/sdk/datadog/arm-datadog/LICENSE +++ b/sdk/datadog/arm-datadog/LICENSE @@ -18,4 +18,4 @@ 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. +SOFTWARE. \ No newline at end of file diff --git a/sdk/datadog/arm-datadog/README.md b/sdk/datadog/arm-datadog/README.md index 7a634dd2761a..4eb1049d5dee 100644 --- a/sdk/datadog/arm-datadog/README.md +++ b/sdk/datadog/arm-datadog/README.md @@ -2,6 +2,8 @@ This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Microsoft Datadog client. + + [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/datadog/arm-datadog) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-datadog) | [API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-datadog) | @@ -42,7 +44,6 @@ npm install @azure/identity ``` You will also need to **register a new AAD application and grant access to Azure Microsoft Datadog** 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://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). @@ -62,16 +63,14 @@ For browser environments, use the `InteractiveBrowserCredential` from the `@azur import { InteractiveBrowserCredential } from "@azure/identity"; import { MicrosoftDatadogClient } from "@azure/arm-datadog"; -const subscriptionId = "00000000-0000-0000-0000-000000000000"; const credential = new InteractiveBrowserCredential({ tenantId: "", - clientId: "", -}); + clientId: "" + }); const client = new MicrosoftDatadogClient(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 @@ -107,7 +106,6 @@ If you'd like to contribute to this library, please read the [contributing guide - [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - [azure_cli]: https://learn.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/ [azure_sub]: https://azure.microsoft.com/free/ diff --git a/sdk/datadog/arm-datadog/_meta.json b/sdk/datadog/arm-datadog/_meta.json index 92ed983d47d3..08f50e89e0f9 100644 --- a/sdk/datadog/arm-datadog/_meta.json +++ b/sdk/datadog/arm-datadog/_meta.json @@ -1,8 +1,8 @@ { - "commit": "583e15ceb4cf23dc23b2300bd352f16d781e69ac", + "commit": "2ff3228b987ab59dff3d5df9a3192ed7c5567e3e", "readme": "specification/datadog/resource-manager/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=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\datadog\\resource-manager\\readme.md --use=@autorest/typescript@6.0.12 --generate-sample=true", + "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/datadog/resource-manager/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.4", - "use": "@autorest/typescript@6.0.12" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.26", + "use": "@autorest/typescript@^6.0.12" } diff --git a/sdk/datadog/arm-datadog/api-extractor.json b/sdk/datadog/arm-datadog/api-extractor.json index 08feb264ce66..aa0e9dcecfaa 100644 --- a/sdk/datadog/arm-datadog/api-extractor.json +++ b/sdk/datadog/arm-datadog/api-extractor.json @@ -28,4 +28,4 @@ } } } -} +} \ No newline at end of file diff --git a/sdk/datadog/arm-datadog/package.json b/sdk/datadog/arm-datadog/package.json index 1d8084f24211..37cdec40d39c 100644 --- a/sdk/datadog/arm-datadog/package.json +++ b/sdk/datadog/arm-datadog/package.json @@ -3,17 +3,17 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for MicrosoftDatadogClient.", - "version": "3.1.0", + "version": "4.0.0", "engines": { "node": ">=18.0.0" }, "dependencies": { "@azure/abort-controller": "^2.1.2", "@azure/core-auth": "^1.9.0", - "@azure/core-client": "^1.9.2", + "@azure/core-client": "^1.9.4", "@azure/core-lro": "^2.5.4", "@azure/core-paging": "^1.6.2", - "@azure/core-rest-pipeline": "^1.18.2", + "@azure/core-rest-pipeline": "^1.20.0", "tslib": "^2.8.1" }, "keywords": [ @@ -28,18 +28,19 @@ "main": "./dist/commonjs/index.js", "module": "./dist/esm/index.js", "types": "./dist/commonjs/index.d.ts", + "type": "module", "devDependencies": { "@azure-tools/test-credential": "^2.0.0", "@azure-tools/test-recorder": "^4.1.0", "@azure-tools/test-utils-vitest": "^1.0.0", "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.6.0", - "@azure/logger": "^1.1.4", + "@azure/identity": "^4.9.1", + "@azure/logger": "^1.2.0", "@types/node": "^18.0.0", "@vitest/browser": "^3.0.9", "@vitest/coverage-istanbul": "^3.0.9", "dotenv": "^16.0.0", - "playwright": "^1.50.0", + "playwright": "^1.52.0", "typescript": "~5.8.2", "vitest": "^3.0.9" }, @@ -56,20 +57,30 @@ ], "scripts": { "build": "npm run clean && dev-tool run build-package && dev-tool run extract-api", + "build:browser": "echo skipped", + "build:node": "echo skipped", "build:samples": "echo skipped.", - "check-format": "echo skipped", + "build:test": "echo skipped", + "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "execute:samples": "echo skipped", "extract-api": "dev-tool run extract-api", - "format": "echo skipped", + "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:browser": "echo skipped", + "integration-test:node": "dev-tool run test:vitest --esm", "lint": "echo skipped", + "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", "pack": "npm pack 2>&1", "prepack": "npm run build", - "test": "npm run test:node && npm run test:browser", + "test": "npm run integration-test", "test:browser": "echo skipped", "test:node": "dev-tool run test:vitest", - "test:node:esm": "dev-tool run test:vitest --esm", - "update-snippets": "dev-tool run update-snippets" + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:browser": "echo skipped", + "unit-test:node": "dev-tool run test:vitest", + "update-snippets": "dev-tool run update-snippets", + "test:node:esm": "dev-tool run test:vitest --esm" }, "sideEffects": false, "//metadata": { @@ -81,16 +92,9 @@ ] }, "autoPublish": true, + "browser": "./dist/browser/index.js", + "react-native": "./dist/react-native/index.js", "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/datadog/arm-datadog", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://learn.microsoft.com/javascript/api/@azure/arm-datadog?view=azure-node-preview" - }, - "type": "module", "tshy": { "project": "./tsconfig.src.json", "exports": { @@ -107,8 +111,6 @@ ], "selfLink": false }, - "browser": "./dist/browser/index.js", - "react-native": "./dist/react-native/index.js", "exports": { "./package.json": "./package.json", ".": { @@ -130,4 +132,4 @@ } } } -} +} \ No newline at end of file diff --git a/sdk/datadog/arm-datadog/review/arm-datadog.api.md b/sdk/datadog/arm-datadog/review/arm-datadog.api.md index 046e8f38da18..8fd8dad70587 100644 --- a/sdk/datadog/arm-datadog/review/arm-datadog.api.md +++ b/sdk/datadog/arm-datadog/review/arm-datadog.api.md @@ -10,6 +10,24 @@ import { OperationState } from '@azure/core-lro'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; import { SimplePollerLike } from '@azure/core-lro'; +// @public +export interface BillingInfo { + get(resourceGroupName: string, monitorName: string, options?: BillingInfoGetOptionalParams): Promise; +} + +// @public +export interface BillingInfoGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BillingInfoGetResponse = BillingInfoResponse; + +// @public +export interface BillingInfoResponse { + marketplaceSaasInfo?: MarketplaceSaaSInfo; + partnerBillingEntity?: PartnerBillingEntity; +} + // @public export type CreatedByType = string; @@ -24,10 +42,10 @@ export interface CreateResourceSupportedResponse { properties?: CreateResourceSupportedProperties; } -// @public (undocumented) +// @public export interface CreateResourceSupportedResponseList { - // (undocumented) - value?: CreateResourceSupportedResponse[]; + nextLink?: string; + value: CreateResourceSupportedResponse[]; } // @public @@ -43,6 +61,13 @@ export interface CreationSupportedGetOptionalParams extends coreClient.Operation // @public export type CreationSupportedGetResponse = CreateResourceSupportedResponse; +// @public +export interface CreationSupportedListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CreationSupportedListNextResponse = CreateResourceSupportedResponseList; + // @public export interface CreationSupportedListOptionalParams extends coreClient.OperationOptions { } @@ -74,7 +99,7 @@ export interface DatadogAgreementResource { // @public export interface DatadogAgreementResourceListResponse { nextLink?: string; - value?: DatadogAgreementResource[]; + value: DatadogAgreementResource[]; } // @public (undocumented) @@ -88,7 +113,7 @@ export interface DatadogApiKey { // @public export interface DatadogApiKeyListResponse { nextLink?: string; - value?: DatadogApiKey[]; + value: DatadogApiKey[]; } // @public (undocumented) @@ -103,7 +128,7 @@ export interface DatadogHost { // @public export interface DatadogHostListResponse { nextLink?: string; - value?: DatadogHost[]; + value: DatadogHost[]; } // @public (undocumented) @@ -128,33 +153,22 @@ export interface DatadogLogsAgent { } // @public (undocumented) -export interface DatadogMonitorResource { - readonly id?: string; +export interface DatadogMonitorResource extends TrackedResource { // (undocumented) identity?: IdentityProperties; - // (undocumented) - location: string; - readonly name?: string; properties?: MonitorProperties; - // (undocumented) sku?: ResourceSku; - readonly systemData?: SystemData; - tags?: { - [propertyName: string]: string; - }; - readonly type?: string; } // @public export interface DatadogMonitorResourceListResponse { nextLink?: string; - value?: DatadogMonitorResource[]; + value: DatadogMonitorResource[]; } // @public export interface DatadogMonitorResourceUpdateParameters { properties?: MonitorUpdateProperties; - // (undocumented) sku?: ResourceSku; tags?: { [propertyName: string]: string; @@ -188,20 +202,16 @@ export interface DatadogSingleSignOnProperties { readonly singleSignOnUrl?: string; } -// @public (undocumented) -export interface DatadogSingleSignOnResource { - readonly id?: string; - readonly name?: string; +// @public +export interface DatadogSingleSignOnResource extends ProxyResource { // (undocumented) properties?: DatadogSingleSignOnProperties; - readonly systemData?: SystemData; - readonly type?: string; } // @public export interface DatadogSingleSignOnResourceListResponse { nextLink?: string; - value?: DatadogSingleSignOnResource[]; + value: DatadogSingleSignOnResource[]; } // @public @@ -325,12 +335,13 @@ export type LiftrResourceCategories = string; // @public export interface LinkedResource { id?: string; + location?: string; } // @public export interface LinkedResourceListResponse { nextLink?: string; - value?: LinkedResource[]; + value: LinkedResource[]; } // @public @@ -346,14 +357,12 @@ export type ManagedIdentityTypes = string; // @public export interface MarketplaceAgreements { - createOrUpdate(options?: MarketplaceAgreementsCreateOrUpdateOptionalParams): Promise; + createOrUpdate(body: DatadogAgreementResource, options?: MarketplaceAgreementsCreateOrUpdateOptionalParams): Promise; list(options?: MarketplaceAgreementsListOptionalParams): PagedAsyncIterableIterator; } // @public export interface MarketplaceAgreementsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - // (undocumented) - body?: DatadogAgreementResource; } // @public @@ -373,6 +382,15 @@ export interface MarketplaceAgreementsListOptionalParams extends coreClient.Oper // @public export type MarketplaceAgreementsListResponse = DatadogAgreementResourceListResponse; +// @public +export interface MarketplaceSaaSInfo { + billedAzureSubscriptionId?: string; + marketplaceName?: string; + marketplaceStatus?: string; + marketplaceSubscriptionId?: string; + subscribed?: boolean; +} + // @public export type MarketplaceSubscriptionStatus = string; @@ -389,6 +407,8 @@ export class MicrosoftDatadogClient extends coreClient.ServiceClient { // (undocumented) apiVersion: string; // (undocumented) + billingInfo: BillingInfo; + // (undocumented) creationSupported: CreationSupported; // (undocumented) marketplaceAgreements: MarketplaceAgreements; @@ -425,46 +445,48 @@ export interface MonitoredResource { // @public export interface MonitoredResourceListResponse { nextLink?: string; - value?: MonitoredResource[]; + value: MonitoredResource[]; } // @public export interface MonitoredSubscription { error?: string; status?: Status; - subscriptionId?: string; + subscriptionId: string; tagRules?: MonitoringTagRulesProperties; } // @public -export interface MonitoredSubscriptionProperties { - readonly id?: string; - readonly name?: string; +export interface MonitoredSubscriptionProperties extends ProxyResource { properties?: SubscriptionList; - readonly type?: string; } -// @public (undocumented) +// @public export interface MonitoredSubscriptionPropertiesList { - // (undocumented) - value?: MonitoredSubscriptionProperties[]; + nextLink?: string; + value: MonitoredSubscriptionProperties[]; } // @public export interface MonitoredSubscriptions { - beginCreateorUpdate(resourceGroupName: string, monitorName: string, configurationName: string, options?: MonitoredSubscriptionsCreateorUpdateOptionalParams): Promise, MonitoredSubscriptionsCreateorUpdateResponse>>; - beginCreateorUpdateAndWait(resourceGroupName: string, monitorName: string, configurationName: string, options?: MonitoredSubscriptionsCreateorUpdateOptionalParams): Promise; + beginCreateorUpdate(resourceGroupName: string, monitorName: string, configurationName: string, body: MonitoredSubscriptionProperties, options?: MonitoredSubscriptionsCreateorUpdateOptionalParams): Promise, MonitoredSubscriptionsCreateorUpdateResponse>>; + beginCreateorUpdateAndWait(resourceGroupName: string, monitorName: string, configurationName: string, body: MonitoredSubscriptionProperties, options?: MonitoredSubscriptionsCreateorUpdateOptionalParams): Promise; beginDelete(resourceGroupName: string, monitorName: string, configurationName: string, options?: MonitoredSubscriptionsDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, monitorName: string, configurationName: string, options?: MonitoredSubscriptionsDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, monitorName: string, configurationName: string, options?: MonitoredSubscriptionsUpdateOptionalParams): Promise, MonitoredSubscriptionsUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, monitorName: string, configurationName: string, options?: MonitoredSubscriptionsUpdateOptionalParams): Promise; + beginUpdate(resourceGroupName: string, monitorName: string, configurationName: string, body: MonitoredSubscriptionProperties, options?: MonitoredSubscriptionsUpdateOptionalParams): Promise, MonitoredSubscriptionsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, monitorName: string, configurationName: string, body: MonitoredSubscriptionProperties, options?: MonitoredSubscriptionsUpdateOptionalParams): Promise; get(resourceGroupName: string, monitorName: string, configurationName: string, options?: MonitoredSubscriptionsGetOptionalParams): Promise; list(resourceGroupName: string, monitorName: string, options?: MonitoredSubscriptionsListOptionalParams): PagedAsyncIterableIterator; } +// @public +export interface MonitoredSubscriptionsCreateorUpdateHeaders { + location?: string; + retryAfter?: number; +} + // @public export interface MonitoredSubscriptionsCreateorUpdateOptionalParams extends coreClient.OperationOptions { - body?: MonitoredSubscriptionProperties; resumeFrom?: string; updateIntervalInMs?: number; } @@ -472,6 +494,12 @@ export interface MonitoredSubscriptionsCreateorUpdateOptionalParams extends core // @public export type MonitoredSubscriptionsCreateorUpdateResponse = MonitoredSubscriptionProperties; +// @public +export interface MonitoredSubscriptionsDeleteHeaders { + location?: string; + retryAfter?: number; +} + // @public export interface MonitoredSubscriptionsDeleteOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -485,6 +513,13 @@ export interface MonitoredSubscriptionsGetOptionalParams extends coreClient.Oper // @public export type MonitoredSubscriptionsGetResponse = MonitoredSubscriptionProperties; +// @public +export interface MonitoredSubscriptionsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitoredSubscriptionsListNextResponse = MonitoredSubscriptionPropertiesList; + // @public export interface MonitoredSubscriptionsListOptionalParams extends coreClient.OperationOptions { } @@ -492,9 +527,14 @@ export interface MonitoredSubscriptionsListOptionalParams extends coreClient.Ope // @public export type MonitoredSubscriptionsListResponse = MonitoredSubscriptionPropertiesList; +// @public +export interface MonitoredSubscriptionsUpdateHeaders { + location?: string; + retryAfter?: number; +} + // @public export interface MonitoredSubscriptionsUpdateOptionalParams extends coreClient.OperationOptions { - body?: MonitoredSubscriptionProperties; resumeFrom?: string; updateIntervalInMs?: number; } @@ -506,23 +546,20 @@ export type MonitoredSubscriptionsUpdateResponse = MonitoredSubscriptionProperti export type MonitoringStatus = string; // @public -export interface MonitoringTagRules { - readonly id?: string; - readonly name?: string; +export interface MonitoringTagRules extends ProxyResource { properties?: MonitoringTagRulesProperties; - readonly systemData?: SystemData; - readonly type?: string; } // @public export interface MonitoringTagRulesListResponse { nextLink?: string; - value?: MonitoringTagRules[]; + value: MonitoringTagRules[]; } // @public export interface MonitoringTagRulesProperties { automuting?: boolean; + customMetrics?: boolean; logRules?: LogRules; metricRules?: MetricRules; readonly provisioningState?: ProvisioningState; @@ -541,12 +578,12 @@ export interface MonitorProperties { // @public export interface Monitors { - beginCreate(resourceGroupName: string, monitorName: string, options?: MonitorsCreateOptionalParams): Promise, MonitorsCreateResponse>>; - beginCreateAndWait(resourceGroupName: string, monitorName: string, options?: MonitorsCreateOptionalParams): Promise; + beginCreate(resourceGroupName: string, monitorName: string, body: DatadogMonitorResource, options?: MonitorsCreateOptionalParams): Promise, MonitorsCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, monitorName: string, body: DatadogMonitorResource, options?: MonitorsCreateOptionalParams): Promise; beginDelete(resourceGroupName: string, monitorName: string, options?: MonitorsDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, monitorName: string, options?: MonitorsDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, monitorName: string, options?: MonitorsUpdateOptionalParams): Promise, MonitorsUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, monitorName: string, options?: MonitorsUpdateOptionalParams): Promise; + beginUpdate(resourceGroupName: string, monitorName: string, body: DatadogMonitorResourceUpdateParameters, options?: MonitorsUpdateOptionalParams): Promise, MonitorsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, monitorName: string, body: DatadogMonitorResourceUpdateParameters, options?: MonitorsUpdateOptionalParams): Promise; get(resourceGroupName: string, monitorName: string, options?: MonitorsGetOptionalParams): Promise; getDefaultKey(resourceGroupName: string, monitorName: string, options?: MonitorsGetDefaultKeyOptionalParams): Promise; list(options?: MonitorsListOptionalParams): PagedAsyncIterableIterator; @@ -559,10 +596,14 @@ export interface Monitors { setDefaultKey(resourceGroupName: string, monitorName: string, options?: MonitorsSetDefaultKeyOptionalParams): Promise; } +// @public +export interface MonitorsCreateHeaders { + azureAsyncOperation?: string; + retryAfter?: number; +} + // @public export interface MonitorsCreateOptionalParams extends coreClient.OperationOptions { - // (undocumented) - body?: DatadogMonitorResource; resumeFrom?: string; updateIntervalInMs?: number; } @@ -570,6 +611,12 @@ export interface MonitorsCreateOptionalParams extends coreClient.OperationOption // @public export type MonitorsCreateResponse = DatadogMonitorResource; +// @public +export interface MonitorsDeleteHeaders { + location?: string; + retryAfter?: number; +} + // @public export interface MonitorsDeleteOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -687,9 +734,14 @@ export interface MonitorsSetDefaultKeyOptionalParams extends coreClient.Operatio body?: DatadogApiKey; } +// @public +export interface MonitorsUpdateHeaders { + location?: string; + retryAfter?: number; +} + // @public export interface MonitorsUpdateOptionalParams extends coreClient.OperationOptions { - body?: DatadogMonitorResourceUpdateParameters; resumeFrom?: string; updateIntervalInMs?: number; } @@ -717,7 +769,7 @@ export interface OperationDisplay { // @public export interface OperationListResult { nextLink?: string; - value?: OperationResult[]; + value: OperationResult[]; } // @public @@ -746,26 +798,49 @@ export interface OperationsListOptionalParams extends coreClient.OperationOption // @public export type OperationsListResponse = OperationListResult; +// @public +export interface PartnerBillingEntity { + id?: string; + name?: string; + partnerEntityUri?: string; +} + // @public export type ProvisioningState = string; -// @public (undocumented) +// @public +export interface ProxyResource extends Resource { +} + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly systemData?: SystemData; + readonly type?: string; +} + +// @public export interface ResourceSku { name: string; } // @public export interface SingleSignOnConfigurations { - beginCreateOrUpdate(resourceGroupName: string, monitorName: string, configurationName: string, options?: SingleSignOnConfigurationsCreateOrUpdateOptionalParams): Promise, SingleSignOnConfigurationsCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, monitorName: string, configurationName: string, options?: SingleSignOnConfigurationsCreateOrUpdateOptionalParams): Promise; + beginCreateOrUpdate(resourceGroupName: string, monitorName: string, configurationName: string, body: DatadogSingleSignOnResource, options?: SingleSignOnConfigurationsCreateOrUpdateOptionalParams): Promise, SingleSignOnConfigurationsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, monitorName: string, configurationName: string, body: DatadogSingleSignOnResource, options?: SingleSignOnConfigurationsCreateOrUpdateOptionalParams): Promise; get(resourceGroupName: string, monitorName: string, configurationName: string, options?: SingleSignOnConfigurationsGetOptionalParams): Promise; list(resourceGroupName: string, monitorName: string, options?: SingleSignOnConfigurationsListOptionalParams): PagedAsyncIterableIterator; } +// @public +export interface SingleSignOnConfigurationsCreateOrUpdateHeaders { + azureAsyncOperation?: string; + retryAfter?: number; +} + // @public export interface SingleSignOnConfigurationsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - // (undocumented) - body?: DatadogSingleSignOnResource; resumeFrom?: string; updateIntervalInMs?: number; } @@ -821,14 +896,13 @@ export type TagAction = string; // @public export interface TagRules { - createOrUpdate(resourceGroupName: string, monitorName: string, ruleSetName: string, options?: TagRulesCreateOrUpdateOptionalParams): Promise; + createOrUpdate(resourceGroupName: string, monitorName: string, ruleSetName: string, body: MonitoringTagRules, options?: TagRulesCreateOrUpdateOptionalParams): Promise; get(resourceGroupName: string, monitorName: string, ruleSetName: string, options?: TagRulesGetOptionalParams): Promise; list(resourceGroupName: string, monitorName: string, options?: TagRulesListOptionalParams): PagedAsyncIterableIterator; } // @public export interface TagRulesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - body?: MonitoringTagRules; } // @public @@ -855,6 +929,14 @@ export interface TagRulesListOptionalParams extends coreClient.OperationOptions // @public export type TagRulesListResponse = MonitoringTagRulesListResponse; +// @public +export interface TrackedResource extends Resource { + location: string; + tags?: { + [propertyName: string]: string; + }; +} + // @public export interface UserInfo { emailAddress?: string; diff --git a/sdk/datadog/arm-datadog/sample.env b/sdk/datadog/arm-datadog/sample.env index 672847a3fea0..508439fc7d62 100644 --- a/sdk/datadog/arm-datadog/sample.env +++ b/sdk/datadog/arm-datadog/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/datadog/arm-datadog/src/lroImpl.ts b/sdk/datadog/arm-datadog/src/lroImpl.ts index a1dab276a1b7..1b3a95e6c540 100644 --- a/sdk/datadog/arm-datadog/src/lroImpl.ts +++ b/sdk/datadog/arm-datadog/src/lroImpl.ts @@ -5,6 +5,7 @@ * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ + import { AbortSignalLike } from "@azure/abort-controller"; import { LongRunningOperation, LroResponse } from "@azure/core-lro"; @@ -22,17 +23,14 @@ export function createLroSpec(inputs: { requestMethod: spec.httpMethod, requestPath: spec.path!, sendInitialRequest: () => sendOperationFn(args, spec), - sendPollRequest: ( - path: string, - options?: { abortSignal?: AbortSignalLike } - ) => { + sendPollRequest: (path: string, options?: { abortSignal?: AbortSignalLike }) => { const { requestBody, ...restSpec } = spec; return sendOperationFn(args, { ...restSpec, httpMethod: "GET", path, - abortSignal: options?.abortSignal + abortSignal: options?.abortSignal, }); - } + }, }; } diff --git a/sdk/datadog/arm-datadog/src/microsoftDatadogClient.ts b/sdk/datadog/arm-datadog/src/microsoftDatadogClient.ts index 08e2e7de78df..352aff2dc699 100644 --- a/sdk/datadog/arm-datadog/src/microsoftDatadogClient.ts +++ b/sdk/datadog/arm-datadog/src/microsoftDatadogClient.ts @@ -8,36 +8,34 @@ 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 { PipelineRequest, PipelineResponse, SendRequest } from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { + OperationsImpl, MarketplaceAgreementsImpl, - CreationSupportedImpl, MonitorsImpl, - OperationsImpl, - TagRulesImpl, + CreationSupportedImpl, + BillingInfoImpl, + MonitoredSubscriptionsImpl, SingleSignOnConfigurationsImpl, - MonitoredSubscriptionsImpl + TagRulesImpl, } from "./operations/index.js"; import { + Operations, MarketplaceAgreements, - CreationSupported, Monitors, - Operations, - TagRules, + CreationSupported, + BillingInfo, + MonitoredSubscriptions, SingleSignOnConfigurations, - MonitoredSubscriptions + TagRules, } from "./operationsInterfaces/index.js"; import { MicrosoftDatadogClientOptionalParams } from "./models/index.js"; export class MicrosoftDatadogClient extends coreClient.ServiceClient { $host: string; - subscriptionId: string; apiVersion: string; + subscriptionId: string; /** * Initializes a new instance of the MicrosoftDatadogClient class. @@ -48,7 +46,7 @@ export class MicrosoftDatadogClient extends coreClient.ServiceClient { constructor( credentials: coreAuth.TokenCredential, subscriptionId: string, - options?: MicrosoftDatadogClientOptionalParams + options?: MicrosoftDatadogClientOptionalParams, ) { if (credentials === undefined) { throw new Error("'credentials' cannot be null"); @@ -63,10 +61,10 @@ export class MicrosoftDatadogClient extends coreClient.ServiceClient { } const defaults: MicrosoftDatadogClientOptionalParams = { requestContentType: "application/json; charset=utf-8", - credential: credentials + credential: credentials, }; - const packageDetails = `azsdk-js-arm-datadog/3.1.0`; + const packageDetails = `azsdk-js-arm-datadog/4.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -76,20 +74,19 @@ export class MicrosoftDatadogClient extends coreClient.ServiceClient { ...defaults, ...options, userAgentOptions: { - userAgentPrefix + userAgentPrefix, }, - endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com" + 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(); + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = + options.pipeline.getOrderedPolicies(); bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => - pipelinePolicy.name === - coreRestPipeline.bearerTokenAuthenticationPolicyName + pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName, ); } if ( @@ -99,19 +96,17 @@ export class MicrosoftDatadogClient extends coreClient.ServiceClient { !bearerTokenAuthenticationPolicyFound ) { this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, }); this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ credential: credentials, scopes: - optionsWithDefaults.credentialScopes ?? - `${optionsWithDefaults.endpoint}/.default`, + optionsWithDefaults.credentialScopes ?? `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { - authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) + authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge, + }, + }), ); } // Parameter assignments @@ -119,14 +114,15 @@ export class MicrosoftDatadogClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2023-01-01"; + this.apiVersion = options.apiVersion || "2023-10-20"; + this.operations = new OperationsImpl(this); this.marketplaceAgreements = new MarketplaceAgreementsImpl(this); - this.creationSupported = new CreationSupportedImpl(this); this.monitors = new MonitorsImpl(this); - this.operations = new OperationsImpl(this); - this.tagRules = new TagRulesImpl(this); - this.singleSignOnConfigurations = new SingleSignOnConfigurationsImpl(this); + this.creationSupported = new CreationSupportedImpl(this); + this.billingInfo = new BillingInfoImpl(this); this.monitoredSubscriptions = new MonitoredSubscriptionsImpl(this); + this.singleSignOnConfigurations = new SingleSignOnConfigurationsImpl(this); + this.tagRules = new TagRulesImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); } @@ -137,10 +133,7 @@ export class MicrosoftDatadogClient extends coreClient.ServiceClient { } const apiVersionPolicy = { name: "CustomApiVersionPolicy", - async sendRequest( - request: PipelineRequest, - next: SendRequest - ): Promise { + async sendRequest(request: PipelineRequest, next: SendRequest): Promise { const param = request.url.split("?"); if (param.length > 1) { const newParams = param[1].split("&").map((item) => { @@ -153,16 +146,17 @@ export class MicrosoftDatadogClient extends coreClient.ServiceClient { request.url = param[0] + "?" + newParams.join("&"); } return next(request); - } + }, }; this.pipeline.addPolicy(apiVersionPolicy); } + operations: Operations; marketplaceAgreements: MarketplaceAgreements; - creationSupported: CreationSupported; monitors: Monitors; - operations: Operations; - tagRules: TagRules; - singleSignOnConfigurations: SingleSignOnConfigurations; + creationSupported: CreationSupported; + billingInfo: BillingInfo; monitoredSubscriptions: MonitoredSubscriptions; + singleSignOnConfigurations: SingleSignOnConfigurations; + tagRules: TagRules; } diff --git a/sdk/datadog/arm-datadog/src/models/index.ts b/sdk/datadog/arm-datadog/src/models/index.ts index b0a8c7189c3b..0edbdcdd69bc 100644 --- a/sdk/datadog/arm-datadog/src/models/index.ts +++ b/sdk/datadog/arm-datadog/src/models/index.ts @@ -8,11 +8,90 @@ import * as coreClient from "@azure/core-client"; +/** Represents a paginated list of operation results. */ +export interface OperationListResult { + /** The list of operations. */ + value: OperationResult[]; + /** The URL to get the next set of results, if any. */ + nextLink?: string; +} + +/** A Microsoft.Datadog REST API operation. */ +export interface OperationResult { + /** Operation name, i.e., {provider}/{resource}/{operation}. */ + name?: string; + /** The object that represents the operation. */ + display?: OperationDisplay; + /** Indicates whether the operation is a data action */ + isDataAction?: boolean; +} + +/** Represents the display information for an operation. */ +export interface OperationDisplay { + /** The service provider: Microsoft.Datadog. */ + provider?: string; + /** The resource on which the operation is performed. */ + resource?: string; + /** The type of operation: create, update, delete, etc. */ + operation?: string; + /** A localized description of the operation. */ + description?: 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; +} + /** Response of a list operation. */ export interface DatadogAgreementResourceListResponse { - /** Results of a list operation. */ - value?: DatadogAgreementResource[]; - /** Link to the next set of results, if any. */ + /** The DatadogAgreementResource items on this page */ + value: DatadogAgreementResource[]; + /** The link to the next page of items */ nextLink?: string; } @@ -77,57 +156,133 @@ export interface SystemData { lastModifiedAt?: Date; } -/** 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; +/** Response of a list operation. */ +export interface DatadogMonitorResourceListResponse { + /** The DatadogMonitorResource items on this page */ + value: DatadogMonitorResource[]; + /** The link to the next page of items */ + nextLink?: string; } -/** The error detail. */ -export interface ErrorDetail { +/** Represents the SKU of a resource. */ +export interface ResourceSku { + /** The name of the SKU. */ + name: string; +} + +/** Properties specific to the monitor resource. */ +export interface MonitorProperties { + /** NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly provisioningState?: ProvisioningState; + /** Flag specifying if the resource monitoring is enabled or disabled. */ + monitoringStatus?: MonitoringStatus; /** - * The error code. + * Flag specifying the Marketplace Subscription Status of the resource. If payment is not made in time, the resource will go in Suspended state. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly code?: string; + readonly marketplaceSubscriptionStatus?: MarketplaceSubscriptionStatus; + /** Specify the Datadog organization name. In the case of linking to existing organizations, Id, ApiKey, and Applicationkey is required as well. */ + datadogOrganizationProperties?: DatadogOrganizationProperties; + /** Includes name, email and optionally, phone number. User Information can't be null. */ + userInfo?: UserInfo; + /** NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly liftrResourceCategory?: LiftrResourceCategories; /** - * The error message. + * The priority of the resource. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly message?: string; + readonly liftrResourcePreference?: number; +} + +/** Specify the Datadog organization name. In the case of linking to existing organizations, Id, ApiKey, and Applicationkey is required as well. */ +export interface DatadogOrganizationProperties { + /** Name of the Datadog organization. */ + name?: string; + /** Id of the Datadog organization. */ + id?: string; /** - * The error target. - * NOTE: This property will not be serialized. It can only be populated by the server. + * The auth code used to linking to an existing Datadog organization. + * This value contains a credential. Consider obscuring before showing to users */ - readonly target?: string; + linkingAuthCode?: string; /** - * The error details. + * The client_id from an existing in exchange for an auth token to link organization. + * This value contains a credential. Consider obscuring before showing to users + */ + linkingClientId?: string; + /** The redirect URI for linking. */ + redirectUri?: string; + /** + * Api key associated to the Datadog organization. + * This value contains a credential. Consider obscuring before showing to users + */ + apiKey?: string; + /** + * Application key associated to the Datadog organization. + * This value contains a credential. Consider obscuring before showing to users + */ + applicationKey?: string; + /** The Id of the Enterprise App used for Single sign on. */ + enterpriseAppId?: string; + /** The configuration which describes the state of cloud security posture management. This collects configuration information for all resources in a subscription and track conformance to industry benchmarks. */ + cspm?: boolean; +} + +/** Includes name, email and optionally, phone number. User Information can't be null. */ +export interface UserInfo { + /** Name of the user */ + name?: string; + /** Email of the user used by Datadog for contacting them if needed */ + emailAddress?: string; + /** Phone number of the user used by Datadog for contacting them if needed */ + phoneNumber?: string; +} + +export interface IdentityProperties { + /** + * The identity ID. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly details?: ErrorDetail[]; + readonly principalId?: string; /** - * The error additional info. + * The tenant ID of resource. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly tenantId?: string; + /** Specifies the identity type of the Datadog Monitor. At this time the only allowed value is 'SystemAssigned'. */ + type?: ManagedIdentityTypes; } -/** The resource management error additional info. */ -export interface ErrorAdditionalInfo { +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { /** - * The additional info type. + * 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; /** - * The additional info. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly info?: Record; + readonly systemData?: SystemData; } +/** Paged collection of CreateResourceSupportedResponse items */ export interface CreateResourceSupportedResponseList { - value?: CreateResourceSupportedResponse[]; + /** The CreateResourceSupportedResponse items on this page */ + value: CreateResourceSupportedResponse[]; + /** The link to the next page of items */ + nextLink?: string; } /** Datadog resource can be created or not. */ @@ -150,12 +305,54 @@ export interface CreateResourceSupportedProperties { readonly creationSupported?: boolean; } -/** Response of a list operation. */ -export interface DatadogApiKeyListResponse { - /** Results of a list operation. */ - value?: DatadogApiKey[]; - /** Link to the next set of results, if any. */ - nextLink?: string; +/** The parameters for a PATCH request to a monitor resource. */ +export interface DatadogMonitorResourceUpdateParameters { + /** The set of properties that can be update in a PATCH request to a monitor resource. */ + properties?: MonitorUpdateProperties; + /** The new tags of the monitor resource. */ + tags?: { [propertyName: string]: string }; + /** Represents the SKU of a resource. */ + sku?: ResourceSku; +} + +/** The set of properties that can be update in a PATCH request to a monitor resource. */ +export interface MonitorUpdateProperties { + /** Flag specifying if the resource monitoring is enabled or disabled. */ + monitoringStatus?: MonitoringStatus; + /** The new cloud security posture management value of the monitor resource. This collects configuration information for all resources in a subscription and track conformance to industry benchmarks. */ + cspm?: boolean; +} + +/** Marketplace Subscription and Organization details to which resource gets billed into. */ +export interface BillingInfoResponse { + /** Marketplace Subscription details */ + marketplaceSaasInfo?: MarketplaceSaaSInfo; + /** Partner Billing Entity details: Organization Info */ + partnerBillingEntity?: PartnerBillingEntity; +} + +/** Marketplace SAAS Info of the resource. */ +export interface MarketplaceSaaSInfo { + /** Marketplace Subscription Id. This is a GUID-formatted string. */ + marketplaceSubscriptionId?: string; + /** Marketplace Subscription Details: SAAS Name */ + marketplaceName?: string; + /** Marketplace Subscription Details: SaaS Subscription Status */ + marketplaceStatus?: string; + /** The Azure Subscription ID to which the Marketplace Subscription belongs and gets billed into. */ + billedAzureSubscriptionId?: string; + /** Flag specifying if the Marketplace status is subscribed or not. */ + subscribed?: boolean; +} + +/** Partner Billing details associated with the resource. */ +export interface PartnerBillingEntity { + /** The Datadog Organization Id. */ + id?: string; + /** The Datadog Organization Name. */ + name?: string; + /** Link to the datadog organization page */ + partnerEntityUri?: string; } export interface DatadogApiKey { @@ -169,11 +366,19 @@ export interface DatadogApiKey { created?: string; } +/** Response of a list operation. */ +export interface DatadogApiKeyListResponse { + /** The DatadogApiKey items on this page */ + value: DatadogApiKey[]; + /** The link to the next page of items */ + nextLink?: string; +} + /** Response of a list operation. */ export interface DatadogHostListResponse { - /** Results of a list operation. */ - value?: DatadogHost[]; - /** Link to the next set of results, if any. */ + /** The DatadogHost items on this page */ + value: DatadogHost[]; + /** The link to the next page of items */ nextLink?: string; } @@ -210,9 +415,9 @@ export interface DatadogLogsAgent { /** Response of a list operation. */ export interface LinkedResourceListResponse { - /** Results of a list operation. */ - value?: LinkedResource[]; - /** Link to the next set of results, if any. */ + /** The LinkedResource items on this page */ + value: LinkedResource[]; + /** The link to the next page of items */ nextLink?: string; } @@ -220,13 +425,15 @@ export interface LinkedResourceListResponse { export interface LinkedResource { /** The ARM id of the linked resource. */ id?: string; + /** The location of the linked resource. */ + location?: string; } /** Response of a list operation. */ export interface MonitoredResourceListResponse { - /** Results of a list operation. */ - value?: MonitoredResource[]; - /** Link to the next set of results, if any. */ + /** The MonitoredResource items on this page */ + value: MonitoredResource[]; + /** The link to the next page of items */ nextLink?: string; } @@ -244,203 +451,32 @@ export interface MonitoredResource { reasonForLogsStatus?: string; } -/** Result of GET request to list the Microsoft.Datadog operations. */ -export interface OperationListResult { - /** List of operations supported by the Microsoft.Datadog provider. */ - value?: OperationResult[]; - /** URL to get the next set of operation list results if there are any. */ - nextLink?: string; -} - -/** A Microsoft.Datadog REST API operation. */ -export interface OperationResult { - /** Operation name, i.e., {provider}/{resource}/{operation}. */ - name?: string; - /** The object that represents the operation. */ - display?: OperationDisplay; - /** Indicates whether the operation is a data action */ - isDataAction?: boolean; -} - -/** The object that represents the operation. */ -export interface OperationDisplay { - /** Service provider, i.e., Microsoft.Datadog. */ - provider?: string; - /** Type on which the operation is performed, e.g., 'monitors'. */ - resource?: string; - /** Operation type, e.g., read, write, delete, etc. */ - operation?: string; - /** Description of the operation, e.g., 'Write monitors'. */ - description?: string; -} - -/** Response of a list operation. */ -export interface DatadogMonitorResourceListResponse { - /** Results of a list operation. */ - value?: DatadogMonitorResource[]; - /** Link to the next set of results, if any. */ +/** Paged collection of MonitoredSubscriptionProperties items */ +export interface MonitoredSubscriptionPropertiesList { + /** The MonitoredSubscriptionProperties items on this page */ + value: MonitoredSubscriptionProperties[]; + /** The link to the next page of items */ nextLink?: string; } -export interface DatadogMonitorResource { - /** - * ARM id of the monitor resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * Name of the monitor resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * The type of the monitor resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - sku?: ResourceSku; - /** Properties specific to the monitor resource. */ - properties?: MonitorProperties; - identity?: IdentityProperties; - /** Dictionary of */ - tags?: { [propertyName: string]: string }; - location: string; - /** - * Metadata pertaining to creation and last modification of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly systemData?: SystemData; -} - -export interface ResourceSku { - /** Name of the SKU in {PlanId} format. For Terraform, the only allowed value is 'linking'. */ - name: string; -} - -/** Properties specific to the monitor resource. */ -export interface MonitorProperties { - /** NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly provisioningState?: ProvisioningState; - /** Flag specifying if the resource monitoring is enabled or disabled. */ - monitoringStatus?: MonitoringStatus; - /** - * Flag specifying the Marketplace Subscription Status of the resource. If payment is not made in time, the resource will go in Suspended state. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly marketplaceSubscriptionStatus?: MarketplaceSubscriptionStatus; - /** Specify the Datadog organization name. In the case of linking to existing organizations, Id, ApiKey, and Applicationkey is required as well. */ - datadogOrganizationProperties?: DatadogOrganizationProperties; - /** Includes name, email and optionally, phone number. User Information can't be null. */ - userInfo?: UserInfo; - /** NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly liftrResourceCategory?: LiftrResourceCategories; - /** - * The priority of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly liftrResourcePreference?: number; -} - -/** Specify the Datadog organization name. In the case of linking to existing organizations, Id, ApiKey, and Applicationkey is required as well. */ -export interface DatadogOrganizationProperties { - /** Name of the Datadog organization. */ - name?: string; - /** Id of the Datadog organization. */ - id?: string; - /** The auth code used to linking to an existing Datadog organization. */ - linkingAuthCode?: string; - /** The client_id from an existing in exchange for an auth token to link organization. */ - linkingClientId?: string; - /** The redirect URI for linking. */ - redirectUri?: string; - /** Api key associated to the Datadog organization. */ - apiKey?: string; - /** Application key associated to the Datadog organization. */ - applicationKey?: string; - /** The Id of the Enterprise App used for Single sign on. */ - enterpriseAppId?: string; - /** The configuration which describes the state of cloud security posture management. This collects configuration information for all resources in a subscription and track conformance to industry benchmarks. */ - cspm?: boolean; -} - -/** Includes name, email and optionally, phone number. User Information can't be null. */ -export interface UserInfo { - /** Name of the user */ - name?: string; - /** Email of the user used by Datadog for contacting them if needed */ - emailAddress?: string; - /** Phone number of the user used by Datadog for contacting them if needed */ - phoneNumber?: string; -} - -export interface IdentityProperties { - /** - * The identity ID. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalId?: string; - /** - * The tenant ID of resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly tenantId?: string; - /** Specifies the identity type of the Datadog Monitor. At this time the only allowed value is 'SystemAssigned'. */ - type?: ManagedIdentityTypes; -} - -/** The parameters for a PATCH request to a monitor resource. */ -export interface DatadogMonitorResourceUpdateParameters { - /** The set of properties that can be update in a PATCH request to a monitor resource. */ - properties?: MonitorUpdateProperties; - /** The new tags of the monitor resource. */ - tags?: { [propertyName: string]: string }; - sku?: ResourceSku; -} - -/** The set of properties that can be update in a PATCH request to a monitor resource. */ -export interface MonitorUpdateProperties { - /** Flag specifying if the resource monitoring is enabled or disabled. */ - monitoringStatus?: MonitoringStatus; - /** The new cloud security posture management value of the monitor resource. This collects configuration information for all resources in a subscription and track conformance to industry benchmarks. */ - cspm?: boolean; -} - -export interface DatadogSetPasswordLink { - setPasswordLink?: string; -} - -/** Response of a list operation. */ -export interface MonitoringTagRulesListResponse { - /** Results of a list operation. */ - value?: MonitoringTagRules[]; - /** Link to the next set of results, if any. */ - nextLink?: string; +/** The request to update subscriptions needed to be monitored by the Datadog monitor resource. */ +export interface SubscriptionList { + /** The operation for the patch on the resource. */ + operation?: Operation; + /** List of subscriptions and the state of the monitoring. */ + monitoredSubscriptionList?: MonitoredSubscription[]; } -/** Capture logs and metrics of Azure resources based on ARM tags. */ -export interface MonitoringTagRules { - /** - * Name of the rule set. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * The id of the rule set. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * The type of the rule set. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; +/** The list of subscriptions and it's monitoring status by current Datadog monitor. */ +export interface MonitoredSubscription { + /** The subscriptionId to be monitored. */ + subscriptionId: string; + /** The state of monitoring. */ + status?: Status; + /** The reason of not monitoring the subscription. */ + error?: string; /** Definition of the properties for a TagRules resource. */ - properties?: MonitoringTagRulesProperties; - /** - * Metadata pertaining to creation and last modification of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly systemData?: SystemData; + tagRules?: MonitoringTagRulesProperties; } /** Definition of the properties for a TagRules resource. */ @@ -453,6 +489,8 @@ export interface MonitoringTagRulesProperties { metricRules?: MetricRules; /** Configuration to enable/disable auto-muting flag */ automuting?: boolean; + /** Configuration to enable/disable custom metrics. If enabled, custom metrics from app insights will be sent. */ + customMetrics?: boolean; } /** Set of rules for sending logs for the Monitor resource. */ @@ -483,38 +521,18 @@ export interface MetricRules { filteringTags?: FilteringTag[]; } +export interface DatadogSetPasswordLink { + setPasswordLink?: string; +} + /** Response of a list operation. */ export interface DatadogSingleSignOnResourceListResponse { - /** Results of a list operation. */ - value?: DatadogSingleSignOnResource[]; - /** Link to the next set of results, if any. */ + /** The DatadogSingleSignOnResource items on this page */ + value: DatadogSingleSignOnResource[]; + /** The link to the next page of items */ nextLink?: string; } -export interface DatadogSingleSignOnResource { - /** - * ARM id of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * Name of the configuration. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * The type of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - properties?: DatadogSingleSignOnProperties; - /** - * Metadata pertaining to creation and last modification of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly systemData?: SystemData; -} - export interface DatadogSingleSignOnProperties { /** NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningState; @@ -529,49 +547,104 @@ export interface DatadogSingleSignOnProperties { readonly singleSignOnUrl?: string; } -export interface MonitoredSubscriptionPropertiesList { - value?: MonitoredSubscriptionProperties[]; +/** Response of a list operation. */ +export interface MonitoringTagRulesListResponse { + /** The MonitoringTagRules items on this page */ + value: MonitoringTagRules[]; + /** The link to the next page of items */ + nextLink?: string; +} + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export interface TrackedResource extends Resource { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The geo-location where the resource lives */ + location: string; +} + +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export interface ProxyResource extends Resource {} + +export interface DatadogMonitorResource extends TrackedResource { + /** Represents the SKU of a resource. */ + sku?: ResourceSku; + /** Properties specific to the monitor resource. */ + properties?: MonitorProperties; + identity?: IdentityProperties; } /** The request to update subscriptions needed to be monitored by the Datadog monitor resource. */ -export interface MonitoredSubscriptionProperties { - /** - * Name of the monitored subscription resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * The id of the monitored subscription resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * The type of the monitored subscription resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; +export interface MonitoredSubscriptionProperties extends ProxyResource { /** The request to update subscriptions needed to be monitored by the Datadog monitor resource. */ properties?: SubscriptionList; } -/** The request to update subscriptions needed to be monitored by the Datadog monitor resource. */ -export interface SubscriptionList { - /** The operation for the patch on the resource. */ - operation?: Operation; - /** List of subscriptions and the state of the monitoring. */ - monitoredSubscriptionList?: MonitoredSubscription[]; +/** Concrete proxy resource types can be created by aliasing this type using a specific property type. */ +export interface DatadogSingleSignOnResource extends ProxyResource { + properties?: DatadogSingleSignOnProperties; } -/** The list of subscriptions and it's monitoring status by current Datadog monitor. */ -export interface MonitoredSubscription { - /** The subscriptionId to be monitored. */ - subscriptionId?: string; - /** The state of monitoring. */ - status?: Status; - /** The reason of not monitoring the subscription. */ - error?: string; +/** Capture logs and metrics of Azure resources based on ARM tags. */ +export interface MonitoringTagRules extends ProxyResource { /** Definition of the properties for a TagRules resource. */ - tagRules?: MonitoringTagRulesProperties; + properties?: MonitoringTagRulesProperties; +} + +/** Defines headers for Monitors_create operation. */ +export interface MonitorsCreateHeaders { + /** A link to the status monitor */ + azureAsyncOperation?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for Monitors_update operation. */ +export interface MonitorsUpdateHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for Monitors_delete operation. */ +export interface MonitorsDeleteHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for MonitoredSubscriptions_createorUpdate operation. */ +export interface MonitoredSubscriptionsCreateorUpdateHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for MonitoredSubscriptions_update operation. */ +export interface MonitoredSubscriptionsUpdateHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for MonitoredSubscriptions_delete operation. */ +export interface MonitoredSubscriptionsDeleteHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for SingleSignOnConfigurations_createOrUpdate operation. */ +export interface SingleSignOnConfigurationsCreateOrUpdateHeaders { + /** A link to the status monitor */ + azureAsyncOperation?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; } /** Known values of {@link CreatedByType} that the service accepts. */ @@ -583,7 +656,7 @@ export enum KnownCreatedByType { /** ManagedIdentity */ ManagedIdentity = "ManagedIdentity", /** Key */ - Key = "Key" + Key = "Key", } /** @@ -617,7 +690,7 @@ export enum KnownProvisioningState { /** Deleted */ Deleted = "Deleted", /** NotSpecified */ - NotSpecified = "NotSpecified" + NotSpecified = "NotSpecified", } /** @@ -642,7 +715,7 @@ export enum KnownMonitoringStatus { /** Enabled */ Enabled = "Enabled", /** Disabled */ - Disabled = "Disabled" + Disabled = "Disabled", } /** @@ -664,7 +737,7 @@ export enum KnownMarketplaceSubscriptionStatus { /** Suspended */ Suspended = "Suspended", /** Unsubscribed */ - Unsubscribed = "Unsubscribed" + Unsubscribed = "Unsubscribed", } /** @@ -684,7 +757,7 @@ export enum KnownLiftrResourceCategories { /** Unknown */ Unknown = "Unknown", /** MonitorLogs */ - MonitorLogs = "MonitorLogs" + MonitorLogs = "MonitorLogs", } /** @@ -702,60 +775,18 @@ export enum KnownManagedIdentityTypes { /** SystemAssigned */ SystemAssigned = "SystemAssigned", /** UserAssigned */ - UserAssigned = "UserAssigned" -} - -/** - * Defines values for ManagedIdentityTypes. \ - * {@link KnownManagedIdentityTypes} can be used interchangeably with ManagedIdentityTypes, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **SystemAssigned** \ - * **UserAssigned** - */ -export type ManagedIdentityTypes = string; - -/** Known values of {@link TagAction} that the service accepts. */ -export enum KnownTagAction { - /** Include */ - Include = "Include", - /** Exclude */ - Exclude = "Exclude" -} - -/** - * Defines values for TagAction. \ - * {@link KnownTagAction} can be used interchangeably with TagAction, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Include** \ - * **Exclude** - */ -export type TagAction = string; - -/** Known values of {@link SingleSignOnStates} that the service accepts. */ -export enum KnownSingleSignOnStates { - /** Initial */ - Initial = "Initial", - /** Enable */ - Enable = "Enable", - /** Disable */ - Disable = "Disable", - /** Existing */ - Existing = "Existing" + UserAssigned = "UserAssigned", } /** - * Defines values for SingleSignOnStates. \ - * {@link KnownSingleSignOnStates} can be used interchangeably with SingleSignOnStates, + * Defines values for ManagedIdentityTypes. \ + * {@link KnownManagedIdentityTypes} can be used interchangeably with ManagedIdentityTypes, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **Initial** \ - * **Enable** \ - * **Disable** \ - * **Existing** + * **SystemAssigned** \ + * **UserAssigned** */ -export type SingleSignOnStates = string; +export type ManagedIdentityTypes = string; /** Known values of {@link Operation} that the service accepts. */ export enum KnownOperation { @@ -768,7 +799,7 @@ export enum KnownOperation { /** DeleteComplete */ DeleteComplete = "DeleteComplete", /** Active */ - Active = "Active" + Active = "Active", } /** @@ -793,7 +824,7 @@ export enum KnownStatus { /** Failed */ Failed = "Failed", /** Deleting */ - Deleting = "Deleting" + Deleting = "Deleting", } /** @@ -808,109 +839,99 @@ export enum KnownStatus { */ export type Status = string; -/** Optional parameters. */ -export interface MarketplaceAgreementsListOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type MarketplaceAgreementsListResponse = DatadogAgreementResourceListResponse; - -/** Optional parameters. */ -export interface MarketplaceAgreementsCreateOrUpdateOptionalParams - extends coreClient.OperationOptions { - body?: DatadogAgreementResource; +/** Known values of {@link TagAction} that the service accepts. */ +export enum KnownTagAction { + /** Include */ + Include = "Include", + /** Exclude */ + Exclude = "Exclude", } -/** Contains response data for the createOrUpdate operation. */ -export type MarketplaceAgreementsCreateOrUpdateResponse = DatadogAgreementResource; +/** + * Defines values for TagAction. \ + * {@link KnownTagAction} can be used interchangeably with TagAction, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Include** \ + * **Exclude** + */ +export type TagAction = string; -/** Optional parameters. */ -export interface MarketplaceAgreementsListNextOptionalParams - extends coreClient.OperationOptions {} +/** Known values of {@link SingleSignOnStates} that the service accepts. */ +export enum KnownSingleSignOnStates { + /** Initial */ + Initial = "Initial", + /** Enable */ + Enable = "Enable", + /** Disable */ + Disable = "Disable", + /** Existing */ + Existing = "Existing", +} -/** Contains response data for the listNext operation. */ -export type MarketplaceAgreementsListNextResponse = DatadogAgreementResourceListResponse; +/** + * Defines values for SingleSignOnStates. \ + * {@link KnownSingleSignOnStates} can be used interchangeably with SingleSignOnStates, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Initial** \ + * **Enable** \ + * **Disable** \ + * **Existing** + */ +export type SingleSignOnStates = string; /** Optional parameters. */ -export interface CreationSupportedListOptionalParams - extends coreClient.OperationOptions {} +export interface OperationsListOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the list operation. */ -export type CreationSupportedListResponse = CreateResourceSupportedResponseList; - -/** Optional parameters. */ -export interface CreationSupportedGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type CreationSupportedGetResponse = CreateResourceSupportedResponse; - -/** Optional parameters. */ -export interface MonitorsListApiKeysOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listApiKeys operation. */ -export type MonitorsListApiKeysResponse = DatadogApiKeyListResponse; +export type OperationsListResponse = OperationListResult; /** Optional parameters. */ -export interface MonitorsGetDefaultKeyOptionalParams - extends coreClient.OperationOptions {} +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the getDefaultKey operation. */ -export type MonitorsGetDefaultKeyResponse = DatadogApiKey; - -/** Optional parameters. */ -export interface MonitorsSetDefaultKeyOptionalParams - extends coreClient.OperationOptions { - body?: DatadogApiKey; -} +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationListResult; /** Optional parameters. */ -export interface MonitorsListHostsOptionalParams - extends coreClient.OperationOptions {} +export interface MarketplaceAgreementsListOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listHosts operation. */ -export type MonitorsListHostsResponse = DatadogHostListResponse; +/** Contains response data for the list operation. */ +export type MarketplaceAgreementsListResponse = DatadogAgreementResourceListResponse; /** Optional parameters. */ -export interface MonitorsListLinkedResourcesOptionalParams +export interface MarketplaceAgreementsCreateOrUpdateOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listLinkedResources operation. */ -export type MonitorsListLinkedResourcesResponse = LinkedResourceListResponse; +/** Contains response data for the createOrUpdate operation. */ +export type MarketplaceAgreementsCreateOrUpdateResponse = DatadogAgreementResource; /** Optional parameters. */ -export interface MonitorsListMonitoredResourcesOptionalParams - extends coreClient.OperationOptions {} +export interface MarketplaceAgreementsListNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listMonitoredResources operation. */ -export type MonitorsListMonitoredResourcesResponse = MonitoredResourceListResponse; +/** Contains response data for the listNext operation. */ +export type MarketplaceAgreementsListNextResponse = DatadogAgreementResourceListResponse; /** Optional parameters. */ -export interface MonitorsListOptionalParams - extends coreClient.OperationOptions {} +export interface MonitorsListOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the list operation. */ export type MonitorsListResponse = DatadogMonitorResourceListResponse; /** Optional parameters. */ -export interface MonitorsListByResourceGroupOptionalParams - extends coreClient.OperationOptions {} +export interface MonitorsListByResourceGroupOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listByResourceGroup operation. */ export type MonitorsListByResourceGroupResponse = DatadogMonitorResourceListResponse; /** Optional parameters. */ -export interface MonitorsGetOptionalParams - extends coreClient.OperationOptions {} +export interface MonitorsGetOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the get operation. */ export type MonitorsGetResponse = DatadogMonitorResource; /** Optional parameters. */ -export interface MonitorsCreateOptionalParams - extends coreClient.OperationOptions { - body?: DatadogMonitorResource; +export interface MonitorsCreateOptionalParams 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. */ @@ -921,10 +942,7 @@ export interface MonitorsCreateOptionalParams export type MonitorsCreateResponse = DatadogMonitorResource; /** Optional parameters. */ -export interface MonitorsUpdateOptionalParams - extends coreClient.OperationOptions { - /** The parameters for a PATCH request to a monitor resource. */ - body?: DatadogMonitorResourceUpdateParameters; +export interface MonitorsUpdateOptionalParams 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. */ @@ -935,8 +953,7 @@ export interface MonitorsUpdateOptionalParams export type MonitorsUpdateResponse = DatadogMonitorResource; /** Optional parameters. */ -export interface MonitorsDeleteOptionalParams - extends coreClient.OperationOptions { +export interface MonitorsDeleteOptionalParams 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. */ @@ -944,22 +961,67 @@ export interface MonitorsDeleteOptionalParams } /** Optional parameters. */ -export interface MonitorsRefreshSetPasswordLinkOptionalParams - extends coreClient.OperationOptions {} +export interface MonitorsGetDefaultKeyOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the getDefaultKey operation. */ +export type MonitorsGetDefaultKeyResponse = DatadogApiKey; + +/** Optional parameters. */ +export interface MonitorsListApiKeysOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the listApiKeys operation. */ +export type MonitorsListApiKeysResponse = DatadogApiKeyListResponse; + +/** Optional parameters. */ +export interface MonitorsListHostsOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the listHosts operation. */ +export type MonitorsListHostsResponse = DatadogHostListResponse; + +/** Optional parameters. */ +export interface MonitorsListLinkedResourcesOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the listLinkedResources operation. */ +export type MonitorsListLinkedResourcesResponse = LinkedResourceListResponse; + +/** Optional parameters. */ +export interface MonitorsListMonitoredResourcesOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the listMonitoredResources operation. */ +export type MonitorsListMonitoredResourcesResponse = MonitoredResourceListResponse; + +/** Optional parameters. */ +export interface MonitorsRefreshSetPasswordLinkOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the refreshSetPasswordLink operation. */ export type MonitorsRefreshSetPasswordLinkResponse = DatadogSetPasswordLink; /** Optional parameters. */ -export interface MonitorsListApiKeysNextOptionalParams +export interface MonitorsSetDefaultKeyOptionalParams extends coreClient.OperationOptions { + body?: DatadogApiKey; +} + +/** Optional parameters. */ +export interface MonitorsListNextOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type MonitorsListNextResponse = DatadogMonitorResourceListResponse; + +/** Optional parameters. */ +export interface MonitorsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions {} +/** Contains response data for the listByResourceGroupNext operation. */ +export type MonitorsListByResourceGroupNextResponse = DatadogMonitorResourceListResponse; + +/** Optional parameters. */ +export interface MonitorsListApiKeysNextOptionalParams extends coreClient.OperationOptions {} + /** Contains response data for the listApiKeysNext operation. */ export type MonitorsListApiKeysNextResponse = DatadogApiKeyListResponse; /** Optional parameters. */ -export interface MonitorsListHostsNextOptionalParams - extends coreClient.OperationOptions {} +export interface MonitorsListHostsNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listHostsNext operation. */ export type MonitorsListHostsNextResponse = DatadogHostListResponse; @@ -979,75 +1041,93 @@ export interface MonitorsListMonitoredResourcesNextOptionalParams export type MonitorsListMonitoredResourcesNextResponse = MonitoredResourceListResponse; /** Optional parameters. */ -export interface MonitorsListNextOptionalParams - extends coreClient.OperationOptions {} +export interface CreationSupportedListOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listNext operation. */ -export type MonitorsListNextResponse = DatadogMonitorResourceListResponse; +/** Contains response data for the list operation. */ +export type CreationSupportedListResponse = CreateResourceSupportedResponseList; /** Optional parameters. */ -export interface MonitorsListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} +export interface CreationSupportedGetOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByResourceGroupNext operation. */ -export type MonitorsListByResourceGroupNextResponse = DatadogMonitorResourceListResponse; +/** Contains response data for the get operation. */ +export type CreationSupportedGetResponse = CreateResourceSupportedResponse; /** Optional parameters. */ -export interface OperationsListOptionalParams - extends coreClient.OperationOptions {} +export interface CreationSupportedListNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the list operation. */ -export type OperationsListResponse = OperationListResult; +/** Contains response data for the listNext operation. */ +export type CreationSupportedListNextResponse = CreateResourceSupportedResponseList; /** Optional parameters. */ -export interface OperationsListNextOptionalParams - extends coreClient.OperationOptions {} +export interface BillingInfoGetOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listNext operation. */ -export type OperationsListNextResponse = OperationListResult; +/** Contains response data for the get operation. */ +export type BillingInfoGetResponse = BillingInfoResponse; /** Optional parameters. */ -export interface TagRulesListOptionalParams - extends coreClient.OperationOptions {} +export interface MonitoredSubscriptionsListOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the list operation. */ -export type TagRulesListResponse = MonitoringTagRulesListResponse; +export type MonitoredSubscriptionsListResponse = MonitoredSubscriptionPropertiesList; + +/** Optional parameters. */ +export interface MonitoredSubscriptionsGetOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type MonitoredSubscriptionsGetResponse = MonitoredSubscriptionProperties; /** Optional parameters. */ -export interface TagRulesCreateOrUpdateOptionalParams +export interface MonitoredSubscriptionsCreateorUpdateOptionalParams extends coreClient.OperationOptions { - /** Capture logs and metrics of Azure resources based on ARM tags. */ - body?: MonitoringTagRules; + /** 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 TagRulesCreateOrUpdateResponse = MonitoringTagRules; +/** Contains response data for the createorUpdate operation. */ +export type MonitoredSubscriptionsCreateorUpdateResponse = MonitoredSubscriptionProperties; /** Optional parameters. */ -export interface TagRulesGetOptionalParams - extends coreClient.OperationOptions {} +export interface MonitoredSubscriptionsUpdateOptionalParams 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 get operation. */ -export type TagRulesGetResponse = MonitoringTagRules; +/** Contains response data for the update operation. */ +export type MonitoredSubscriptionsUpdateResponse = MonitoredSubscriptionProperties; /** Optional parameters. */ -export interface TagRulesListNextOptionalParams - extends coreClient.OperationOptions {} +export interface MonitoredSubscriptionsDeleteOptionalParams 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; +} + +/** Optional parameters. */ +export interface MonitoredSubscriptionsListNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ -export type TagRulesListNextResponse = MonitoringTagRulesListResponse; +export type MonitoredSubscriptionsListNextResponse = MonitoredSubscriptionPropertiesList; /** Optional parameters. */ -export interface SingleSignOnConfigurationsListOptionalParams - extends coreClient.OperationOptions {} +export interface SingleSignOnConfigurationsListOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the list operation. */ export type SingleSignOnConfigurationsListResponse = DatadogSingleSignOnResourceListResponse; +/** Optional parameters. */ +export interface SingleSignOnConfigurationsGetOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type SingleSignOnConfigurationsGetResponse = DatadogSingleSignOnResource; + /** Optional parameters. */ export interface SingleSignOnConfigurationsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - body?: DatadogSingleSignOnResource; /** 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. */ @@ -1057,13 +1137,6 @@ export interface SingleSignOnConfigurationsCreateOrUpdateOptionalParams /** Contains response data for the createOrUpdate operation. */ export type SingleSignOnConfigurationsCreateOrUpdateResponse = DatadogSingleSignOnResource; -/** Optional parameters. */ -export interface SingleSignOnConfigurationsGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type SingleSignOnConfigurationsGetResponse = DatadogSingleSignOnResource; - /** Optional parameters. */ export interface SingleSignOnConfigurationsListNextOptionalParams extends coreClient.OperationOptions {} @@ -1072,59 +1145,31 @@ export interface SingleSignOnConfigurationsListNextOptionalParams export type SingleSignOnConfigurationsListNextResponse = DatadogSingleSignOnResourceListResponse; /** Optional parameters. */ -export interface MonitoredSubscriptionsListOptionalParams - extends coreClient.OperationOptions {} +export interface TagRulesListOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the list operation. */ -export type MonitoredSubscriptionsListResponse = MonitoredSubscriptionPropertiesList; +export type TagRulesListResponse = MonitoringTagRulesListResponse; /** Optional parameters. */ -export interface MonitoredSubscriptionsGetOptionalParams - extends coreClient.OperationOptions {} +export interface TagRulesGetOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the get operation. */ -export type MonitoredSubscriptionsGetResponse = MonitoredSubscriptionProperties; +export type TagRulesGetResponse = MonitoringTagRules; /** Optional parameters. */ -export interface MonitoredSubscriptionsCreateorUpdateOptionalParams - extends coreClient.OperationOptions { - /** The request to update subscriptions needed to be monitored by the Datadog monitor resource. */ - body?: MonitoredSubscriptionProperties; - /** 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; -} +export interface TagRulesCreateOrUpdateOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the createorUpdate operation. */ -export type MonitoredSubscriptionsCreateorUpdateResponse = MonitoredSubscriptionProperties; +/** Contains response data for the createOrUpdate operation. */ +export type TagRulesCreateOrUpdateResponse = MonitoringTagRules; /** Optional parameters. */ -export interface MonitoredSubscriptionsUpdateOptionalParams - extends coreClient.OperationOptions { - /** The request to update subscriptions needed to be monitored by the Datadog monitor resource. */ - body?: MonitoredSubscriptionProperties; - /** 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; -} +export interface TagRulesListNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the update operation. */ -export type MonitoredSubscriptionsUpdateResponse = MonitoredSubscriptionProperties; - -/** Optional parameters. */ -export interface MonitoredSubscriptionsDeleteOptionalParams - 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 listNext operation. */ +export type TagRulesListNextResponse = MonitoringTagRulesListResponse; /** Optional parameters. */ -export interface MicrosoftDatadogClientOptionalParams - extends coreClient.ServiceClientOptions { +export interface MicrosoftDatadogClientOptionalParams extends coreClient.ServiceClientOptions { /** server parameter */ $host?: string; /** Api Version */ diff --git a/sdk/datadog/arm-datadog/src/models/mappers.ts b/sdk/datadog/arm-datadog/src/models/mappers.ts index 51ca3fc79573..79481b66433a 100644 --- a/sdk/datadog/arm-datadog/src/models/mappers.ts +++ b/sdk/datadog/arm-datadog/src/models/mappers.ts @@ -8,177 +8,93 @@ import * as coreClient from "@azure/core-client"; -export const DatadogAgreementResourceListResponse: coreClient.CompositeMapper = { +export const OperationListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DatadogAgreementResourceListResponse", + className: "OperationListResult", modelProperties: { value: { serializedName: "value", + required: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "DatadogAgreementResource" - } - } - } + className: "OperationResult", + }, + }, + }, }, nextLink: { serializedName: "nextLink", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const DatadogAgreementResource: coreClient.CompositeMapper = { +export const OperationResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DatadogAgreementResource", + className: "OperationResult", 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" - } - }, - properties: { - serializedName: "properties", type: { - name: "Composite", - className: "DatadogAgreementProperties" - } + name: "String", + }, }, - systemData: { - serializedName: "systemData", + display: { + serializedName: "display", type: { name: "Composite", - className: "SystemData" - } - } - } - } -}; - -export const DatadogAgreementProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DatadogAgreementProperties", - modelProperties: { - publisher: { - serializedName: "publisher", - type: { - name: "String" - } - }, - product: { - serializedName: "product", - type: { - name: "String" - } - }, - plan: { - serializedName: "plan", - type: { - name: "String" - } - }, - licenseTextLink: { - serializedName: "licenseTextLink", - type: { - name: "String" - } - }, - privacyPolicyLink: { - serializedName: "privacyPolicyLink", - type: { - name: "String" - } - }, - retrieveDatetime: { - serializedName: "retrieveDatetime", - type: { - name: "DateTime" - } + className: "OperationDisplay", + }, }, - signature: { - serializedName: "signature", + isDataAction: { + serializedName: "isDataAction", type: { - name: "String" - } + name: "Boolean", + }, }, - accepted: { - serializedName: "accepted", - type: { - name: "Boolean" - } - } - } - } + }, + }, }; -export const SystemData: coreClient.CompositeMapper = { +export const OperationDisplay: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SystemData", + className: "OperationDisplay", modelProperties: { - createdBy: { - serializedName: "createdBy", - type: { - name: "String" - } - }, - createdByType: { - serializedName: "createdByType", + provider: { + serializedName: "provider", type: { - name: "String" - } + name: "String", + }, }, - createdAt: { - serializedName: "createdAt", + resource: { + serializedName: "resource", type: { - name: "DateTime" - } + name: "String", + }, }, - lastModifiedBy: { - serializedName: "lastModifiedBy", + operation: { + serializedName: "operation", type: { - name: "String" - } + name: "String", + }, }, - lastModifiedByType: { - serializedName: "lastModifiedByType", + description: { + serializedName: "description", type: { - name: "String" - } + name: "String", + }, }, - lastModifiedAt: { - serializedName: "lastModifiedAt", - type: { - name: "DateTime" - } - } - } - } + }, + }, }; export const ErrorResponse: coreClient.CompositeMapper = { @@ -190,11 +106,11 @@ export const ErrorResponse: coreClient.CompositeMapper = { serializedName: "error", type: { name: "Composite", - className: "ErrorDetail" - } - } - } - } + className: "ErrorDetail", + }, + }, + }, + }, }; export const ErrorDetail: coreClient.CompositeMapper = { @@ -206,22 +122,22 @@ export const ErrorDetail: coreClient.CompositeMapper = { serializedName: "code", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, message: { serializedName: "message", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, target: { serializedName: "target", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, details: { serializedName: "details", @@ -231,10 +147,10 @@ export const ErrorDetail: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorDetail" - } - } - } + className: "ErrorDetail", + }, + }, + }, }, additionalInfo: { serializedName: "additionalInfo", @@ -244,13 +160,13 @@ export const ErrorDetail: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorAdditionalInfo" - } - } - } - } - } - } + className: "ErrorAdditionalInfo", + }, + }, + }, + }, + }, + }, }; export const ErrorAdditionalInfo: coreClient.CompositeMapper = { @@ -262,919 +178,1077 @@ export const ErrorAdditionalInfo: coreClient.CompositeMapper = { serializedName: "type", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, info: { serializedName: "info", readOnly: true, type: { name: "Dictionary", - value: { type: { name: "any" } } - } - } - } - } + value: { type: { name: "any" } }, + }, + }, + }, + }, }; -export const CreateResourceSupportedResponseList: coreClient.CompositeMapper = { +export const DatadogAgreementResourceListResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CreateResourceSupportedResponseList", + className: "DatadogAgreementResourceListResponse", modelProperties: { value: { serializedName: "value", + required: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "CreateResourceSupportedResponse" - } - } - } - } - } - } -}; - -export const CreateResourceSupportedResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CreateResourceSupportedResponse", - modelProperties: { - properties: { - serializedName: "properties", + className: "DatadogAgreementResource", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", type: { - name: "Composite", - className: "CreateResourceSupportedProperties" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const CreateResourceSupportedProperties: coreClient.CompositeMapper = { +export const DatadogAgreementResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CreateResourceSupportedProperties", + className: "DatadogAgreementResource", modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String", + }, + }, name: { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - creationSupported: { - serializedName: "creationSupported", + type: { + serializedName: "type", readOnly: true, type: { - name: "Boolean" - } - } - } - } + name: "String", + }, + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "DatadogAgreementProperties", + }, + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData", + }, + }, + }, + }, }; -export const DatadogApiKeyListResponse: coreClient.CompositeMapper = { +export const DatadogAgreementProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DatadogApiKeyListResponse", + className: "DatadogAgreementProperties", modelProperties: { - value: { - serializedName: "value", + publisher: { + serializedName: "publisher", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DatadogApiKey" - } - } - } + name: "String", + }, }, - nextLink: { - serializedName: "nextLink", + product: { + serializedName: "product", + type: { + name: "String", + }, + }, + plan: { + serializedName: "plan", + type: { + name: "String", + }, + }, + licenseTextLink: { + serializedName: "licenseTextLink", + type: { + name: "String", + }, + }, + privacyPolicyLink: { + serializedName: "privacyPolicyLink", + type: { + name: "String", + }, + }, + retrieveDatetime: { + serializedName: "retrieveDatetime", + type: { + name: "DateTime", + }, + }, + signature: { + serializedName: "signature", + type: { + name: "String", + }, + }, + accepted: { + serializedName: "accepted", type: { - name: "String" - } - } - } - } + name: "Boolean", + }, + }, + }, + }, }; -export const DatadogApiKey: coreClient.CompositeMapper = { +export const SystemData: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DatadogApiKey", + className: "SystemData", modelProperties: { createdBy: { serializedName: "createdBy", type: { - name: "String" - } + name: "String", + }, }, - name: { - serializedName: "name", + createdByType: { + serializedName: "createdByType", type: { - name: "String" - } + name: "String", + }, }, - key: { - serializedName: "key", - required: true, + createdAt: { + serializedName: "createdAt", type: { - name: "String" - } + name: "DateTime", + }, }, - created: { - serializedName: "created", + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String", + }, + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String", + }, + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", type: { - name: "String" - } - } - } - } + name: "DateTime", + }, + }, + }, + }, }; -export const DatadogHostListResponse: coreClient.CompositeMapper = { +export const DatadogMonitorResourceListResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DatadogHostListResponse", + className: "DatadogMonitorResourceListResponse", modelProperties: { value: { serializedName: "value", + required: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "DatadogHost" - } - } - } + className: "DatadogMonitorResource", + }, + }, + }, }, nextLink: { serializedName: "nextLink", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const DatadogHost: coreClient.CompositeMapper = { +export const ResourceSku: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DatadogHost", + className: "ResourceSku", modelProperties: { name: { serializedName: "name", + required: true, type: { - name: "String" - } - }, - aliases: { - serializedName: "aliases", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - apps: { - serializedName: "apps", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } + name: "String", + }, }, - meta: { - serializedName: "meta", - type: { - name: "Composite", - className: "DatadogHostMetadata" - } - } - } - } + }, + }, }; -export const DatadogHostMetadata: coreClient.CompositeMapper = { +export const MonitorProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DatadogHostMetadata", + className: "MonitorProperties", modelProperties: { - agentVersion: { - serializedName: "agentVersion", + provisioningState: { + serializedName: "provisioningState", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - installMethod: { - serializedName: "installMethod", + monitoringStatus: { + serializedName: "monitoringStatus", + type: { + name: "String", + }, + }, + marketplaceSubscriptionStatus: { + serializedName: "marketplaceSubscriptionStatus", + readOnly: true, + type: { + name: "String", + }, + }, + datadogOrganizationProperties: { + serializedName: "datadogOrganizationProperties", type: { name: "Composite", - className: "DatadogInstallMethod" - } + className: "DatadogOrganizationProperties", + }, }, - logsAgent: { - serializedName: "logsAgent", + userInfo: { + serializedName: "userInfo", type: { name: "Composite", - className: "DatadogLogsAgent" - } - } - } - } + className: "UserInfo", + }, + }, + liftrResourceCategory: { + serializedName: "liftrResourceCategory", + readOnly: true, + type: { + name: "String", + }, + }, + liftrResourcePreference: { + serializedName: "liftrResourcePreference", + readOnly: true, + type: { + name: "Number", + }, + }, + }, + }, }; -export const DatadogInstallMethod: coreClient.CompositeMapper = { +export const DatadogOrganizationProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DatadogInstallMethod", + className: "DatadogOrganizationProperties", modelProperties: { - tool: { - serializedName: "tool", + name: { + serializedName: "name", type: { - name: "String" - } + name: "String", + }, }, - toolVersion: { - serializedName: "toolVersion", + id: { + serializedName: "id", type: { - name: "String" - } + name: "String", + }, }, - installerVersion: { - serializedName: "installerVersion", + linkingAuthCode: { + serializedName: "linkingAuthCode", type: { - name: "String" - } - } - } - } -}; - -export const DatadogLogsAgent: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DatadogLogsAgent", - modelProperties: { - transport: { - serializedName: "transport", + name: "String", + }, + }, + linkingClientId: { + serializedName: "linkingClientId", type: { - name: "String" - } - } - } - } -}; - -export const LinkedResourceListResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LinkedResourceListResponse", - modelProperties: { - value: { - serializedName: "value", + name: "String", + }, + }, + redirectUri: { + serializedName: "redirectUri", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "LinkedResource" - } - } - } + name: "String", + }, }, - nextLink: { - serializedName: "nextLink", + apiKey: { + serializedName: "apiKey", + type: { + name: "String", + }, + }, + applicationKey: { + serializedName: "applicationKey", + type: { + name: "String", + }, + }, + enterpriseAppId: { + serializedName: "enterpriseAppId", + type: { + name: "String", + }, + }, + cspm: { + serializedName: "cspm", type: { - name: "String" - } - } - } - } + name: "Boolean", + }, + }, + }, + }, }; -export const LinkedResource: coreClient.CompositeMapper = { +export const UserInfo: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LinkedResource", + className: "UserInfo", modelProperties: { - id: { - serializedName: "id", + name: { + constraints: { + MaxLength: 50, + }, + serializedName: "name", + type: { + name: "String", + }, + }, + emailAddress: { + constraints: { + Pattern: new RegExp("^[A-Za-z0-9._%+-]+@(?:[A-Za-z0-9-]+\\.)+[A-Za-z]{2,}$"), + }, + serializedName: "emailAddress", + type: { + name: "String", + }, + }, + phoneNumber: { + constraints: { + MaxLength: 40, + }, + serializedName: "phoneNumber", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const MonitoredResourceListResponse: coreClient.CompositeMapper = { +export const IdentityProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MonitoredResourceListResponse", + className: "IdentityProperties", modelProperties: { - value: { - serializedName: "value", + principalId: { + serializedName: "principalId", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MonitoredResource" - } - } - } + name: "String", + }, }, - nextLink: { - serializedName: "nextLink", + tenantId: { + serializedName: "tenantId", + readOnly: true, + type: { + name: "String", + }, + }, + type: { + serializedName: "type", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const MonitoredResource: coreClient.CompositeMapper = { +export const Resource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MonitoredResource", + className: "Resource", modelProperties: { id: { serializedName: "id", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - sendingMetrics: { - serializedName: "sendingMetrics", + name: { + serializedName: "name", + readOnly: true, type: { - name: "Boolean" - } + name: "String", + }, }, - reasonForMetricsStatus: { - serializedName: "reasonForMetricsStatus", + type: { + serializedName: "type", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - sendingLogs: { - serializedName: "sendingLogs", + systemData: { + serializedName: "systemData", type: { - name: "Boolean" - } + name: "Composite", + className: "SystemData", + }, }, - reasonForLogsStatus: { - serializedName: "reasonForLogsStatus", - type: { - name: "String" - } - } - } - } + }, + }, }; -export const OperationListResult: coreClient.CompositeMapper = { +export const CreateResourceSupportedResponseList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationListResult", + className: "CreateResourceSupportedResponseList", modelProperties: { value: { serializedName: "value", + required: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "OperationResult" - } - } - } + className: "CreateResourceSupportedResponse", + }, + }, + }, }, nextLink: { serializedName: "nextLink", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const OperationResult: coreClient.CompositeMapper = { +export const CreateResourceSupportedResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationResult", + className: "CreateResourceSupportedResponse", + modelProperties: { + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "CreateResourceSupportedProperties", + }, + }, + }, + }, +}; + +export const CreateResourceSupportedProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CreateResourceSupportedProperties", modelProperties: { name: { serializedName: "name", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - display: { - serializedName: "display", + creationSupported: { + serializedName: "creationSupported", + readOnly: true, type: { - name: "Composite", - className: "OperationDisplay" - } + name: "Boolean", + }, }, - isDataAction: { - serializedName: "isDataAction", - type: { - name: "Boolean" - } - } - } - } + }, + }, }; -export const OperationDisplay: coreClient.CompositeMapper = { +export const DatadogMonitorResourceUpdateParameters: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationDisplay", + className: "DatadogMonitorResourceUpdateParameters", modelProperties: { - provider: { - serializedName: "provider", + properties: { + serializedName: "properties", type: { - name: "String" - } + name: "Composite", + className: "MonitorUpdateProperties", + }, }, - resource: { - serializedName: "resource", + tags: { + serializedName: "tags", type: { - name: "String" - } + name: "Dictionary", + value: { type: { name: "String" } }, + }, }, - operation: { - serializedName: "operation", + sku: { + serializedName: "sku", type: { - name: "String" - } + name: "Composite", + className: "ResourceSku", + }, }, - description: { - serializedName: "description", - type: { - name: "String" - } - } - } - } + }, + }, }; -export const DatadogMonitorResourceListResponse: coreClient.CompositeMapper = { +export const MonitorUpdateProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DatadogMonitorResourceListResponse", + className: "MonitorUpdateProperties", modelProperties: { - value: { - serializedName: "value", + monitoringStatus: { + serializedName: "monitoringStatus", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DatadogMonitorResource" - } - } - } + name: "String", + }, }, - nextLink: { - serializedName: "nextLink", + cspm: { + serializedName: "cspm", type: { - name: "String" - } - } - } - } + name: "Boolean", + }, + }, + }, + }, }; -export const DatadogMonitorResource: coreClient.CompositeMapper = { +export const BillingInfoResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DatadogMonitorResource", + className: "BillingInfoResponse", modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String" - } - }, - name: { - serializedName: "name", - readOnly: true, + marketplaceSaasInfo: { + serializedName: "marketplaceSaasInfo", type: { - name: "String" - } - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String" - } + name: "Composite", + className: "MarketplaceSaaSInfo", + }, }, - sku: { - serializedName: "sku", + partnerBillingEntity: { + serializedName: "partnerBillingEntity", type: { name: "Composite", - className: "ResourceSku" - } + className: "PartnerBillingEntity", + }, }, - properties: { - serializedName: "properties", + }, + }, +}; + +export const MarketplaceSaaSInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MarketplaceSaaSInfo", + modelProperties: { + marketplaceSubscriptionId: { + serializedName: "marketplaceSubscriptionId", type: { - name: "Composite", - className: "MonitorProperties" - } + name: "String", + }, }, - identity: { - serializedName: "identity", + marketplaceName: { + serializedName: "marketplaceName", type: { - name: "Composite", - className: "IdentityProperties" - } + name: "String", + }, }, - tags: { - serializedName: "tags", + marketplaceStatus: { + serializedName: "marketplaceStatus", type: { - name: "Dictionary", - value: { type: { name: "String" } } - } + name: "String", + }, }, - location: { - serializedName: "location", - required: true, + billedAzureSubscriptionId: { + serializedName: "billedAzureSubscriptionId", type: { - name: "String" - } + name: "String", + }, }, - systemData: { - serializedName: "systemData", + subscribed: { + serializedName: "subscribed", type: { - name: "Composite", - className: "SystemData" - } - } - } - } + name: "Boolean", + }, + }, + }, + }, }; -export const ResourceSku: coreClient.CompositeMapper = { +export const PartnerBillingEntity: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResourceSku", + className: "PartnerBillingEntity", modelProperties: { + id: { + serializedName: "id", + type: { + name: "String", + }, + }, name: { serializedName: "name", - required: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + partnerEntityUri: { + serializedName: "partnerEntityUri", + type: { + name: "String", + }, + }, + }, + }, }; -export const MonitorProperties: coreClient.CompositeMapper = { +export const DatadogApiKey: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MonitorProperties", + className: "DatadogApiKey", modelProperties: { - provisioningState: { - serializedName: "provisioningState", - readOnly: true, + createdBy: { + serializedName: "createdBy", type: { - name: "String" - } + name: "String", + }, }, - monitoringStatus: { - defaultValue: "Enabled", - serializedName: "monitoringStatus", + name: { + serializedName: "name", type: { - name: "String" - } + name: "String", + }, }, - marketplaceSubscriptionStatus: { - serializedName: "marketplaceSubscriptionStatus", - readOnly: true, + key: { + serializedName: "key", + required: true, type: { - name: "String" - } + name: "String", + }, }, - datadogOrganizationProperties: { - serializedName: "datadogOrganizationProperties", + created: { + serializedName: "created", type: { - name: "Composite", - className: "DatadogOrganizationProperties" - } + name: "String", + }, }, - userInfo: { - serializedName: "userInfo", + }, + }, +}; + +export const DatadogApiKeyListResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DatadogApiKeyListResponse", + modelProperties: { + value: { + serializedName: "value", + required: true, type: { - name: "Composite", - className: "UserInfo" - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DatadogApiKey", + }, + }, + }, }, - liftrResourceCategory: { - serializedName: "liftrResourceCategory", - readOnly: true, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const DatadogHostListResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DatadogHostListResponse", + modelProperties: { + value: { + serializedName: "value", + required: true, type: { - name: "String" - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DatadogHost", + }, + }, + }, }, - liftrResourcePreference: { - serializedName: "liftrResourcePreference", - readOnly: true, + nextLink: { + serializedName: "nextLink", type: { - name: "Number" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const DatadogOrganizationProperties: coreClient.CompositeMapper = { +export const DatadogHost: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DatadogOrganizationProperties", + className: "DatadogHost", modelProperties: { name: { serializedName: "name", type: { - name: "String" - } - }, - id: { - serializedName: "id", - type: { - name: "String" - } + name: "String", + }, }, - linkingAuthCode: { - serializedName: "linkingAuthCode", + aliases: { + serializedName: "aliases", type: { - name: "String" - } + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, }, - linkingClientId: { - serializedName: "linkingClientId", + apps: { + serializedName: "apps", type: { - name: "String" - } + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, }, - redirectUri: { - serializedName: "redirectUri", + meta: { + serializedName: "meta", type: { - name: "String" - } + name: "Composite", + className: "DatadogHostMetadata", + }, }, - apiKey: { - serializedName: "apiKey", + }, + }, +}; + +export const DatadogHostMetadata: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DatadogHostMetadata", + modelProperties: { + agentVersion: { + serializedName: "agentVersion", type: { - name: "String" - } + name: "String", + }, }, - applicationKey: { - serializedName: "applicationKey", + installMethod: { + serializedName: "installMethod", type: { - name: "String" - } + name: "Composite", + className: "DatadogInstallMethod", + }, }, - enterpriseAppId: { - serializedName: "enterpriseAppId", + logsAgent: { + serializedName: "logsAgent", type: { - name: "String" - } + name: "Composite", + className: "DatadogLogsAgent", + }, }, - cspm: { - serializedName: "cspm", - type: { - name: "Boolean" - } - } - } - } + }, + }, }; -export const UserInfo: coreClient.CompositeMapper = { +export const DatadogInstallMethod: coreClient.CompositeMapper = { type: { name: "Composite", - className: "UserInfo", + className: "DatadogInstallMethod", modelProperties: { - name: { - constraints: { - MaxLength: 50 - }, - serializedName: "name", + tool: { + serializedName: "tool", type: { - name: "String" - } - }, - emailAddress: { - constraints: { - Pattern: new RegExp( - "^[A-Za-z0-9._%+-]+@(?:[A-Za-z0-9-]+\\.)+[A-Za-z]{2,}$" - ) + name: "String", }, - serializedName: "emailAddress", - type: { - name: "String" - } }, - phoneNumber: { - constraints: { - MaxLength: 40 + toolVersion: { + serializedName: "toolVersion", + type: { + name: "String", }, - serializedName: "phoneNumber", + }, + installerVersion: { + serializedName: "installerVersion", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const IdentityProperties: coreClient.CompositeMapper = { +export const DatadogLogsAgent: coreClient.CompositeMapper = { type: { name: "Composite", - className: "IdentityProperties", + className: "DatadogLogsAgent", modelProperties: { - principalId: { - serializedName: "principalId", - readOnly: true, + transport: { + serializedName: "transport", type: { - name: "String" - } + name: "String", + }, }, - tenantId: { - serializedName: "tenantId", - readOnly: true, + }, + }, +}; + +export const LinkedResourceListResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LinkedResourceListResponse", + modelProperties: { + value: { + serializedName: "value", + required: true, type: { - name: "String" - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LinkedResource", + }, + }, + }, }, - type: { - serializedName: "type", + nextLink: { + serializedName: "nextLink", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const DatadogMonitorResourceUpdateParameters: coreClient.CompositeMapper = { +export const LinkedResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DatadogMonitorResourceUpdateParameters", + className: "LinkedResource", modelProperties: { - properties: { - serializedName: "properties", + id: { + serializedName: "id", type: { - name: "Composite", - className: "MonitorUpdateProperties" - } + name: "String", + }, }, - tags: { - serializedName: "tags", + location: { + serializedName: "location", type: { - name: "Dictionary", - value: { type: { name: "String" } } - } + name: "String", + }, }, - sku: { - serializedName: "sku", - type: { - name: "Composite", - className: "ResourceSku" - } - } - } - } + }, + }, }; -export const MonitorUpdateProperties: coreClient.CompositeMapper = { +export const MonitoredResourceListResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MonitorUpdateProperties", + className: "MonitoredResourceListResponse", modelProperties: { - monitoringStatus: { - defaultValue: "Enabled", - serializedName: "monitoringStatus", + value: { + serializedName: "value", + required: true, type: { - name: "String" - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MonitoredResource", + }, + }, + }, }, - cspm: { - serializedName: "cspm", + nextLink: { + serializedName: "nextLink", type: { - name: "Boolean" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const DatadogSetPasswordLink: coreClient.CompositeMapper = { +export const MonitoredResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DatadogSetPasswordLink", + className: "MonitoredResource", modelProperties: { - setPasswordLink: { - serializedName: "setPasswordLink", + id: { + serializedName: "id", + type: { + name: "String", + }, + }, + sendingMetrics: { + serializedName: "sendingMetrics", + type: { + name: "Boolean", + }, + }, + reasonForMetricsStatus: { + serializedName: "reasonForMetricsStatus", + type: { + name: "String", + }, + }, + sendingLogs: { + serializedName: "sendingLogs", + type: { + name: "Boolean", + }, + }, + reasonForLogsStatus: { + serializedName: "reasonForLogsStatus", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const MonitoringTagRulesListResponse: coreClient.CompositeMapper = { +export const MonitoredSubscriptionPropertiesList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MonitoringTagRulesListResponse", + className: "MonitoredSubscriptionPropertiesList", modelProperties: { value: { serializedName: "value", + required: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "MonitoringTagRules" - } - } - } + className: "MonitoredSubscriptionProperties", + }, + }, + }, }, nextLink: { serializedName: "nextLink", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const MonitoringTagRules: coreClient.CompositeMapper = { +export const SubscriptionList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MonitoringTagRules", + className: "SubscriptionList", modelProperties: { - name: { - serializedName: "name", - readOnly: true, + operation: { + serializedName: "operation", type: { - name: "String" - } + name: "String", + }, }, - id: { - serializedName: "id", - readOnly: true, + monitoredSubscriptionList: { + serializedName: "monitoredSubscriptionList", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MonitoredSubscription", + }, + }, + }, + }, + }, + }, +}; + +export const MonitoredSubscription: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitoredSubscription", + modelProperties: { + subscriptionId: { + serializedName: "subscriptionId", + required: true, type: { - name: "String" - } + name: "String", + }, }, - type: { - serializedName: "type", - readOnly: true, + status: { + serializedName: "status", type: { - name: "String" - } + name: "String", + }, }, - properties: { - serializedName: "properties", + error: { + serializedName: "error", + type: { + name: "String", + }, + }, + tagRules: { + serializedName: "tagRules", type: { name: "Composite", - className: "MonitoringTagRulesProperties" - } + className: "MonitoringTagRulesProperties", + }, }, - systemData: { - serializedName: "systemData", - type: { - name: "Composite", - className: "SystemData" - } - } - } - } + }, + }, }; export const MonitoringTagRulesProperties: coreClient.CompositeMapper = { @@ -1186,31 +1260,37 @@ export const MonitoringTagRulesProperties: coreClient.CompositeMapper = { serializedName: "provisioningState", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, logRules: { serializedName: "logRules", type: { name: "Composite", - className: "LogRules" - } + className: "LogRules", + }, }, metricRules: { serializedName: "metricRules", type: { name: "Composite", - className: "MetricRules" - } + className: "MetricRules", + }, }, automuting: { serializedName: "automuting", type: { - name: "Boolean" - } - } - } - } + name: "Boolean", + }, + }, + customMetrics: { + serializedName: "customMetrics", + type: { + name: "Boolean", + }, + }, + }, + }, }; export const LogRules: coreClient.CompositeMapper = { @@ -1221,20 +1301,20 @@ export const LogRules: coreClient.CompositeMapper = { sendAadLogs: { serializedName: "sendAadLogs", type: { - name: "Boolean" - } + name: "Boolean", + }, }, sendSubscriptionLogs: { serializedName: "sendSubscriptionLogs", type: { - name: "Boolean" - } + name: "Boolean", + }, }, sendResourceLogs: { serializedName: "sendResourceLogs", type: { - name: "Boolean" - } + name: "Boolean", + }, }, filteringTags: { serializedName: "filteringTags", @@ -1243,13 +1323,13 @@ export const LogRules: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "FilteringTag" - } - } - } - } - } - } + className: "FilteringTag", + }, + }, + }, + }, + }, + }, }; export const FilteringTag: coreClient.CompositeMapper = { @@ -1260,23 +1340,23 @@ export const FilteringTag: coreClient.CompositeMapper = { name: { serializedName: "name", type: { - name: "String" - } + name: "String", + }, }, value: { serializedName: "value", type: { - name: "String" - } + name: "String", + }, }, action: { serializedName: "action", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const MetricRules: coreClient.CompositeMapper = { @@ -1291,13 +1371,28 @@ export const MetricRules: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "FilteringTag" - } - } - } - } - } - } + className: "FilteringTag", + }, + }, + }, + }, + }, + }, +}; + +export const DatadogSetPasswordLink: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DatadogSetPasswordLink", + modelProperties: { + setPasswordLink: { + serializedName: "setPasswordLink", + type: { + name: "String", + }, + }, + }, + }, }; export const DatadogSingleSignOnResourceListResponse: coreClient.CompositeMapper = { @@ -1307,68 +1402,25 @@ export const DatadogSingleSignOnResourceListResponse: coreClient.CompositeMapper modelProperties: { value: { serializedName: "value", + required: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "DatadogSingleSignOnResource" - } - } - } + className: "DatadogSingleSignOnResource", + }, + }, + }, }, nextLink: { serializedName: "nextLink", type: { - name: "String" - } - } - } - } -}; - -export const DatadogSingleSignOnResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DatadogSingleSignOnResource", - 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" - } - }, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "DatadogSingleSignOnProperties" - } + name: "String", + }, }, - systemData: { - serializedName: "systemData", - type: { - name: "Composite", - className: "SystemData" - } - } - } - } + }, + }, }; export const DatadogSingleSignOnProperties: coreClient.CompositeMapper = { @@ -1380,147 +1432,319 @@ export const DatadogSingleSignOnProperties: coreClient.CompositeMapper = { serializedName: "provisioningState", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, singleSignOnState: { serializedName: "singleSignOnState", type: { - name: "String" - } + name: "String", + }, }, enterpriseAppId: { serializedName: "enterpriseAppId", type: { - name: "String" - } + name: "String", + }, }, singleSignOnUrl: { serializedName: "singleSignOnUrl", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const MonitoredSubscriptionPropertiesList: coreClient.CompositeMapper = { +export const MonitoringTagRulesListResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MonitoredSubscriptionPropertiesList", + className: "MonitoringTagRulesListResponse", modelProperties: { value: { serializedName: "value", + required: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "MonitoredSubscriptionProperties" - } - } - } - } - } - } + className: "MonitoringTagRules", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, }; -export const MonitoredSubscriptionProperties: coreClient.CompositeMapper = { +export const TrackedResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MonitoredSubscriptionProperties", + className: "TrackedResource", modelProperties: { - name: { - serializedName: "name", - readOnly: true, + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", type: { - name: "String" - } + name: "Dictionary", + value: { type: { name: "String" } }, + }, }, - id: { - serializedName: "id", - readOnly: true, + location: { + serializedName: "location", + required: true, type: { - name: "String" - } + name: "String", + }, }, - type: { - serializedName: "type", - readOnly: true, + }, + }, +}; + +export const ProxyResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties, + }, + }, +}; + +export const DatadogMonitorResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DatadogMonitorResource", + modelProperties: { + ...TrackedResource.type.modelProperties, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "ResourceSku", + }, + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "MonitorProperties", + }, + }, + identity: { + serializedName: "identity", type: { - name: "String" - } + name: "Composite", + className: "IdentityProperties", + }, }, + }, + }, +}; + +export const MonitoredSubscriptionProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitoredSubscriptionProperties", + modelProperties: { + ...ProxyResource.type.modelProperties, properties: { serializedName: "properties", type: { name: "Composite", - className: "SubscriptionList" - } - } - } - } + className: "SubscriptionList", + }, + }, + }, + }, }; -export const SubscriptionList: coreClient.CompositeMapper = { +export const DatadogSingleSignOnResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SubscriptionList", + className: "DatadogSingleSignOnResource", modelProperties: { - operation: { - serializedName: "operation", + ...ProxyResource.type.modelProperties, + properties: { + serializedName: "properties", type: { - name: "String" - } + name: "Composite", + className: "DatadogSingleSignOnProperties", + }, }, - monitoredSubscriptionList: { - serializedName: "monitoredSubscriptionList", + }, + }, +}; + +export const MonitoringTagRules: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitoringTagRules", + modelProperties: { + ...ProxyResource.type.modelProperties, + properties: { + serializedName: "properties", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MonitoredSubscription" - } - } - } - } - } - } + name: "Composite", + className: "MonitoringTagRulesProperties", + }, + }, + }, + }, }; -export const MonitoredSubscription: coreClient.CompositeMapper = { +export const MonitorsCreateHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MonitoredSubscription", + className: "MonitorsCreateHeaders", modelProperties: { - subscriptionId: { - serializedName: "subscriptionId", + azureAsyncOperation: { + serializedName: "azure-asyncoperation", type: { - name: "String" - } + name: "String", + }, }, - status: { - serializedName: "status", + retryAfter: { + serializedName: "retry-after", type: { - name: "String" - } + name: "Number", + }, }, - error: { - serializedName: "error", + }, + }, +}; + +export const MonitorsUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitorsUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", type: { - name: "String" - } + name: "String", + }, }, - tagRules: { - serializedName: "tagRules", + retryAfter: { + serializedName: "retry-after", type: { - name: "Composite", - className: "MonitoringTagRulesProperties" - } - } - } - } + name: "Number", + }, + }, + }, + }, +}; + +export const MonitorsDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitorsDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const MonitoredSubscriptionsCreateorUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitoredSubscriptionsCreateorUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const MonitoredSubscriptionsUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitoredSubscriptionsUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const MonitoredSubscriptionsDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitoredSubscriptionsDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const SingleSignOnConfigurationsCreateOrUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SingleSignOnConfigurationsCreateOrUpdateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, }; diff --git a/sdk/datadog/arm-datadog/src/models/parameters.ts b/sdk/datadog/arm-datadog/src/models/parameters.ts index 6e74d6b1bfa2..67243b6c8e45 100644 --- a/sdk/datadog/arm-datadog/src/models/parameters.ts +++ b/sdk/datadog/arm-datadog/src/models/parameters.ts @@ -9,16 +9,16 @@ import { OperationParameter, OperationURLParameter, - OperationQueryParameter + OperationQueryParameter, } from "@azure/core-client"; import { DatadogAgreementResource as DatadogAgreementResourceMapper, - DatadogApiKey as DatadogApiKeyMapper, DatadogMonitorResource as DatadogMonitorResourceMapper, DatadogMonitorResourceUpdateParameters as DatadogMonitorResourceUpdateParametersMapper, - MonitoringTagRules as MonitoringTagRulesMapper, + DatadogApiKey as DatadogApiKeyMapper, + MonitoredSubscriptionProperties as MonitoredSubscriptionPropertiesMapper, DatadogSingleSignOnResource as DatadogSingleSignOnResourceMapper, - MonitoredSubscriptionProperties as MonitoredSubscriptionPropertiesMapper + MonitoringTagRules as MonitoringTagRulesMapper, } from "../models/mappers.js"; export const accept: OperationParameter = { @@ -28,9 +28,9 @@ export const accept: OperationParameter = { isConstant: true, serializedName: "Accept", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const $host: OperationURLParameter = { @@ -39,53 +39,22 @@ export const $host: OperationURLParameter = { serializedName: "$host", required: true, type: { - name: "String" - } - }, - skipEncoding: true -}; - -export const subscriptionId: OperationURLParameter = { - parameterPath: "subscriptionId", - mapper: { - constraints: { - MinLength: 1 + name: "String", }, - serializedName: "subscriptionId", - required: true, - type: { - name: "String" - } - } + }, + skipEncoding: true, }; export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2023-01-01", + defaultValue: "2023-10-20", 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 body: OperationParameter = { - parameterPath: ["options", "body"], - mapper: DatadogAgreementResourceMapper + name: "String", + }, + }, }; export const nextLink: OperationURLParameter = { @@ -94,21 +63,41 @@ export const nextLink: OperationURLParameter = { serializedName: "nextLink", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; -export const datadogOrganizationId: OperationQueryParameter = { - parameterPath: "datadogOrganizationId", +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", mapper: { - serializedName: "datadogOrganizationId", + constraints: { + MinLength: 1, + }, + serializedName: "subscriptionId", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, +}; + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String", + }, + }, +}; + +export const body: OperationParameter = { + parameterPath: "body", + mapper: DatadogAgreementResourceMapper, }; export const resourceGroupName: OperationURLParameter = { @@ -116,14 +105,14 @@ export const resourceGroupName: OperationURLParameter = { mapper: { constraints: { MaxLength: 90, - MinLength: 1 + MinLength: 1, }, serializedName: "resourceGroupName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const monitorName: OperationURLParameter = { @@ -132,59 +121,70 @@ export const monitorName: OperationURLParameter = { serializedName: "monitorName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const body1: OperationParameter = { - parameterPath: ["options", "body"], - mapper: DatadogApiKeyMapper + parameterPath: "body", + mapper: DatadogMonitorResourceMapper, }; export const body2: OperationParameter = { - parameterPath: ["options", "body"], - mapper: DatadogMonitorResourceMapper + parameterPath: "body", + mapper: DatadogMonitorResourceUpdateParametersMapper, }; export const body3: OperationParameter = { parameterPath: ["options", "body"], - mapper: DatadogMonitorResourceUpdateParametersMapper + mapper: DatadogApiKeyMapper, }; -export const body4: OperationParameter = { - parameterPath: ["options", "body"], - mapper: MonitoringTagRulesMapper +export const datadogOrganizationId: OperationQueryParameter = { + parameterPath: "datadogOrganizationId", + mapper: { + serializedName: "datadogOrganizationId", + required: true, + type: { + name: "String", + }, + }, }; -export const ruleSetName: OperationURLParameter = { - parameterPath: "ruleSetName", +export const configurationName: OperationURLParameter = { + parameterPath: "configurationName", mapper: { - serializedName: "ruleSetName", + serializedName: "configurationName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, +}; + +export const body4: OperationParameter = { + parameterPath: "body", + mapper: MonitoredSubscriptionPropertiesMapper, }; export const body5: OperationParameter = { - parameterPath: ["options", "body"], - mapper: DatadogSingleSignOnResourceMapper + parameterPath: "body", + mapper: DatadogSingleSignOnResourceMapper, }; -export const configurationName: OperationURLParameter = { - parameterPath: "configurationName", +export const ruleSetName: OperationURLParameter = { + parameterPath: "ruleSetName", mapper: { - serializedName: "configurationName", + serializedName: "ruleSetName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const body6: OperationParameter = { - parameterPath: ["options", "body"], - mapper: MonitoredSubscriptionPropertiesMapper + parameterPath: "body", + mapper: MonitoringTagRulesMapper, }; diff --git a/sdk/datadog/arm-datadog/src/operations/billingInfo.ts b/sdk/datadog/arm-datadog/src/operations/billingInfo.ts new file mode 100644 index 000000000000..04415c212bae --- /dev/null +++ b/sdk/datadog/arm-datadog/src/operations/billingInfo.ts @@ -0,0 +1,68 @@ +/* + * 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 { BillingInfo } from "../operationsInterfaces/index.js"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { MicrosoftDatadogClient } from "../microsoftDatadogClient.js"; +import { BillingInfoGetOptionalParams, BillingInfoGetResponse } from "../models/index.js"; + +/** Class containing BillingInfo operations. */ +export class BillingInfoImpl implements BillingInfo { + private readonly client: MicrosoftDatadogClient; + + /** + * Initialize a new instance of the class BillingInfo class. + * @param client Reference to the service client + */ + constructor(client: MicrosoftDatadogClient) { + this.client = client; + } + + /** + * Get marketplace and organization info mapped to the given monitor. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + monitorName: string, + options?: BillingInfoGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, options }, + getOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/getBillingInfo", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.BillingInfoResponse, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/datadog/arm-datadog/src/operations/creationSupported.ts b/sdk/datadog/arm-datadog/src/operations/creationSupported.ts index 92322ae8e810..1836aafddf4b 100644 --- a/sdk/datadog/arm-datadog/src/operations/creationSupported.ts +++ b/sdk/datadog/arm-datadog/src/operations/creationSupported.ts @@ -7,6 +7,7 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper.js"; import { CreationSupported } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers.js"; @@ -14,10 +15,12 @@ import * as Parameters from "../models/parameters.js"; import { MicrosoftDatadogClient } from "../microsoftDatadogClient.js"; import { CreateResourceSupportedResponse, + CreationSupportedListNextOptionalParams, CreationSupportedListOptionalParams, CreationSupportedListResponse, CreationSupportedGetOptionalParams, - CreationSupportedGetResponse + CreationSupportedGetResponse, + CreationSupportedListNextResponse, } from "../models/index.js"; /// @@ -40,7 +43,7 @@ export class CreationSupportedImpl implements CreationSupported { */ public list( datadogOrganizationId: string, - options?: CreationSupportedListOptionalParams + options?: CreationSupportedListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(datadogOrganizationId, options); return { @@ -55,28 +58,38 @@ export class CreationSupportedImpl implements CreationSupported { throw new Error("maxPageSize is not supported by this operation."); } return this.listPagingPage(datadogOrganizationId, options, settings); - } + }, }; } private async *listPagingPage( datadogOrganizationId: string, options?: CreationSupportedListOptionalParams, - _settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: CreationSupportedListResponse; - result = await this._list(datadogOrganizationId, options); - yield result.value || []; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(datadogOrganizationId, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } } private async *listPagingAll( datadogOrganizationId: string, - options?: CreationSupportedListOptionalParams + options?: CreationSupportedListOptionalParams, ): AsyncIterableIterator { - for await (const page of this.listPagingPage( - datadogOrganizationId, - options - )) { + for await (const page of this.listPagingPage(datadogOrganizationId, options)) { yield* page; } } @@ -88,12 +101,9 @@ export class CreationSupportedImpl implements CreationSupported { */ private _list( datadogOrganizationId: string, - options?: CreationSupportedListOptionalParams + options?: CreationSupportedListOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { datadogOrganizationId, options }, - listOperationSpec - ); + return this.client.sendOperationRequest({ datadogOrganizationId, options }, listOperationSpec); } /** @@ -103,48 +113,70 @@ export class CreationSupportedImpl implements CreationSupported { */ get( datadogOrganizationId: string, - options?: CreationSupportedGetOptionalParams + options?: CreationSupportedGetOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { datadogOrganizationId, options }, - getOperationSpec - ); + return this.client.sendOperationRequest({ datadogOrganizationId, options }, getOperationSpec); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: CreationSupportedListNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec); } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/subscriptionStatuses", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/subscriptionStatuses", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.CreateResourceSupportedResponseList + bodyMapper: Mappers.CreateResourceSupportedResponseList, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion, Parameters.datadogOrganizationId], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/subscriptionStatuses/default", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/subscriptionStatuses/default", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.CreateResourceSupportedResponse + bodyMapper: Mappers.CreateResourceSupportedResponse, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion, Parameters.datadogOrganizationId], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CreateResourceSupportedResponseList, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer, }; diff --git a/sdk/datadog/arm-datadog/src/operations/index.ts b/sdk/datadog/arm-datadog/src/operations/index.ts index 8b30e403c8fb..7ffb43cd8f8e 100644 --- a/sdk/datadog/arm-datadog/src/operations/index.ts +++ b/sdk/datadog/arm-datadog/src/operations/index.ts @@ -6,10 +6,11 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +export * from "./operations.js"; export * from "./marketplaceAgreements.js"; -export * from "./creationSupported.js"; export * from "./monitors.js"; -export * from "./operations.js"; -export * from "./tagRules.js"; -export * from "./singleSignOnConfigurations.js"; +export * from "./creationSupported.js"; +export * from "./billingInfo.js"; export * from "./monitoredSubscriptions.js"; +export * from "./singleSignOnConfigurations.js"; +export * from "./tagRules.js"; diff --git a/sdk/datadog/arm-datadog/src/operations/marketplaceAgreements.ts b/sdk/datadog/arm-datadog/src/operations/marketplaceAgreements.ts index c4c4cb2ff040..3d21101754c7 100644 --- a/sdk/datadog/arm-datadog/src/operations/marketplaceAgreements.ts +++ b/sdk/datadog/arm-datadog/src/operations/marketplaceAgreements.ts @@ -20,7 +20,7 @@ import { MarketplaceAgreementsListResponse, MarketplaceAgreementsCreateOrUpdateOptionalParams, MarketplaceAgreementsCreateOrUpdateResponse, - MarketplaceAgreementsListNextResponse + MarketplaceAgreementsListNextResponse, } from "../models/index.js"; /// @@ -41,7 +41,7 @@ export class MarketplaceAgreementsImpl implements MarketplaceAgreements { * @param options The options parameters. */ public list( - options?: MarketplaceAgreementsListOptionalParams + options?: MarketplaceAgreementsListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { @@ -56,13 +56,13 @@ export class MarketplaceAgreementsImpl implements MarketplaceAgreements { throw new Error("maxPageSize is not supported by this operation."); } return this.listPagingPage(options, settings); - } + }, }; } private async *listPagingPage( options?: MarketplaceAgreementsListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: MarketplaceAgreementsListResponse; let continuationToken = settings?.continuationToken; @@ -83,7 +83,7 @@ export class MarketplaceAgreementsImpl implements MarketplaceAgreements { } private async *listPagingAll( - options?: MarketplaceAgreementsListOptionalParams + options?: MarketplaceAgreementsListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; @@ -95,22 +95,21 @@ export class MarketplaceAgreementsImpl implements MarketplaceAgreements { * @param options The options parameters. */ private _list( - options?: MarketplaceAgreementsListOptionalParams + options?: MarketplaceAgreementsListOptionalParams, ): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } /** * Create Datadog marketplace agreement in the subscription. + * @param body The request body * @param options The options parameters. */ createOrUpdate( - options?: MarketplaceAgreementsCreateOrUpdateOptionalParams + body: DatadogAgreementResource, + options?: MarketplaceAgreementsCreateOrUpdateOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { options }, - createOrUpdateOperationSpec - ); + return this.client.sendOperationRequest({ body, options }, createOrUpdateOperationSpec); } /** @@ -120,69 +119,60 @@ export class MarketplaceAgreementsImpl implements MarketplaceAgreements { */ private _listNext( nextLink: string, - options?: MarketplaceAgreementsListNextOptionalParams + options?: MarketplaceAgreementsListNextOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec - ); + return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec); } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/agreements", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/agreements", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DatadogAgreementResourceListResponse + bodyMapper: Mappers.DatadogAgreementResourceListResponse, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/agreements/default", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/agreements/default", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.DatadogAgreementResource + bodyMapper: Mappers.DatadogAgreementResource, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.body, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DatadogAgreementResourceListResponse + bodyMapper: Mappers.DatadogAgreementResourceListResponse, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.nextLink - ], + urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/datadog/arm-datadog/src/operations/monitoredSubscriptions.ts b/sdk/datadog/arm-datadog/src/operations/monitoredSubscriptions.ts index 260800f80bfb..357bdca30129 100644 --- a/sdk/datadog/arm-datadog/src/operations/monitoredSubscriptions.ts +++ b/sdk/datadog/arm-datadog/src/operations/monitoredSubscriptions.ts @@ -7,19 +7,17 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper.js"; import { MonitoredSubscriptions } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers.js"; import * as Parameters from "../models/parameters.js"; import { MicrosoftDatadogClient } from "../microsoftDatadogClient.js"; -import { - SimplePollerLike, - OperationState, - createHttpPoller -} from "@azure/core-lro"; +import { SimplePollerLike, OperationState, createHttpPoller } from "@azure/core-lro"; import { createLroSpec } from "../lroImpl.js"; import { MonitoredSubscriptionProperties, + MonitoredSubscriptionsListNextOptionalParams, MonitoredSubscriptionsListOptionalParams, MonitoredSubscriptionsListResponse, MonitoredSubscriptionsGetOptionalParams, @@ -28,7 +26,8 @@ import { MonitoredSubscriptionsCreateorUpdateResponse, MonitoredSubscriptionsUpdateOptionalParams, MonitoredSubscriptionsUpdateResponse, - MonitoredSubscriptionsDeleteOptionalParams + MonitoredSubscriptionsDeleteOptionalParams, + MonitoredSubscriptionsListNextResponse, } from "../models/index.js"; /// @@ -53,7 +52,7 @@ export class MonitoredSubscriptionsImpl implements MonitoredSubscriptions { public list( resourceGroupName: string, monitorName: string, - options?: MonitoredSubscriptionsListOptionalParams + options?: MonitoredSubscriptionsListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(resourceGroupName, monitorName, options); return { @@ -67,13 +66,8 @@ export class MonitoredSubscriptionsImpl implements MonitoredSubscriptions { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listPagingPage( - resourceGroupName, - monitorName, - options, - settings - ); - } + return this.listPagingPage(resourceGroupName, monitorName, options, settings); + }, }; } @@ -81,23 +75,32 @@ export class MonitoredSubscriptionsImpl implements MonitoredSubscriptions { resourceGroupName: string, monitorName: string, options?: MonitoredSubscriptionsListOptionalParams, - _settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: MonitoredSubscriptionsListResponse; - result = await this._list(resourceGroupName, monitorName, options); - yield result.value || []; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, monitorName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext(resourceGroupName, monitorName, continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } } private async *listPagingAll( resourceGroupName: string, monitorName: string, - options?: MonitoredSubscriptionsListOptionalParams + options?: MonitoredSubscriptionsListOptionalParams, ): AsyncIterableIterator { - for await (const page of this.listPagingPage( - resourceGroupName, - monitorName, - options - )) { + for await (const page of this.listPagingPage(resourceGroupName, monitorName, options)) { yield* page; } } @@ -111,11 +114,11 @@ export class MonitoredSubscriptionsImpl implements MonitoredSubscriptions { private _list( resourceGroupName: string, monitorName: string, - options?: MonitoredSubscriptionsListOptionalParams + options?: MonitoredSubscriptionsListOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, monitorName, options }, - listOperationSpec + listOperationSpec, ); } @@ -130,11 +133,11 @@ export class MonitoredSubscriptionsImpl implements MonitoredSubscriptions { resourceGroupName: string, monitorName: string, configurationName: string, - options?: MonitoredSubscriptionsGetOptionalParams + options?: MonitoredSubscriptionsGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, monitorName, configurationName, options }, - getOperationSpec + getOperationSpec, ); } @@ -143,13 +146,16 @@ export class MonitoredSubscriptionsImpl implements MonitoredSubscriptions { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Monitor resource name * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the Datadog monitor + * resource. * @param options The options parameters. */ async beginCreateorUpdate( resourceGroupName: string, monitorName: string, configurationName: string, - options?: MonitoredSubscriptionsCreateorUpdateOptionalParams + body: MonitoredSubscriptionProperties, + options?: MonitoredSubscriptionsCreateorUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -158,21 +164,19 @@ export class MonitoredSubscriptionsImpl implements MonitoredSubscriptions { > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -181,8 +185,8 @@ export class MonitoredSubscriptionsImpl implements MonitoredSubscriptions { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -190,22 +194,29 @@ export class MonitoredSubscriptionsImpl implements MonitoredSubscriptions { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, - args: { resourceGroupName, monitorName, configurationName, options }, - spec: createorUpdateOperationSpec + args: { + resourceGroupName, + monitorName, + configurationName, + body, + options, + }, + spec: createorUpdateOperationSpec, }); const poller = await createHttpPoller< MonitoredSubscriptionsCreateorUpdateResponse, OperationState >(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", }); await poller.poll(); return poller; @@ -216,19 +227,23 @@ export class MonitoredSubscriptionsImpl implements MonitoredSubscriptions { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Monitor resource name * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the Datadog monitor + * resource. * @param options The options parameters. */ async beginCreateorUpdateAndWait( resourceGroupName: string, monitorName: string, configurationName: string, - options?: MonitoredSubscriptionsCreateorUpdateOptionalParams + body: MonitoredSubscriptionProperties, + options?: MonitoredSubscriptionsCreateorUpdateOptionalParams, ): Promise { const poller = await this.beginCreateorUpdate( resourceGroupName, monitorName, configurationName, - options + body, + options, ); return poller.pollUntilDone(); } @@ -238,13 +253,16 @@ export class MonitoredSubscriptionsImpl implements MonitoredSubscriptions { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Monitor resource name * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the Datadog monitor + * resource. * @param options The options parameters. */ async beginUpdate( resourceGroupName: string, monitorName: string, configurationName: string, - options?: MonitoredSubscriptionsUpdateOptionalParams + body: MonitoredSubscriptionProperties, + options?: MonitoredSubscriptionsUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -253,21 +271,19 @@ export class MonitoredSubscriptionsImpl implements MonitoredSubscriptions { > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -276,8 +292,8 @@ export class MonitoredSubscriptionsImpl implements MonitoredSubscriptions { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -285,22 +301,29 @@ export class MonitoredSubscriptionsImpl implements MonitoredSubscriptions { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, - args: { resourceGroupName, monitorName, configurationName, options }, - spec: updateOperationSpec + args: { + resourceGroupName, + monitorName, + configurationName, + body, + options, + }, + spec: updateOperationSpec, }); const poller = await createHttpPoller< MonitoredSubscriptionsUpdateResponse, OperationState >(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", }); await poller.poll(); return poller; @@ -311,19 +334,23 @@ export class MonitoredSubscriptionsImpl implements MonitoredSubscriptions { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Monitor resource name * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the Datadog monitor + * resource. * @param options The options parameters. */ async beginUpdateAndWait( resourceGroupName: string, monitorName: string, configurationName: string, - options?: MonitoredSubscriptionsUpdateOptionalParams + body: MonitoredSubscriptionProperties, + options?: MonitoredSubscriptionsUpdateOptionalParams, ): Promise { const poller = await this.beginUpdate( resourceGroupName, monitorName, configurationName, - options + body, + options, ); return poller.pollUntilDone(); } @@ -332,32 +359,30 @@ export class MonitoredSubscriptionsImpl implements MonitoredSubscriptions { * Updates the subscriptions that are being monitored by the Datadog monitor resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Monitor resource name - * @param configurationName Configuration name + * @param configurationName The configuration name. Only 'default' value is supported. * @param options The options parameters. */ async beginDelete( resourceGroupName: string, monitorName: string, configurationName: string, - options?: MonitoredSubscriptionsDeleteOptionalParams + options?: MonitoredSubscriptionsDeleteOptionalParams, ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -366,8 +391,8 @@ export class MonitoredSubscriptionsImpl implements MonitoredSubscriptions { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -375,19 +400,20 @@ export class MonitoredSubscriptionsImpl implements MonitoredSubscriptions { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { resourceGroupName, monitorName, configurationName, options }, - spec: deleteOperationSpec + spec: deleteOperationSpec, }); const poller = await createHttpPoller>(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", }); await poller.poll(); return poller; @@ -397,60 +423,77 @@ export class MonitoredSubscriptionsImpl implements MonitoredSubscriptions { * Updates the subscriptions that are being monitored by the Datadog monitor resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Monitor resource name - * @param configurationName Configuration name + * @param configurationName The configuration name. Only 'default' value is supported. * @param options The options parameters. */ async beginDeleteAndWait( resourceGroupName: string, monitorName: string, configurationName: string, - options?: MonitoredSubscriptionsDeleteOptionalParams + options?: MonitoredSubscriptionsDeleteOptionalParams, ): Promise { const poller = await this.beginDelete( resourceGroupName, monitorName, configurationName, - options + options, ); return poller.pollUntilDone(); } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + monitorName: string, + nextLink: string, + options?: MonitoredSubscriptionsListNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, nextLink, options }, + listNextOperationSpec, + ); + } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.MonitoredSubscriptionPropertiesList + bodyMapper: Mappers.MonitoredSubscriptionPropertiesList, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.monitorName + Parameters.monitorName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions/{configurationName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions/{configurationName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.MonitoredSubscriptionProperties + bodyMapper: Mappers.MonitoredSubscriptionProperties, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -458,82 +501,79 @@ const getOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.monitorName, - Parameters.configurationName + Parameters.configurationName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const createorUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions/{configurationName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions/{configurationName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.MonitoredSubscriptionProperties + bodyMapper: Mappers.MonitoredSubscriptionProperties, }, 201: { - bodyMapper: Mappers.MonitoredSubscriptionProperties + bodyMapper: Mappers.MonitoredSubscriptionProperties, }, 202: { - bodyMapper: Mappers.MonitoredSubscriptionProperties + bodyMapper: Mappers.MonitoredSubscriptionProperties, }, 204: { - bodyMapper: Mappers.MonitoredSubscriptionProperties + bodyMapper: Mappers.MonitoredSubscriptionProperties, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - requestBody: Parameters.body6, + requestBody: Parameters.body4, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.monitorName, - Parameters.configurationName + Parameters.configurationName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const updateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions/{configurationName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions/{configurationName}", httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.MonitoredSubscriptionProperties + bodyMapper: Mappers.MonitoredSubscriptionProperties, }, 201: { - bodyMapper: Mappers.MonitoredSubscriptionProperties + bodyMapper: Mappers.MonitoredSubscriptionProperties, }, 202: { - bodyMapper: Mappers.MonitoredSubscriptionProperties + bodyMapper: Mappers.MonitoredSubscriptionProperties, }, 204: { - bodyMapper: Mappers.MonitoredSubscriptionProperties + bodyMapper: Mappers.MonitoredSubscriptionProperties, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - requestBody: Parameters.body6, + requestBody: Parameters.body4, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.monitorName, - Parameters.configurationName + Parameters.configurationName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions/{configurationName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions/{configurationName}", httpMethod: "DELETE", responses: { 200: {}, @@ -541,8 +581,8 @@ const deleteOperationSpec: coreClient.OperationSpec = { 202: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -550,8 +590,29 @@ const deleteOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.monitorName, - Parameters.configurationName + Parameters.configurationName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.MonitoredSubscriptionPropertiesList, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/datadog/arm-datadog/src/operations/monitors.ts b/sdk/datadog/arm-datadog/src/operations/monitors.ts index 5e8e8313c13d..2e438e3e1157 100644 --- a/sdk/datadog/arm-datadog/src/operations/monitors.ts +++ b/sdk/datadog/arm-datadog/src/operations/monitors.ts @@ -13,13 +13,16 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers.js"; import * as Parameters from "../models/parameters.js"; import { MicrosoftDatadogClient } from "../microsoftDatadogClient.js"; -import { - SimplePollerLike, - OperationState, - createHttpPoller -} from "@azure/core-lro"; +import { SimplePollerLike, OperationState, createHttpPoller } from "@azure/core-lro"; import { createLroSpec } from "../lroImpl.js"; import { + DatadogMonitorResource, + MonitorsListNextOptionalParams, + MonitorsListOptionalParams, + MonitorsListResponse, + MonitorsListByResourceGroupNextOptionalParams, + MonitorsListByResourceGroupOptionalParams, + MonitorsListByResourceGroupResponse, DatadogApiKey, MonitorsListApiKeysNextOptionalParams, MonitorsListApiKeysOptionalParams, @@ -36,31 +39,25 @@ import { MonitorsListMonitoredResourcesNextOptionalParams, MonitorsListMonitoredResourcesOptionalParams, MonitorsListMonitoredResourcesResponse, - DatadogMonitorResource, - MonitorsListNextOptionalParams, - MonitorsListOptionalParams, - MonitorsListResponse, - MonitorsListByResourceGroupNextOptionalParams, - MonitorsListByResourceGroupOptionalParams, - MonitorsListByResourceGroupResponse, - MonitorsGetDefaultKeyOptionalParams, - MonitorsGetDefaultKeyResponse, - MonitorsSetDefaultKeyOptionalParams, MonitorsGetOptionalParams, MonitorsGetResponse, MonitorsCreateOptionalParams, MonitorsCreateResponse, + DatadogMonitorResourceUpdateParameters, MonitorsUpdateOptionalParams, MonitorsUpdateResponse, MonitorsDeleteOptionalParams, + MonitorsGetDefaultKeyOptionalParams, + MonitorsGetDefaultKeyResponse, MonitorsRefreshSetPasswordLinkOptionalParams, MonitorsRefreshSetPasswordLinkResponse, + MonitorsSetDefaultKeyOptionalParams, + MonitorsListNextResponse, + MonitorsListByResourceGroupNextResponse, MonitorsListApiKeysNextResponse, MonitorsListHostsNextResponse, MonitorsListLinkedResourcesNextResponse, MonitorsListMonitoredResourcesNextResponse, - MonitorsListNextResponse, - MonitorsListByResourceGroupNextResponse } from "../models/index.js"; /// @@ -76,6 +73,118 @@ export class MonitorsImpl implements Monitors { this.client = client; } + /** + * List all monitors under the specified subscription. + * @param options The options parameters. + */ + public list( + options?: MonitorsListOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(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(options, settings); + }, + }; + } + + private async *listPagingPage( + options?: MonitorsListOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: MonitorsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + options?: MonitorsListOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * List all monitors under the specified resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: MonitorsListByResourceGroupOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, 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.listByResourceGroupPagingPage(resourceGroupName, options, settings); + }, + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: MonitorsListByResourceGroupOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: MonitorsListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext(resourceGroupName, continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: MonitorsListByResourceGroupOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage(resourceGroupName, options)) { + yield* page; + } + } + /** * List the api keys for a given monitor resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -85,13 +194,9 @@ export class MonitorsImpl implements Monitors { public listApiKeys( resourceGroupName: string, monitorName: string, - options?: MonitorsListApiKeysOptionalParams + options?: MonitorsListApiKeysOptionalParams, ): PagedAsyncIterableIterator { - const iter = this.listApiKeysPagingAll( - resourceGroupName, - monitorName, - options - ); + const iter = this.listApiKeysPagingAll(resourceGroupName, monitorName, options); return { next() { return iter.next(); @@ -103,13 +208,8 @@ export class MonitorsImpl implements Monitors { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listApiKeysPagingPage( - resourceGroupName, - monitorName, - options, - settings - ); - } + return this.listApiKeysPagingPage(resourceGroupName, monitorName, options, settings); + }, }; } @@ -117,7 +217,7 @@ export class MonitorsImpl implements Monitors { resourceGroupName: string, monitorName: string, options?: MonitorsListApiKeysOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: MonitorsListApiKeysResponse; let continuationToken = settings?.continuationToken; @@ -133,7 +233,7 @@ export class MonitorsImpl implements Monitors { resourceGroupName, monitorName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -145,13 +245,9 @@ export class MonitorsImpl implements Monitors { private async *listApiKeysPagingAll( resourceGroupName: string, monitorName: string, - options?: MonitorsListApiKeysOptionalParams + options?: MonitorsListApiKeysOptionalParams, ): AsyncIterableIterator { - for await (const page of this.listApiKeysPagingPage( - resourceGroupName, - monitorName, - options - )) { + for await (const page of this.listApiKeysPagingPage(resourceGroupName, monitorName, options)) { yield* page; } } @@ -165,13 +261,9 @@ export class MonitorsImpl implements Monitors { public listHosts( resourceGroupName: string, monitorName: string, - options?: MonitorsListHostsOptionalParams + options?: MonitorsListHostsOptionalParams, ): PagedAsyncIterableIterator { - const iter = this.listHostsPagingAll( - resourceGroupName, - monitorName, - options - ); + const iter = this.listHostsPagingAll(resourceGroupName, monitorName, options); return { next() { return iter.next(); @@ -183,13 +275,8 @@ export class MonitorsImpl implements Monitors { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listHostsPagingPage( - resourceGroupName, - monitorName, - options, - settings - ); - } + return this.listHostsPagingPage(resourceGroupName, monitorName, options, settings); + }, }; } @@ -197,7 +284,7 @@ export class MonitorsImpl implements Monitors { resourceGroupName: string, monitorName: string, options?: MonitorsListHostsOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: MonitorsListHostsResponse; let continuationToken = settings?.continuationToken; @@ -213,7 +300,7 @@ export class MonitorsImpl implements Monitors { resourceGroupName, monitorName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -225,13 +312,9 @@ export class MonitorsImpl implements Monitors { private async *listHostsPagingAll( resourceGroupName: string, monitorName: string, - options?: MonitorsListHostsOptionalParams + options?: MonitorsListHostsOptionalParams, ): AsyncIterableIterator { - for await (const page of this.listHostsPagingPage( - resourceGroupName, - monitorName, - options - )) { + for await (const page of this.listHostsPagingPage(resourceGroupName, monitorName, options)) { yield* page; } } @@ -245,13 +328,9 @@ export class MonitorsImpl implements Monitors { public listLinkedResources( resourceGroupName: string, monitorName: string, - options?: MonitorsListLinkedResourcesOptionalParams + options?: MonitorsListLinkedResourcesOptionalParams, ): PagedAsyncIterableIterator { - const iter = this.listLinkedResourcesPagingAll( - resourceGroupName, - monitorName, - options - ); + const iter = this.listLinkedResourcesPagingAll(resourceGroupName, monitorName, options); return { next() { return iter.next(); @@ -267,9 +346,9 @@ export class MonitorsImpl implements Monitors { resourceGroupName, monitorName, options, - settings + settings, ); - } + }, }; } @@ -277,16 +356,12 @@ export class MonitorsImpl implements Monitors { resourceGroupName: string, monitorName: string, options?: MonitorsListLinkedResourcesOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: MonitorsListLinkedResourcesResponse; let continuationToken = settings?.continuationToken; if (!continuationToken) { - result = await this._listLinkedResources( - resourceGroupName, - monitorName, - options - ); + result = await this._listLinkedResources(resourceGroupName, monitorName, options); let page = result.value || []; continuationToken = result.nextLink; setContinuationToken(page, continuationToken); @@ -297,7 +372,7 @@ export class MonitorsImpl implements Monitors { resourceGroupName, monitorName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -309,12 +384,12 @@ export class MonitorsImpl implements Monitors { private async *listLinkedResourcesPagingAll( resourceGroupName: string, monitorName: string, - options?: MonitorsListLinkedResourcesOptionalParams + options?: MonitorsListLinkedResourcesOptionalParams, ): AsyncIterableIterator { for await (const page of this.listLinkedResourcesPagingPage( resourceGroupName, monitorName, - options + options, )) { yield* page; } @@ -329,13 +404,9 @@ export class MonitorsImpl implements Monitors { public listMonitoredResources( resourceGroupName: string, monitorName: string, - options?: MonitorsListMonitoredResourcesOptionalParams + options?: MonitorsListMonitoredResourcesOptionalParams, ): PagedAsyncIterableIterator { - const iter = this.listMonitoredResourcesPagingAll( - resourceGroupName, - monitorName, - options - ); + const iter = this.listMonitoredResourcesPagingAll(resourceGroupName, monitorName, options); return { next() { return iter.next(); @@ -351,9 +422,9 @@ export class MonitorsImpl implements Monitors { resourceGroupName, monitorName, options, - settings + settings, ); - } + }, }; } @@ -361,16 +432,12 @@ export class MonitorsImpl implements Monitors { resourceGroupName: string, monitorName: string, options?: MonitorsListMonitoredResourcesOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: MonitorsListMonitoredResourcesResponse; let continuationToken = settings?.continuationToken; if (!continuationToken) { - result = await this._listMonitoredResources( - resourceGroupName, - monitorName, - options - ); + result = await this._listMonitoredResources(resourceGroupName, monitorName, options); let page = result.value || []; continuationToken = result.nextLink; setContinuationToken(page, continuationToken); @@ -381,7 +448,7 @@ export class MonitorsImpl implements Monitors { resourceGroupName, monitorName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -393,12 +460,12 @@ export class MonitorsImpl implements Monitors { private async *listMonitoredResourcesPagingAll( resourceGroupName: string, monitorName: string, - options?: MonitorsListMonitoredResourcesOptionalParams + options?: MonitorsListMonitoredResourcesOptionalParams, ): AsyncIterableIterator { for await (const page of this.listMonitoredResourcesPagingPage( resourceGroupName, monitorName, - options + options, )) { yield* page; } @@ -408,54 +475,8 @@ export class MonitorsImpl implements Monitors { * List all monitors under the specified subscription. * @param options The options parameters. */ - public list( - options?: MonitorsListOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(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(options, settings); - } - }; - } - - private async *listPagingPage( - options?: MonitorsListOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: MonitorsListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext(continuationToken, options); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - options?: MonitorsListOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } + private _list(options?: MonitorsListOptionalParams): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); } /** @@ -463,211 +484,30 @@ export class MonitorsImpl implements Monitors { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param options The options parameters. */ - public listByResourceGroup( + private _listByResourceGroup( resourceGroupName: string, - options?: MonitorsListByResourceGroupOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listByResourceGroupPagingAll(resourceGroupName, 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.listByResourceGroupPagingPage( - resourceGroupName, - options, - settings - ); - } - }; + options?: MonitorsListByResourceGroupOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec, + ); } - private async *listByResourceGroupPagingPage( - resourceGroupName: string, - options?: MonitorsListByResourceGroupOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: MonitorsListByResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByResourceGroup(resourceGroupName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByResourceGroupNext( - resourceGroupName, - continuationToken, - options - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByResourceGroupPagingAll( - resourceGroupName: string, - options?: MonitorsListByResourceGroupOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listByResourceGroupPagingPage( - resourceGroupName, - options - )) { - yield* page; - } - } - - /** - * List the api keys for a given monitor resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param monitorName Monitor resource name - * @param options The options parameters. - */ - private _listApiKeys( - resourceGroupName: string, - monitorName: string, - options?: MonitorsListApiKeysOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, monitorName, options }, - listApiKeysOperationSpec - ); - } - - /** - * Get the default api key. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param monitorName Monitor resource name - * @param options The options parameters. - */ - getDefaultKey( - resourceGroupName: string, - monitorName: string, - options?: MonitorsGetDefaultKeyOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, monitorName, options }, - getDefaultKeyOperationSpec - ); - } - - /** - * Set the default api key. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param monitorName Monitor resource name - * @param options The options parameters. - */ - setDefaultKey( + /** + * Get the properties of a specific monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + get( resourceGroupName: string, monitorName: string, - options?: MonitorsSetDefaultKeyOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, monitorName, options }, - setDefaultKeyOperationSpec - ); - } - - /** - * List the hosts for a given monitor resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param monitorName Monitor resource name - * @param options The options parameters. - */ - private _listHosts( - resourceGroupName: string, - monitorName: string, - options?: MonitorsListHostsOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, monitorName, options }, - listHostsOperationSpec - ); - } - - /** - * List all Azure resources associated to the same Datadog organization as the target resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param monitorName Monitor resource name - * @param options The options parameters. - */ - private _listLinkedResources( - resourceGroupName: string, - monitorName: string, - options?: MonitorsListLinkedResourcesOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, monitorName, options }, - listLinkedResourcesOperationSpec - ); - } - - /** - * List the resources currently being monitored by the Datadog monitor resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param monitorName Monitor resource name - * @param options The options parameters. - */ - private _listMonitoredResources( - resourceGroupName: string, - monitorName: string, - options?: MonitorsListMonitoredResourcesOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, monitorName, options }, - listMonitoredResourcesOperationSpec - ); - } - - /** - * List all monitors under the specified subscription. - * @param options The options parameters. - */ - private _list( - options?: MonitorsListOptionalParams - ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); - } - - /** - * List all monitors under the specified resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - private _listByResourceGroup( - resourceGroupName: string, - options?: MonitorsListByResourceGroupOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listByResourceGroupOperationSpec - ); - } - - /** - * Get the properties of a specific monitor resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param monitorName Monitor resource name - * @param options The options parameters. - */ - get( - resourceGroupName: string, - monitorName: string, - options?: MonitorsGetOptionalParams + options?: MonitorsGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, monitorName, options }, - getOperationSpec + getOperationSpec, ); } @@ -675,35 +515,30 @@ export class MonitorsImpl implements Monitors { * Create a monitor resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Monitor resource name + * @param body * @param options The options parameters. */ async beginCreate( resourceGroupName: string, monitorName: string, - options?: MonitorsCreateOptionalParams - ): Promise< - SimplePollerLike< - OperationState, - MonitorsCreateResponse - > - > { + body: DatadogMonitorResource, + options?: MonitorsCreateOptionalParams, + ): Promise, MonitorsCreateResponse>> { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -712,8 +547,8 @@ export class MonitorsImpl implements Monitors { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -721,15 +556,15 @@ export class MonitorsImpl implements Monitors { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, - args: { resourceGroupName, monitorName, options }, - spec: createOperationSpec + args: { resourceGroupName, monitorName, body, options }, + spec: createOperationSpec, }); const poller = await createHttpPoller< MonitorsCreateResponse, @@ -737,7 +572,7 @@ export class MonitorsImpl implements Monitors { >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation", }); await poller.poll(); return poller; @@ -747,18 +582,16 @@ export class MonitorsImpl implements Monitors { * Create a monitor resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Monitor resource name + * @param body * @param options The options parameters. */ async beginCreateAndWait( resourceGroupName: string, monitorName: string, - options?: MonitorsCreateOptionalParams + body: DatadogMonitorResource, + options?: MonitorsCreateOptionalParams, ): Promise { - const poller = await this.beginCreate( - resourceGroupName, - monitorName, - options - ); + const poller = await this.beginCreate(resourceGroupName, monitorName, body, options); return poller.pollUntilDone(); } @@ -766,35 +599,30 @@ export class MonitorsImpl implements Monitors { * Update a monitor resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Monitor resource name + * @param body The parameters for a PATCH request to a monitor resource. * @param options The options parameters. */ async beginUpdate( resourceGroupName: string, monitorName: string, - options?: MonitorsUpdateOptionalParams - ): Promise< - SimplePollerLike< - OperationState, - MonitorsUpdateResponse - > - > { + body: DatadogMonitorResourceUpdateParameters, + options?: MonitorsUpdateOptionalParams, + ): Promise, MonitorsUpdateResponse>> { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -803,8 +631,8 @@ export class MonitorsImpl implements Monitors { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -812,22 +640,23 @@ export class MonitorsImpl implements Monitors { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, - args: { resourceGroupName, monitorName, options }, - spec: updateOperationSpec + args: { resourceGroupName, monitorName, body, options }, + spec: updateOperationSpec, }); const poller = await createHttpPoller< MonitorsUpdateResponse, OperationState >(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", }); await poller.poll(); return poller; @@ -837,18 +666,16 @@ export class MonitorsImpl implements Monitors { * Update a monitor resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Monitor resource name + * @param body The parameters for a PATCH request to a monitor resource. * @param options The options parameters. */ async beginUpdateAndWait( resourceGroupName: string, monitorName: string, - options?: MonitorsUpdateOptionalParams + body: DatadogMonitorResourceUpdateParameters, + options?: MonitorsUpdateOptionalParams, ): Promise { - const poller = await this.beginUpdate( - resourceGroupName, - monitorName, - options - ); + const poller = await this.beginUpdate(resourceGroupName, monitorName, body, options); return poller.pollUntilDone(); } @@ -861,25 +688,23 @@ export class MonitorsImpl implements Monitors { async beginDelete( resourceGroupName: string, monitorName: string, - options?: MonitorsDeleteOptionalParams + options?: MonitorsDeleteOptionalParams, ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -888,8 +713,8 @@ export class MonitorsImpl implements Monitors { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -897,19 +722,20 @@ export class MonitorsImpl implements Monitors { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { resourceGroupName, monitorName, options }, - spec: deleteOperationSpec + spec: deleteOperationSpec, }); const poller = await createHttpPoller>(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", }); await poller.poll(); return poller; @@ -924,16 +750,97 @@ export class MonitorsImpl implements Monitors { async beginDeleteAndWait( resourceGroupName: string, monitorName: string, - options?: MonitorsDeleteOptionalParams + options?: MonitorsDeleteOptionalParams, ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - monitorName, - options - ); + const poller = await this.beginDelete(resourceGroupName, monitorName, options); return poller.pollUntilDone(); } + /** + * Get the default api key. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + getDefaultKey( + resourceGroupName: string, + monitorName: string, + options?: MonitorsGetDefaultKeyOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, options }, + getDefaultKeyOperationSpec, + ); + } + + /** + * List the api keys for a given monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + private _listApiKeys( + resourceGroupName: string, + monitorName: string, + options?: MonitorsListApiKeysOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, options }, + listApiKeysOperationSpec, + ); + } + + /** + * List the hosts for a given monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + private _listHosts( + resourceGroupName: string, + monitorName: string, + options?: MonitorsListHostsOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, options }, + listHostsOperationSpec, + ); + } + + /** + * List all Azure resources associated to the same Datadog organization as the target resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + private _listLinkedResources( + resourceGroupName: string, + monitorName: string, + options?: MonitorsListLinkedResourcesOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, options }, + listLinkedResourcesOperationSpec, + ); + } + + /** + * List the resources currently being monitored by the Datadog monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + private _listMonitoredResources( + resourceGroupName: string, + monitorName: string, + options?: MonitorsListMonitoredResourcesOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, options }, + listMonitoredResourcesOperationSpec, + ); + } + /** * Refresh the set password link and return a latest one. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -943,11 +850,57 @@ export class MonitorsImpl implements Monitors { refreshSetPasswordLink( resourceGroupName: string, monitorName: string, - options?: MonitorsRefreshSetPasswordLinkOptionalParams + options?: MonitorsRefreshSetPasswordLinkOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, monitorName, options }, - refreshSetPasswordLinkOperationSpec + refreshSetPasswordLinkOperationSpec, + ); + } + + /** + * Set the default api key. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + setDefaultKey( + resourceGroupName: string, + monitorName: string, + options?: MonitorsSetDefaultKeyOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, options }, + setDefaultKeyOperationSpec, + ); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: MonitorsListNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: MonitorsListByResourceGroupNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec, ); } @@ -962,11 +915,11 @@ export class MonitorsImpl implements Monitors { resourceGroupName: string, monitorName: string, nextLink: string, - options?: MonitorsListApiKeysNextOptionalParams + options?: MonitorsListApiKeysNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, monitorName, nextLink, options }, - listApiKeysNextOperationSpec + listApiKeysNextOperationSpec, ); } @@ -981,11 +934,11 @@ export class MonitorsImpl implements Monitors { resourceGroupName: string, monitorName: string, nextLink: string, - options?: MonitorsListHostsNextOptionalParams + options?: MonitorsListHostsNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, monitorName, nextLink, options }, - listHostsNextOperationSpec + listHostsNextOperationSpec, ); } @@ -1000,11 +953,11 @@ export class MonitorsImpl implements Monitors { resourceGroupName: string, monitorName: string, nextLink: string, - options?: MonitorsListLinkedResourcesNextOptionalParams + options?: MonitorsListLinkedResourcesNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, monitorName, nextLink, options }, - listLinkedResourcesNextOperationSpec + listLinkedResourcesNextOperationSpec, ); } @@ -1019,102 +972,89 @@ export class MonitorsImpl implements Monitors { resourceGroupName: string, monitorName: string, nextLink: string, - options?: MonitorsListMonitoredResourcesNextOptionalParams + options?: MonitorsListMonitoredResourcesNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, monitorName, nextLink, options }, - listMonitoredResourcesNextOperationSpec - ); - } - - /** - * ListNext - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - nextLink: string, - options?: MonitorsListNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec - ); - } - - /** - * ListByResourceGroupNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. - * @param options The options parameters. - */ - private _listByResourceGroupNext( - resourceGroupName: string, - nextLink: string, - options?: MonitorsListByResourceGroupNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec + listMonitoredResourcesNextOperationSpec, ); } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); -const listApiKeysOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listApiKeys", - httpMethod: "POST", +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/monitors", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DatadogApiKeyListResponse + bodyMapper: Mappers.DatadogMonitorResourceListResponse, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.monitorName - ], + urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; -const getDefaultKeyOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/getDefaultKey", - httpMethod: "POST", +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DatadogApiKey + bodyMapper: Mappers.DatadogMonitorResourceListResponse, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DatadogMonitorResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.monitorName + Parameters.monitorName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const setDefaultKeyOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/setDefaultKey", - httpMethod: "POST", +const createOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}", + httpMethod: "PUT", responses: { - 200: {}, + 200: { + bodyMapper: Mappers.DatadogMonitorResource, + }, + 201: { + bodyMapper: Mappers.DatadogMonitorResource, + }, + 202: { + bodyMapper: Mappers.DatadogMonitorResource, + }, + 204: { + bodyMapper: Mappers.DatadogMonitorResource, + }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.body1, queryParameters: [Parameters.apiVersion], @@ -1122,368 +1062,329 @@ const setDefaultKeyOperationSpec: coreClient.OperationSpec = { Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.monitorName + Parameters.monitorName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; -const listHostsOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listHosts", - httpMethod: "POST", +const updateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}", + httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.DatadogHostListResponse + bodyMapper: Mappers.DatadogMonitorResource, + }, + 201: { + bodyMapper: Mappers.DatadogMonitorResource, + }, + 202: { + bodyMapper: Mappers.DatadogMonitorResource, + }, + 204: { + bodyMapper: Mappers.DatadogMonitorResource, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, + requestBody: Parameters.body2, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.monitorName + Parameters.monitorName, ], - headerParameters: [Parameters.accept], - serializer + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, }; -const listLinkedResourcesOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listLinkedResources", - httpMethod: "POST", +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}", + httpMethod: "DELETE", responses: { - 200: { - bodyMapper: Mappers.LinkedResourceListResponse - }, + 200: {}, + 201: {}, + 202: {}, + 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.monitorName + Parameters.monitorName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listMonitoredResourcesOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listMonitoredResources", +const getDefaultKeyOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/getDefaultKey", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.MonitoredResourceListResponse + bodyMapper: Mappers.DatadogApiKey, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.monitorName + Parameters.monitorName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/monitors", - httpMethod: "GET", +const listApiKeysOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listApiKeys", + httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.DatadogMonitorResourceListResponse + bodyMapper: Mappers.DatadogApiKeyListResponse, }, default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer -}; -const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DatadogMonitorResourceListResponse + bodyMapper: Mappers.ErrorResponse, }, - default: { - bodyMapper: Mappers.ErrorResponse - } }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.resourceGroupName, + Parameters.monitorName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}", - httpMethod: "GET", +const listHostsOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listHosts", + httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.DatadogMonitorResource + bodyMapper: Mappers.DatadogHostListResponse, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.monitorName + Parameters.monitorName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const createOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}", - httpMethod: "PUT", +const listLinkedResourcesOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listLinkedResources", + httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.DatadogMonitorResource - }, - 201: { - bodyMapper: Mappers.DatadogMonitorResource - }, - 202: { - bodyMapper: Mappers.DatadogMonitorResource - }, - 204: { - bodyMapper: Mappers.DatadogMonitorResource + bodyMapper: Mappers.LinkedResourceListResponse, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - requestBody: Parameters.body2, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.monitorName + Parameters.monitorName, ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer + headerParameters: [Parameters.accept], + serializer, }; -const updateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}", - httpMethod: "PATCH", +const listMonitoredResourcesOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listMonitoredResources", + httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.DatadogMonitorResource - }, - 201: { - bodyMapper: Mappers.DatadogMonitorResource - }, - 202: { - bodyMapper: Mappers.DatadogMonitorResource - }, - 204: { - bodyMapper: Mappers.DatadogMonitorResource + bodyMapper: Mappers.MonitoredResourceListResponse, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - requestBody: Parameters.body3, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.monitorName + Parameters.monitorName, ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer + headerParameters: [Parameters.accept], + serializer, }; -const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}", - httpMethod: "DELETE", +const refreshSetPasswordLinkOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/refreshSetPasswordLink", + httpMethod: "POST", responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, + 200: { + bodyMapper: Mappers.DatadogSetPasswordLink, + }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.monitorName + Parameters.monitorName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const refreshSetPasswordLinkOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/refreshSetPasswordLink", +const setDefaultKeyOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/setDefaultKey", httpMethod: "POST", responses: { - 200: { - bodyMapper: Mappers.DatadogSetPasswordLink - }, + 200: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, + requestBody: Parameters.body3, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.monitorName + Parameters.monitorName, ], - headerParameters: [Parameters.accept], - serializer + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, }; -const listApiKeysNextOperationSpec: coreClient.OperationSpec = { +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DatadogApiKeyListResponse + bodyMapper: Mappers.DatadogMonitorResourceListResponse, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.nextLink, - Parameters.resourceGroupName, - Parameters.monitorName - ], + urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listHostsNextOperationSpec: coreClient.OperationSpec = { +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DatadogHostListResponse + bodyMapper: Mappers.DatadogMonitorResourceListResponse, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.nextLink, + Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.monitorName ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listLinkedResourcesNextOperationSpec: coreClient.OperationSpec = { +const listApiKeysNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.LinkedResourceListResponse + bodyMapper: Mappers.DatadogApiKeyListResponse, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.nextLink, + Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.monitorName + Parameters.monitorName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listMonitoredResourcesNextOperationSpec: coreClient.OperationSpec = { +const listHostsNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.MonitoredResourceListResponse + bodyMapper: Mappers.DatadogHostListResponse, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.nextLink, + Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.monitorName + Parameters.monitorName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listNextOperationSpec: coreClient.OperationSpec = { +const listLinkedResourcesNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DatadogMonitorResourceListResponse + bodyMapper: Mappers.LinkedResourceListResponse, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, + Parameters.nextLink, Parameters.subscriptionId, - Parameters.nextLink + Parameters.resourceGroupName, + Parameters.monitorName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { +const listMonitoredResourcesNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DatadogMonitorResourceListResponse + bodyMapper: Mappers.MonitoredResourceListResponse, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.nextLink, - Parameters.resourceGroupName + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/datadog/arm-datadog/src/operations/operations.ts b/sdk/datadog/arm-datadog/src/operations/operations.ts index 68a17687b08f..11b9c2a4c1b6 100644 --- a/sdk/datadog/arm-datadog/src/operations/operations.ts +++ b/sdk/datadog/arm-datadog/src/operations/operations.ts @@ -18,7 +18,7 @@ import { OperationsListNextOptionalParams, OperationsListOptionalParams, OperationsListResponse, - OperationsListNextResponse + OperationsListNextResponse, } from "../models/index.js"; /// @@ -35,12 +35,10 @@ export class OperationsImpl implements Operations { } /** - * List all operations provided by Microsoft.Datadog for the 2023-01-01 api version. + * List the operations for the provider * @param options The options parameters. */ - public list( - options?: OperationsListOptionalParams - ): PagedAsyncIterableIterator { + public list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { next() { @@ -54,13 +52,13 @@ export class OperationsImpl implements Operations { throw new Error("maxPageSize is not supported by this operation."); } return this.listPagingPage(options, settings); - } + }, }; } private async *listPagingPage( options?: OperationsListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: OperationsListResponse; let continuationToken = settings?.continuationToken; @@ -81,7 +79,7 @@ export class OperationsImpl implements Operations { } private async *listPagingAll( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; @@ -89,12 +87,10 @@ export class OperationsImpl implements Operations { } /** - * List all operations provided by Microsoft.Datadog for the 2023-01-01 api version. + * List the operations for the provider * @param options The options parameters. */ - private _list( - options?: OperationsListOptionalParams - ): Promise { + private _list(options?: OperationsListOptionalParams): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -105,12 +101,9 @@ export class OperationsImpl implements Operations { */ private _listNext( nextLink: string, - options?: OperationsListNextOptionalParams + options?: OperationsListNextOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec - ); + return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec); } } // Operation Specifications @@ -121,29 +114,29 @@ const listOperationSpec: coreClient.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResult + bodyMapper: Mappers.OperationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResult + bodyMapper: Mappers.OperationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/datadog/arm-datadog/src/operations/singleSignOnConfigurations.ts b/sdk/datadog/arm-datadog/src/operations/singleSignOnConfigurations.ts index 63a849c389a0..d4a89f5d63ad 100644 --- a/sdk/datadog/arm-datadog/src/operations/singleSignOnConfigurations.ts +++ b/sdk/datadog/arm-datadog/src/operations/singleSignOnConfigurations.ts @@ -13,28 +13,23 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers.js"; import * as Parameters from "../models/parameters.js"; import { MicrosoftDatadogClient } from "../microsoftDatadogClient.js"; -import { - SimplePollerLike, - OperationState, - createHttpPoller -} from "@azure/core-lro"; +import { SimplePollerLike, OperationState, createHttpPoller } from "@azure/core-lro"; import { createLroSpec } from "../lroImpl.js"; import { DatadogSingleSignOnResource, SingleSignOnConfigurationsListNextOptionalParams, SingleSignOnConfigurationsListOptionalParams, SingleSignOnConfigurationsListResponse, - SingleSignOnConfigurationsCreateOrUpdateOptionalParams, - SingleSignOnConfigurationsCreateOrUpdateResponse, SingleSignOnConfigurationsGetOptionalParams, SingleSignOnConfigurationsGetResponse, - SingleSignOnConfigurationsListNextResponse + SingleSignOnConfigurationsCreateOrUpdateOptionalParams, + SingleSignOnConfigurationsCreateOrUpdateResponse, + SingleSignOnConfigurationsListNextResponse, } from "../models/index.js"; /// /** Class containing SingleSignOnConfigurations operations. */ -export class SingleSignOnConfigurationsImpl - implements SingleSignOnConfigurations { +export class SingleSignOnConfigurationsImpl implements SingleSignOnConfigurations { private readonly client: MicrosoftDatadogClient; /** @@ -54,7 +49,7 @@ export class SingleSignOnConfigurationsImpl public list( resourceGroupName: string, monitorName: string, - options?: SingleSignOnConfigurationsListOptionalParams + options?: SingleSignOnConfigurationsListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(resourceGroupName, monitorName, options); return { @@ -68,13 +63,8 @@ export class SingleSignOnConfigurationsImpl if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listPagingPage( - resourceGroupName, - monitorName, - options, - settings - ); - } + return this.listPagingPage(resourceGroupName, monitorName, options, settings); + }, }; } @@ -82,7 +72,7 @@ export class SingleSignOnConfigurationsImpl resourceGroupName: string, monitorName: string, options?: SingleSignOnConfigurationsListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: SingleSignOnConfigurationsListResponse; let continuationToken = settings?.continuationToken; @@ -94,12 +84,7 @@ export class SingleSignOnConfigurationsImpl yield page; } while (continuationToken) { - result = await this._listNext( - resourceGroupName, - monitorName, - continuationToken, - options - ); + result = await this._listNext(resourceGroupName, monitorName, continuationToken, options); continuationToken = result.nextLink; let page = result.value || []; setContinuationToken(page, continuationToken); @@ -110,13 +95,9 @@ export class SingleSignOnConfigurationsImpl private async *listPagingAll( resourceGroupName: string, monitorName: string, - options?: SingleSignOnConfigurationsListOptionalParams + options?: SingleSignOnConfigurationsListOptionalParams, ): AsyncIterableIterator { - for await (const page of this.listPagingPage( - resourceGroupName, - monitorName, - options - )) { + for await (const page of this.listPagingPage(resourceGroupName, monitorName, options)) { yield* page; } } @@ -130,11 +111,30 @@ export class SingleSignOnConfigurationsImpl private _list( resourceGroupName: string, monitorName: string, - options?: SingleSignOnConfigurationsListOptionalParams + options?: SingleSignOnConfigurationsListOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, monitorName, options }, - listOperationSpec + listOperationSpec, + ); + } + + /** + * Gets the datadog single sign-on resource for the given Monitor. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param configurationName Configuration name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + monitorName: string, + configurationName: string, + options?: SingleSignOnConfigurationsGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, configurationName, options }, + getOperationSpec, ); } @@ -143,13 +143,16 @@ export class SingleSignOnConfigurationsImpl * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Monitor resource name * @param configurationName Configuration name + * @param body Concrete proxy resource types can be created by aliasing this type using a specific + * property type. * @param options The options parameters. */ async beginCreateOrUpdate( resourceGroupName: string, monitorName: string, configurationName: string, - options?: SingleSignOnConfigurationsCreateOrUpdateOptionalParams + body: DatadogSingleSignOnResource, + options?: SingleSignOnConfigurationsCreateOrUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -158,21 +161,19 @@ export class SingleSignOnConfigurationsImpl > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -181,8 +182,8 @@ export class SingleSignOnConfigurationsImpl ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -190,15 +191,21 @@ export class SingleSignOnConfigurationsImpl rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, - args: { resourceGroupName, monitorName, configurationName, options }, - spec: createOrUpdateOperationSpec + args: { + resourceGroupName, + monitorName, + configurationName, + body, + options, + }, + spec: createOrUpdateOperationSpec, }); const poller = await createHttpPoller< SingleSignOnConfigurationsCreateOrUpdateResponse, @@ -206,7 +213,7 @@ export class SingleSignOnConfigurationsImpl >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation", }); await poller.poll(); return poller; @@ -217,42 +224,27 @@ export class SingleSignOnConfigurationsImpl * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Monitor resource name * @param configurationName Configuration name + * @param body Concrete proxy resource types can be created by aliasing this type using a specific + * property type. * @param options The options parameters. */ async beginCreateOrUpdateAndWait( resourceGroupName: string, monitorName: string, configurationName: string, - options?: SingleSignOnConfigurationsCreateOrUpdateOptionalParams + body: DatadogSingleSignOnResource, + options?: SingleSignOnConfigurationsCreateOrUpdateOptionalParams, ): Promise { const poller = await this.beginCreateOrUpdate( resourceGroupName, monitorName, configurationName, - options + body, + options, ); return poller.pollUntilDone(); } - /** - * Gets the datadog single sign-on resource for the given Monitor. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param monitorName Monitor resource name - * @param configurationName Configuration name - * @param options The options parameters. - */ - get( - resourceGroupName: string, - monitorName: string, - configurationName: string, - options?: SingleSignOnConfigurationsGetOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, monitorName, configurationName, options }, - getOperationSpec - ); - } - /** * ListNext * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -264,11 +256,11 @@ export class SingleSignOnConfigurationsImpl resourceGroupName: string, monitorName: string, nextLink: string, - options?: SingleSignOnConfigurationsListNextOptionalParams + options?: SingleSignOnConfigurationsListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, monitorName, nextLink, options }, - listNextOperationSpec + listNextOperationSpec, ); } } @@ -276,102 +268,99 @@ export class SingleSignOnConfigurationsImpl const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DatadogSingleSignOnResourceListResponse + bodyMapper: Mappers.DatadogSingleSignOnResourceListResponse, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.monitorName + Parameters.monitorName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}", - httpMethod: "PUT", +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DatadogSingleSignOnResource - }, - 201: { - bodyMapper: Mappers.DatadogSingleSignOnResource - }, - 202: { - bodyMapper: Mappers.DatadogSingleSignOnResource - }, - 204: { - bodyMapper: Mappers.DatadogSingleSignOnResource + bodyMapper: Mappers.DatadogSingleSignOnResource, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - requestBody: Parameters.body5, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.monitorName, - Parameters.configurationName + Parameters.configurationName, ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer + headerParameters: [Parameters.accept], + serializer, }; -const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}", - httpMethod: "GET", +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}", + httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.DatadogSingleSignOnResource + bodyMapper: Mappers.DatadogSingleSignOnResource, + }, + 201: { + bodyMapper: Mappers.DatadogSingleSignOnResource, + }, + 202: { + bodyMapper: Mappers.DatadogSingleSignOnResource, + }, + 204: { + bodyMapper: Mappers.DatadogSingleSignOnResource, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, + requestBody: Parameters.body5, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.monitorName, - Parameters.configurationName + Parameters.configurationName, ], - headerParameters: [Parameters.accept], - serializer + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DatadogSingleSignOnResourceListResponse + bodyMapper: Mappers.DatadogSingleSignOnResourceListResponse, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.nextLink, + Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.monitorName + Parameters.monitorName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/datadog/arm-datadog/src/operations/tagRules.ts b/sdk/datadog/arm-datadog/src/operations/tagRules.ts index 63fc1171118f..b363d19173ca 100644 --- a/sdk/datadog/arm-datadog/src/operations/tagRules.ts +++ b/sdk/datadog/arm-datadog/src/operations/tagRules.ts @@ -18,11 +18,11 @@ import { TagRulesListNextOptionalParams, TagRulesListOptionalParams, TagRulesListResponse, - TagRulesCreateOrUpdateOptionalParams, - TagRulesCreateOrUpdateResponse, TagRulesGetOptionalParams, TagRulesGetResponse, - TagRulesListNextResponse + TagRulesCreateOrUpdateOptionalParams, + TagRulesCreateOrUpdateResponse, + TagRulesListNextResponse, } from "../models/index.js"; /// @@ -47,7 +47,7 @@ export class TagRulesImpl implements TagRules { public list( resourceGroupName: string, monitorName: string, - options?: TagRulesListOptionalParams + options?: TagRulesListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(resourceGroupName, monitorName, options); return { @@ -61,13 +61,8 @@ export class TagRulesImpl implements TagRules { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listPagingPage( - resourceGroupName, - monitorName, - options, - settings - ); - } + return this.listPagingPage(resourceGroupName, monitorName, options, settings); + }, }; } @@ -75,7 +70,7 @@ export class TagRulesImpl implements TagRules { resourceGroupName: string, monitorName: string, options?: TagRulesListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: TagRulesListResponse; let continuationToken = settings?.continuationToken; @@ -87,12 +82,7 @@ export class TagRulesImpl implements TagRules { yield page; } while (continuationToken) { - result = await this._listNext( - resourceGroupName, - monitorName, - continuationToken, - options - ); + result = await this._listNext(resourceGroupName, monitorName, continuationToken, options); continuationToken = result.nextLink; let page = result.value || []; setContinuationToken(page, continuationToken); @@ -103,13 +93,9 @@ export class TagRulesImpl implements TagRules { private async *listPagingAll( resourceGroupName: string, monitorName: string, - options?: TagRulesListOptionalParams + options?: TagRulesListOptionalParams, ): AsyncIterableIterator { - for await (const page of this.listPagingPage( - resourceGroupName, - monitorName, - options - )) { + for await (const page of this.listPagingPage(resourceGroupName, monitorName, options)) { yield* page; } } @@ -123,49 +109,51 @@ export class TagRulesImpl implements TagRules { private _list( resourceGroupName: string, monitorName: string, - options?: TagRulesListOptionalParams + options?: TagRulesListOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, monitorName, options }, - listOperationSpec + listOperationSpec, ); } /** - * Create or update a tag rule set for a given monitor resource. + * Get a tag rule set for a given monitor resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Monitor resource name * @param ruleSetName Rule set name * @param options The options parameters. */ - createOrUpdate( + get( resourceGroupName: string, monitorName: string, ruleSetName: string, - options?: TagRulesCreateOrUpdateOptionalParams - ): Promise { + options?: TagRulesGetOptionalParams, + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, monitorName, ruleSetName, options }, - createOrUpdateOperationSpec + getOperationSpec, ); } /** - * Get a tag rule set for a given monitor resource. + * Create or update a tag rule set for a given monitor resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Monitor resource name * @param ruleSetName Rule set name + * @param body Capture logs and metrics of Azure resources based on ARM tags. * @param options The options parameters. */ - get( + createOrUpdate( resourceGroupName: string, monitorName: string, ruleSetName: string, - options?: TagRulesGetOptionalParams - ): Promise { + body: MonitoringTagRules, + options?: TagRulesCreateOrUpdateOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { resourceGroupName, monitorName, ruleSetName, options }, - getOperationSpec + { resourceGroupName, monitorName, ruleSetName, body, options }, + createOrUpdateOperationSpec, ); } @@ -180,11 +168,11 @@ export class TagRulesImpl implements TagRules { resourceGroupName: string, monitorName: string, nextLink: string, - options?: TagRulesListNextOptionalParams + options?: TagRulesListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, monitorName, nextLink, options }, - listNextOperationSpec + listNextOperationSpec, ); } } @@ -192,93 +180,90 @@ export class TagRulesImpl implements TagRules { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.MonitoringTagRulesListResponse + bodyMapper: Mappers.MonitoringTagRulesListResponse, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.monitorName + Parameters.monitorName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules/{ruleSetName}", - httpMethod: "PUT", +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules/{ruleSetName}", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.MonitoringTagRules + bodyMapper: Mappers.MonitoringTagRules, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - requestBody: Parameters.body4, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.monitorName, - Parameters.ruleSetName + Parameters.ruleSetName, ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer + headerParameters: [Parameters.accept], + serializer, }; -const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules/{ruleSetName}", - httpMethod: "GET", +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules/{ruleSetName}", + httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.MonitoringTagRules + bodyMapper: Mappers.MonitoringTagRules, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, + requestBody: Parameters.body6, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.monitorName, - Parameters.ruleSetName + Parameters.ruleSetName, ], - headerParameters: [Parameters.accept], - serializer + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.MonitoringTagRulesListResponse + bodyMapper: Mappers.MonitoringTagRulesListResponse, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.nextLink, + Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.monitorName + Parameters.monitorName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/datadog/arm-datadog/src/operationsInterfaces/billingInfo.ts b/sdk/datadog/arm-datadog/src/operationsInterfaces/billingInfo.ts new file mode 100644 index 000000000000..8083ba91a5f2 --- /dev/null +++ b/sdk/datadog/arm-datadog/src/operationsInterfaces/billingInfo.ts @@ -0,0 +1,24 @@ +/* + * 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 { BillingInfoGetOptionalParams, BillingInfoGetResponse } from "../models/index.js"; + +/** Interface representing a BillingInfo. */ +export interface BillingInfo { + /** + * Get marketplace and organization info mapped to the given monitor. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + monitorName: string, + options?: BillingInfoGetOptionalParams, + ): Promise; +} diff --git a/sdk/datadog/arm-datadog/src/operationsInterfaces/creationSupported.ts b/sdk/datadog/arm-datadog/src/operationsInterfaces/creationSupported.ts index e32a2cf2fea7..803e2c1829db 100644 --- a/sdk/datadog/arm-datadog/src/operationsInterfaces/creationSupported.ts +++ b/sdk/datadog/arm-datadog/src/operationsInterfaces/creationSupported.ts @@ -11,7 +11,7 @@ import { CreateResourceSupportedResponse, CreationSupportedListOptionalParams, CreationSupportedGetOptionalParams, - CreationSupportedGetResponse + CreationSupportedGetResponse, } from "../models/index.js"; /// @@ -24,7 +24,7 @@ export interface CreationSupported { */ list( datadogOrganizationId: string, - options?: CreationSupportedListOptionalParams + options?: CreationSupportedListOptionalParams, ): PagedAsyncIterableIterator; /** * Informs if the current subscription is being already monitored for selected Datadog organization. @@ -33,6 +33,6 @@ export interface CreationSupported { */ get( datadogOrganizationId: string, - options?: CreationSupportedGetOptionalParams + options?: CreationSupportedGetOptionalParams, ): Promise; } diff --git a/sdk/datadog/arm-datadog/src/operationsInterfaces/index.ts b/sdk/datadog/arm-datadog/src/operationsInterfaces/index.ts index 8b30e403c8fb..7ffb43cd8f8e 100644 --- a/sdk/datadog/arm-datadog/src/operationsInterfaces/index.ts +++ b/sdk/datadog/arm-datadog/src/operationsInterfaces/index.ts @@ -6,10 +6,11 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +export * from "./operations.js"; export * from "./marketplaceAgreements.js"; -export * from "./creationSupported.js"; export * from "./monitors.js"; -export * from "./operations.js"; -export * from "./tagRules.js"; -export * from "./singleSignOnConfigurations.js"; +export * from "./creationSupported.js"; +export * from "./billingInfo.js"; export * from "./monitoredSubscriptions.js"; +export * from "./singleSignOnConfigurations.js"; +export * from "./tagRules.js"; diff --git a/sdk/datadog/arm-datadog/src/operationsInterfaces/marketplaceAgreements.ts b/sdk/datadog/arm-datadog/src/operationsInterfaces/marketplaceAgreements.ts index 54ebf44ae013..eb8d47308474 100644 --- a/sdk/datadog/arm-datadog/src/operationsInterfaces/marketplaceAgreements.ts +++ b/sdk/datadog/arm-datadog/src/operationsInterfaces/marketplaceAgreements.ts @@ -11,7 +11,7 @@ import { DatadogAgreementResource, MarketplaceAgreementsListOptionalParams, MarketplaceAgreementsCreateOrUpdateOptionalParams, - MarketplaceAgreementsCreateOrUpdateResponse + MarketplaceAgreementsCreateOrUpdateResponse, } from "../models/index.js"; /// @@ -22,13 +22,15 @@ export interface MarketplaceAgreements { * @param options The options parameters. */ list( - options?: MarketplaceAgreementsListOptionalParams + options?: MarketplaceAgreementsListOptionalParams, ): PagedAsyncIterableIterator; /** * Create Datadog marketplace agreement in the subscription. + * @param body The request body * @param options The options parameters. */ createOrUpdate( - options?: MarketplaceAgreementsCreateOrUpdateOptionalParams + body: DatadogAgreementResource, + options?: MarketplaceAgreementsCreateOrUpdateOptionalParams, ): Promise; } diff --git a/sdk/datadog/arm-datadog/src/operationsInterfaces/monitoredSubscriptions.ts b/sdk/datadog/arm-datadog/src/operationsInterfaces/monitoredSubscriptions.ts index 072ce7a227ed..ff12efa7ff9e 100644 --- a/sdk/datadog/arm-datadog/src/operationsInterfaces/monitoredSubscriptions.ts +++ b/sdk/datadog/arm-datadog/src/operationsInterfaces/monitoredSubscriptions.ts @@ -17,7 +17,7 @@ import { MonitoredSubscriptionsCreateorUpdateResponse, MonitoredSubscriptionsUpdateOptionalParams, MonitoredSubscriptionsUpdateResponse, - MonitoredSubscriptionsDeleteOptionalParams + MonitoredSubscriptionsDeleteOptionalParams, } from "../models/index.js"; /// @@ -32,7 +32,7 @@ export interface MonitoredSubscriptions { list( resourceGroupName: string, monitorName: string, - options?: MonitoredSubscriptionsListOptionalParams + options?: MonitoredSubscriptionsListOptionalParams, ): PagedAsyncIterableIterator; /** * List the subscriptions currently being monitored by the Datadog monitor resource. @@ -45,20 +45,23 @@ export interface MonitoredSubscriptions { resourceGroupName: string, monitorName: string, configurationName: string, - options?: MonitoredSubscriptionsGetOptionalParams + options?: MonitoredSubscriptionsGetOptionalParams, ): Promise; /** * Add the subscriptions that should be monitored by the Datadog monitor resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Monitor resource name * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the Datadog monitor + * resource. * @param options The options parameters. */ beginCreateorUpdate( resourceGroupName: string, monitorName: string, configurationName: string, - options?: MonitoredSubscriptionsCreateorUpdateOptionalParams + body: MonitoredSubscriptionProperties, + options?: MonitoredSubscriptionsCreateorUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -70,26 +73,32 @@ export interface MonitoredSubscriptions { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Monitor resource name * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the Datadog monitor + * resource. * @param options The options parameters. */ beginCreateorUpdateAndWait( resourceGroupName: string, monitorName: string, configurationName: string, - options?: MonitoredSubscriptionsCreateorUpdateOptionalParams + body: MonitoredSubscriptionProperties, + options?: MonitoredSubscriptionsCreateorUpdateOptionalParams, ): Promise; /** * Updates the subscriptions that are being monitored by the Datadog monitor resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Monitor resource name * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the Datadog monitor + * resource. * @param options The options parameters. */ beginUpdate( resourceGroupName: string, monitorName: string, configurationName: string, - options?: MonitoredSubscriptionsUpdateOptionalParams + body: MonitoredSubscriptionProperties, + options?: MonitoredSubscriptionsUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -101,38 +110,41 @@ export interface MonitoredSubscriptions { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Monitor resource name * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the Datadog monitor + * resource. * @param options The options parameters. */ beginUpdateAndWait( resourceGroupName: string, monitorName: string, configurationName: string, - options?: MonitoredSubscriptionsUpdateOptionalParams + body: MonitoredSubscriptionProperties, + options?: MonitoredSubscriptionsUpdateOptionalParams, ): Promise; /** * Updates the subscriptions that are being monitored by the Datadog monitor resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Monitor resource name - * @param configurationName Configuration name + * @param configurationName The configuration name. Only 'default' value is supported. * @param options The options parameters. */ beginDelete( resourceGroupName: string, monitorName: string, configurationName: string, - options?: MonitoredSubscriptionsDeleteOptionalParams + options?: MonitoredSubscriptionsDeleteOptionalParams, ): Promise, void>>; /** * Updates the subscriptions that are being monitored by the Datadog monitor resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Monitor resource name - * @param configurationName Configuration name + * @param configurationName The configuration name. Only 'default' value is supported. * @param options The options parameters. */ beginDeleteAndWait( resourceGroupName: string, monitorName: string, configurationName: string, - options?: MonitoredSubscriptionsDeleteOptionalParams + options?: MonitoredSubscriptionsDeleteOptionalParams, ): Promise; } diff --git a/sdk/datadog/arm-datadog/src/operationsInterfaces/monitors.ts b/sdk/datadog/arm-datadog/src/operationsInterfaces/monitors.ts index a22091fbf495..d5e01c358223 100644 --- a/sdk/datadog/arm-datadog/src/operationsInterfaces/monitors.ts +++ b/sdk/datadog/arm-datadog/src/operationsInterfaces/monitors.ts @@ -9,6 +9,9 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { + DatadogMonitorResource, + MonitorsListOptionalParams, + MonitorsListByResourceGroupOptionalParams, DatadogApiKey, MonitorsListApiKeysOptionalParams, DatadogHost, @@ -17,26 +20,38 @@ import { MonitorsListLinkedResourcesOptionalParams, MonitoredResource, MonitorsListMonitoredResourcesOptionalParams, - DatadogMonitorResource, - MonitorsListOptionalParams, - MonitorsListByResourceGroupOptionalParams, - MonitorsGetDefaultKeyOptionalParams, - MonitorsGetDefaultKeyResponse, - MonitorsSetDefaultKeyOptionalParams, MonitorsGetOptionalParams, MonitorsGetResponse, MonitorsCreateOptionalParams, MonitorsCreateResponse, + DatadogMonitorResourceUpdateParameters, MonitorsUpdateOptionalParams, MonitorsUpdateResponse, MonitorsDeleteOptionalParams, + MonitorsGetDefaultKeyOptionalParams, + MonitorsGetDefaultKeyResponse, MonitorsRefreshSetPasswordLinkOptionalParams, - MonitorsRefreshSetPasswordLinkResponse + MonitorsRefreshSetPasswordLinkResponse, + MonitorsSetDefaultKeyOptionalParams, } from "../models/index.js"; /// /** Interface representing a Monitors. */ export interface Monitors { + /** + * List all monitors under the specified subscription. + * @param options The options parameters. + */ + list(options?: MonitorsListOptionalParams): PagedAsyncIterableIterator; + /** + * List all monitors under the specified resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: MonitorsListByResourceGroupOptionalParams, + ): PagedAsyncIterableIterator; /** * List the api keys for a given monitor resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -46,7 +61,7 @@ export interface Monitors { listApiKeys( resourceGroupName: string, monitorName: string, - options?: MonitorsListApiKeysOptionalParams + options?: MonitorsListApiKeysOptionalParams, ): PagedAsyncIterableIterator; /** * List the hosts for a given monitor resource. @@ -57,7 +72,7 @@ export interface Monitors { listHosts( resourceGroupName: string, monitorName: string, - options?: MonitorsListHostsOptionalParams + options?: MonitorsListHostsOptionalParams, ): PagedAsyncIterableIterator; /** * List all Azure resources associated to the same Datadog organization as the target resource. @@ -68,7 +83,7 @@ export interface Monitors { listLinkedResources( resourceGroupName: string, monitorName: string, - options?: MonitorsListLinkedResourcesOptionalParams + options?: MonitorsListLinkedResourcesOptionalParams, ): PagedAsyncIterableIterator; /** * List the resources currently being monitored by the Datadog monitor resource. @@ -79,46 +94,8 @@ export interface Monitors { listMonitoredResources( resourceGroupName: string, monitorName: string, - options?: MonitorsListMonitoredResourcesOptionalParams + options?: MonitorsListMonitoredResourcesOptionalParams, ): PagedAsyncIterableIterator; - /** - * List all monitors under the specified subscription. - * @param options The options parameters. - */ - list( - options?: MonitorsListOptionalParams - ): PagedAsyncIterableIterator; - /** - * List all monitors under the specified resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - listByResourceGroup( - resourceGroupName: string, - options?: MonitorsListByResourceGroupOptionalParams - ): PagedAsyncIterableIterator; - /** - * Get the default api key. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param monitorName Monitor resource name - * @param options The options parameters. - */ - getDefaultKey( - resourceGroupName: string, - monitorName: string, - options?: MonitorsGetDefaultKeyOptionalParams - ): Promise; - /** - * Set the default api key. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param monitorName Monitor resource name - * @param options The options parameters. - */ - setDefaultKey( - resourceGroupName: string, - monitorName: string, - options?: MonitorsSetDefaultKeyOptionalParams - ): Promise; /** * Get the properties of a specific monitor resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -128,61 +105,59 @@ export interface Monitors { get( resourceGroupName: string, monitorName: string, - options?: MonitorsGetOptionalParams + options?: MonitorsGetOptionalParams, ): Promise; /** * Create a monitor resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Monitor resource name + * @param body * @param options The options parameters. */ beginCreate( resourceGroupName: string, monitorName: string, - options?: MonitorsCreateOptionalParams - ): Promise< - SimplePollerLike< - OperationState, - MonitorsCreateResponse - > - >; + body: DatadogMonitorResource, + options?: MonitorsCreateOptionalParams, + ): Promise, MonitorsCreateResponse>>; /** * Create a monitor resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Monitor resource name + * @param body * @param options The options parameters. */ beginCreateAndWait( resourceGroupName: string, monitorName: string, - options?: MonitorsCreateOptionalParams + body: DatadogMonitorResource, + options?: MonitorsCreateOptionalParams, ): Promise; /** * Update a monitor resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Monitor resource name + * @param body The parameters for a PATCH request to a monitor resource. * @param options The options parameters. */ beginUpdate( resourceGroupName: string, monitorName: string, - options?: MonitorsUpdateOptionalParams - ): Promise< - SimplePollerLike< - OperationState, - MonitorsUpdateResponse - > - >; + body: DatadogMonitorResourceUpdateParameters, + options?: MonitorsUpdateOptionalParams, + ): Promise, MonitorsUpdateResponse>>; /** * Update a monitor resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Monitor resource name + * @param body The parameters for a PATCH request to a monitor resource. * @param options The options parameters. */ beginUpdateAndWait( resourceGroupName: string, monitorName: string, - options?: MonitorsUpdateOptionalParams + body: DatadogMonitorResourceUpdateParameters, + options?: MonitorsUpdateOptionalParams, ): Promise; /** * Delete a monitor resource. @@ -193,7 +168,7 @@ export interface Monitors { beginDelete( resourceGroupName: string, monitorName: string, - options?: MonitorsDeleteOptionalParams + options?: MonitorsDeleteOptionalParams, ): Promise, void>>; /** * Delete a monitor resource. @@ -204,8 +179,19 @@ export interface Monitors { beginDeleteAndWait( resourceGroupName: string, monitorName: string, - options?: MonitorsDeleteOptionalParams + options?: MonitorsDeleteOptionalParams, ): Promise; + /** + * Get the default api key. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + getDefaultKey( + resourceGroupName: string, + monitorName: string, + options?: MonitorsGetDefaultKeyOptionalParams, + ): Promise; /** * Refresh the set password link and return a latest one. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -215,6 +201,17 @@ export interface Monitors { refreshSetPasswordLink( resourceGroupName: string, monitorName: string, - options?: MonitorsRefreshSetPasswordLinkOptionalParams + options?: MonitorsRefreshSetPasswordLinkOptionalParams, ): Promise; + /** + * Set the default api key. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + setDefaultKey( + resourceGroupName: string, + monitorName: string, + options?: MonitorsSetDefaultKeyOptionalParams, + ): Promise; } diff --git a/sdk/datadog/arm-datadog/src/operationsInterfaces/operations.ts b/sdk/datadog/arm-datadog/src/operationsInterfaces/operations.ts index 780d923d2604..06ba4964ada5 100644 --- a/sdk/datadog/arm-datadog/src/operationsInterfaces/operations.ts +++ b/sdk/datadog/arm-datadog/src/operationsInterfaces/operations.ts @@ -13,10 +13,8 @@ import { OperationResult, OperationsListOptionalParams } from "../models/index.j /** Interface representing a Operations. */ export interface Operations { /** - * List all operations provided by Microsoft.Datadog for the 2023-01-01 api version. + * List the operations for the provider * @param options The options parameters. */ - list( - options?: OperationsListOptionalParams - ): PagedAsyncIterableIterator; + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; } diff --git a/sdk/datadog/arm-datadog/src/operationsInterfaces/singleSignOnConfigurations.ts b/sdk/datadog/arm-datadog/src/operationsInterfaces/singleSignOnConfigurations.ts index 0a4e3ec1b18a..23f92d63abf6 100644 --- a/sdk/datadog/arm-datadog/src/operationsInterfaces/singleSignOnConfigurations.ts +++ b/sdk/datadog/arm-datadog/src/operationsInterfaces/singleSignOnConfigurations.ts @@ -11,10 +11,10 @@ import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { DatadogSingleSignOnResource, SingleSignOnConfigurationsListOptionalParams, + SingleSignOnConfigurationsGetOptionalParams, + SingleSignOnConfigurationsGetResponse, SingleSignOnConfigurationsCreateOrUpdateOptionalParams, SingleSignOnConfigurationsCreateOrUpdateResponse, - SingleSignOnConfigurationsGetOptionalParams, - SingleSignOnConfigurationsGetResponse } from "../models/index.js"; /// @@ -29,20 +29,36 @@ export interface SingleSignOnConfigurations { list( resourceGroupName: string, monitorName: string, - options?: SingleSignOnConfigurationsListOptionalParams + options?: SingleSignOnConfigurationsListOptionalParams, ): PagedAsyncIterableIterator; + /** + * Gets the datadog single sign-on resource for the given Monitor. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param configurationName Configuration name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + monitorName: string, + configurationName: string, + options?: SingleSignOnConfigurationsGetOptionalParams, + ): Promise; /** * Configures single-sign-on for this resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Monitor resource name * @param configurationName Configuration name + * @param body Concrete proxy resource types can be created by aliasing this type using a specific + * property type. * @param options The options parameters. */ beginCreateOrUpdate( resourceGroupName: string, monitorName: string, configurationName: string, - options?: SingleSignOnConfigurationsCreateOrUpdateOptionalParams + body: DatadogSingleSignOnResource, + options?: SingleSignOnConfigurationsCreateOrUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -54,25 +70,15 @@ export interface SingleSignOnConfigurations { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Monitor resource name * @param configurationName Configuration name + * @param body Concrete proxy resource types can be created by aliasing this type using a specific + * property type. * @param options The options parameters. */ beginCreateOrUpdateAndWait( resourceGroupName: string, monitorName: string, configurationName: string, - options?: SingleSignOnConfigurationsCreateOrUpdateOptionalParams + body: DatadogSingleSignOnResource, + options?: SingleSignOnConfigurationsCreateOrUpdateOptionalParams, ): Promise; - /** - * Gets the datadog single sign-on resource for the given Monitor. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param monitorName Monitor resource name - * @param configurationName Configuration name - * @param options The options parameters. - */ - get( - resourceGroupName: string, - monitorName: string, - configurationName: string, - options?: SingleSignOnConfigurationsGetOptionalParams - ): Promise; } diff --git a/sdk/datadog/arm-datadog/src/operationsInterfaces/tagRules.ts b/sdk/datadog/arm-datadog/src/operationsInterfaces/tagRules.ts index aa28db1f50de..71b890b9552a 100644 --- a/sdk/datadog/arm-datadog/src/operationsInterfaces/tagRules.ts +++ b/sdk/datadog/arm-datadog/src/operationsInterfaces/tagRules.ts @@ -10,10 +10,10 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { MonitoringTagRules, TagRulesListOptionalParams, + TagRulesGetOptionalParams, + TagRulesGetResponse, TagRulesCreateOrUpdateOptionalParams, TagRulesCreateOrUpdateResponse, - TagRulesGetOptionalParams, - TagRulesGetResponse } from "../models/index.js"; /// @@ -28,32 +28,34 @@ export interface TagRules { list( resourceGroupName: string, monitorName: string, - options?: TagRulesListOptionalParams + options?: TagRulesListOptionalParams, ): PagedAsyncIterableIterator; /** - * Create or update a tag rule set for a given monitor resource. + * Get a tag rule set for a given monitor resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Monitor resource name * @param ruleSetName Rule set name * @param options The options parameters. */ - createOrUpdate( + get( resourceGroupName: string, monitorName: string, ruleSetName: string, - options?: TagRulesCreateOrUpdateOptionalParams - ): Promise; + options?: TagRulesGetOptionalParams, + ): Promise; /** - * Get a tag rule set for a given monitor resource. + * Create or update a tag rule set for a given monitor resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Monitor resource name * @param ruleSetName Rule set name + * @param body Capture logs and metrics of Azure resources based on ARM tags. * @param options The options parameters. */ - get( + createOrUpdate( resourceGroupName: string, monitorName: string, ruleSetName: string, - options?: TagRulesGetOptionalParams - ): Promise; + body: MonitoringTagRules, + options?: TagRulesCreateOrUpdateOptionalParams, + ): Promise; } diff --git a/sdk/datadog/arm-datadog/src/pagingHelper.ts b/sdk/datadog/arm-datadog/src/pagingHelper.ts index 269a2b9814b5..e362819bdfc4 100644 --- a/sdk/datadog/arm-datadog/src/pagingHelper.ts +++ b/sdk/datadog/arm-datadog/src/pagingHelper.ts @@ -26,10 +26,7 @@ export function getContinuationToken(page: unknown): string | undefined { return pageMap.get(page)?.continuationToken; } -export function setContinuationToken( - page: unknown, - continuationToken: string | undefined -): void { +export function setContinuationToken(page: unknown, continuationToken: string | undefined): void { if (typeof page !== "object" || page === null || !continuationToken) { return; } diff --git a/sdk/datadog/arm-datadog/test/sampleTest.spec.ts b/sdk/datadog/arm-datadog/test/sampleTest.spec.ts new file mode 100644 index 000000000000..90b3c8a868b4 --- /dev/null +++ b/sdk/datadog/arm-datadog/test/sampleTest.spec.ts @@ -0,0 +1,38 @@ +/* + * 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 } from "@azure-tools/test-recorder"; +import { afterEach, beforeEach, describe, it, assert } from "vitest"; + +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 () => { + recorder = new Recorder(); + await recorder.start(recorderOptions); + }); + + afterEach(async () => { + await recorder.stop(); + }); + + it("sample test", async () => { + assert(true); + }); +}); diff --git a/sdk/datadog/arm-datadog/test/snippets.spec.ts b/sdk/datadog/arm-datadog/test/snippets.spec.ts index c17082b5b3a9..49efdf528068 100644 --- a/sdk/datadog/arm-datadog/test/snippets.spec.ts +++ b/sdk/datadog/arm-datadog/test/snippets.spec.ts @@ -1,5 +1,10 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. +/* + * 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 { MicrosoftDatadogClient } from "../src/index.js"; import { DefaultAzureCredential, InteractiveBrowserCredential } from "@azure/identity"; diff --git a/sdk/datadog/arm-datadog/tsconfig.json b/sdk/datadog/arm-datadog/tsconfig.json index 19ceb382b521..59ea83c046bf 100644 --- a/sdk/datadog/arm-datadog/tsconfig.json +++ b/sdk/datadog/arm-datadog/tsconfig.json @@ -3,11 +3,8 @@ { "path": "./tsconfig.src.json" }, - { - "path": "./tsconfig.samples.json" - }, { "path": "./tsconfig.test.json" } ] -} +} \ No newline at end of file