Skip to content

Commit

Permalink
postgresql-track2-ga (Azure#19317)
Browse files Browse the repository at this point in the history
  • Loading branch information
colawwj authored Dec 15, 2021
1 parent b57fb67 commit 9451c84
Show file tree
Hide file tree
Showing 29 changed files with 177 additions and 231 deletions.
3 changes: 2 additions & 1 deletion common/config/rush/pnpm-lock.yaml

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

29 changes: 7 additions & 22 deletions sdk/postgresql/arm-postgresql/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,11 @@
## Release History
# Release History

## 6.0.0 (2021-12-14)

### 6.0.0-beta.2 (Unreleased)
The package of @azure/arm-postgresql is using our next generation design principles since version 6.0.0, which contains breaking changes.

#### Features Added
To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog).

#### Breaking Changes
To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide).

#### Bugs Fixed

#### Other Changes

### 6.0.0-beta.1 (2021-10-19)

This is the first preview for the new version of the `@azure/arm-postgresql` package that follows the new [guidelines for TypeScript SDKs](https://azure.github.io/azure-sdk/typescript_introduction.html) for Azure services.

While this package remains auto generated, the SDK generator itself has undergone changes to comply with the above guidelines in order to generate packages that are idiomatic to the JavaScript/TypeScript ecosystem and consistent with other packages for Azure services. For more on this, please see [State of the Azure SDK 2021](https://devblogs.microsoft.com/azure-sdk/state-of-the-azure-sdk-2021/).

Please note that this version has breaking changes, all of which were made after careful consideration during the authoring of the guidelines and user studies.

**Noteworthy changes and features**
- Authentication: The packages `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` are no longer supported. Use package [@azure/identity](https://www.npmjs.com/package/@azure/identity) instead. Select a credential from Azure Identity examples based on the authentication method of your choice.
- Callbacks: Method overloads that used callbacks have been removed and the use of promises is encouraged instead.
- List operations now return an iterable result that follows the `PagedAsyncIterableIterator` interface as opposed to the previous model where you had to make a new request using the link to the next page.
- Long running operations i.e. the Lro related object returned by methods whose names started with `begin`, now uses `pollUntilDone` to check whether the request is finished, instead of `pollUntilFinished`. To get the final result, use the corresponding method that will have the suffix `AndWait`.
- The SDK only supports ECMAScript 2015 (ES6) and beyond, all projects that referenced this SDK should be upgraded to use ES6.
To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart).
4 changes: 4 additions & 0 deletions sdk/postgresql/arm-postgresql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new PostgreSQLManagementClient(new DefaultAzureCredential(), 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

### PostgreSQLManagementClient
Expand Down
6 changes: 3 additions & 3 deletions sdk/postgresql/arm-postgresql/_meta.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"commit": "01c6e5b81b5a52b433fabfa56801f5a87b942067",
"commit": "6654157972dbf54b187150e389237494f35145f4",
"readme": "specification/postgresql/resource-manager/readme.md",
"autorest_command": "autorest --version=3.1.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/postgresql/resource-manager/readme.md --tag=package-2020-01-01 --use=@autorest/[email protected]beta.13",
"autorest_command": "autorest --version=3.1.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/postgresql/resource-manager/readme.md --tag=package-2020-01-01 --use=@autorest/[email protected]alpha.16.20211207.1",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
"tag": "package-2020-01-01",
"use": "@autorest/[email protected]beta.13"
"use": "@autorest/[email protected]alpha.16.20211207.1"
}
28 changes: 9 additions & 19 deletions sdk/postgresql/arm-postgresql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,18 @@
"sdk-type": "mgmt",
"author": "Microsoft Corporation",
"description": "A generated SDK for PostgreSQLManagementClient.",
"version": "6.0.0-beta.2",
"engines": {
"node": ">=12.0.0"
},
"version": "6.0.0",
"engines": { "node": ">=12.0.0" },
"dependencies": {
"@azure/core-lro": "^2.2.0",
"@azure/abort-controller": "^1.0.0",
"@azure/core-paging": "^1.1.1",
"@azure/core-paging": "^1.2.0",
"@azure/core-client": "^1.0.0",
"@azure/core-auth": "^1.3.0",
"@azure/core-rest-pipeline": "^1.1.0",
"tslib": "^2.2.0"
},
"keywords": [
"node",
"azure",
"typescript",
"browser",
"isomorphic"
],
"keywords": ["node", "azure", "typescript", "browser", "isomorphic"],
"license": "MIT",
"main": "./dist/index.js",
"module": "./dist-esm/src/index.js",
Expand All @@ -38,6 +30,7 @@
"rollup-plugin-sourcemaps": "^0.4.2",
"typescript": "~4.2.0",
"uglify-js": "^3.4.9",
"rimraf": "^3.0.0",
"@azure/identity": "^2.0.1",
"@azure-tools/test-recorder": "^1.0.0",
"mocha": "^7.1.1",
Expand All @@ -48,9 +41,7 @@
"type": "git",
"url": "https://github.com/Azure/azure-sdk-for-js.git"
},
"bugs": {
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
},
"bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" },
"files": [
"dist/**/*.js",
"dist/**/*.js.map",
Expand All @@ -70,14 +61,14 @@
"types/*"
],
"scripts": {
"build": "tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api",
"build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api",
"minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js",
"prepack": "npm run build",
"pack": "npm pack 2>&1",
"extract-api": "api-extractor run --local",
"lint": "echo skipped",
"audit": "echo skipped",
"clean": "echo skipped",
"clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log",
"build:node": "echo skipped",
"build:browser": "echo skipped",
"build:test": "echo skipped",
Expand All @@ -86,14 +77,13 @@
"execute:samples": "echo skipped",
"format": "echo skipped",
"test": "npm run integration-test",
"prebuild": "echo skipped",
"test:node": "echo skipped",
"test:browser": "echo skipped",
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
"unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node",
"unit-test:browser": "echo skipped",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts",
"integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js",
"integration-test:browser": "echo skipped",
"docs": "echo skipped"
},
Expand Down
16 changes: 5 additions & 11 deletions sdk/postgresql/arm-postgresql/review/arm-postgresql.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,9 @@ export interface PerformanceTierServiceLevelObjectives {
}

