kazrael2119 2023-03-21 17:05:32 +08:00 коммит произвёл GitHub
Родитель 1071bc83ff
Коммит 9dab1c9714
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
59 изменённых файлов: 4020 добавлений и 1 удалений

Просмотреть файл

@ -96,6 +96,7 @@ specifiers:
'@rush-temp/arm-features': file:./projects/arm-features.tgz
'@rush-temp/arm-fluidrelay': file:./projects/arm-fluidrelay.tgz
'@rush-temp/arm-frontdoor': file:./projects/arm-frontdoor.tgz
'@rush-temp/arm-graphservices': file:./projects/arm-graphservices.tgz
'@rush-temp/arm-hanaonazure': file:./projects/arm-hanaonazure.tgz
'@rush-temp/arm-hardwaresecuritymodules': file:./projects/arm-hardwaresecuritymodules.tgz
'@rush-temp/arm-hdinsight': file:./projects/arm-hdinsight.tgz
@ -430,6 +431,7 @@ dependencies:
'@rush-temp/arm-features': file:projects/arm-features.tgz
'@rush-temp/arm-fluidrelay': file:projects/arm-fluidrelay.tgz
'@rush-temp/arm-frontdoor': file:projects/arm-frontdoor.tgz
'@rush-temp/arm-graphservices': file:projects/arm-graphservices.tgz
'@rush-temp/arm-hanaonazure': file:projects/arm-hanaonazure.tgz
'@rush-temp/arm-hardwaresecuritymodules': file:projects/arm-hardwaresecuritymodules.tgz
'@rush-temp/arm-hdinsight': file:projects/arm-hdinsight.tgz
@ -12166,6 +12168,36 @@ packages:
- supports-color
dev: false
file:projects/arm-graphservices.tgz:
resolution: {integrity: sha512-FGMQq6BOIpb01GiMS1PDpo/y17Bb9bxNSMVtLJRoORxpGlTgbpDWB+1o65n5kZ4P2Sda2DScSr+Oml3uXoC3kg==, tarball: file:projects/arm-graphservices.tgz}
name: '@rush-temp/arm-graphservices'
version: 0.0.0
dependencies:
'@azure-tools/test-recorder': 2.0.0
'@azure/identity': 2.1.0
'@microsoft/api-extractor': 7.34.4_@types+node@14.18.37
'@rollup/plugin-commonjs': 24.0.1_rollup@2.79.1
'@rollup/plugin-json': 6.0.0_rollup@2.79.1
'@rollup/plugin-multi-entry': 6.0.0_rollup@2.79.1
'@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1
'@types/chai': 4.3.4
'@types/node': 14.18.37
chai: 4.3.7
cross-env: 7.0.3
dotenv: 16.0.3
mkdirp: 2.1.5
mocha: 7.2.0
rimraf: 3.0.2
rollup: 2.79.1
rollup-plugin-sourcemaps: 0.6.3_uvqxrz6xmh6o32kxhfeqlqrt5q
tslib: 2.5.0
typescript: 4.8.4
uglify-js: 3.17.4
transitivePeerDependencies:
- encoding
- supports-color
dev: false
file:projects/arm-hanaonazure.tgz:
resolution: {integrity: sha512-1NSUUNIl576g7DAB1k8qytIsRfg6Cd9J239nnW50hrqt4i6cmLfj7Hn7eaiVgQ66GJ7iqCTUiKTMcowRm4lTDg==, tarball: file:projects/arm-hanaonazure.tgz}
name: '@rush-temp/arm-hanaonazure'

Просмотреть файл

@ -8,3 +8,4 @@ https://docs.microsoft.com/javascript/api/@azure/arm-dataprotection
https://docs.microsoft.com/javascript/api/@azure-rest/purview-sharing?view=azure-node-preview
https://docs.microsoft.com/javascript/api/@azure/arm-voiceservices
https://docs.microsoft.com/javascript/api/@azure/arm-voiceservices?view=azure-node-preview
https://docs.microsoft.com/javascript/api/@azure/arm-graphservices?view=azure-node-preview

Просмотреть файл

@ -1947,6 +1947,11 @@
"packageName": "@azure/web-pubsub-client-protobuf",
"projectFolder": "sdk/web-pubsub/web-pubsub-client-protobuf",
"versionPolicyName": "client"
},
{
"packageName": "@azure/arm-graphservices",
"projectFolder": "sdk/graphservices/arm-graphservices",
"versionPolicyName": "management"
}
]
}
}

Просмотреть файл

@ -0,0 +1,5 @@
# Release History
## 1.0.0-beta.1 (2023-03-14)
The package of @azure/arm-graphservices is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart).

Просмотреть файл

@ -0,0 +1,21 @@
The MIT License (MIT)
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
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Просмотреть файл

