diff --git a/sdk/dfp/arm-dfp/LICENSE.txt b/sdk/dfp/arm-dfp/LICENSE.txt new file mode 100644 index 000000000000..2d3163745319 --- /dev/null +++ b/sdk/dfp/arm-dfp/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2021 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. diff --git a/sdk/dfp/arm-dfp/README.md b/sdk/dfp/arm-dfp/README.md new file mode 100644 index 000000000000..13483fa0a25f --- /dev/null +++ b/sdk/dfp/arm-dfp/README.md @@ -0,0 +1,102 @@ +## Azure DFPManagementClient SDK for JavaScript + +This package contains an isomorphic SDK for DFPManagementClient. + +### Currently supported environments + +- Node.js version 6.x.x or higher +- Browser JavaScript + +### How to Install + +```bash +npm install @azure/arm-dfp +``` + +### How to use + +#### nodejs - client creation and getDetails instances as an example written in TypeScript. + +##### Install @azure/ms-rest-nodeauth + +- Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`. +```bash +npm install @azure/ms-rest-nodeauth@"^3.0.0" +``` + +##### Sample code + +While the below sample uses the interactive login, other authentication options can be found in the [README.md file of @azure/ms-rest-nodeauth](https://www.npmjs.com/package/@azure/ms-rest-nodeauth) package +```typescript +const msRestNodeAuth = require("@azure/ms-rest-nodeauth"); +const { DFPManagementClient } = require("@azure/arm-dfp"); +const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; + +msRestNodeAuth.interactiveLogin().then((creds) => { + const client = new DFPManagementClient(creds, subscriptionId); + const resourceGroupName = "testresourceGroupName"; + const instanceName = "testinstanceName"; + client.instances.getDetails(resourceGroupName, instanceName).then((result) => { + console.log("The result is:"); + console.log(result); + }); +}).catch((err) => { + console.error(err); +}); +``` + +#### browser - Authentication, client creation and getDetails instances as an example written in JavaScript. + +##### Install @azure/ms-rest-browserauth + +```bash +npm install @azure/ms-rest-browserauth +``` + +##### Sample code + +See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. + +- index.html +```html + + + + @azure/arm-dfp sample + + + + + + + + +``` + +## 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/sdk/dfp/arm-dfp/README.png) diff --git a/sdk/dfp/arm-dfp/package.json b/sdk/dfp/arm-dfp/package.json new file mode 100644 index 000000000000..29d7ee28c546 --- /dev/null +++ b/sdk/dfp/arm-dfp/package.json @@ -0,0 +1,58 @@ +{ + "name": "@azure/arm-dfp", + "author": "Microsoft Corporation", + "description": "DFPManagementClient Library with typescript type definitions for node.js and browser.", + "version": "1.0.0", + "dependencies": { + "@azure/ms-rest-azure-js": "^2.0.1", + "@azure/ms-rest-js": "^2.0.4", + "tslib": "^1.10.0" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "license": "MIT", + "main": "./dist/arm-dfp.js", + "module": "./esm/dFPManagementClient.js", + "types": "./esm/dFPManagementClient.d.ts", + "devDependencies": { + "typescript": "^3.5.3", + "rollup": "^1.18.0", + "rollup-plugin-node-resolve": "^5.2.0", + "rollup-plugin-sourcemaps": "^0.4.2", + "uglify-js": "^3.6.0" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/dfp/arm-dfp", + "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", + "esm/**/*.js", + "esm/**/*.js.map", + "esm/**/*.d.ts", + "esm/**/*.d.ts.map", + "src/**/*.ts", + "README.md", + "rollup.config.js", + "tsconfig.json" + ], + "scripts": { + "build": "tsc && rollup -c rollup.config.js && npm run minify", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-dfp.js.map'\" -o ./dist/arm-dfp.min.js ./dist/arm-dfp.js", + "prepack": "npm install && npm run build" + }, + "sideEffects": false, + "autoPublish": true +} diff --git a/sdk/dfp/arm-dfp/rollup.config.js b/sdk/dfp/arm-dfp/rollup.config.js new file mode 100644 index 000000000000..782fe0e836c0 --- /dev/null +++ b/sdk/dfp/arm-dfp/rollup.config.js @@ -0,0 +1,37 @@ +import rollup from "rollup"; +import nodeResolve from "rollup-plugin-node-resolve"; +import sourcemaps from "rollup-plugin-sourcemaps"; + +/** + * @type {rollup.RollupFileOptions} + */ +const config = { + input: "./esm/dFPManagementClient.js", + external: [ + "@azure/ms-rest-js", + "@azure/ms-rest-azure-js" + ], + output: { + file: "./dist/arm-dfp.js", + format: "umd", + name: "Azure.ArmDfp", + sourcemap: true, + globals: { + "@azure/ms-rest-js": "msRest", + "@azure/ms-rest-azure-js": "msRestAzure" + }, + banner: `/* + * 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. + */` + }, + plugins: [ + nodeResolve({ mainFields: ['module', 'main'] }), + sourcemaps() + ] +}; + +export default config; diff --git a/sdk/dfp/arm-dfp/src/dFPManagementClient.ts b/sdk/dfp/arm-dfp/src/dFPManagementClient.ts new file mode 100644 index 000000000000..77df093ebd40 --- /dev/null +++ b/sdk/dfp/arm-dfp/src/dFPManagementClient.ts @@ -0,0 +1,139 @@ +/* + * 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 msRest from "@azure/ms-rest-js"; +import * as Models from "./models"; +import * as Mappers from "./models/mappers"; +import * as Parameters from "./models/parameters"; +import * as operations from "./operations"; +import { DFPManagementClientContext } from "./dFPManagementClientContext"; + + +class DFPManagementClient extends DFPManagementClientContext { + // Operation groups + instances: operations.Instances; + + /** + * Initializes a new instance of the DFPManagementClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId A unique identifier for a Microsoft Azure subscription. The subscription + * ID forms part of the URI for every service call. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.DFPManagementClientOptions) { + super(credentials, subscriptionId, options); + this.instances = new operations.Instances(this); + } + + /** + * Lists all of the available DFP REST API operations. + * @param [options] The optional parameters + * @returns Promise + */ + listOperations(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + listOperations(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + listOperations(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listOperations(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + options + }, + listOperationsOperationSpec, + callback) as Promise; + } + + /** + * Lists all of the available DFP REST API operations. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listOperationsNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listOperationsNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listOperationsNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listOperationsNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + nextPageLink, + options + }, + listOperationsNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Dynamics365FraudProtection/operations", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listOperationsNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +export { + DFPManagementClient, + DFPManagementClientContext, + Models as DFPManagementModels, + Mappers as DFPManagementMappers +}; +export * from "./operations"; diff --git a/sdk/dfp/arm-dfp/src/dFPManagementClientContext.ts b/sdk/dfp/arm-dfp/src/dFPManagementClientContext.ts new file mode 100644 index 000000000000..e6bfcad1e26d --- /dev/null +++ b/sdk/dfp/arm-dfp/src/dFPManagementClientContext.ts @@ -0,0 +1,62 @@ +/* + * 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 Models from "./models"; +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; + +const packageName = "@azure/arm-dfp"; +const packageVersion = "1.0.0"; + +export class DFPManagementClientContext extends msRestAzure.AzureServiceClient { + credentials: msRest.ServiceClientCredentials; + subscriptionId: string; + apiVersion?: string; + + /** + * Initializes a new instance of the DFPManagementClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId A unique identifier for a Microsoft Azure subscription. The subscription + * ID forms part of the URI for every service call. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.DFPManagementClientOptions) { + if (credentials == undefined) { + throw new Error('\'credentials\' cannot be null.'); + } + if (subscriptionId == undefined) { + throw new Error('\'subscriptionId\' cannot be null.'); + } + + if (!options) { + options = {}; + } + if(!options.userAgent) { + const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); + options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; + } + + super(credentials, options); + + this.apiVersion = '2021-02-01-preview'; + this.acceptLanguage = 'en-US'; + this.longRunningOperationRetryTimeout = 30; + this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; + this.requestContentType = "application/json; charset=utf-8"; + this.credentials = credentials; + this.subscriptionId = subscriptionId; + + if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + this.acceptLanguage = options.acceptLanguage; + } + if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; + } + } +} diff --git a/sdk/dfp/arm-dfp/src/models/index.ts b/sdk/dfp/arm-dfp/src/models/index.ts new file mode 100644 index 000000000000..c405d6a37c5c --- /dev/null +++ b/sdk/dfp/arm-dfp/src/models/index.ts @@ -0,0 +1,650 @@ +/* + * 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 { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/ms-rest-js"; + +export { BaseResource, CloudError }; + +/** + * Display information of an operation. + */ +export interface OperationDisplayValue { + /** + * Friendly name of the operation. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly operation?: string; + /** + * Friendly name of the resource type the operation applies to. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly resource?: string; + /** + * Friendly description of the operation. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly description?: string; + /** + * Friendly name of the resource provider. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly provider?: string; +} + +/** + * Metadata pertaining to creation and last modification of the resource. + */ +export interface SystemData { + /** + * The identity that created the resource. + */ + createdBy?: string; + /** + * The type of identity that created the resource. Possible values include: 'User', + * 'Application', 'ManagedIdentity', 'Key' + */ + createdByType?: CreatedByType; + /** + * The timestamp of resource creation (UTC). + */ + createdAt?: Date; + /** + * The identity that last modified the resource. + */ + lastModifiedBy?: string; + /** + * The type of identity that last modified the resource. Possible values include: 'User', + * 'Application', 'ManagedIdentity', 'Key' + */ + lastModifiedByType?: CreatedByType; + /** + * The timestamp of resource last modification (UTC) + */ + lastModifiedAt?: Date; +} + +/** + * Represents an instance of a DFP instance resource. + */ +export interface DFPInstance extends BaseResource { + /** + * A collection of DFP instance administrators + */ + administration?: DFPInstanceAdministrators; + /** + * The current deployment state of DFP resource. The provisioningState is to indicate states for + * resource provisioning. Possible values include: 'Deleting', 'Succeeded', 'Failed', 'Paused', + * 'Suspended', 'Provisioning', 'Updating', 'Suspending', 'Pausing', 'Resuming', 'Preparing', + * 'Scaling' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly provisioningState?: ProvisioningState; + /** + * Location of the DFP resource. + */ + location: string; + /** + * Key-value pairs of additional resource provisioning properties. + */ + tags?: { [propertyName: string]: string }; + /** + * Metadata pertaining to creation and last modification of the resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly systemData?: SystemData; +} + +/** + * An array of administrator user identities + */ +export interface DFPInstanceAdministrators { + /** + * An array of administrator user identities. + */ + members?: string[]; +} + +/** + * Provision request specification + */ +export interface DFPInstanceUpdateParameters { + /** + * Key-value pairs of additional provisioning properties. + */ + tags?: { [propertyName: string]: string }; + /** + * A collection of DFP instance administrators + */ + administration?: DFPInstanceAdministrators; +} + +/** + * Details of DFP instance name request body. + */ +export interface CheckInstanceNameAvailabilityParameters { + /** + * Name for checking availability. + */ + name?: string; + /** + * The resource type of DFP instance. Default value: + * 'Microsoft.Dynamics365FraudProtection/instances'. + */ + type?: string; +} + +/** + * The checking result of DFP instance name availability. + */ +export interface CheckInstanceNameAvailabilityResult { + /** + * Indicator of availability of the DFP instance name. + */ + nameAvailable?: boolean; + /** + * The reason of unavailability. + */ + reason?: string; + /** + * The detailed message of the request unavailability. + */ + message?: string; +} + +/** + * Common fields that are returned in the response for all Azure Resource Manager resources + * @summary Resource + */ +export interface Resource extends BaseResource { + /** + * Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * The name of the resource + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + * "Microsoft.Storage/storageAccounts" + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; +} + +/** + * The resource model definition for a Azure Resource Manager proxy resource. It will not have tags + * and a location + * @summary Proxy Resource + */ +export interface ProxyResource extends Resource { +} + +/** + * The resource model definition for an Azure Resource Manager tracked top level resource which has + * 'tags' and a 'location' + * @summary Tracked Resource + */ +export interface TrackedResource extends Resource { + /** + * Resource tags. + */ + tags?: { [propertyName: string]: string }; + /** + * The geo-location where the resource lives + */ + location: string; +} + +/** + * The resource model definition for an Azure Resource Manager resource with an etag. + * @summary Entity Resource + */ +export interface AzureEntityResource extends Resource { + /** + * Resource Etag. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly etag?: string; +} + +/** + * 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?: any; +} + +/** + * 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[]; +} + +/** + * Common error response for all Azure Resource Manager APIs to return error details for failed + * operations. (This also follows the OData error response format.). + * @summary Error response + */ +export interface ErrorResponse { + /** + * The error object. + */ + error?: ErrorDetail; +} + +/** + * 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; +} + +/** + * Details of a REST API operation, returned from the Resource Provider Operations API + * @summary REST API Operation + */ +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". Possible values include: 'user', 'system', + * '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. + * Possible values include: 'Internal' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly actionType?: ActionType; +} + +/** + * An interface representing DFPManagementClientOptions. + */ +export interface DFPManagementClientOptions extends AzureServiceClientOptions { + baseUri?: string; +} + +/** + * @interface + * An array of DFP instance resources. + * @extends Array + */ +export interface DFPInstances extends Array { + /** + * 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; +} + +/** + * @interface + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link + * to get the next set of results. + * @extends Array + */ +export interface OperationListResult extends Array { + /** + * 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; +} + +/** + * Defines values for ProvisioningState. + * Possible values include: 'Deleting', 'Succeeded', 'Failed', 'Paused', 'Suspended', + * 'Provisioning', 'Updating', 'Suspending', 'Pausing', 'Resuming', 'Preparing', 'Scaling' + * @readonly + * @enum {string} + */ +export type ProvisioningState = 'Deleting' | 'Succeeded' | 'Failed' | 'Paused' | 'Suspended' | 'Provisioning' | 'Updating' | 'Suspending' | 'Pausing' | 'Resuming' | 'Preparing' | 'Scaling'; + +/** + * Defines values for CreatedByType. + * Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + * @readonly + * @enum {string} + */ +export type CreatedByType = 'User' | 'Application' | 'ManagedIdentity' | 'Key'; + +/** + * Defines values for Origin. + * Possible values include: 'user', 'system', 'user,system' + * @readonly + * @enum {string} + */ +export type Origin = 'user' | 'system' | 'user,system'; + +/** + * Defines values for ActionType. + * Possible values include: 'Internal' + * @readonly + * @enum {string} + */ +export type ActionType = 'Internal'; + +/** + * Contains response data for the getDetails operation. + */ +export type InstancesGetDetailsResponse = DFPInstance & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: DFPInstance; + }; +}; + +/** + * Contains response data for the create operation. + */ +export type InstancesCreateResponse = DFPInstance & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: DFPInstance; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type InstancesUpdateResponse = DFPInstance & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: DFPInstance; + }; +}; + +/** + * Contains response data for the listByResourceGroup operation. + */ +export type InstancesListByResourceGroupResponse = DFPInstances & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: DFPInstances; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type InstancesListResponse = DFPInstances & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: DFPInstances; + }; +}; + +/** + * Contains response data for the checkNameAvailability operation. + */ +export type InstancesCheckNameAvailabilityResponse = CheckInstanceNameAvailabilityResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CheckInstanceNameAvailabilityResult; + }; +}; + +/** + * Contains response data for the beginCreate operation. + */ +export type InstancesBeginCreateResponse = DFPInstance & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: DFPInstance; + }; +}; + +/** + * Contains response data for the beginUpdate operation. + */ +export type InstancesBeginUpdateResponse = DFPInstance & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: DFPInstance; + }; +}; + +/** + * Contains response data for the listByResourceGroupNext operation. + */ +export type InstancesListByResourceGroupNextResponse = DFPInstances & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: DFPInstances; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type InstancesListNextResponse = DFPInstances & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: DFPInstances; + }; +}; + +/** + * Contains response data for the listOperations operation. + */ +export type ListOperationsResponse = OperationListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: OperationListResult; + }; +}; + +/** + * Contains response data for the listOperationsNext operation. + */ +export type ListOperationsNextResponse = OperationListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: OperationListResult; + }; +}; diff --git a/sdk/dfp/arm-dfp/src/models/instancesMappers.ts b/sdk/dfp/arm-dfp/src/models/instancesMappers.ts new file mode 100644 index 000000000000..bb30afdd6bdb --- /dev/null +++ b/sdk/dfp/arm-dfp/src/models/instancesMappers.ts @@ -0,0 +1,25 @@ +/* + * 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 { + AzureEntityResource, + BaseResource, + CheckInstanceNameAvailabilityParameters, + CheckInstanceNameAvailabilityResult, + DFPInstance, + DFPInstanceAdministrators, + DFPInstances, + DFPInstanceUpdateParameters, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + ProxyResource, + Resource, + SystemData, + TrackedResource +} from "../models/mappers"; diff --git a/sdk/dfp/arm-dfp/src/models/mappers.ts b/sdk/dfp/arm-dfp/src/models/mappers.ts new file mode 100644 index 000000000000..b7ce5208310d --- /dev/null +++ b/sdk/dfp/arm-dfp/src/models/mappers.ts @@ -0,0 +1,582 @@ +/* + * 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 { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/ms-rest-js"; + +export const CloudError = CloudErrorMapper; +export const BaseResource = BaseResourceMapper; + +export const OperationDisplayValue: msRest.CompositeMapper = { + serializedName: "OperationDisplayValue", + type: { + name: "Composite", + className: "OperationDisplayValue", + modelProperties: { + operation: { + readOnly: true, + serializedName: "operation", + type: { + name: "String" + } + }, + resource: { + readOnly: true, + serializedName: "resource", + type: { + name: "String" + } + }, + description: { + readOnly: true, + serializedName: "description", + type: { + name: "String" + } + }, + provider: { + readOnly: true, + serializedName: "provider", + type: { + name: "String" + } + } + } + } +}; + +export const SystemData: msRest.CompositeMapper = { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String" + } + }, + createdByType: { + serializedName: "createdByType", + type: { + name: "String" + } + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String" + } + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String" + } + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime" + } + } + } + } +}; + +export const DFPInstance: msRest.CompositeMapper = { + serializedName: "DFPInstance", + type: { + name: "Composite", + className: "DFPInstance", + modelProperties: { + administration: { + serializedName: "properties.administration", + type: { + name: "Composite", + className: "DFPInstanceAdministrators" + } + }, + provisioningState: { + readOnly: true, + serializedName: "properties.provisioningState", + type: { + name: "String" + } + }, + location: { + required: true, + serializedName: "location", + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + }, + systemData: { + readOnly: true, + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + +export const DFPInstanceAdministrators: msRest.CompositeMapper = { + serializedName: "DFPInstanceAdministrators", + type: { + name: "Composite", + className: "DFPInstanceAdministrators", + modelProperties: { + members: { + serializedName: "members", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const DFPInstanceUpdateParameters: msRest.CompositeMapper = { + serializedName: "DFPInstanceUpdateParameters", + type: { + name: "Composite", + className: "DFPInstanceUpdateParameters", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + }, + administration: { + serializedName: "properties.administration", + type: { + name: "Composite", + className: "DFPInstanceAdministrators" + } + } + } + } +}; + +export const CheckInstanceNameAvailabilityParameters: msRest.CompositeMapper = { + serializedName: "CheckInstanceNameAvailabilityParameters", + type: { + name: "Composite", + className: "CheckInstanceNameAvailabilityParameters", + modelProperties: { + name: { + serializedName: "name", + constraints: { + MaxLength: 63, + MinLength: 3, + Pattern: /^[a-z][a-z0-9]*$/ + }, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + defaultValue: 'Microsoft.Dynamics365FraudProtection/instances', + type: { + name: "String" + } + } + } + } +}; + +export const CheckInstanceNameAvailabilityResult: msRest.CompositeMapper = { + serializedName: "CheckInstanceNameAvailabilityResult", + type: { + name: "Composite", + className: "CheckInstanceNameAvailabilityResult", + modelProperties: { + nameAvailable: { + serializedName: "nameAvailable", + type: { + name: "Boolean" + } + }, + reason: { + serializedName: "reason", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const Resource: msRest.CompositeMapper = { + serializedName: "Resource", + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const ProxyResource: msRest.CompositeMapper = { + serializedName: "ProxyResource", + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties + } + } +}; + +export const TrackedResource: msRest.CompositeMapper = { + serializedName: "TrackedResource", + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + }, + location: { + required: true, + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const AzureEntityResource: msRest.CompositeMapper = { + serializedName: "AzureEntityResource", + type: { + name: "Composite", + className: "AzureEntityResource", + modelProperties: { + ...Resource.type.modelProperties, + etag: { + readOnly: true, + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const ErrorAdditionalInfo: msRest.CompositeMapper = { + serializedName: "ErrorAdditionalInfo", + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + modelProperties: { + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + info: { + readOnly: true, + serializedName: "info", + type: { + name: "Object" + } + } + } + } +}; + +export const ErrorDetail: msRest.CompositeMapper = { + serializedName: "ErrorDetail", + type: { + name: "Composite", + className: "ErrorDetail", + modelProperties: { + code: { + readOnly: true, + serializedName: "code", + type: { + name: "String" + } + }, + message: { + readOnly: true, + serializedName: "message", + type: { + name: "String" + } + }, + target: { + readOnly: true, + serializedName: "target", + type: { + name: "String" + } + }, + details: { + readOnly: true, + serializedName: "details", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + }, + additionalInfo: { + readOnly: true, + serializedName: "additionalInfo", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" + } + } + } + } + } + } +}; + +export const ErrorResponse: msRest.CompositeMapper = { + serializedName: "ErrorResponse", + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + } +}; + +export const OperationDisplay: msRest.CompositeMapper = { + serializedName: "Operation_display", + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + readOnly: true, + serializedName: "provider", + type: { + name: "String" + } + }, + resource: { + readOnly: true, + serializedName: "resource", + type: { + name: "String" + } + }, + operation: { + readOnly: true, + serializedName: "operation", + type: { + name: "String" + } + }, + description: { + readOnly: true, + serializedName: "description", + type: { + name: "String" + } + } + } + } +}; + +export const Operation: msRest.CompositeMapper = { + serializedName: "Operation", + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + isDataAction: { + readOnly: true, + serializedName: "isDataAction", + type: { + name: "Boolean" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + }, + origin: { + readOnly: true, + serializedName: "origin", + type: { + name: "String" + } + }, + actionType: { + readOnly: true, + serializedName: "actionType", + type: { + name: "String" + } + } + } + } +}; + +export const DFPInstances: msRest.CompositeMapper = { + serializedName: "DFPInstances", + type: { + name: "Composite", + className: "DFPInstances", + modelProperties: { + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DFPInstance" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const OperationListResult: msRest.CompositeMapper = { + serializedName: "OperationListResult", + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/dfp/arm-dfp/src/models/parameters.ts b/sdk/dfp/arm-dfp/src/models/parameters.ts new file mode 100644 index 000000000000..f54e755d569b --- /dev/null +++ b/sdk/dfp/arm-dfp/src/models/parameters.ts @@ -0,0 +1,92 @@ +/* + * 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 msRest from "@azure/ms-rest-js"; + +export const acceptLanguage: msRest.OperationParameter = { + parameterPath: "acceptLanguage", + mapper: { + serializedName: "accept-language", + defaultValue: 'en-US', + type: { + name: "String" + } + } +}; +export const apiVersion: msRest.OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + required: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; +export const instanceName: msRest.OperationURLParameter = { + parameterPath: "instanceName", + mapper: { + required: true, + serializedName: "instanceName", + constraints: { + MaxLength: 63, + MinLength: 3, + Pattern: /^[a-z][a-z0-9]*$/ + }, + type: { + name: "String" + } + } +}; +export const location: msRest.OperationURLParameter = { + parameterPath: "location", + mapper: { + required: true, + serializedName: "location", + type: { + name: "String" + } + } +}; +export const nextPageLink: msRest.OperationURLParameter = { + parameterPath: "nextPageLink", + mapper: { + required: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const resourceGroupName: msRest.OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + required: true, + serializedName: "resourceGroupName", + constraints: { + MaxLength: 90, + MinLength: 1, + Pattern: /^[-\w\._\(\)]+$/ + }, + type: { + name: "String" + } + } +}; +export const subscriptionId: msRest.OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + required: true, + serializedName: "subscriptionId", + type: { + name: "String" + } + } +}; diff --git a/sdk/dfp/arm-dfp/src/operations/index.ts b/sdk/dfp/arm-dfp/src/operations/index.ts new file mode 100644 index 000000000000..fdfec243a1f1 --- /dev/null +++ b/sdk/dfp/arm-dfp/src/operations/index.ts @@ -0,0 +1,10 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export * from "./instances"; diff --git a/sdk/dfp/arm-dfp/src/operations/instances.ts b/sdk/dfp/arm-dfp/src/operations/instances.ts new file mode 100644 index 000000000000..45821a7bb6b1 --- /dev/null +++ b/sdk/dfp/arm-dfp/src/operations/instances.ts @@ -0,0 +1,570 @@ +/* + * 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 msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; +import * as Models from "../models"; +import * as Mappers from "../models/instancesMappers"; +import * as Parameters from "../models/parameters"; +import { DFPManagementClientContext } from "../dFPManagementClientContext"; + +/** Class representing a Instances. */ +export class Instances { + private readonly client: DFPManagementClientContext; + + /** + * Create a Instances. + * @param {DFPManagementClientContext} client Reference to the service client. + */ + constructor(client: DFPManagementClientContext) { + this.client = client; + } + + /** + * Gets details about the specified instances. + * @param resourceGroupName The name of the Azure Resource group of which a given DFP instance is + * part. This name must be at least 1 character in length, and no more than 90. + * @param instanceName The name of the instance. It must be a minimum of 3 characters, and a + * maximum of 63. + * @param [options] The optional parameters + * @returns Promise + */ + getDetails(resourceGroupName: string, instanceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the Azure Resource group of which a given DFP instance is + * part. This name must be at least 1 character in length, and no more than 90. + * @param instanceName The name of the instance. It must be a minimum of 3 characters, and a + * maximum of 63. + * @param callback The callback + */ + getDetails(resourceGroupName: string, instanceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the Azure Resource group of which a given DFP instance is + * part. This name must be at least 1 character in length, and no more than 90. + * @param instanceName The name of the instance. It must be a minimum of 3 characters, and a + * maximum of 63. + * @param options The optional parameters + * @param callback The callback + */ + getDetails(resourceGroupName: string, instanceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getDetails(resourceGroupName: string, instanceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + instanceName, + options + }, + getDetailsOperationSpec, + callback) as Promise; + } + + /** + * Provisions the specified DFP instance based on the configuration specified in the request. + * @param resourceGroupName The name of the Azure Resource group of which a given DFP instance is + * part. This name must be at least 1 character in length, and no more than 90. + * @param instanceName The name of the DFP instances. It must be a minimum of 3 characters, and a + * maximum of 63. + * @param instanceParameters Contains the information used to provision the DFP instance. + * @param [options] The optional parameters + * @returns Promise + */ + create(resourceGroupName: string, instanceName: string, instanceParameters: Models.DFPInstance, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreate(resourceGroupName,instanceName,instanceParameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Deletes the specified DFP instance. + * @param resourceGroupName The name of the Azure Resource group of which a given DFP instance is + * part. This name must be at least 1 character in length, and no more than 90. + * @param instanceName The name of the DFP instance. It must be at least 3 characters in length, + * and no more than 63. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, instanceName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMethod(resourceGroupName,instanceName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Updates the current state of the specified DFP instance. + * @param resourceGroupName The name of the Azure Resource group of which a given DFP instance is + * part. This name must be at least 1 character in length, and no more than 90. + * @param instanceName The name of the DFP instance. It must be at least 3 characters in length, + * and no more than 63. + * @param instanceUpdateParameters Request object that contains the updated information for the + * instance. + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, instanceName: string, instanceUpdateParameters: Models.DFPInstanceUpdateParameters, options?: msRest.RequestOptionsBase): Promise { + return this.beginUpdate(resourceGroupName,instanceName,instanceUpdateParameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Gets all the Dedicated instance for the given resource group. + * @param resourceGroupName The name of the Azure Resource group of which a given DFP instance is + * part. This name must be at least 1 character in length, and no more than 90. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the Azure Resource group of which a given DFP instance is + * part. This name must be at least 1 character in length, and no more than 90. + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the Azure Resource group of which a given DFP instance is + * part. This name must be at least 1 character in length, and no more than 90. + * @param options The optional parameters + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + options + }, + listByResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * Lists all the Dedicated instances for the given subscription. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Check the name availability in the target location. + * @param location The region name which the operation will lookup into. + * @param instanceParameters The name of the instance. + * @param [options] The optional parameters + * @returns Promise + */ + checkNameAvailability(location: string, instanceParameters: Models.CheckInstanceNameAvailabilityParameters, options?: msRest.RequestOptionsBase): Promise; + /** + * @param location The region name which the operation will lookup into. + * @param instanceParameters The name of the instance. + * @param callback The callback + */ + checkNameAvailability(location: string, instanceParameters: Models.CheckInstanceNameAvailabilityParameters, callback: msRest.ServiceCallback): void; + /** + * @param location The region name which the operation will lookup into. + * @param instanceParameters The name of the instance. + * @param options The optional parameters + * @param callback The callback + */ + checkNameAvailability(location: string, instanceParameters: Models.CheckInstanceNameAvailabilityParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + checkNameAvailability(location: string, instanceParameters: Models.CheckInstanceNameAvailabilityParameters, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + location, + instanceParameters, + options + }, + checkNameAvailabilityOperationSpec, + callback) as Promise; + } + + /** + * Provisions the specified DFP instance based on the configuration specified in the request. + * @param resourceGroupName The name of the Azure Resource group of which a given DFP instance is + * part. This name must be at least 1 character in length, and no more than 90. + * @param instanceName The name of the DFP instances. It must be a minimum of 3 characters, and a + * maximum of 63. + * @param instanceParameters Contains the information used to provision the DFP instance. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreate(resourceGroupName: string, instanceName: string, instanceParameters: Models.DFPInstance, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + instanceName, + instanceParameters, + options + }, + beginCreateOperationSpec, + options); + } + + /** + * Deletes the specified DFP instance. + * @param resourceGroupName The name of the Azure Resource group of which a given DFP instance is + * part. This name must be at least 1 character in length, and no more than 90. + * @param instanceName The name of the DFP instance. It must be at least 3 characters in length, + * and no more than 63. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteMethod(resourceGroupName: string, instanceName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + instanceName, + options + }, + beginDeleteMethodOperationSpec, + options); + } + + /** + * Updates the current state of the specified DFP instance. + * @param resourceGroupName The name of the Azure Resource group of which a given DFP instance is + * part. This name must be at least 1 character in length, and no more than 90. + * @param instanceName The name of the DFP instance. It must be at least 3 characters in length, + * and no more than 63. + * @param instanceUpdateParameters Request object that contains the updated information for the + * instance. + * @param [options] The optional parameters + * @returns Promise + */ + beginUpdate(resourceGroupName: string, instanceName: string, instanceUpdateParameters: Models.DFPInstanceUpdateParameters, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + instanceName, + instanceUpdateParameters, + options + }, + beginUpdateOperationSpec, + options); + } + + /** + * Gets all the Dedicated instance for the given resource group. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByResourceGroupNextOperationSpec, + callback) as Promise; + } + + /** + * Lists all the Dedicated instances for the given subscription. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getDetailsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dynamics365FraudProtection/instances/{instanceName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.instanceName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DFPInstance + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dynamics365FraudProtection/instances", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DFPInstances + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Dynamics365FraudProtection/instances", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DFPInstances + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const checkNameAvailabilityOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Dynamics365FraudProtection/locations/{location}/checkNameAvailability", + urlParameters: [ + Parameters.location, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "instanceParameters", + mapper: { + ...Mappers.CheckInstanceNameAvailabilityParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.CheckInstanceNameAvailabilityResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginCreateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dynamics365FraudProtection/instances/{instanceName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.instanceName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "instanceParameters", + mapper: { + ...Mappers.DFPInstance, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.DFPInstance + }, + 201: { + bodyMapper: Mappers.DFPInstance + }, + 202: { + bodyMapper: Mappers.DFPInstance + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginDeleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dynamics365FraudProtection/instances/{instanceName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.instanceName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dynamics365FraudProtection/instances/{instanceName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.instanceName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "instanceUpdateParameters", + mapper: { + ...Mappers.DFPInstanceUpdateParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.DFPInstance + }, + 202: { + bodyMapper: Mappers.DFPInstance + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DFPInstances + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DFPInstances + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/dfp/arm-dfp/tsconfig.json b/sdk/dfp/arm-dfp/tsconfig.json new file mode 100644 index 000000000000..422b584abd5e --- /dev/null +++ b/sdk/dfp/arm-dfp/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es5", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": ["es6", "dom"], + "declaration": true, + "outDir": "./esm", + "importHelpers": true + }, + "include": ["./src/**/*.ts"], + "exclude": ["node_modules"] +}