From 666165ac5ea1ae37d7f1bf5788f04e80633af651 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 12 Jan 2021 06:46:56 +0000 Subject: [PATCH] CodeGen from PR 12312 in Azure/azure-rest-api-specs Merge 2ebbef8e518d2684e3448871efb3480d8e8744be into a533c2e00bfaa8f9aeb0715d388d2aa63e58927c --- sdk/confluent/arm-confluent/LICENSE.txt | 21 + sdk/confluent/arm-confluent/README.md | 98 +++ sdk/confluent/arm-confluent/package.json | 58 ++ sdk/confluent/arm-confluent/rollup.config.js | 37 + .../src/confluentManagementClient.ts | 45 ++ .../src/confluentManagementClientContext.ts | 61 ++ .../arm-confluent/src/models/index.ts | 671 ++++++++++++++++++ .../arm-confluent/src/models/mappers.ts | 593 ++++++++++++++++ .../models/marketplaceAgreementsMappers.ts | 21 + .../src/models/organizationMappers.ts | 22 + .../models/organizationOperationsMappers.ts | 15 + .../arm-confluent/src/models/parameters.ts | 74 ++ .../arm-confluent/src/operations/index.ts | 12 + .../src/operations/marketplaceAgreements.ts | 173 +++++ .../src/operations/organization.ts | 474 +++++++++++++ .../src/operations/organizationOperations.ts | 125 ++++ sdk/confluent/arm-confluent/tsconfig.json | 19 + 17 files changed, 2519 insertions(+) create mode 100644 sdk/confluent/arm-confluent/LICENSE.txt create mode 100644 sdk/confluent/arm-confluent/README.md create mode 100644 sdk/confluent/arm-confluent/package.json create mode 100644 sdk/confluent/arm-confluent/rollup.config.js create mode 100644 sdk/confluent/arm-confluent/src/confluentManagementClient.ts create mode 100644 sdk/confluent/arm-confluent/src/confluentManagementClientContext.ts create mode 100644 sdk/confluent/arm-confluent/src/models/index.ts create mode 100644 sdk/confluent/arm-confluent/src/models/mappers.ts create mode 100644 sdk/confluent/arm-confluent/src/models/marketplaceAgreementsMappers.ts create mode 100644 sdk/confluent/arm-confluent/src/models/organizationMappers.ts create mode 100644 sdk/confluent/arm-confluent/src/models/organizationOperationsMappers.ts create mode 100644 sdk/confluent/arm-confluent/src/models/parameters.ts create mode 100644 sdk/confluent/arm-confluent/src/operations/index.ts create mode 100644 sdk/confluent/arm-confluent/src/operations/marketplaceAgreements.ts create mode 100644 sdk/confluent/arm-confluent/src/operations/organization.ts create mode 100644 sdk/confluent/arm-confluent/src/operations/organizationOperations.ts create mode 100644 sdk/confluent/arm-confluent/tsconfig.json diff --git a/sdk/confluent/arm-confluent/LICENSE.txt b/sdk/confluent/arm-confluent/LICENSE.txt new file mode 100644 index 000000000000..2d3163745319 --- /dev/null +++ b/sdk/confluent/arm-confluent/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/confluent/arm-confluent/README.md b/sdk/confluent/arm-confluent/README.md new file mode 100644 index 000000000000..9ca2a62fcf35 --- /dev/null +++ b/sdk/confluent/arm-confluent/README.md @@ -0,0 +1,98 @@ +## Azure ConfluentManagementClient SDK for JavaScript + +This package contains an isomorphic SDK for ConfluentManagementClient. + +### Currently supported environments + +- Node.js version 6.x.x or higher +- Browser JavaScript + +### How to Install + +```bash +npm install @azure/arm-confluent +``` + +### How to use + +#### nodejs - client creation and list marketplaceAgreements 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 { ConfluentManagementClient } = require("@azure/arm-confluent"); +const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; + +msRestNodeAuth.interactiveLogin().then((creds) => { + const client = new ConfluentManagementClient(creds, subscriptionId); + client.marketplaceAgreements.list().then((result) => { + console.log("The result is:"); + console.log(result); + }); +}).catch((err) => { + console.error(err); +}); +``` + +#### browser - Authentication, client creation and list marketplaceAgreements 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-confluent 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/confluent/arm-confluent/README.png) diff --git a/sdk/confluent/arm-confluent/package.json b/sdk/confluent/arm-confluent/package.json new file mode 100644 index 000000000000..16bf07712819 --- /dev/null +++ b/sdk/confluent/arm-confluent/package.json @@ -0,0 +1,58 @@ +{ + "name": "@azure/arm-confluent", + "author": "Microsoft Corporation", + "description": "ConfluentManagementClient 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-confluent.js", + "module": "./esm/confluentManagementClient.js", + "types": "./esm/confluentManagementClient.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/confluent/arm-confluent", + "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-confluent.js.map'\" -o ./dist/arm-confluent.min.js ./dist/arm-confluent.js", + "prepack": "npm install && npm run build" + }, + "sideEffects": false, + "autoPublish": true +} diff --git a/sdk/confluent/arm-confluent/rollup.config.js b/sdk/confluent/arm-confluent/rollup.config.js new file mode 100644 index 000000000000..1a686a0a4a89 --- /dev/null +++ b/sdk/confluent/arm-confluent/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/confluentManagementClient.js", + external: [ + "@azure/ms-rest-js", + "@azure/ms-rest-azure-js" + ], + output: { + file: "./dist/arm-confluent.js", + format: "umd", + name: "Azure.ArmConfluent", + 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/confluent/arm-confluent/src/confluentManagementClient.ts b/sdk/confluent/arm-confluent/src/confluentManagementClient.ts new file mode 100644 index 000000000000..8d81e31ff927 --- /dev/null +++ b/sdk/confluent/arm-confluent/src/confluentManagementClient.ts @@ -0,0 +1,45 @@ +/* + * 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 operations from "./operations"; +import { ConfluentManagementClientContext } from "./confluentManagementClientContext"; + + +class ConfluentManagementClient extends ConfluentManagementClientContext { + // Operation groups + marketplaceAgreements: operations.MarketplaceAgreements; + organizationOperations: operations.OrganizationOperations; + organization: operations.Organization; + + /** + * Initializes a new instance of the ConfluentManagementClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId Microsoft Azure subscription id + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.ConfluentManagementClientOptions) { + super(credentials, subscriptionId, options); + this.marketplaceAgreements = new operations.MarketplaceAgreements(this); + this.organizationOperations = new operations.OrganizationOperations(this); + this.organization = new operations.Organization(this); + } +} + +// Operation Specifications + +export { + ConfluentManagementClient, + ConfluentManagementClientContext, + Models as ConfluentManagementModels, + Mappers as ConfluentManagementMappers +}; +export * from "./operations"; diff --git a/sdk/confluent/arm-confluent/src/confluentManagementClientContext.ts b/sdk/confluent/arm-confluent/src/confluentManagementClientContext.ts new file mode 100644 index 000000000000..b37da363a893 --- /dev/null +++ b/sdk/confluent/arm-confluent/src/confluentManagementClientContext.ts @@ -0,0 +1,61 @@ +/* + * 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-confluent"; +const packageVersion = "1.0.0"; + +export class ConfluentManagementClientContext extends msRestAzure.AzureServiceClient { + credentials: msRest.ServiceClientCredentials; + apiVersion?: string; + subscriptionId: string; + + /** + * Initializes a new instance of the ConfluentManagementClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId Microsoft Azure subscription id + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.ConfluentManagementClientOptions) { + 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 = '2020-03-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/confluent/arm-confluent/src/models/index.ts b/sdk/confluent/arm-confluent/src/models/index.ts new file mode 100644 index 000000000000..41d3f696d741 --- /dev/null +++ b/sdk/confluent/arm-confluent/src/models/index.ts @@ -0,0 +1,671 @@ +/* + * 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 }; + +/** + * Terms properties for Marketplace and Confluent. + */ +export interface ConfluentAgreementProperties { + /** + * Publisher identifier string. + */ + publisher?: string; + /** + * Product identifier string. + */ + product?: string; + /** + * Plan identifier string. + */ + plan?: string; + /** + * Link to HTML with Microsoft and Publisher terms. + */ + licenseTextLink?: string; + /** + * Link to the privacy policy of the publisher. + */ + privacyPolicyLink?: string; + /** + * Date and time in UTC of when the terms were accepted. This is empty if Accepted is false. + */ + retrieveDatetime?: Date; + /** + * Terms signature. + */ + signature?: string; + /** + * If any version of the terms have been accepted, otherwise false. + */ + accepted?: boolean; +} + +/** + * Agreement Terms definition + */ +export interface ConfluentAgreementResource extends BaseResource { + /** + * The ARM id of the resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * The name of the agreement. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * The type of the agreement. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; + /** + * Represents the properties of the resource. + */ + properties?: ConfluentAgreementProperties; +} + +/** + * The object that represents the operation. + */ +export interface OperationDisplay { + /** + * Service provider: Microsoft.Confluent + */ + provider?: string; + /** + * Type on which the operation is performed, e.g., 'clusters'. + */ + resource?: string; + /** + * Operation type, e.g., read, write, delete, etc. + */ + operation?: string; + /** + * Description of the operation, e.g., 'Write confluent'. + */ + description?: string; +} + +/** + * An Confluent REST API operation. + */ +export interface OperationResult { + /** + * Operation name: {provider}/{resource}/{operation} + */ + name?: string; + /** + * The object that represents the operation. + */ + display?: OperationDisplay; +} + +/** + * Response body of Error + * @summary ErrorResponseBody + */ +export interface ErrorResponseBody { + /** + * Error code + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly code?: string; + /** + * Error message + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly message?: string; + /** + * Error target + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly target?: string; + /** + * Error detail + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly details?: ErrorResponseBody[]; +} + +/** + * Default error response for resource provider + * @summary ResourceProviderDefaultErrorResponse + */ +export interface ResourceProviderDefaultErrorResponse { + /** + * Response body of Error + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly error?: ErrorResponseBody; +} + +/** + * Confluent Offer detail + */ +export interface OfferDetail { + /** + * Publisher Id + */ + publisherId?: string; + /** + * Offer Id + */ + id?: string; + /** + * Offer Plan Id + */ + planId?: string; + /** + * Offer Plan Name + */ + planName?: string; + /** + * Offer Plan Term unit + */ + termUnit?: string; + /** + * SaaS Offer Status. Possible values include: 'Started', 'PendingFulfillmentStart', + * 'InProgress', 'Subscribed', 'Suspended', 'Reinstated', 'Succeeded', 'Failed', 'Unsubscribed', + * 'Updating' + */ + status?: SaaSOfferStatus; +} + +/** + * Subscriber detail + */ +export interface UserDetail { + /** + * First name + */ + firstName?: string; + /** + * Last name + */ + lastName?: string; + /** + * Email address + */ + emailAddress?: string; +} + +/** + * Confluent offer detail + */ +export interface OrganizationResourcePropertiesOfferDetail extends OfferDetail { +} + +/** + * Subscriber detail + */ +export interface OrganizationResourcePropertiesUserDetail extends UserDetail { +} + +/** + * Organization resource property + */ +export interface OrganizationResourceProperties { + /** + * The creation time of the resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly createdTime?: Date; + /** + * Provision states for confluent RP. Possible values include: 'Accepted', 'Creating', + * 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled', 'Deleted', 'NotSpecified' + */ + provisioningState?: ProvisionState; + /** + * Id of the Confluent organization. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly organizationId?: string; + /** + * SSO url for the Confluent organization. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly ssoUrl?: string; + /** + * Confluent offer detail + */ + offerDetail?: OrganizationResourcePropertiesOfferDetail; + /** + * Subscriber detail + */ + userDetail?: OrganizationResourcePropertiesUserDetail; +} + +/** + * Organization resource. + */ +export interface OrganizationResource extends BaseResource { + /** + * The ARM id of the resource. + * **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. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; + /** + * The creation time of the resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly createdTime?: Date; + /** + * Provision states for confluent RP. Possible values include: 'Accepted', 'Creating', + * 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled', 'Deleted', 'NotSpecified' + */ + provisioningState?: ProvisionState; + /** + * Id of the Confluent organization. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly organizationId?: string; + /** + * SSO url for the Confluent organization. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly ssoUrl?: string; + /** + * Confluent offer detail + */ + offerDetail?: OrganizationResourcePropertiesOfferDetail; + /** + * Subscriber detail + */ + userDetail?: OrganizationResourcePropertiesUserDetail; + /** + * Organization resource tags + */ + tags?: { [propertyName: string]: string }; + /** + * Location of Organization resource + */ + location?: string; +} + +/** + * Organization Resource update + */ +export interface OrganizationResourceUpdate { + /** + * ARM resource tags + */ + tags?: { [propertyName: string]: string }; +} + +/** + * Optional Parameters. + */ +export interface MarketplaceAgreementsCreateOptionalParams extends msRest.RequestOptionsBase { + body?: ConfluentAgreementResource; +} + +/** + * Optional Parameters. + */ +export interface OrganizationCreateOptionalParams extends msRest.RequestOptionsBase { + /** + * Organization resource model + */ + body?: OrganizationResource; +} + +/** + * Optional Parameters. + */ +export interface OrganizationUpdateOptionalParams extends msRest.RequestOptionsBase { + /** + * Updated Organization resource + */ + body?: OrganizationResourceUpdate; +} + +/** + * Optional Parameters. + */ +export interface OrganizationBeginCreateOptionalParams extends msRest.RequestOptionsBase { + /** + * Organization resource model + */ + body?: OrganizationResource; +} + +/** + * An interface representing ConfluentManagementClientOptions. + */ +export interface ConfluentManagementClientOptions extends AzureServiceClientOptions { + baseUri?: string; +} + +/** + * @interface + * Response of a agreements operation. + * @extends Array + */ +export interface ConfluentAgreementResourceListResponse extends Array { + /** + * Link to the next set of results, if any. + */ + nextLink?: string; +} + +/** + * @interface + * Result of GET request to list Confluent operations. + * @extends Array + */ +export interface OperationListResult extends Array { + /** + * URL to get the next set of operation list results if there are any. + */ + nextLink?: string; +} + +/** + * @interface + * The response of a list operation. + * @extends Array + */ +export interface OrganizationResourceListResult extends Array { + /** + * Link to the next set of results, if any. + */ + nextLink?: string; +} + +/** + * Defines values for ProvisionState. + * Possible values include: 'Accepted', 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', + * 'Canceled', 'Deleted', 'NotSpecified' + * @readonly + * @enum {string} + */ +export type ProvisionState = 'Accepted' | 'Creating' | 'Updating' | 'Deleting' | 'Succeeded' | 'Failed' | 'Canceled' | 'Deleted' | 'NotSpecified'; + +/** + * Defines values for SaaSOfferStatus. + * Possible values include: 'Started', 'PendingFulfillmentStart', 'InProgress', 'Subscribed', + * 'Suspended', 'Reinstated', 'Succeeded', 'Failed', 'Unsubscribed', 'Updating' + * @readonly + * @enum {string} + */ +export type SaaSOfferStatus = 'Started' | 'PendingFulfillmentStart' | 'InProgress' | 'Subscribed' | 'Suspended' | 'Reinstated' | 'Succeeded' | 'Failed' | 'Unsubscribed' | 'Updating'; + +/** + * Contains response data for the list operation. + */ +export type MarketplaceAgreementsListResponse = ConfluentAgreementResourceListResponse & { + /** + * 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: ConfluentAgreementResourceListResponse; + }; +}; + +/** + * Contains response data for the create operation. + */ +export type MarketplaceAgreementsCreateResponse = ConfluentAgreementResource & { + /** + * 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: ConfluentAgreementResource; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type MarketplaceAgreementsListNextResponse = ConfluentAgreementResourceListResponse & { + /** + * 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: ConfluentAgreementResourceListResponse; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type OrganizationOperationsListResponse = 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 listNext operation. + */ +export type OrganizationOperationsListNextResponse = 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 listBySubscription operation. + */ +export type OrganizationListBySubscriptionResponse = OrganizationResourceListResult & { + /** + * 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: OrganizationResourceListResult; + }; +}; + +/** + * Contains response data for the listByResourceGroup operation. + */ +export type OrganizationListByResourceGroupResponse = OrganizationResourceListResult & { + /** + * 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: OrganizationResourceListResult; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type OrganizationGetResponse = OrganizationResource & { + /** + * 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: OrganizationResource; + }; +}; + +/** + * Contains response data for the create operation. + */ +export type OrganizationCreateResponse = OrganizationResource & { + /** + * 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: OrganizationResource; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type OrganizationUpdateResponse = OrganizationResource & { + /** + * 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: OrganizationResource; + }; +}; + +/** + * Contains response data for the beginCreate operation. + */ +export type OrganizationBeginCreateResponse = OrganizationResource & { + /** + * 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: OrganizationResource; + }; +}; + +/** + * Contains response data for the listBySubscriptionNext operation. + */ +export type OrganizationListBySubscriptionNextResponse = OrganizationResourceListResult & { + /** + * 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: OrganizationResourceListResult; + }; +}; + +/** + * Contains response data for the listByResourceGroupNext operation. + */ +export type OrganizationListByResourceGroupNextResponse = OrganizationResourceListResult & { + /** + * 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: OrganizationResourceListResult; + }; +}; diff --git a/sdk/confluent/arm-confluent/src/models/mappers.ts b/sdk/confluent/arm-confluent/src/models/mappers.ts new file mode 100644 index 000000000000..4fdb987ae938 --- /dev/null +++ b/sdk/confluent/arm-confluent/src/models/mappers.ts @@ -0,0 +1,593 @@ +/* + * 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 ConfluentAgreementProperties: msRest.CompositeMapper = { + serializedName: "ConfluentAgreementProperties", + type: { + name: "Composite", + className: "ConfluentAgreementProperties", + modelProperties: { + publisher: { + serializedName: "publisher", + type: { + name: "String" + } + }, + product: { + serializedName: "product", + type: { + name: "String" + } + }, + plan: { + serializedName: "plan", + type: { + name: "String" + } + }, + licenseTextLink: { + serializedName: "licenseTextLink", + type: { + name: "String" + } + }, + privacyPolicyLink: { + serializedName: "privacyPolicyLink", + type: { + name: "String" + } + }, + retrieveDatetime: { + serializedName: "retrieveDatetime", + type: { + name: "DateTime" + } + }, + signature: { + serializedName: "signature", + type: { + name: "String" + } + }, + accepted: { + serializedName: "accepted", + type: { + name: "Boolean" + } + } + } + } +}; + +export const ConfluentAgreementResource: msRest.CompositeMapper = { + serializedName: "ConfluentAgreementResource", + type: { + name: "Composite", + className: "ConfluentAgreementResource", + 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" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "ConfluentAgreementProperties" + } + } + } + } +}; + +export const OperationDisplay: msRest.CompositeMapper = { + serializedName: "OperationDisplay", + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + } + } + } +}; + +export const OperationResult: msRest.CompositeMapper = { + serializedName: "OperationResult", + type: { + name: "Composite", + className: "OperationResult", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + } + } + } +}; + +export const ErrorResponseBody: msRest.CompositeMapper = { + serializedName: "ErrorResponseBody", + type: { + name: "Composite", + className: "ErrorResponseBody", + 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: "ErrorResponseBody" + } + } + } + } + } + } +}; + +export const ResourceProviderDefaultErrorResponse: msRest.CompositeMapper = { + serializedName: "ResourceProviderDefaultErrorResponse", + type: { + name: "Composite", + className: "ResourceProviderDefaultErrorResponse", + modelProperties: { + error: { + readOnly: true, + serializedName: "error", + type: { + name: "Composite", + className: "ErrorResponseBody" + } + } + } + } +}; + +export const OfferDetail: msRest.CompositeMapper = { + serializedName: "OfferDetail", + type: { + name: "Composite", + className: "OfferDetail", + modelProperties: { + publisherId: { + serializedName: "publisherId", + constraints: { + MaxLength: 50 + }, + type: { + name: "String" + } + }, + id: { + serializedName: "id", + constraints: { + MaxLength: 50 + }, + type: { + name: "String" + } + }, + planId: { + serializedName: "planId", + constraints: { + MaxLength: 50 + }, + type: { + name: "String" + } + }, + planName: { + serializedName: "planName", + constraints: { + MaxLength: 50 + }, + type: { + name: "String" + } + }, + termUnit: { + serializedName: "termUnit", + constraints: { + MaxLength: 25 + }, + type: { + name: "String" + } + }, + status: { + serializedName: "status", + type: { + name: "String" + } + } + } + } +}; + +export const UserDetail: msRest.CompositeMapper = { + serializedName: "UserDetail", + type: { + name: "Composite", + className: "UserDetail", + modelProperties: { + firstName: { + serializedName: "firstName", + constraints: { + MaxLength: 50 + }, + type: { + name: "String" + } + }, + lastName: { + serializedName: "lastName", + constraints: { + MaxLength: 50 + }, + type: { + name: "String" + } + }, + emailAddress: { + serializedName: "emailAddress", + constraints: { + Pattern: /^\S+@\S+\.\S+$/ + }, + type: { + name: "String" + } + } + } + } +}; + +export const OrganizationResourcePropertiesOfferDetail: msRest.CompositeMapper = { + serializedName: "OrganizationResourceProperties_offerDetail", + type: { + name: "Composite", + className: "OrganizationResourcePropertiesOfferDetail", + modelProperties: { + ...OfferDetail.type.modelProperties + } + } +}; + +export const OrganizationResourcePropertiesUserDetail: msRest.CompositeMapper = { + serializedName: "OrganizationResourceProperties_userDetail", + type: { + name: "Composite", + className: "OrganizationResourcePropertiesUserDetail", + modelProperties: { + ...UserDetail.type.modelProperties + } + } +}; + +export const OrganizationResourceProperties: msRest.CompositeMapper = { + serializedName: "OrganizationResourceProperties", + type: { + name: "Composite", + className: "OrganizationResourceProperties", + modelProperties: { + createdTime: { + readOnly: true, + serializedName: "createdTime", + type: { + name: "DateTime" + } + }, + provisioningState: { + serializedName: "provisioningState", + type: { + name: "String" + } + }, + organizationId: { + readOnly: true, + serializedName: "organizationId", + type: { + name: "String" + } + }, + ssoUrl: { + readOnly: true, + serializedName: "ssoUrl", + type: { + name: "String" + } + }, + offerDetail: { + serializedName: "offerDetail", + type: { + name: "Composite", + className: "OrganizationResourcePropertiesOfferDetail" + } + }, + userDetail: { + serializedName: "userDetail", + type: { + name: "Composite", + className: "OrganizationResourcePropertiesUserDetail" + } + } + } + } +}; + +export const OrganizationResource: msRest.CompositeMapper = { + serializedName: "OrganizationResource", + type: { + name: "Composite", + className: "OrganizationResource", + 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" + } + }, + createdTime: { + readOnly: true, + serializedName: "properties.createdTime", + type: { + name: "DateTime" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + type: { + name: "String" + } + }, + organizationId: { + readOnly: true, + serializedName: "properties.organizationId", + type: { + name: "String" + } + }, + ssoUrl: { + readOnly: true, + serializedName: "properties.ssoUrl", + type: { + name: "String" + } + }, + offerDetail: { + serializedName: "properties.offerDetail", + type: { + name: "Composite", + className: "OrganizationResourcePropertiesOfferDetail" + } + }, + userDetail: { + serializedName: "properties.userDetail", + type: { + name: "Composite", + className: "OrganizationResourcePropertiesUserDetail" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const OrganizationResourceUpdate: msRest.CompositeMapper = { + serializedName: "OrganizationResourceUpdate", + type: { + name: "Composite", + className: "OrganizationResourceUpdate", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const ConfluentAgreementResourceListResponse: msRest.CompositeMapper = { + serializedName: "ConfluentAgreementResourceListResponse", + type: { + name: "Composite", + className: "ConfluentAgreementResourceListResponse", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ConfluentAgreementResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const OperationListResult: msRest.CompositeMapper = { + serializedName: "OperationListResult", + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "OperationResult" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const OrganizationResourceListResult: msRest.CompositeMapper = { + serializedName: "OrganizationResourceListResult", + type: { + name: "Composite", + className: "OrganizationResourceListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "OrganizationResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/confluent/arm-confluent/src/models/marketplaceAgreementsMappers.ts b/sdk/confluent/arm-confluent/src/models/marketplaceAgreementsMappers.ts new file mode 100644 index 000000000000..336eea897021 --- /dev/null +++ b/sdk/confluent/arm-confluent/src/models/marketplaceAgreementsMappers.ts @@ -0,0 +1,21 @@ +/* + * 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 { + BaseResource, + ConfluentAgreementProperties, + ConfluentAgreementResource, + ConfluentAgreementResourceListResponse, + ErrorResponseBody, + OfferDetail, + OrganizationResource, + OrganizationResourcePropertiesOfferDetail, + OrganizationResourcePropertiesUserDetail, + ResourceProviderDefaultErrorResponse, + UserDetail +} from "../models/mappers"; diff --git a/sdk/confluent/arm-confluent/src/models/organizationMappers.ts b/sdk/confluent/arm-confluent/src/models/organizationMappers.ts new file mode 100644 index 000000000000..5fae6c2f6c2b --- /dev/null +++ b/sdk/confluent/arm-confluent/src/models/organizationMappers.ts @@ -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. + */ + +export { + BaseResource, + ConfluentAgreementProperties, + ConfluentAgreementResource, + ErrorResponseBody, + OfferDetail, + OrganizationResource, + OrganizationResourceListResult, + OrganizationResourcePropertiesOfferDetail, + OrganizationResourcePropertiesUserDetail, + OrganizationResourceUpdate, + ResourceProviderDefaultErrorResponse, + UserDetail +} from "../models/mappers"; diff --git a/sdk/confluent/arm-confluent/src/models/organizationOperationsMappers.ts b/sdk/confluent/arm-confluent/src/models/organizationOperationsMappers.ts new file mode 100644 index 000000000000..672b22024b3b --- /dev/null +++ b/sdk/confluent/arm-confluent/src/models/organizationOperationsMappers.ts @@ -0,0 +1,15 @@ +/* + * 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 { + ErrorResponseBody, + OperationDisplay, + OperationListResult, + OperationResult, + ResourceProviderDefaultErrorResponse +} from "../models/mappers"; diff --git a/sdk/confluent/arm-confluent/src/models/parameters.ts b/sdk/confluent/arm-confluent/src/models/parameters.ts new file mode 100644 index 000000000000..0652f9084aff --- /dev/null +++ b/sdk/confluent/arm-confluent/src/models/parameters.ts @@ -0,0 +1,74 @@ +/* + * 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, + isConstant: true, + serializedName: "api-version", + defaultValue: '2020-03-01-preview', + type: { + name: "String" + } + } +}; +export const nextPageLink: msRest.OperationURLParameter = { + parameterPath: "nextPageLink", + mapper: { + required: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const organizationName: msRest.OperationURLParameter = { + parameterPath: "organizationName", + mapper: { + required: true, + serializedName: "organizationName", + type: { + name: "String" + } + } +}; +export const resourceGroupName: msRest.OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + required: true, + serializedName: "resourceGroupName", + type: { + name: "String" + } + } +}; +export const subscriptionId: msRest.OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + required: true, + serializedName: "subscriptionId", + type: { + name: "String" + } + } +}; diff --git a/sdk/confluent/arm-confluent/src/operations/index.ts b/sdk/confluent/arm-confluent/src/operations/index.ts new file mode 100644 index 000000000000..e5fed98f2914 --- /dev/null +++ b/sdk/confluent/arm-confluent/src/operations/index.ts @@ -0,0 +1,12 @@ +/* + * 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 "./marketplaceAgreements"; +export * from "./organizationOperations"; +export * from "./organization"; diff --git a/sdk/confluent/arm-confluent/src/operations/marketplaceAgreements.ts b/sdk/confluent/arm-confluent/src/operations/marketplaceAgreements.ts new file mode 100644 index 000000000000..1241885e7d2c --- /dev/null +++ b/sdk/confluent/arm-confluent/src/operations/marketplaceAgreements.ts @@ -0,0 +1,173 @@ +/* + * 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/marketplaceAgreementsMappers"; +import * as Parameters from "../models/parameters"; +import { ConfluentManagementClientContext } from "../confluentManagementClientContext"; + +/** Class representing a MarketplaceAgreements. */ +export class MarketplaceAgreements { + private readonly client: ConfluentManagementClientContext; + + /** + * Create a MarketplaceAgreements. + * @param {ConfluentManagementClientContext} client Reference to the service client. + */ + constructor(client: ConfluentManagementClientContext) { + this.client = client; + } + + /** + * @summary List Confluent marketplace agreements in the 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; + } + + /** + * @summary Create Confluent Marketplace agreement in the subscription. + * @param [options] The optional parameters + * @returns Promise + */ + create(options?: Models.MarketplaceAgreementsCreateOptionalParams): Promise; + /** + * @param callback The callback + */ + create(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + create(options: Models.MarketplaceAgreementsCreateOptionalParams, callback: msRest.ServiceCallback): void; + create(options?: Models.MarketplaceAgreementsCreateOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + createOperationSpec, + callback) as Promise; + } + + /** + * @summary List Confluent marketplace agreements in the 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 listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Confluent/agreements", + urlParameters: [ + Parameters.subscriptionId + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ConfluentAgreementResourceListResponse + }, + default: { + bodyMapper: Mappers.ResourceProviderDefaultErrorResponse + } + }, + serializer +}; + +const createOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Confluent/agreements/default", + urlParameters: [ + Parameters.subscriptionId + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: [ + "options", + "body" + ], + mapper: Mappers.ConfluentAgreementResource + }, + responses: { + 200: { + bodyMapper: Mappers.ConfluentAgreementResource + }, + default: { + bodyMapper: Mappers.ResourceProviderDefaultErrorResponse + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ConfluentAgreementResourceListResponse + }, + default: { + bodyMapper: Mappers.ResourceProviderDefaultErrorResponse + } + }, + serializer +}; diff --git a/sdk/confluent/arm-confluent/src/operations/organization.ts b/sdk/confluent/arm-confluent/src/operations/organization.ts new file mode 100644 index 000000000000..4fbf507348ec --- /dev/null +++ b/sdk/confluent/arm-confluent/src/operations/organization.ts @@ -0,0 +1,474 @@ +/* + * 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/organizationMappers"; +import * as Parameters from "../models/parameters"; +import { ConfluentManagementClientContext } from "../confluentManagementClientContext"; + +/** Class representing a Organization. */ +export class Organization { + private readonly client: ConfluentManagementClientContext; + + /** + * Create a Organization. + * @param {ConfluentManagementClientContext} client Reference to the service client. + */ + constructor(client: ConfluentManagementClientContext) { + this.client = client; + } + + /** + * @summary List all organizations under the specified subscription. + * @param [options] The optional parameters + * @returns Promise + */ + listBySubscription(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + listBySubscription(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + listBySubscription(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listBySubscription(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listBySubscriptionOperationSpec, + callback) as Promise; + } + + /** + * @summary List all Organizations under the specified resource group. + * @param resourceGroupName Resource group name + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Resource group name + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Resource group name + * @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; + } + + /** + * @summary Get the properties of a specific Organization resource. + * @param resourceGroupName Resource group name + * @param organizationName Organization resource name + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, organizationName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Resource group name + * @param organizationName Organization resource name + * @param callback The callback + */ + get(resourceGroupName: string, organizationName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Resource group name + * @param organizationName Organization resource name + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, organizationName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, organizationName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + organizationName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * @summary Create Organization resource + * @param resourceGroupName Resource group name + * @param organizationName Organization resource name + * @param [options] The optional parameters + * @returns Promise + */ + create(resourceGroupName: string, organizationName: string, options?: Models.OrganizationCreateOptionalParams): Promise { + return this.beginCreate(resourceGroupName,organizationName,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * @summary Update Organization resource + * @param resourceGroupName Resource group name + * @param organizationName Organization resource name + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, organizationName: string, options?: Models.OrganizationUpdateOptionalParams): Promise; + /** + * @param resourceGroupName Resource group name + * @param organizationName Organization resource name + * @param callback The callback + */ + update(resourceGroupName: string, organizationName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Resource group name + * @param organizationName Organization resource name + * @param options The optional parameters + * @param callback The callback + */ + update(resourceGroupName: string, organizationName: string, options: Models.OrganizationUpdateOptionalParams, callback: msRest.ServiceCallback): void; + update(resourceGroupName: string, organizationName: string, options?: Models.OrganizationUpdateOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + organizationName, + options + }, + updateOperationSpec, + callback) as Promise; + } + + /** + * @summary Delete Organization resource + * @param resourceGroupName Resource group name + * @param organizationName Organization resource name + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, organizationName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMethod(resourceGroupName,organizationName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * @summary Create Organization resource + * @param resourceGroupName Resource group name + * @param organizationName Organization resource name + * @param [options] The optional parameters + * @returns Promise + */ + beginCreate(resourceGroupName: string, organizationName: string, options?: Models.OrganizationBeginCreateOptionalParams): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + organizationName, + options + }, + beginCreateOperationSpec, + options); + } + + /** + * @summary Delete Organization resource + * @param resourceGroupName Resource group name + * @param organizationName Organization resource name + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteMethod(resourceGroupName: string, organizationName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + organizationName, + options + }, + beginDeleteMethodOperationSpec, + options); + } + + /** + * @summary List all organizations under the specified subscription. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listBySubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listBySubscriptionNext(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 + */ + listBySubscriptionNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listBySubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listBySubscriptionNextOperationSpec, + callback) as Promise; + } + + /** + * @summary List all Organizations under the specified 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; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listBySubscriptionOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Confluent/organizations", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OrganizationResourceListResult + }, + default: { + bodyMapper: Mappers.ResourceProviderDefaultErrorResponse + } + }, + serializer +}; + +const listByResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OrganizationResourceListResult + }, + default: { + bodyMapper: Mappers.ResourceProviderDefaultErrorResponse + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.organizationName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OrganizationResource + }, + default: { + bodyMapper: Mappers.ResourceProviderDefaultErrorResponse + } + }, + serializer +}; + +const updateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.organizationName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: [ + "options", + "body" + ], + mapper: Mappers.OrganizationResourceUpdate + }, + responses: { + 200: { + bodyMapper: Mappers.OrganizationResource + }, + default: { + bodyMapper: Mappers.ResourceProviderDefaultErrorResponse + } + }, + serializer +}; + +const beginCreateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.organizationName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: [ + "options", + "body" + ], + mapper: Mappers.OrganizationResource + }, + responses: { + 200: { + bodyMapper: Mappers.OrganizationResource + }, + 201: { + bodyMapper: Mappers.OrganizationResource + }, + default: { + bodyMapper: Mappers.ResourceProviderDefaultErrorResponse + } + }, + serializer +}; + +const beginDeleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.organizationName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ResourceProviderDefaultErrorResponse + } + }, + serializer +}; + +const listBySubscriptionNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OrganizationResourceListResult + }, + default: { + bodyMapper: Mappers.ResourceProviderDefaultErrorResponse + } + }, + 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.OrganizationResourceListResult + }, + default: { + bodyMapper: Mappers.ResourceProviderDefaultErrorResponse + } + }, + serializer +}; diff --git a/sdk/confluent/arm-confluent/src/operations/organizationOperations.ts b/sdk/confluent/arm-confluent/src/operations/organizationOperations.ts new file mode 100644 index 000000000000..bc0aa99f748a --- /dev/null +++ b/sdk/confluent/arm-confluent/src/operations/organizationOperations.ts @@ -0,0 +1,125 @@ +/* + * 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/organizationOperationsMappers"; +import * as Parameters from "../models/parameters"; +import { ConfluentManagementClientContext } from "../confluentManagementClientContext"; + +/** Class representing a OrganizationOperations. */ +export class OrganizationOperations { + private readonly client: ConfluentManagementClientContext; + + /** + * Create a OrganizationOperations. + * @param {ConfluentManagementClientContext} client Reference to the service client. + */ + constructor(client: ConfluentManagementClientContext) { + this.client = client; + } + + /** + * @summary List all operations provided by Microsoft.Confluent. + * @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; + } + + /** + * @summary List all operations provided by Microsoft.Confluent. + * @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 listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Confluent/operations", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.ResourceProviderDefaultErrorResponse + } + }, + 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.OperationListResult + }, + default: { + bodyMapper: Mappers.ResourceProviderDefaultErrorResponse + } + }, + serializer +}; diff --git a/sdk/confluent/arm-confluent/tsconfig.json b/sdk/confluent/arm-confluent/tsconfig.json new file mode 100644 index 000000000000..422b584abd5e --- /dev/null +++ b/sdk/confluent/arm-confluent/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"] +}