@ -0,0 +1,109 @@
# Azure GraphServices client library for JavaScript
This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure GraphServices client.
Self service experience for Microsoft Graph metered services
[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/graphservices/arm-graphservices) |
[Package (NPM)](https://www.npmjs.com/package/@azure/arm-graphservices) |
[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-graphservices?view=azure-node-preview) |
[Samples](https://github.com/Azure-Samples/azure-samples-js-management)
## Getting started
### Currently supported environments
- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule)
- Latest versions of Safari, Chrome, Edge and Firefox.
See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
### Prerequisites
- An [Azure subscription][azure_sub].
### Install the `@azure/arm-graphservices` package
Install the Azure GraphServices client library for JavaScript with `npm`:
```bash
npm install @azure/arm-graphservices
```
### Create and authenticate a `GraphServices`
To create a client object to access the Azure GraphServices API, you will need the `endpoint` of your Azure GraphServices resource and a `credential`. The Azure GraphServices client can use Azure Active Directory credentials to authenticate.
You can find the endpoint for your Azure GraphServices resource in the [Azure Portal][azure_portal].
You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token).
To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package:
```bash
npm install @azure/identity
```
You will also need to **register a new AAD application and grant access to Azure GraphServices** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions).
Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.
For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal).
```javascript
const { GraphServices } = require("@azure/arm-graphservices");
const { DefaultAzureCredential } = require("@azure/identity");
// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details.
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new GraphServices(new DefaultAzureCredential(), subscriptionId);
// For client-side applications running in the browser, use this code instead:
// const credential = new InteractiveBrowserCredential({
// tenantId: "<YOUR_TENANT_ID>",
// clientId: "<YOUR_CLIENT_ID>"
// });
// const client = new GraphServices(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
### GraphServices
`GraphServices` is the primary interface for developers using the Azure GraphServices client library. Explore the methods on this client object to understand the different features of the Azure GraphServices service that you can access.
## Troubleshooting
### Logging
Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:
```javascript
const { setLogLevel } = require("@azure/logger");
setLogLevel("info");
```
For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).
## Next steps
Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library.
## Contributing
If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code.
## Related projects
- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js)
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fgraphservices%2Farm-graphservices%2FREADME.png)
[azure_cli]: https://docs.microsoft.com/cli/azure
[azure_sub]: https://azure.microsoft.com/free/
[azure_sub]: https://azure.microsoft.com/free/
[azure_portal]: https://portal.azure.com
[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity
[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential

Просмотреть файл

@ -0,0 +1,8 @@
{
"commit": "d4dfb3388ab40185cf302512268ad1406f666d64",
"readme": "specification/graphservicesprod/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=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\graphservicesprod\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.9 --generate-sample=true",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
"release_tool": "@azure-tools/js-sdk-release-tools@2.6.2",
"use": "@autorest/typescript@6.0.0-rc.9"
}

Просмотреть файл

@ -0,0 +1,31 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"mainEntryPointFilePath": "./dist-esm/src/index.d.ts",
"docModel": {
"enabled": true
},
"apiReport": {
"enabled": true,
"reportFolder": "./review"
},
"dtsRollup": {
"enabled": true,
"untrimmedFilePath": "",
"publicTrimmedFilePath": "./types/arm-graphservices.d.ts"
},
"messages": {
"tsdocMessageReporting": {
"default": {
"logLevel": "none"
}
},
"extractorMessageReporting": {
"ae-missing-release-tag": {
"logLevel": "none"
},
"ae-unresolved-link": {
"logLevel": "none"
}
}
}
}

Просмотреть файл

@ -0,0 +1,123 @@
{
"name": "@azure/arm-graphservices",
"sdk-type": "mgmt",
"author": "Microsoft Corporation",
"description": "A generated SDK for GraphServices.",
"version": "1.0.0-beta.1",
"engines": {
"node": ">=14.0.0"
},
"dependencies": {
"@azure/core-lro": "^2.5.0",
"@azure/abort-controller": "^1.0.0",
"@azure/core-paging": "^1.2.0",
"@azure/core-client": "^1.7.0",
"@azure/core-auth": "^1.3.0",
"@azure/core-rest-pipeline": "^1.8.0",
"tslib": "^2.2.0"
},
"keywords": [
"node",
"azure",
"typescript",
"browser",
"isomorphic"
],
"license": "MIT",
"main": "./dist/index.js",
"module": "./dist-esm/src/index.js",
"types": "./types/arm-graphservices.d.ts",
"devDependencies": {
"@microsoft/api-extractor": "^7.31.1",
"@rollup/plugin-commonjs": "^24.0.0",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-multi-entry": "^6.0.0",
"@rollup/plugin-node-resolve": "^13.1.3",
"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",
"mocha": "^7.1.1",
"@types/chai": "^4.2.8",
"chai": "^4.2.0",
"cross-env": "^7.0.2",
"@types/node": "^14.0.0",
"@azure/dev-tool": "^1.0.0"
},
"repository": {
"type": "git",
"url": "https://github.com/Azure/azure-sdk-for-js.git"
},
"bugs": {
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
},
"files": [
"dist/**/*.js",
"dist/**/*.js.map",
"dist/**/*.d.ts",
"dist/**/*.d.ts.map",
"dist-esm/**/*.js",
"dist-esm/**/*.js.map",
"dist-esm/**/*.d.ts",
"dist-esm/**/*.d.ts.map",
"src/**/*.ts",
"README.md",
"LICENSE",
"rollup.config.js",
"tsconfig.json",
"review/*",
"CHANGELOG.md",
"types/*"
],
"scripts": {
"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": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log",
"build:node": "echo skipped",
"build:browser": "echo skipped",
"build:test": "echo skipped",
"build:samples": "echo skipped.",
"check-format": "echo skipped",
"execute:samples": "echo skipped",
"format": "echo skipped",
"test": "npm run integration-test",
"test:node": "echo skipped",
"test:browser": "echo skipped",
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
"unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node",
"unit-test:browser": "echo skipped",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'",
"integration-test:browser": "echo skipped"
},
"sideEffects": false,
"//metadata": {
"constantPaths": [
{
"path": "src/graphServices.ts",
"prefix": "packageDetails"
}
]
},
"autoPublish": true,
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/graphservices/arm-graphservices",
"//sampleConfiguration": {
"productName": "",
"productSlugs": [
"azure"
],
"disableDocsMs": true,
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-graphservices?view=azure-node-preview"
}
}

Просмотреть файл

@ -0,0 +1,4 @@
{
"Entries": [],
"Variables": {}
}

Просмотреть файл

@ -0,0 +1,262 @@
## API Report File for "@azure/arm-graphservices"
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
import * as coreAuth from '@azure/core-auth';
import * as coreClient from '@azure/core-client';
import { OperationState } from '@azure/core-lro';
import { PagedAsyncIterableIterator } from '@azure/core-paging';
import { SimplePollerLike } from '@azure/core-lro';
// @public
export interface Account {
beginCreateAndUpdate(resourceGroupName: string, resourceName: string, accountResource: AccountResource, options?: AccountCreateAndUpdateOptionalParams): Promise<SimplePollerLike<OperationState<AccountCreateAndUpdateResponse>, AccountCreateAndUpdateResponse>>;
beginCreateAndUpdateAndWait(resourceGroupName: string, resourceName: string, accountResource: AccountResource, options?: AccountCreateAndUpdateOptionalParams): Promise<AccountCreateAndUpdateResponse>;
delete(resourceGroupName: string, resourceName: string, options?: AccountDeleteOptionalParams): Promise<void>;
get(resourceGroupName: string, resourceName: string, options?: AccountGetOptionalParams): Promise<AccountGetResponse>;
update(resourceGroupName: string, resourceName: string, accountResource: AccountPatchResource, options?: AccountUpdateOptionalParams): Promise<AccountUpdateResponse>;
}
// @public
export interface AccountCreateAndUpdateOptionalParams extends coreClient.OperationOptions {
resumeFrom?: string;
updateIntervalInMs?: number;
}
// @public
export type AccountCreateAndUpdateResponse = AccountResource;
// @public
export interface AccountDeleteOptionalParams extends coreClient.OperationOptions {
}
// @public
export interface AccountGetOptionalParams extends coreClient.OperationOptions {
}
// @public
export type AccountGetResponse = AccountResource;
// @public
export interface AccountPatchResource extends TagUpdate {
}
// @public
export interface AccountResource extends Resource {
properties: AccountResourceProperties;
readonly systemData?: AccountResourceSystemData;
}
// @public
export interface AccountResourceList {
nextLink?: string;
value?: AccountResource[];
}
// @public
export interface AccountResourceProperties {
appId: string;
readonly billingPlanId?: string;
readonly provisioningState?: ProvisioningState;
}
// @public
export interface AccountResourceSystemData {
createdAt?: Date;
createdByType?: CreatedByType;
lastModifiedAt?: Date;
lastModifiedByType?: CreatedByType;
}
// @public
export interface Accounts {
listByResourceGroup(resourceGroupName: string, options?: AccountsListByResourceGroupOptionalParams): PagedAsyncIterableIterator<AccountResource>;
listBySubscription(options?: AccountsListBySubscriptionOptionalParams): PagedAsyncIterableIterator<AccountResource>;
}
// @public
export interface AccountsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions {
}
// @public
export type AccountsListByResourceGroupNextResponse = AccountResourceList;
// @public
export interface AccountsListByResourceGroupOptionalParams extends coreClient.OperationOptions {
}
// @public
export type AccountsListByResourceGroupResponse = AccountResourceList;
// @public
export interface AccountsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions {
}
// @public
export type AccountsListBySubscriptionNextResponse = AccountResourceList;
// @public
export interface AccountsListBySubscriptionOptionalParams extends coreClient.OperationOptions {
}
// @public
export type AccountsListBySubscriptionResponse = AccountResourceList;
// @public
export interface AccountUpdateOptionalParams extends coreClient.OperationOptions {
}
// @public
export type AccountUpdateResponse = AccountResource;
// @public
export type ActionType = string;
// @public
export type CreatedByType = string;
// @public
export interface ErrorAdditionalInfo {
readonly info?: Record<string, unknown>;
readonly type?: string;
}
// @public
export interface ErrorDetail {
readonly additionalInfo?: ErrorAdditionalInfo[];
readonly code?: string;
readonly details?: ErrorDetail[];
readonly message?: string;
readonly target?: string;
}
// @public
export interface ErrorResponse {
error?: ErrorDetail;
}
// @public
export function getContinuationToken(page: unknown): string | undefined;
// @public (undocumented)
export class GraphServices extends coreClient.ServiceClient {
// (undocumented)
$host: string;
constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: GraphServicesOptionalParams);
// (undocumented)
account: Account;
// (undocumented)
accounts: Accounts;
// (undocumented)
apiVersion: string;
// (undocumented)
operationOperations: OperationOperations;
// (undocumented)
subscriptionId: string;
}
// @public
export interface GraphServicesOptionalParams extends coreClient.ServiceClientOptions {
$host?: string;
apiVersion?: string;
endpoint?: string;
}
// @public
export enum KnownActionType {
Internal = "Internal"
}
// @public
export enum KnownCreatedByType {
Application = "Application",
Key = "Key",
ManagedIdentity = "ManagedIdentity",
User = "User"
}
// @public
export enum KnownOrigin {
System = "system",
User = "user",
UserSystem = "user,system"
}
// @public
export enum KnownProvisioningState {
Canceled = "Canceled",
Failed = "Failed",
Succeeded = "Succeeded"
}
// @public
export interface Operation {
readonly actionType?: ActionType;
display?: OperationDisplay;
readonly isDataAction?: boolean;
readonly name?: string;
readonly origin?: Origin;
}
// @public
export interface OperationDisplay {
readonly description?: string;
readonly operation?: string;
readonly provider?: string;
readonly resource?: string;
}
// @public
export interface OperationListNextOptionalParams extends coreClient.OperationOptions {
}
// @public
export type OperationListNextResponse = OperationListResult;
// @public
export interface OperationListOptionalParams extends coreClient.OperationOptions {
}
// @public
export type OperationListResponse = OperationListResult;
// @public
export interface OperationListResult {
readonly nextLink?: string;
readonly value?: Operation[];
}
// @public
export interface OperationOperations {
list(options?: OperationListOptionalParams): PagedAsyncIterableIterator<Operation>;
}
// @public
export type Origin = string;
// @public
export type ProvisioningState = string;
// @public
export interface Resource {
readonly id?: string;
location?: string;
readonly name?: string;
tags?: {
[propertyName: string]: string;
};
readonly type?: string;
}
// @public
export interface TagUpdate {
tags?: {
[propertyName: string]: string;
};
}
// (No @packageDocumentation comment for this package)
```

Просмотреть файл

@ -0,0 +1,122 @@
/*
* 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 nodeResolve from "@rollup/plugin-node-resolve";
import cjs from "@rollup/plugin-commonjs";
import sourcemaps from "rollup-plugin-sourcemaps";
import multiEntry from "@rollup/plugin-multi-entry";
import json from "@rollup/plugin-json";
import nodeBuiltins from "builtin-modules";
// #region Warning Handler
/**
* A function that can determine whether a rollup warning should be ignored. If
* the function returns `true`, then the warning will not be displayed.
*/
function ignoreNiseSinonEval(warning) {
return (
warning.code === "EVAL" &&
warning.id &&
(warning.id.includes("node_modules/nise") ||
warning.id.includes("node_modules/sinon")) === true
);
}
function ignoreChaiCircularDependency(warning) {
return (
warning.code === "CIRCULAR_DEPENDENCY" &&
warning.importer && warning.importer.includes("node_modules/chai") === true
);
}
const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval];
/**
* Construct a warning handler for the shared rollup configuration
* that ignores certain warnings that are not relevant to testing.
*/
function makeOnWarnForTesting() {
return (warning, warn) => {
// If every inhibitor returns false (i.e. no inhibitors), then show the warning
if (warningInhibitors.every((inhib) => !inhib(warning))) {
warn(warning);
}
};
}
// #endregion
function makeBrowserTestConfig() {
const config = {
input: {
include: ["dist-esm/test/**/*.spec.js"],
exclude: ["dist-esm/test/**/node/**"]
},
output: {
file: `dist-test/index.browser.js`,
format: "umd",
sourcemap: true
},
preserveSymlinks: false,
plugins: [
multiEntry({ exports: false }),
nodeResolve({
mainFields: ["module", "browser"]
}),
cjs(),
json(),
sourcemaps()
//viz({ filename: "dist-test/browser-stats.html", sourcemap: true })
],
onwarn: makeOnWarnForTesting(),
// Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0,
// rollup started respecting the "sideEffects" field in package.json. Since
// our package.json sets "sideEffects=false", this also applies to test
// code, which causes all tests to be removed by tree-shaking.
treeshake: false
};
return config;
}
const defaultConfigurationOptions = {
disableBrowserBundle: false
};
export function makeConfig(pkg, options) {
options = {
...defaultConfigurationOptions,
...(options || {})
};
const baseConfig = {
// Use the package's module field if it has one
input: pkg["module"] || "dist-esm/src/index.js",
external: [
...nodeBuiltins,
...Object.keys(pkg.dependencies),
...Object.keys(pkg.devDependencies)
],
output: { file: "dist/index.js", format: "cjs", sourcemap: true },
preserveSymlinks: false,
plugins: [sourcemaps(), nodeResolve()]
};
const config = [baseConfig];
if (!options.disableBrowserBundle) {
config.push(makeBrowserTestConfig());
}
return config;
}
export default makeConfig(require("./package.json"));