// @public (undocumented)
export class PostgreSQLManagementClient extends PostgreSQLManagementClientContext {
export class PostgreSQLManagementClient extends coreClient.ServiceClient {
// (undocumented)
$host: string;
constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: PostgreSQLManagementClientOptionalParams);
// (undocumented)
checkNameAvailability: CheckNameAvailability;
Expand Down Expand Up @@ -525,16 +527,9 @@ export class PostgreSQLManagementClient extends PostgreSQLManagementClientContex
// (undocumented)
serverSecurityAlertPolicies: ServerSecurityAlertPolicies;
// (undocumented)
virtualNetworkRules: VirtualNetworkRules;
}

// @public (undocumented)
export class PostgreSQLManagementClientContext extends coreClient.ServiceClient {
// (undocumented)
$host: string;
constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: PostgreSQLManagementClientOptionalParams);
// (undocumented)
subscriptionId: string;
// (undocumented)
virtualNetworkRules: VirtualNetworkRules;
}

// @public
Expand Down Expand Up @@ -1223,7 +1218,6 @@ export type VirtualNetworkRulesListByServerResponse = VirtualNetworkRuleListResu
// @public
export type VirtualNetworkRuleState = string;


// (No @packageDocumentation comment for this package)

```
1 change: 0 additions & 1 deletion sdk/postgresql/arm-postgresql/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@
/// <reference lib="esnext.asynciterable" />
export * from "./models";
export { PostgreSQLManagementClient } from "./postgreSQLManagementClient";
export { PostgreSQLManagementClientContext } from "./postgreSQLManagementClientContext";
export * from "./operationsInterfaces";
38 changes: 19 additions & 19 deletions sdk/postgresql/arm-postgresql/src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,25 +89,6 @@ export interface StorageProfile {
storageAutogrow?: StorageAutogrow;
}

/** Common fields that are returned in the response for all Azure Resource Manager resources */
export interface Resource {
/**
* Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly id?: string;
/**
* The name of the resource
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly name?: string;
/**
* The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly type?: string;
}

/** A private endpoint connection under a server */
export interface ServerPrivateEndpointConnection {
/**
Expand Down Expand Up @@ -152,6 +133,25 @@ export interface ServerPrivateLinkServiceConnectionStateProperty {
readonly actionsRequired?: PrivateLinkServiceConnectionStateActionsRequire;
}

/** Common fields that are returned in the response for all Azure Resource Manager resources */
export interface Resource {
/**
* Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly id?: string;
/**
* The name of the resource
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly name?: string;
/**
* The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly type?: string;
}

/** An error response from the Batch service. */
export interface CloudError {
/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.) */
Expand Down
60 changes: 30 additions & 30 deletions sdk/postgresql/arm-postgresql/src/models/mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,36 +216,6 @@ export const StorageProfile: coreClient.CompositeMapper = {
}
};

export const Resource: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "Resource",
modelProperties: {
id: {
serializedName: "id",
readOnly: true,
type: {
name: "String"
}
},
name: {
serializedName: "name",
readOnly: true,
type: {
name: "String"
}
},
type: {
serializedName: "type",
readOnly: true,
type: {
name: "String"
}
}
}
}
};

export const ServerPrivateEndpointConnection: coreClient.CompositeMapper = {
type: {
name: "Composite",
Expand Down Expand Up @@ -344,6 +314,36 @@ export const ServerPrivateLinkServiceConnectionStateProperty: coreClient.Composi
}
};

export const Resource: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "Resource",
modelProperties: {
id: {
serializedName: "id",
readOnly: true,
type: {
name: "String"
}
},
name: {
serializedName: "name",
readOnly: true,
type: {
name: "String"
}
},
type: {
serializedName: "type",
readOnly: true,
type: {
name: "String"
}
}
}
}
};

export const CloudError: coreClient.CompositeMapper = {
type: {
name: "Composite",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { CheckNameAvailability } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { PostgreSQLManagementClientContext } from "../postgreSQLManagementClientContext";
import { PostgreSQLManagementClient } from "../postgreSQLManagementClient";
import {
NameAvailabilityRequest,
CheckNameAvailabilityExecuteOptionalParams,
Expand All @@ -19,13 +19,13 @@ import {

/** Class containing CheckNameAvailability operations. */
export class CheckNameAvailabilityImpl implements CheckNameAvailability {
private readonly client: PostgreSQLManagementClientContext;
private readonly client: PostgreSQLManagementClient;

/**
* Initialize a new instance of the class CheckNameAvailability class.
* @param client Reference to the service client
*/
constructor(client: PostgreSQLManagementClientContext) {
constructor(client: PostgreSQLManagementClient) {
this.client = client;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Configurations } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { PostgreSQLManagementClientContext } from "../postgreSQLManagementClientContext";
import { PostgreSQLManagementClient } from "../postgreSQLManagementClient";
import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
import { LroImpl } from "../lroImpl";
import {
Expand All @@ -27,13 +27,13 @@ import {
/// <reference lib="esnext.asynciterable" />
/** Class containing Configurations operations. */
export class ConfigurationsImpl implements Configurations {
private readonly client: PostgreSQLManagementClientContext;
private readonly client: PostgreSQLManagementClient;

/**
* Initialize a new instance of the class Configurations class.
* @param client Reference to the service client
*/
constructor(client: PostgreSQLManagementClientContext) {
constructor(client: PostgreSQLManagementClient) {
this.client = client;
}

Expand Down
Loading

0 comments on commit 9451c84

Please sign in to comment.