Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[AutoPR @azure/arm-datadog] Fix lint error for Datadog RP #4692

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sdk/datadog/arm-datadog/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022 Microsoft
Copyright (c) 2023 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
10 changes: 5 additions & 5 deletions sdk/datadog/arm-datadog/_meta.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"commit": "e6a2296d02ec6c4b2c32479198bfbcb9b16ea247",
"readme": "specification\\datadog\\resource-manager\\readme.md",
"autorest_command": "autorest --version=3.8.4 --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/[email protected].3.20221108.1 --generate-sample=true",
"commit": "6ce31e89b8b2e41a24392155d9f279416f43d9f0",
"readme": "specification/datadog/resource-manager/readme.md",
"autorest_command": "autorest --version=3.9.3 --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/[email protected].10",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
"release_tool": "@azure-tools/js-sdk-release-tools@2.4.2",
"use": "@autorest/[email protected].3.20221108.1"
"release_tool": "@azure-tools/js-sdk-release-tools@2.7.0",
"use": "@autorest/[email protected].10"
}
19 changes: 6 additions & 13 deletions sdk/datadog/arm-datadog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
"node": ">=14.0.0"
},
"dependencies": {
"@azure/core-lro": "^2.2.0",
"@azure/core-lro": "^2.5.0",
"@azure/abort-controller": "^1.0.0",
"@azure/core-paging": "^1.2.0",
"@azure/core-client": "^1.6.1",
"@azure/core-client": "^1.7.0",
"@azure/core-auth": "^1.3.0",
"@azure/core-rest-pipeline": "^1.8.0",
"tslib": "^2.2.0"
Expand All @@ -33,12 +33,13 @@
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-multi-entry": "^6.0.0",
"@rollup/plugin-node-resolve": "^13.1.3",
"mkdirp": "^1.0.4",
"mkdirp": "^2.1.2",
"rollup": "^2.66.1",
"rollup-plugin-sourcemaps": "^0.6.3",
"typescript": "~4.8.0",
"uglify-js": "^3.4.9",
"rimraf": "^3.0.0",
"dotenv": "^16.0.0",
"@azure/identity": "^2.0.1",
"@azure-tools/test-recorder": "^3.0.0",
"@azure-tools/test-credential": "^1.0.0",
Expand All @@ -49,7 +50,6 @@
"@types/node": "^14.0.0",
"@azure/dev-tool": "^1.0.0"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/datadog/arm-datadog",
"repository": {
"type": "git",
"url": "https://github.com/Azure/azure-sdk-for-js.git"
Expand Down Expand Up @@ -111,12 +111,5 @@
]
},
"autoPublish": true,
"//sampleConfiguration": {
"productName": "",
"productSlugs": [
"azure"
],
"disableDocsMs": true,
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-datadog?view=azure-node-preview"
}
}
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/datadog/arm-datadog"
}
16 changes: 8 additions & 8 deletions sdk/datadog/arm-datadog/review/arm-datadog.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

import * as coreAuth from '@azure/core-auth';
import * as coreClient from '@azure/core-client';
import { OperationState } from '@azure/core-lro';
import { PagedAsyncIterableIterator } from '@azure/core-paging';
import { PollerLike } from '@azure/core-lro';
import { PollOperationState } from '@azure/core-lro';
import { SimplePollerLike } from '@azure/core-lro';

// @public
export type CreatedByType = string;
Expand Down Expand Up @@ -129,10 +129,10 @@ export interface DatadogOrganizationProperties {
apiKey?: string;
applicationKey?: string;
enterpriseAppId?: string;
readonly id?: string;
id?: string;
linkingAuthCode?: string;
linkingClientId?: string;
readonly name?: string;
name?: string;
redirectUri?: string;
}