Просмотреть файл

@ -0,0 +1,4 @@
# App registration secret for AAD authentication
AZURE_CLIENT_SECRET=
AZURE_CLIENT_ID=
AZURE_TENANT_ID=

Просмотреть файл

@ -0,0 +1,48 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AccountResource, GraphServices } from "@azure/arm-graphservices";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Create or update account resource.
*
* @summary Create or update account resource.
* x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Create.json
*/
async function createAccountResource() {
const subscriptionId =
process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["GRAPHSERVICES_RESOURCE_GROUP"] || "testResourceGroupGRAM";
const resourceName = "11111111-aaaa-1111-bbbb-1111111111111";
const accountResource: AccountResource = {
properties: { appId: "11111111-aaaa-1111-bbbb-111111111111" },
tags: { tag1: "value1", tag2: "value2" }
};
const credential = new DefaultAzureCredential();
const client = new GraphServices(credential, subscriptionId);
const result = await client.account.beginCreateAndUpdateAndWait(
resourceGroupName,
resourceName,
accountResource
);
console.log(result);
}
async function main() {
createAccountResource();
}
main().catch(console.error);

Просмотреть файл

@ -0,0 +1,40 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { GraphServices } from "@azure/arm-graphservices";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Deletes a account resource.
*
* @summary Deletes a account resource.
* x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Delete.json
*/
async function deleteAccountResource() {
const subscriptionId =
process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] ||
"11111111-aaaa-1111-bbbb-111111111111";
const resourceGroupName =
process.env["GRAPHSERVICES_RESOURCE_GROUP"] || "testResourceGroupGRAM";
const resourceName = "11111111-aaaa-1111-bbbb-111111111111";
const credential = new DefaultAzureCredential();
const client = new GraphServices(credential, subscriptionId);
const result = await client.account.delete(resourceGroupName, resourceName);
console.log(result);
}
async function main() {
deleteAccountResource();
}
main().catch(console.error);

Просмотреть файл

@ -0,0 +1,40 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { GraphServices } from "@azure/arm-graphservices";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Returns account resource for a given name.
*
* @summary Returns account resource for a given name.
* x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Get.json
*/
async function getAccounts() {
const subscriptionId =
process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["GRAPHSERVICES_RESOURCE_GROUP"] || "testResourceGroupGRAM";
const resourceName = "11111111-aaaa-1111-bbbb-111111111111";
const credential = new DefaultAzureCredential();
const client = new GraphServices(credential, subscriptionId);
const result = await client.account.get(resourceGroupName, resourceName);
console.log(result);
}
async function main() {
getAccounts();
}
main().catch(console.error);

Просмотреть файл

@ -0,0 +1,47 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AccountPatchResource, GraphServices } from "@azure/arm-graphservices";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Update account details.
*
* @summary Update account details.
* x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Update.json
*/
async function updateAccountResource() {
const subscriptionId =
process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["GRAPHSERVICES_RESOURCE_GROUP"] || "testResourceGroupGRAM";
const resourceName = "11111111-aaaa-1111-bbbb-111111111111";
const accountResource: AccountPatchResource = {
tags: { tag1: "value1", tag2: "value2" }
};
const credential = new DefaultAzureCredential();
const client = new GraphServices(credential, subscriptionId);
const result = await client.account.update(
resourceGroupName,
resourceName,
accountResource
);
console.log(result);
}
async function main() {
updateAccountResource();
}
main().catch(console.error);

Просмотреть файл

@ -0,0 +1,44 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { GraphServices } from "@azure/arm-graphservices";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Returns list of accounts apps.
*
* @summary Returns list of accounts apps.
* x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_List.json
*/
async function createOrUpdateAccountResource() {
const subscriptionId =
process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["GRAPHSERVICES_RESOURCE_GROUP"] || "testResourceGroupGRAM";
const credential = new DefaultAzureCredential();
const client = new GraphServices(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.accounts.listByResourceGroup(
resourceGroupName
)) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
createOrUpdateAccountResource();
}
main().catch(console.error);

Просмотреть файл

@ -0,0 +1,40 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { GraphServices } from "@azure/arm-graphservices";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Returns list of accounts belonging to a subscription.
*
* @summary Returns list of accounts belonging to a subscription.
* x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_List_Sub.json
*/
async function getListOfAccountsBySubscription() {
const subscriptionId =
process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new GraphServices(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.accounts.listBySubscription()) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
getListOfAccountsBySubscription();
}
main().catch(console.error);

Просмотреть файл

@ -0,0 +1,40 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { GraphServices } from "@azure/arm-graphservices";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Returns list of operations.
*
* @summary Returns list of operations.
* x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Operations_List.json
*/
async function getListOfOperations() {
const subscriptionId =
process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new GraphServices(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.operationOperations.list()) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
getListOfOperations();
}
main().catch(console.error);

Просмотреть файл

@ -0,0 +1,62 @@
# client library samples for JavaScript (Beta)
These sample programs show how to use the JavaScript client libraries for in some common scenarios.
| **File Name** | **Description** |
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [accountCreateAndUpdateSample.js][accountcreateandupdatesample] | Create or update account resource. x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Create.json |
| [accountDeleteSample.js][accountdeletesample] | Deletes a account resource. x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Delete.json |
| [accountGetSample.js][accountgetsample] | Returns account resource for a given name. x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Get.json |
| [accountUpdateSample.js][accountupdatesample] | Update account details. x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Update.json |
| [accountsListByResourceGroupSample.js][accountslistbyresourcegroupsample] | Returns list of accounts apps. x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_List.json |
| [accountsListBySubscriptionSample.js][accountslistbysubscriptionsample] | Returns list of accounts belonging to a subscription. x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_List_Sub.json |
| [operationListSample.js][operationlistsample] | Returns list of operations. x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Operations_List.json |
## Prerequisites
The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule).
You need [an Azure subscription][freesub] to run these sample programs.
Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function.
Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package].
## Setup
To run the samples using the published version of the package:
1. Install the dependencies using `npm`:
```bash
npm install
```
2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically.
3. Run whichever samples you like (note that some samples may require additional setup, see the table above):
```bash
node accountCreateAndUpdateSample.js
```
Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform):
```bash
npx cross-env GRAPHSERVICES_SUBSCRIPTION_ID="<graphservices subscription id>" GRAPHSERVICES_RESOURCE_GROUP="<graphservices resource group>" node accountCreateAndUpdateSample.js
```
## Next Steps
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
[accountcreateandupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/accountCreateAndUpdateSample.js
[accountdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/accountDeleteSample.js
[accountgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/accountGetSample.js
[accountupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/accountUpdateSample.js
[accountslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/accountsListByResourceGroupSample.js
[accountslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/accountsListBySubscriptionSample.js
[operationlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/operationListSample.js
[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-graphservices?view=azure-node-preview
[freesub]: https://azure.microsoft.com/free/
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/graphservices/arm-graphservices/README.md

Просмотреть файл

@ -0,0 +1,44 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { GraphServices } = require("@azure/arm-graphservices");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Create or update account resource.
*
* @summary Create or update account resource.
* x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Create.json
*/
async function createAccountResource() {
const subscriptionId =
process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["GRAPHSERVICES_RESOURCE_GROUP"] || "testResourceGroupGRAM";
const resourceName = "11111111-aaaa-1111-bbbb-1111111111111";
const accountResource = {
properties: { appId: "11111111-aaaa-1111-bbbb-111111111111" },
tags: { tag1: "value1", tag2: "value2" },
};
const credential = new DefaultAzureCredential();
const client = new GraphServices(credential, subscriptionId);
const result = await client.account.beginCreateAndUpdateAndWait(
resourceGroupName,
resourceName,
accountResource
);
console.log(result);
}
async function main() {
createAccountResource();
}
main().catch(console.error);

Просмотреть файл

@ -0,0 +1,36 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { GraphServices } = require("@azure/arm-graphservices");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Deletes a account resource.
*
* @summary Deletes a account resource.
* x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Delete.json
*/
async function deleteAccountResource() {
const subscriptionId =
process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] || "11111111-aaaa-1111-bbbb-111111111111";
const resourceGroupName = process.env["GRAPHSERVICES_RESOURCE_GROUP"] || "testResourceGroupGRAM";
const resourceName = "11111111-aaaa-1111-bbbb-111111111111";
const credential = new DefaultAzureCredential();
const client = new GraphServices(credential, subscriptionId);
const result = await client.account.delete(resourceGroupName, resourceName);
console.log(result);
}
async function main() {
deleteAccountResource();
}
main().catch(console.error);

Просмотреть файл

@ -0,0 +1,36 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { GraphServices } = require("@azure/arm-graphservices");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Returns account resource for a given name.
*
* @summary Returns account resource for a given name.
* x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Get.json
*/
async function getAccounts() {
const subscriptionId =
process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["GRAPHSERVICES_RESOURCE_GROUP"] || "testResourceGroupGRAM";
const resourceName = "11111111-aaaa-1111-bbbb-111111111111";
const credential = new DefaultAzureCredential();
const client = new GraphServices(credential, subscriptionId);
const result = await client.account.get(resourceGroupName, resourceName);
console.log(result);
}
async function main() {
getAccounts();
}
main().catch(console.error);

Просмотреть файл

@ -0,0 +1,39 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { GraphServices } = require("@azure/arm-graphservices");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Update account details.
*
* @summary Update account details.
* x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Update.json
*/
async function updateAccountResource() {
const subscriptionId =
process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["GRAPHSERVICES_RESOURCE_GROUP"] || "testResourceGroupGRAM";
const resourceName = "11111111-aaaa-1111-bbbb-111111111111";
const accountResource = {
tags: { tag1: "value1", tag2: "value2" },
};
const credential = new DefaultAzureCredential();
const client = new GraphServices(credential, subscriptionId);
const result = await client.account.update(resourceGroupName, resourceName, accountResource);
console.log(result);
}
async function main() {
updateAccountResource();
}
main().catch(console.error);

Просмотреть файл

@ -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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { GraphServices } = require("@azure/arm-graphservices");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Returns list of accounts apps.
*
* @summary Returns list of accounts apps.
* x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_List.json
*/
async function createOrUpdateAccountResource() {
const subscriptionId =
process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["GRAPHSERVICES_RESOURCE_GROUP"] || "testResourceGroupGRAM";
const credential = new DefaultAzureCredential();
const client = new GraphServices(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.accounts.listByResourceGroup(resourceGroupName)) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
createOrUpdateAccountResource();
}
main().catch(console.error);

Просмотреть файл

@ -0,0 +1,37 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { GraphServices } = require("@azure/arm-graphservices");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Returns list of accounts belonging to a subscription.
*
* @summary Returns list of accounts belonging to a subscription.
* x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_List_Sub.json
*/
async function getListOfAccountsBySubscription() {
const subscriptionId =
process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new GraphServices(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.accounts.listBySubscription()) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
getListOfAccountsBySubscription();
}
main().catch(console.error);

Просмотреть файл

@ -0,0 +1,37 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { GraphServices } = require("@azure/arm-graphservices");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Returns list of operations.
*
* @summary Returns list of operations.
* x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Operations_List.json
*/
async function getListOfOperations() {
const subscriptionId =
process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new GraphServices(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.operationOperations.list()) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
getListOfOperations();
}
main().catch(console.error);

Просмотреть файл

@ -0,0 +1,32 @@
{
"name": "@azure-samples/arm-graphservices-js-beta",
"private": true,
"version": "1.0.0",
"description": " client library samples for JavaScript (Beta)",
"engines": {
"node": ">=14.0.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Azure/azure-sdk-for-js.git",
"directory": "sdk/graphservices/arm-graphservices"
},
"keywords": [
"node",
"azure",
"typescript",
"browser",
"isomorphic"
],
"author": "Microsoft Corporation",
"license": "MIT",
"bugs": {
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/graphservices/arm-graphservices",
"dependencies": {
"@azure/arm-graphservices": "next",
"dotenv": "latest",
"@azure/identity": "^2.0.1"
}
}

Просмотреть файл

@ -0,0 +1,4 @@
# App registration secret for AAD authentication
AZURE_CLIENT_SECRET=
AZURE_CLIENT_ID=
AZURE_TENANT_ID=

Просмотреть файл

@ -0,0 +1,75 @@
# client library samples for TypeScript (Beta)
These sample programs show how to use the TypeScript client libraries for in some common scenarios.
| **File Name** | **Description** |
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [accountCreateAndUpdateSample.ts][accountcreateandupdatesample] | Create or update account resource. x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Create.json |
| [accountDeleteSample.ts][accountdeletesample] | Deletes a account resource. x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Delete.json |
| [accountGetSample.ts][accountgetsample] | Returns account resource for a given name. x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Get.json |
| [accountUpdateSample.ts][accountupdatesample] | Update account details. x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Update.json |
| [accountsListByResourceGroupSample.ts][accountslistbyresourcegroupsample] | Returns list of accounts apps. x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_List.json |
| [accountsListBySubscriptionSample.ts][accountslistbysubscriptionsample] | Returns list of accounts belonging to a subscription. x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_List_Sub.json |
| [operationListSample.ts][operationlistsample] | Returns list of operations. x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Operations_List.json |
## Prerequisites
The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule).
Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using:
```bash
npm install -g typescript
```
You need [an Azure subscription][freesub] to run these sample programs.
Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function.
Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package].
## Setup
To run the samples using the published version of the package:
1. Install the dependencies using `npm`:
```bash
npm install
```
2. Compile the samples:
```bash
npm run build
```
3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically.
4. Run whichever samples you like (note that some samples may require additional setup, see the table above):
```bash
node dist/accountCreateAndUpdateSample.js
```
Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform):
```bash
npx cross-env GRAPHSERVICES_SUBSCRIPTION_ID="<graphservices subscription id>" GRAPHSERVICES_RESOURCE_GROUP="<graphservices resource group>" node dist/accountCreateAndUpdateSample.js
```
## Next Steps
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
[accountcreateandupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/accountCreateAndUpdateSample.ts
[accountdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/accountDeleteSample.ts
[accountgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/accountGetSample.ts
[accountupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/accountUpdateSample.ts
[accountslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/accountsListByResourceGroupSample.ts
[accountslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/accountsListBySubscriptionSample.ts
[operationlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/operationListSample.ts
[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-graphservices?view=azure-node-preview
[freesub]: https://azure.microsoft.com/free/
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/graphservices/arm-graphservices/README.md
[typescript]: https://www.typescriptlang.org/docs/home.html

Просмотреть файл

@ -0,0 +1,41 @@
{
"name": "@azure-samples/arm-graphservices-ts-beta",
"private": true,
"version": "1.0.0",
"description": " client library samples for TypeScript (Beta)",
"engines": {
"node": ">=14.0.0"
},
"scripts": {
"build": "tsc",
"prebuild": "rimraf dist/"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Azure/azure-sdk-for-js.git",
"directory": "sdk/graphservices/arm-graphservices"
},
"keywords": [
"node",
"azure",
"typescript",
"browser",
"isomorphic"
],
"author": "Microsoft Corporation",
"license": "MIT",
"bugs": {
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/graphservices/arm-graphservices",
"dependencies": {
"@azure/arm-graphservices": "next",
"dotenv": "latest",
"@azure/identity": "^2.0.1"
},
"devDependencies": {
"@types/node": "^14.0.0",
"typescript": "~4.8.0",
"rimraf": "latest"
}
}

Просмотреть файл

@ -0,0 +1,4 @@
# App registration secret for AAD authentication
AZURE_CLIENT_SECRET=
AZURE_CLIENT_ID=
AZURE_TENANT_ID=

Просмотреть файл

@ -0,0 +1,48 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AccountResource, GraphServices } from "@azure/arm-graphservices";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Create or update account resource.
*
* @summary Create or update account resource.
* x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Create.json
*/
async function createAccountResource() {
const subscriptionId =
process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["GRAPHSERVICES_RESOURCE_GROUP"] || "testResourceGroupGRAM";
const resourceName = "11111111-aaaa-1111-bbbb-1111111111111";
const accountResource: AccountResource = {
properties: { appId: "11111111-aaaa-1111-bbbb-111111111111" },
tags: { tag1: "value1", tag2: "value2" }
};
const credential = new DefaultAzureCredential();
const client = new GraphServices(credential, subscriptionId);
const result = await client.account.beginCreateAndUpdateAndWait(
resourceGroupName,
resourceName,
accountResource
);
console.log(result);
}
async function main() {
createAccountResource();
}
main().catch(console.error);

Просмотреть файл

@ -0,0 +1,40 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { GraphServices } from "@azure/arm-graphservices";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Deletes a account resource.
*
* @summary Deletes a account resource.
* x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Delete.json
*/
async function deleteAccountResource() {
const subscriptionId =
process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] ||
"11111111-aaaa-1111-bbbb-111111111111";
const resourceGroupName =
process.env["GRAPHSERVICES_RESOURCE_GROUP"] || "testResourceGroupGRAM";
const resourceName = "11111111-aaaa-1111-bbbb-111111111111";
const credential = new DefaultAzureCredential();
const client = new GraphServices(credential, subscriptionId);
const result = await client.account.delete(resourceGroupName, resourceName);
console.log(result);
}
async function main() {
deleteAccountResource();
}
main().catch(console.error);

Просмотреть файл

@ -0,0 +1,40 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { GraphServices } from "@azure/arm-graphservices";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Returns account resource for a given name.
*
* @summary Returns account resource for a given name.
* x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Get.json
*/
async function getAccounts() {
const subscriptionId =
process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["GRAPHSERVICES_RESOURCE_GROUP"] || "testResourceGroupGRAM";
const resourceName = "11111111-aaaa-1111-bbbb-111111111111";
const credential = new DefaultAzureCredential();
const client = new GraphServices(credential, subscriptionId);
const result = await client.account.get(resourceGroupName, resourceName);
console.log(result);
}
async function main() {
getAccounts();
}
main().catch(console.error);

Просмотреть файл

@ -0,0 +1,47 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AccountPatchResource, GraphServices } from "@azure/arm-graphservices";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Update account details.
*
* @summary Update account details.
* x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Update.json
*/
async function updateAccountResource() {
const subscriptionId =
process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["GRAPHSERVICES_RESOURCE_GROUP"] || "testResourceGroupGRAM";
const resourceName = "11111111-aaaa-1111-bbbb-111111111111";
const accountResource: AccountPatchResource = {
tags: { tag1: "value1", tag2: "value2" }
};
const credential = new DefaultAzureCredential();
const client = new GraphServices(credential, subscriptionId);
const result = await client.account.update(
resourceGroupName,
resourceName,
accountResource
);
console.log(result);
}
async function main() {
updateAccountResource();
}
main().catch(console.error);

Просмотреть файл

@ -0,0 +1,44 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { GraphServices } from "@azure/arm-graphservices";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Returns list of accounts apps.
*
* @summary Returns list of accounts apps.
* x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_List.json
*/
async function createOrUpdateAccountResource() {
const subscriptionId =
process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["GRAPHSERVICES_RESOURCE_GROUP"] || "testResourceGroupGRAM";
const credential = new DefaultAzureCredential();
const client = new GraphServices(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.accounts.listByResourceGroup(
resourceGroupName
)) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
createOrUpdateAccountResource();
}
main().catch(console.error);

Просмотреть файл

@ -0,0 +1,40 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { GraphServices } from "@azure/arm-graphservices";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Returns list of accounts belonging to a subscription.
*
* @summary Returns list of accounts belonging to a subscription.
* x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_List_Sub.json
*/
async function getListOfAccountsBySubscription() {
const subscriptionId =
process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new GraphServices(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.accounts.listBySubscription()) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
getListOfAccountsBySubscription();
}
main().catch(console.error);

Просмотреть файл

@ -0,0 +1,40 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { GraphServices } from "@azure/arm-graphservices";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Returns list of operations.
*
* @summary Returns list of operations.
* x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Operations_List.json
*/
async function getListOfOperations() {
const subscriptionId =
process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new GraphServices(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.operationOperations.list()) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
getListOfOperations();
}
main().catch(console.error);

Просмотреть файл

@ -0,0 +1,17 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "commonjs",
"moduleResolution": "node",
"resolveJsonModule": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"alwaysStrict": true,
"outDir": "dist",
"rootDir": "src"
},
"include": [
"src/**.ts"
]
}

Просмотреть файл

@ -0,0 +1,148 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import * as coreClient from "@azure/core-client";
import * as coreRestPipeline from "@azure/core-rest-pipeline";
import {
PipelineRequest,
PipelineResponse,
SendRequest
} from "@azure/core-rest-pipeline";
import * as coreAuth from "@azure/core-auth";
import {
AccountsImpl,
AccountImpl,
OperationOperationsImpl
} from "./operations";
import { Accounts, Account, OperationOperations } from "./operationsInterfaces";
import { GraphServicesOptionalParams } from "./models";
export class GraphServices extends coreClient.ServiceClient {
$host: string;
apiVersion: string;
subscriptionId: string;
/**
* Initializes a new instance of the GraphServices class.
* @param credentials Subscription credentials which uniquely identify client subscription.
* @param subscriptionId The ID of the target subscription.
* @param options The parameter options
*/
constructor(
credentials: coreAuth.TokenCredential,
subscriptionId: string,
options?: GraphServicesOptionalParams
) {
if (credentials === undefined) {
throw new Error("'credentials' cannot be null");
}
if (subscriptionId === undefined) {
throw new Error("'subscriptionId' cannot be null");
}
// Initializing default values for options
if (!options) {
options = {};
}
const defaults: GraphServicesOptionalParams = {
requestContentType: "application/json; charset=utf-8",
credential: credentials
};
const packageDetails = `azsdk-js-arm-graphservices/1.0.0-beta.1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
: `${packageDetails}`;
const optionsWithDefaults = {
...defaults,
...options,
userAgentOptions: {
userAgentPrefix
},
endpoint:
options.endpoint ?? options.baseUri ?? "https://management.azure.com"
};
super(optionsWithDefaults);
let bearerTokenAuthenticationPolicyFound: boolean = false;
if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
(pipelinePolicy) =>
pipelinePolicy.name ===
coreRestPipeline.bearerTokenAuthenticationPolicyName
);
}
if (
!options ||
!options.pipeline ||
options.pipeline.getOrderedPolicies().length == 0 ||
!bearerTokenAuthenticationPolicyFound
) {
this.pipeline.removePolicy({
name: coreRestPipeline.bearerTokenAuthenticationPolicyName
});
this.pipeline.addPolicy(
coreRestPipeline.bearerTokenAuthenticationPolicy({
credential: credentials,
scopes:
optionsWithDefaults.credentialScopes ??
`${optionsWithDefaults.endpoint}/.default`,
challengeCallbacks: {
authorizeRequestOnChallenge:
coreClient.authorizeRequestOnClaimChallenge
}
})
);
}
// Parameter assignments
this.subscriptionId = subscriptionId;
// Assigning values to Constant parameters
this.$host = options.$host || "https://management.azure.com";
this.apiVersion = options.apiVersion || "2022-09-22-preview";
this.accounts = new AccountsImpl(this);
this.account = new AccountImpl(this);
this.operationOperations = new OperationOperationsImpl(this);
this.addCustomApiVersionPolicy(options.apiVersion);
}
/** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
private addCustomApiVersionPolicy(apiVersion?: string) {
if (!apiVersion) {
return;
}
const apiVersionPolicy = {
name: "CustomApiVersionPolicy",
async sendRequest(
request: PipelineRequest,
next: SendRequest
): Promise<PipelineResponse> {
const param = request.url.split("?");
if (param.length > 1) {
const newParams = param[1].split("&").map((item) => {
if (item.indexOf("api-version") > -1) {
return "api-version=" + apiVersion;
} else {
return item;
}
});
request.url = param[0] + "?" + newParams.join("&");
}
return next(request);
}
};
this.pipeline.addPolicy(apiVersionPolicy);
}
accounts: Accounts;
account: Account;
operationOperations: OperationOperations;
}

Просмотреть файл

@ -0,0 +1,13 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
/// <reference lib="esnext.asynciterable" />
export { getContinuationToken } from "./pagingHelper";
export * from "./models";
export { GraphServices } from "./graphServices";
export * from "./operationsInterfaces";

Просмотреть файл

@ -0,0 +1,42 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { AbortSignalLike } from "@azure/abort-controller";
import { LongRunningOperation, LroResponse } from "@azure/core-lro";
export function createLroSpec<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
});
}
};
}

Просмотреть файл

@ -0,0 +1,364 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import * as coreClient from "@azure/core-client";
/** The list of accounts. */
export interface AccountResourceList {
/** The link to the next page of items */
nextLink?: string;
/** The list of recommendations. */
value?: AccountResource[];
}
/** Metadata pertaining to creation and last modification of the resource. */
export interface AccountResourceSystemData {
/** The type of identity that created the resource. */
createdByType?: CreatedByType;
/** The timestamp of resource creation (UTC). */
createdAt?: Date;
/** The type of identity that last modified the resource. */
lastModifiedByType?: CreatedByType;
/** The timestamp of resource last modification (UTC) */
lastModifiedAt?: Date;
}
/** Property bag from billing account */
export interface AccountResourceProperties {
/**
* Provisioning state.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly provisioningState?: ProvisioningState;
/** Customer owned application ID */
appId: string;
/**
* Billing Plan Id
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly billingPlanId?: string;
}
/** An Azure resource. */
export interface Resource {
/**
* Azure resource ID.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly id?: string;
/**
* Azure resource name.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly name?: string;
/**
* Azure resource type.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly type?: string;
/** Location of the resource. */
location?: string;
/** resource tags. */
tags?: { [propertyName: string]: 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<string, unknown>;
}
/** Request payload used to update an existing resource's tags. */
export interface TagUpdate {
/** List of key value pairs that describe the resource. This will overwrite the existing tags. */
tags?: { [propertyName: string]: string };
}
/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */
export interface OperationListResult {
/**
* List of operations supported by the resource provider
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly value?: Operation[];
/**
* URL to get the next set of operation list results (if there are any).
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly nextLink?: string;
}
/** Details of a REST API operation, returned from the Resource Provider Operations API */
export interface Operation {
/**
* The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action"
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly name?: string;
/**
* Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly isDataAction?: boolean;
/** Localized display information for this particular operation. */
display?: OperationDisplay;
/**
* The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system"
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly origin?: Origin;
/**
* Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly actionType?: ActionType;
}
/** Localized display information for this particular operation. */
export interface OperationDisplay {
/**
* The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute".
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly provider?: string;
/**
* The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections".
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly resource?: string;
/**
* The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine".
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly operation?: string;
/**
* The short, localized friendly description of the operation; suitable for tool tips and detailed views.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly description?: string;
}
/** Account details */
export interface AccountResource extends Resource {
/**
* 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?: AccountResourceSystemData;
/** Property bag from billing account */
properties: AccountResourceProperties;
}
/** Account patch properties */
export interface AccountPatchResource extends TagUpdate {}
/** Known values of {@link CreatedByType} that the service accepts. */
export enum KnownCreatedByType {
/** User */
User = "User",
/** Application */
Application = "Application",
/** ManagedIdentity */
ManagedIdentity = "ManagedIdentity",
/** Key */
Key = "Key"
}
/**
* Defines values for CreatedByType. \
* {@link KnownCreatedByType} can be used interchangeably with CreatedByType,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **User** \
* **Application** \
* **ManagedIdentity** \
* **Key**
*/
export type CreatedByType = string;
/** Known values of {@link ProvisioningState} that the service accepts. */
export enum KnownProvisioningState {
/** Succeeded */
Succeeded = "Succeeded",
/** Failed */
Failed = "Failed",
/** Canceled */
Canceled = "Canceled"
}
/**
* Defines values for ProvisioningState. \
* {@link KnownProvisioningState} can be used interchangeably with ProvisioningState,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **Succeeded** \
* **Failed** \
* **Canceled**
*/
export type ProvisioningState = string;
/** Known values of {@link Origin} that the service accepts. */
export enum KnownOrigin {
/** User */
User = "user",
/** System */
System = "system",
/** UserSystem */
UserSystem = "user,system"
}
/**
* Defines values for Origin. \
* {@link KnownOrigin} can be used interchangeably with Origin,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **user** \
* **system** \
* **user,system**
*/
export type Origin = string;
/** Known values of {@link ActionType} that the service accepts. */
export enum KnownActionType {
/** Internal */
Internal = "Internal"
}
/**
* Defines values for ActionType. \
* {@link KnownActionType} can be used interchangeably with ActionType,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **Internal**
*/
export type ActionType = string;
/** Optional parameters. */
export interface AccountsListByResourceGroupOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the listByResourceGroup operation. */
export type AccountsListByResourceGroupResponse = AccountResourceList;
/** Optional parameters. */
export interface AccountsListBySubscriptionOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the listBySubscription operation. */
export type AccountsListBySubscriptionResponse = AccountResourceList;
/** Optional parameters. */
export interface AccountsListByResourceGroupNextOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the listByResourceGroupNext operation. */
export type AccountsListByResourceGroupNextResponse = AccountResourceList;
/** Optional parameters. */
export interface AccountsListBySubscriptionNextOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the listBySubscriptionNext operation. */
export type AccountsListBySubscriptionNextResponse = AccountResourceList;
/** Optional parameters. */
export interface AccountGetOptionalParams extends coreClient.OperationOptions {}
/** Contains response data for the get operation. */
export type AccountGetResponse = AccountResource;
/** Optional parameters. */
export interface AccountCreateAndUpdateOptionalParams
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 createAndUpdate operation. */
export type AccountCreateAndUpdateResponse = AccountResource;
/** Optional parameters. */
export interface AccountUpdateOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the update operation. */
export type AccountUpdateResponse = AccountResource;
/** Optional parameters. */
export interface AccountDeleteOptionalParams
extends coreClient.OperationOptions {}
/** Optional parameters. */
export interface OperationListOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the list operation. */
export type OperationListResponse = OperationListResult;
/** Optional parameters. */
export interface OperationListNextOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the listNext operation. */
export type OperationListNextResponse = OperationListResult;
/** Optional parameters. */
export interface GraphServicesOptionalParams
extends coreClient.ServiceClientOptions {
/** server parameter */
$host?: string;
/** Api Version */
apiVersion?: string;
/** Overrides client endpoint. */
endpoint?: string;
}

Просмотреть файл

@ -0,0 +1,408 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import * as coreClient from "@azure/core-client";
export const AccountResourceList: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "AccountResourceList",
modelProperties: {
nextLink: {
serializedName: "nextLink",
type: {
name: "String"
}
},
value: {
serializedName: "value",
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "AccountResource"
}
}
}
}
}
}
};
export const AccountResourceSystemData: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "AccountResourceSystemData",
modelProperties: {
createdByType: {
serializedName: "createdByType",
type: {
name: "String"
}
},
createdAt: {
serializedName: "createdAt",
type: {
name: "DateTime"
}
},
lastModifiedByType: {
serializedName: "lastModifiedByType",
type: {
name: "String"
}
},
lastModifiedAt: {
serializedName: "lastModifiedAt",
type: {
name: "DateTime"
}
}
}
}
};
export const AccountResourceProperties: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "AccountResourceProperties",
modelProperties: {
provisioningState: {
serializedName: "provisioningState",
readOnly: true,
type: {
name: "String"
}
},
appId: {
constraints: {
Pattern: new RegExp(
"(^[A-Za-z0-9]{8}-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}-[A-Za-z0-9]{12}?)$"
)
},
serializedName: "appId",
required: true,
type: {
name: "String"
}
},
billingPlanId: {
constraints: {
Pattern: new RegExp(
"(^[A-Za-z0-9]{8}-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}-[A-Za-z0-9]{12}?)$"
)
},
serializedName: "billingPlanId",
readOnly: true,
type: {
name: "String"
}
}
}
}
};
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"
}
},
location: {
serializedName: "location",
type: {
name: "String"
}
},
tags: {
serializedName: "tags",
type: {
name: "Dictionary",
value: { type: { name: "String" } }
}
}
}
}
};
export const ErrorResponse: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "ErrorResponse",
modelProperties: {
error: {
serializedName: "error",
type: {
name: "Composite",
className: "ErrorDetail"
}
}
}
}
};
export const ErrorDetail: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "ErrorDetail",
modelProperties: {
code: {
serializedName: "code",
readOnly: true,
type: {
name: "String"
}
},
message: {
serializedName: "message",
readOnly: true,
type: {
name: "String"
}
},
target: {
serializedName: "target",
readOnly: true,
type: {
name: "String"
}
},
details: {
serializedName: "details",
readOnly: true,
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "ErrorDetail"
}
}
}
},
additionalInfo: {
serializedName: "additionalInfo",
readOnly: true,
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "ErrorAdditionalInfo"
}
}
}
}
}
}
};
export const ErrorAdditionalInfo: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "ErrorAdditionalInfo",
modelProperties: {
type: {
serializedName: "type",
readOnly: true,
type: {
name: "String"
}
},
info: {
serializedName: "info",
readOnly: true,
type: {
name: "Dictionary",
value: { type: { name: "any" } }
}
}
}
}
};
export const TagUpdate: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "TagUpdate",
modelProperties: {
tags: {
serializedName: "tags",
type: {
name: "Dictionary",
value: { type: { name: "String" } }
}
}
}
}
};
export const OperationListResult: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "OperationListResult",
modelProperties: {
value: {
serializedName: "value",
readOnly: true,
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "Operation"
}
}
}
},
nextLink: {
serializedName: "nextLink",
readOnly: true,
type: {
name: "String"
}
}
}
}
};
export const Operation: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "Operation",
modelProperties: {
name: {
serializedName: "name",
readOnly: true,
type: {
name: "String"
}
},
isDataAction: {
serializedName: "isDataAction",
readOnly: true,
type: {
name: "Boolean"
}
},
display: {
serializedName: "display",
type: {
name: "Composite",
className: "OperationDisplay"
}
},
origin: {
serializedName: "origin",
readOnly: true,
type: {
name: "String"
}
},
actionType: {
serializedName: "actionType",
readOnly: true,
type: {
name: "String"
}
}
}
}
};
export const OperationDisplay: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "OperationDisplay",
modelProperties: {
provider: {
serializedName: "provider",
readOnly: true,
type: {
name: "String"
}
},
resource: {
serializedName: "resource",
readOnly: true,
type: {
name: "String"
}
},
operation: {
serializedName: "operation",
readOnly: true,
type: {
name: "String"
}
},
description: {
serializedName: "description",
readOnly: true,
type: {
name: "String"
}
}
}
}
};
export const AccountResource: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "AccountResource",
modelProperties: {
...Resource.type.modelProperties,
systemData: {
serializedName: "systemData",
type: {
name: "Composite",
className: "AccountResourceSystemData"
}
},
properties: {
serializedName: "properties",
type: {
name: "Composite",
className: "AccountResourceProperties"
}
}
}
}
};
export const AccountPatchResource: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "AccountPatchResource",
modelProperties: {
...TagUpdate.type.modelProperties
}
}
};

Просмотреть файл

@ -0,0 +1,127 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import {
OperationParameter,
OperationURLParameter,
OperationQueryParameter
} from "@azure/core-client";
import {
AccountResource as AccountResourceMapper,
AccountPatchResource as AccountPatchResourceMapper
} from "../models/mappers";
export const accept: OperationParameter = {
parameterPath: "accept",
mapper: {
defaultValue: "application/json",
isConstant: true,
serializedName: "Accept",
type: {
name: "String"
}
}
};
export const $host: OperationURLParameter = {
parameterPath: "$host",
mapper: {
serializedName: "$host",
required: true,
type: {
name: "String"
}
},
skipEncoding: true
};
export const apiVersion: OperationQueryParameter = {
parameterPath: "apiVersion",
mapper: {
defaultValue: "2022-09-22-preview",
isConstant: true,
serializedName: "api-version",
type: {
name: "String"
}
}
};
export const subscriptionId: OperationURLParameter = {
parameterPath: "subscriptionId",
mapper: {
constraints: {
MinLength: 1
},
serializedName: "subscriptionId",
required: true,
type: {
name: "String"
}
}
};
export const resourceGroupName: OperationURLParameter = {
parameterPath: "resourceGroupName",
mapper: {
constraints: {
MaxLength: 90,
MinLength: 1
},
serializedName: "resourceGroupName",
required: true,
type: {
name: "String"
}
}
};
export const nextLink: OperationURLParameter = {
parameterPath: "nextLink",
mapper: {
serializedName: "nextLink",
required: true,
type: {
name: "String"
}
},
skipEncoding: true
};
export const resourceName: OperationURLParameter = {
parameterPath: "resourceName",
mapper: {
serializedName: "resourceName",
required: true,
type: {
name: "String"
}
}
};
export const contentType: OperationParameter = {
parameterPath: ["options", "contentType"],
mapper: {
defaultValue: "application/json",
isConstant: true,
serializedName: "Content-Type",
type: {
name: "String"
}
}
};
export const accountResource: OperationParameter = {
parameterPath: "accountResource",
mapper: AccountResourceMapper
};
export const accountResource1: OperationParameter = {
parameterPath: "accountResource",
mapper: AccountPatchResourceMapper
};

Просмотреть файл

@ -0,0 +1,295 @@
/*
* 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 { Account } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { GraphServices } from "../graphServices";
import {
SimplePollerLike,
OperationState,
createHttpPoller
} from "@azure/core-lro";
import { createLroSpec } from "../lroImpl";
import {
AccountGetOptionalParams,
AccountGetResponse,
AccountResource,
AccountCreateAndUpdateOptionalParams,
AccountCreateAndUpdateResponse,
AccountPatchResource,
AccountUpdateOptionalParams,
AccountUpdateResponse,
AccountDeleteOptionalParams
} from "../models";
/** Class containing Account operations. */
export class AccountImpl implements Account {
private readonly client: GraphServices;
/**
* Initialize a new instance of the class Account class.
* @param client Reference to the service client
*/
constructor(client: GraphServices) {
this.client = client;
}
/**
* Returns account resource for a given name.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the resource.
* @param options The options parameters.
*/
get(
resourceGroupName: string,
resourceName: string,
options?: AccountGetOptionalParams
): Promise<AccountGetResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, resourceName, options },
getOperationSpec
);
}
/**
* Create or update account resource.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the resource.
* @param accountResource Account details.
* @param options The options parameters.
*/
async beginCreateAndUpdate(
resourceGroupName: string,
resourceName: string,
accountResource: AccountResource,
options?: AccountCreateAndUpdateOptionalParams
): Promise<
SimplePollerLike<
OperationState<AccountCreateAndUpdateResponse>,
AccountCreateAndUpdateResponse
>
> {
const directSendOperation = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec
): Promise<AccountCreateAndUpdateResponse> => {
return this.client.sendOperationRequest(args, spec);
};
const sendOperationFn = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec
) => {
let currentRawResponse:
| coreClient.FullOperationResponse
| undefined = undefined;
const providedCallback = args.options?.onResponse;
const callback: coreClient.RawResponseCallback = (
rawResponse: coreClient.FullOperationResponse,
flatResponse: unknown
) => {
currentRawResponse = rawResponse;
providedCallback?.(rawResponse, flatResponse);
};
const updatedArgs = {
...args,
options: {
...args.options,
onResponse: callback
}
};
const flatResponse = await directSendOperation(updatedArgs, spec);
return {
flatResponse,
rawResponse: {
statusCode: currentRawResponse!.status,
body: currentRawResponse!.parsedBody,
headers: currentRawResponse!.headers.toJSON()
}
};
};
const lro = createLroSpec({
sendOperationFn,
args: { resourceGroupName, resourceName, accountResource, options },
spec: createAndUpdateOperationSpec
});
const poller = await createHttpPoller<
AccountCreateAndUpdateResponse,
OperationState<AccountCreateAndUpdateResponse>
>(lro, {
restoreFrom: options?.resumeFrom,
intervalInMs: options?.updateIntervalInMs,
resourceLocationConfig: "azure-async-operation"
});
await poller.poll();
return poller;
}
/**
* Create or update account resource.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the resource.
* @param accountResource Account details.
* @param options The options parameters.
*/
async beginCreateAndUpdateAndWait(
resourceGroupName: string,
resourceName: string,
accountResource: AccountResource,
options?: AccountCreateAndUpdateOptionalParams
): Promise<AccountCreateAndUpdateResponse> {
const poller = await this.beginCreateAndUpdate(
resourceGroupName,
resourceName,
accountResource,
options
);
return poller.pollUntilDone();
}
/**
* Update account details.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the resource.
* @param accountResource Account patch details.
* @param options The options parameters.
*/
update(
resourceGroupName: string,
resourceName: string,
accountResource: AccountPatchResource,
options?: AccountUpdateOptionalParams
): Promise<AccountUpdateResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, resourceName, accountResource, options },
updateOperationSpec
);
}
/**
* Deletes a account resource.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the resource.
* @param options The options parameters.
*/
delete(
resourceGroupName: string,
resourceName: string,
options?: AccountDeleteOptionalParams
): Promise<void> {
return this.client.sendOperationRequest(
{ resourceGroupName, resourceName, options },
deleteOperationSpec
);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const getOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.GraphServices/accounts/{resourceName}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.AccountResource
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.resourceName
],
headerParameters: [Parameters.accept],
serializer
};
const createAndUpdateOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.GraphServices/accounts/{resourceName}",
httpMethod: "PUT",
responses: {
200: {
bodyMapper: Mappers.AccountResource
},
201: {
bodyMapper: Mappers.AccountResource
},
202: {
bodyMapper: Mappers.AccountResource
},
204: {
bodyMapper: Mappers.AccountResource
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
requestBody: Parameters.accountResource,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.resourceName
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const updateOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.GraphServices/accounts/{resourceName}",
httpMethod: "PATCH",
responses: {
200: {
bodyMapper: Mappers.AccountResource
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
requestBody: Parameters.accountResource1,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.resourceName
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const deleteOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.GraphServices/accounts/{resourceName}",
httpMethod: "DELETE",
responses: {
200: {},
204: {},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.resourceName
],
headerParameters: [Parameters.accept],
serializer
};

Просмотреть файл

@ -0,0 +1,303 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
import { setContinuationToken } from "../pagingHelper";
import { Accounts } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { GraphServices } from "../graphServices";
import {
AccountResource,
AccountsListByResourceGroupNextOptionalParams,
AccountsListByResourceGroupOptionalParams,
AccountsListByResourceGroupResponse,
AccountsListBySubscriptionNextOptionalParams,
AccountsListBySubscriptionOptionalParams,
AccountsListBySubscriptionResponse,
AccountsListByResourceGroupNextResponse,
AccountsListBySubscriptionNextResponse
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Class containing Accounts operations. */
export class AccountsImpl implements Accounts {
private readonly client: GraphServices;
/**
* Initialize a new instance of the class Accounts class.
* @param client Reference to the service client
*/
constructor(client: GraphServices) {
this.client = client;
}
/**
* Returns list of accounts apps.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param options The options parameters.
*/
public listByResourceGroup(
resourceGroupName: string,
options?: AccountsListByResourceGroupOptionalParams
): PagedAsyncIterableIterator<AccountResource> {
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?: AccountsListByResourceGroupOptionalParams,
settings?: PageSettings
): AsyncIterableIterator<AccountResource[]> {
let result: AccountsListByResourceGroupResponse;
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?: AccountsListByResourceGroupOptionalParams
): AsyncIterableIterator<AccountResource> {
for await (const page of this.listByResourceGroupPagingPage(
resourceGroupName,
options
)) {
yield* page;
}
}
/**
* Returns list of accounts belonging to a subscription.
* @param options The options parameters.
*/
public listBySubscription(
options?: AccountsListBySubscriptionOptionalParams
): PagedAsyncIterableIterator<AccountResource> {
const iter = this.listBySubscriptionPagingAll(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.listBySubscriptionPagingPage(options, settings);
}
};
}
private async *listBySubscriptionPagingPage(
options?: AccountsListBySubscriptionOptionalParams,
settings?: PageSettings
): AsyncIterableIterator<AccountResource[]> {
let result: AccountsListBySubscriptionResponse;
let continuationToken = settings?.continuationToken;
if (!continuationToken) {
result = await this._listBySubscription(options);
let page = result.value || [];
continuationToken = result.nextLink;
setContinuationToken(page, continuationToken);
yield page;
}
while (continuationToken) {
result = await this._listBySubscriptionNext(continuationToken, options);
continuationToken = result.nextLink;
let page = result.value || [];
setContinuationToken(page, continuationToken);
yield page;
}
}
private async *listBySubscriptionPagingAll(
options?: AccountsListBySubscriptionOptionalParams
): AsyncIterableIterator<AccountResource> {
for await (const page of this.listBySubscriptionPagingPage(options)) {
yield* page;
}
}
/**
* Returns list of accounts apps.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param options The options parameters.
*/
private _listByResourceGroup(
resourceGroupName: string,
options?: AccountsListByResourceGroupOptionalParams
): Promise<AccountsListByResourceGroupResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, options },
listByResourceGroupOperationSpec
);
}
/**
* Returns list of accounts belonging to a subscription.
* @param options The options parameters.
*/
private _listBySubscription(
options?: AccountsListBySubscriptionOptionalParams
): Promise<AccountsListBySubscriptionResponse> {
return this.client.sendOperationRequest(
{ options },
listBySubscriptionOperationSpec
);
}
/**
* 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?: AccountsListByResourceGroupNextOptionalParams
): Promise<AccountsListByResourceGroupNextResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, nextLink, options },
listByResourceGroupNextOperationSpec
);
}
/**
* ListBySubscriptionNext
* @param nextLink The nextLink from the previous successful call to the ListBySubscription method.
* @param options The options parameters.
*/
private _listBySubscriptionNext(
nextLink: string,
options?: AccountsListBySubscriptionNextOptionalParams
): Promise<AccountsListBySubscriptionNextResponse> {
return this.client.sendOperationRequest(
{ nextLink, options },
listBySubscriptionNextOperationSpec
);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const listByResourceGroupOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.GraphServices/accounts",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.AccountResourceList
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName
],
headerParameters: [Parameters.accept],
serializer
};
const listBySubscriptionOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/providers/Microsoft.GraphServices/accounts",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.AccountResourceList
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [Parameters.$host, Parameters.subscriptionId],
headerParameters: [Parameters.accept],
serializer
};
const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.AccountResourceList
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.nextLink
],
headerParameters: [Parameters.accept],
serializer
};
const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.AccountResourceList
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.nextLink
],
headerParameters: [Parameters.accept],
serializer
};

Просмотреть файл

@ -0,0 +1,11 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
export * from "./accounts";
export * from "./account";
export * from "./operationOperations";

Просмотреть файл

@ -0,0 +1,149 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
import { setContinuationToken } from "../pagingHelper";
import { OperationOperations } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { GraphServices } from "../graphServices";
import {
Operation,
OperationListNextOptionalParams,
OperationListOptionalParams,
OperationListResponse,
OperationListNextResponse
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Class containing OperationOperations operations. */
export class OperationOperationsImpl implements OperationOperations {
private readonly client: GraphServices;
/**
* Initialize a new instance of the class OperationOperations class.
* @param client Reference to the service client
*/
constructor(client: GraphServices) {
this.client = client;
}
/**
* Returns list of operations.
* @param options The options parameters.
*/
public list(
options?: OperationListOptionalParams
): PagedAsyncIterableIterator<Operation> {
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?: OperationListOptionalParams,
settings?: PageSettings
): AsyncIterableIterator<Operation[]> {
let result: OperationListResponse;
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?: OperationListOptionalParams
): AsyncIterableIterator<Operation> {
for await (const page of this.listPagingPage(options)) {
yield* page;
}
}
/**
* Returns list of operations.
* @param options The options parameters.
*/
private _list(
options?: OperationListOptionalParams
): Promise<OperationListResponse> {
return this.client.sendOperationRequest({ options }, listOperationSpec);
}
/**
* ListNext
* @param nextLink The nextLink from the previous successful call to the List method.
* @param options The options parameters.
*/
private _listNext(
nextLink: string,
options?: OperationListNextOptionalParams
): Promise<OperationListNextResponse> {
return this.client.sendOperationRequest(
{ nextLink, options },
listNextOperationSpec
);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const listOperationSpec: coreClient.OperationSpec = {
path: "/providers/Microsoft.GraphServices/operations",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.OperationListResult
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [Parameters.$host],
headerParameters: [Parameters.accept],
serializer
};
const listNextOperationSpec: coreClient.OperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.OperationListResult
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
urlParameters: [Parameters.$host, Parameters.nextLink],
headerParameters: [Parameters.accept],
serializer
};

Просмотреть файл

@ -0,0 +1,90 @@
/*
* 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 { SimplePollerLike, OperationState } from "@azure/core-lro";
import {
AccountGetOptionalParams,
AccountGetResponse,
AccountResource,
AccountCreateAndUpdateOptionalParams,
AccountCreateAndUpdateResponse,
AccountPatchResource,
AccountUpdateOptionalParams,
AccountUpdateResponse,
AccountDeleteOptionalParams
} from "../models";
/** Interface representing a Account. */
export interface Account {
/**
* Returns account resource for a given name.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the resource.
* @param options The options parameters.
*/
get(
resourceGroupName: string,
resourceName: string,
options?: AccountGetOptionalParams
): Promise<AccountGetResponse>;
/**
* Create or update account resource.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the resource.
* @param accountResource Account details.
* @param options The options parameters.
*/
beginCreateAndUpdate(
resourceGroupName: string,
resourceName: string,
accountResource: AccountResource,
options?: AccountCreateAndUpdateOptionalParams
): Promise<
SimplePollerLike<
OperationState<AccountCreateAndUpdateResponse>,
AccountCreateAndUpdateResponse
>
>;
/**
* Create or update account resource.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the resource.
* @param accountResource Account details.
* @param options The options parameters.
*/
beginCreateAndUpdateAndWait(
resourceGroupName: string,
resourceName: string,
accountResource: AccountResource,
options?: AccountCreateAndUpdateOptionalParams
): Promise<AccountCreateAndUpdateResponse>;
/**
* Update account details.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the resource.
* @param accountResource Account patch details.
* @param options The options parameters.
*/
update(
resourceGroupName: string,
resourceName: string,
accountResource: AccountPatchResource,
options?: AccountUpdateOptionalParams
): Promise<AccountUpdateResponse>;
/**
* Deletes a account resource.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the resource.
* @param options The options parameters.
*/
delete(
resourceGroupName: string,
resourceName: string,
options?: AccountDeleteOptionalParams
): Promise<void>;
}

Просмотреть файл

@ -0,0 +1,35 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import {
AccountResource,
AccountsListByResourceGroupOptionalParams,
AccountsListBySubscriptionOptionalParams
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Interface representing a Accounts. */
export interface Accounts {
/**
* Returns list of accounts apps.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param options The options parameters.
*/
listByResourceGroup(
resourceGroupName: string,
options?: AccountsListByResourceGroupOptionalParams
): PagedAsyncIterableIterator<AccountResource>;
/**
* Returns list of accounts belonging to a subscription.
* @param options The options parameters.
*/
listBySubscription(
options?: AccountsListBySubscriptionOptionalParams
): PagedAsyncIterableIterator<AccountResource>;
}

Просмотреть файл

@ -0,0 +1,11 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
export * from "./accounts";
export * from "./account";
export * from "./operationOperations";

Просмотреть файл

@ -0,0 +1,22 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import { Operation, OperationListOptionalParams } from "../models";
/// <reference lib="esnext.asynciterable" />
/** Interface representing a OperationOperations. */
export interface OperationOperations {
/**
* Returns list of operations.
* @param options The options parameters.
*/
list(
options?: OperationListOptionalParams
): PagedAsyncIterableIterator<Operation>;
}

Просмотреть файл

@ -0,0 +1,39 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
export interface PageInfo {
continuationToken?: string;
}
const pageMap = new WeakMap<object, PageInfo>();
/**
* Given the last `.value` produced by the `byPage` iterator,
* returns a continuation token that can be used to begin paging from
* that point later.
* @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.
* @returns The continuation token that can be passed into byPage() during future calls.
*/
export function getContinuationToken(page: unknown): string | undefined {
if (typeof page !== "object" || page === null) {
return undefined;
}
return pageMap.get(page)?.continuationToken;
}
export function setContinuationToken(
page: unknown,
continuationToken: string | undefined
): void {
if (typeof page !== "object" || page === null || !continuationToken) {
return;
}
const pageInfo = pageMap.get(page) ?? {};
pageInfo.continuationToken = continuationToken;
pageMap.set(page, pageInfo);
}

Просмотреть файл

@ -0,0 +1,64 @@
/*
* 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 {
env,
Recorder,
RecorderStartOptions,
delay,
isPlaybackMode,
} from "@azure-tools/test-recorder";
import { createTestCredential } from "@azure-tools/test-credential";
import { assert } from "chai";
import { Context } from "mocha";
import { GraphServices } from "../src/graphServices";
const replaceableVariables: Record<string, string> = {
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
};
export const testPollingOptions = {
updateIntervalInMs: isPlaybackMode() ? 0 : undefined,
};
describe("GraphServices test", () => {
let recorder: Recorder;
let subscriptionId: string;
let client: GraphServices;
let location: string;
let resourceGroup: string;
let resourcename: string;
beforeEach(async function (this: Context) {
recorder = new Recorder(this.currentTest);
await recorder.start(recorderOptions);
subscriptionId = env.SUBSCRIPTION_ID || '';
// This is an example of how the environment variables are used
const credential = createTestCredential();
client = new GraphServices(credential, subscriptionId, recorder.configureClientOptions({}));
location = "eastus";
resourceGroup = "czwjstest";
resourcename = "resourcetest";
});
afterEach(async function () {
await recorder.stop();
});
it("operation list test", async function () {
const res = await client.operationOperations.list();
});
})

Просмотреть файл

@ -0,0 +1,33 @@
{
"compilerOptions": {
"module": "es6",
"moduleResolution": "node",
"strict": true,
"target": "es6",
"sourceMap": true,
"declarationMap": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"lib": [
"es6",
"dom"
],
"declaration": true,
"outDir": "./dist-esm",
"importHelpers": true,
"paths": {
"@azure/arm-graphservices": [
"./src/index"
]
}
},
"include": [
"./src/**/*.ts",
"./test/**/*.ts",
"samples-dev/**/*.ts"
],
"exclude": [
"node_modules"
]
}

Просмотреть файл

@ -0,0 +1,38 @@
# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file.
trigger:
branches:
include:
- main
- feature/*
- release/*
- hotfix/*
exclude:
- feature/v4
paths:
include:
- sdk/graphservices/arm-graphservices
- sdk/graphservices/ci.mgmt.yml
pr:
branches:
include:
- main
- feature/*
- release/*
- hotfix/*
exclude:
- feature/v4
paths:
include:
- sdk/graphservices/arm-graphservices
- sdk/graphservices/ci.mgmt.yml
extends:
template: /eng/pipelines/templates/stages/archetype-sdk-client.yml
parameters:
ServiceDirectory: graphservices
Artifacts:
- name: azure-arm-graphservices
safeName: azurearmgraphservices