Expand Down Expand Up @@ -407,11 +407,11 @@ export interface MonitorProperties {

// @public
export interface Monitors {
beginCreate(resourceGroupName: string, monitorName: string, options?: MonitorsCreateOptionalParams): Promise<PollerLike<PollOperationState<MonitorsCreateResponse>, MonitorsCreateResponse>>;
beginCreate(resourceGroupName: string, monitorName: string, options?: MonitorsCreateOptionalParams): Promise<SimplePollerLike<OperationState<MonitorsCreateResponse>, MonitorsCreateResponse>>;
beginCreateAndWait(resourceGroupName: string, monitorName: string, options?: MonitorsCreateOptionalParams): Promise<MonitorsCreateResponse>;
beginDelete(resourceGroupName: string, monitorName: string, options?: MonitorsDeleteOptionalParams): Promise<PollerLike<PollOperationState<void>, void>>;
beginDelete(resourceGroupName: string, monitorName: string, options?: MonitorsDeleteOptionalParams): Promise<SimplePollerLike<OperationState<void>, void>>;
beginDeleteAndWait(resourceGroupName: string, monitorName: string, options?: MonitorsDeleteOptionalParams): Promise<void>;
beginUpdate(resourceGroupName: string, monitorName: string, options?: MonitorsUpdateOptionalParams): Promise<PollerLike<PollOperationState<MonitorsUpdateResponse>, MonitorsUpdateResponse>>;
beginUpdate(resourceGroupName: string, monitorName: string, options?: MonitorsUpdateOptionalParams): Promise<SimplePollerLike<OperationState<MonitorsUpdateResponse>, MonitorsUpdateResponse>>;
beginUpdateAndWait(resourceGroupName: string, monitorName: string, options?: MonitorsUpdateOptionalParams): Promise<MonitorsUpdateResponse>;
get(resourceGroupName: string, monitorName: string, options?: MonitorsGetOptionalParams): Promise<MonitorsGetResponse>;
getDefaultKey(resourceGroupName: string, monitorName: string, options?: MonitorsGetDefaultKeyOptionalParams): Promise<MonitorsGetDefaultKeyResponse>;
Expand Down Expand Up @@ -618,7 +618,7 @@ export interface ResourceSku {

// @public
export interface SingleSignOnConfigurations {
beginCreateOrUpdate(resourceGroupName: string, monitorName: string, configurationName: string, options?: SingleSignOnConfigurationsCreateOrUpdateOptionalParams): Promise<PollerLike<PollOperationState<SingleSignOnConfigurationsCreateOrUpdateResponse>, SingleSignOnConfigurationsCreateOrUpdateResponse>>;
beginCreateOrUpdate(resourceGroupName: string, monitorName: string, configurationName: string, options?: SingleSignOnConfigurationsCreateOrUpdateOptionalParams): Promise<SimplePollerLike<OperationState<SingleSignOnConfigurationsCreateOrUpdateResponse>, SingleSignOnConfigurationsCreateOrUpdateResponse>>;
beginCreateOrUpdateAndWait(resourceGroupName: string, monitorName: string, configurationName: string, options?: SingleSignOnConfigurationsCreateOrUpdateOptionalParams): Promise<SingleSignOnConfigurationsCreateOrUpdateResponse>;
get(resourceGroupName: string, monitorName: string, configurationName: string, options?: SingleSignOnConfigurationsGetOptionalParams): Promise<SingleSignOnConfigurationsGetResponse>;
list(resourceGroupName: string, monitorName: string, options?: SingleSignOnConfigurationsListOptionalParams): PagedAsyncIterableIterator<DatadogSingleSignOnResource>;
Expand Down
54 changes: 31 additions & 23 deletions sdk/datadog/arm-datadog/src/lroImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,37 @@
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import { AbortSignalLike } from "@azure/abort-controller";
import { LongRunningOperation, LroResponse } from "@azure/core-lro";

export class LroImpl<T> implements LongRunningOperation<T> {
constructor(
private sendOperationFn: (args: any, spec: any) => Promise<LroResponse<T>>,
private args: Record<string, unknown>,
private spec: {
readonly requestBody?: unknown;
readonly path?: string;
readonly httpMethod: string;
} & Record<string, any>,
public requestPath: string = spec.path!,
public requestMethod: string = spec.httpMethod
) {}
public async sendInitialRequest(): Promise<LroResponse<T>> {
return this.sendOperationFn(this.args, this.spec);
}
public async sendPollRequest(path: string): Promise<LroResponse<T>> {
const { requestBody, ...restSpec } = this.spec;
return this.sendOperationFn(this.args, {
...restSpec,
path,
httpMethod: "GET"
});
}
export function createLroSpec<T>(inputs: {
sendOperationFn: (args: any, spec: any) => Promise<LroResponse<T>>;
args: Record<string, unknown>;
spec: {
readonly requestBody?: unknown;
readonly path?: string;
readonly httpMethod: string;
} & Record<string, any>;
}): LongRunningOperation<T> {
const { args, spec, sendOperationFn } = inputs;
return {
requestMethod: spec.httpMethod,
requestPath: spec.path!,
sendInitialRequest: () => sendOperationFn(args, spec),
sendPollRequest: (
path: string,
options?: { abortSignal?: AbortSignalLike }
) => {
const { requestBody, ...restSpec } = spec;
return sendOperationFn(args, {
...restSpec,
httpMethod: "GET",
path,
abortSignal: options?.abortSignal
});
}
};
}
2 changes: 1 addition & 1 deletion sdk/datadog/arm-datadog/src/microsoftDatadogClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export class MicrosoftDatadogClient extends coreClient.ServiceClient {

// Assigning values to Constant parameters
this.$host = options.$host || "https://management.azure.com";
this.apiVersion = options.apiVersion || "2021-03-01";
this.apiVersion = options.apiVersion || "2022-06-01";
this.marketplaceAgreements = new MarketplaceAgreementsImpl(this);
this.monitors = new MonitorsImpl(this);
this.operations = new OperationsImpl(this);
Expand Down
14 changes: 4 additions & 10 deletions sdk/datadog/arm-datadog/src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,16 +319,10 @@ export interface MonitorProperties {

/** Datadog organization properties */
export interface DatadogOrganizationProperties {
/**
* Name of the Datadog organization.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly name?: string;
/**
* Id of the Datadog organization.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly id?: string;
/** 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. */
Expand Down
2 changes: 0 additions & 2 deletions sdk/datadog/arm-datadog/src/models/mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -856,14 +856,12 @@ export const DatadogOrganizationProperties: coreClient.CompositeMapper = {
modelProperties: {
name: {
serializedName: "name",
readOnly: true,
type: {
name: "String"
}
},
id: {
serializedName: "id",
readOnly: true,
type: {
name: "String"
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/datadog/arm-datadog/src/models/parameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const subscriptionId: OperationURLParameter = {
export const apiVersion: OperationQueryParameter = {
parameterPath: "apiVersion",
mapper: {
defaultValue: "2021-03-01",
defaultValue: "2022-06-01",
isConstant: true,
serializedName: "api-version",
type: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ const listNextOperationSpec: coreClient.OperationSpec = {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Expand Down
Loading