From 787bb832c90932010f6d12c573f23956cadedf80 Mon Sep 17 00:00:00 2001 From: Dan Schulte Date: Fri, 5 Oct 2018 09:03:27 -0700 Subject: [PATCH] Generate arm-timeseriesinsights --- packages/arm-timeseriesinsights/.npmignore | 35 + packages/arm-timeseriesinsights/LICENSE.txt | 21 + packages/arm-timeseriesinsights/README.md | 67 + .../lib/models/accessPoliciesMappers.ts | 33 + .../lib/models/environmentsMappers.ts | 38 + .../lib/models/eventSourcesMappers.ts | 42 + .../lib/models/index.ts | 1787 +++++++++++++++++ .../lib/models/mappers.ts | 1481 ++++++++++++++ .../lib/models/operationsMappers.ts | 18 + .../lib/models/parameters.ts | 175 ++ .../lib/models/referenceDataSetsMappers.ts | 38 + .../lib/operations/accessPolicies.ts | 388 ++++ .../lib/operations/environments.ts | 392 ++++ .../lib/operations/eventSources.ts | 389 ++++ .../lib/operations/index.ts | 15 + .../lib/operations/operations.ts | 123 ++ .../lib/operations/referenceDataSets.ts | 389 ++++ .../lib/timeSeriesInsightsClient.ts | 50 + .../lib/timeSeriesInsightsClientContext.ts | 65 + packages/arm-timeseriesinsights/package.json | 39 + .../arm-timeseriesinsights/tsconfig.esm.json | 8 + packages/arm-timeseriesinsights/tsconfig.json | 18 + .../arm-timeseriesinsights/webpack.config.js | 30 + 23 files changed, 5641 insertions(+) create mode 100644 packages/arm-timeseriesinsights/.npmignore create mode 100644 packages/arm-timeseriesinsights/LICENSE.txt create mode 100644 packages/arm-timeseriesinsights/README.md create mode 100644 packages/arm-timeseriesinsights/lib/models/accessPoliciesMappers.ts create mode 100644 packages/arm-timeseriesinsights/lib/models/environmentsMappers.ts create mode 100644 packages/arm-timeseriesinsights/lib/models/eventSourcesMappers.ts create mode 100644 packages/arm-timeseriesinsights/lib/models/index.ts create mode 100644 packages/arm-timeseriesinsights/lib/models/mappers.ts create mode 100644 packages/arm-timeseriesinsights/lib/models/operationsMappers.ts create mode 100644 packages/arm-timeseriesinsights/lib/models/parameters.ts create mode 100644 packages/arm-timeseriesinsights/lib/models/referenceDataSetsMappers.ts create mode 100644 packages/arm-timeseriesinsights/lib/operations/accessPolicies.ts create mode 100644 packages/arm-timeseriesinsights/lib/operations/environments.ts create mode 100644 packages/arm-timeseriesinsights/lib/operations/eventSources.ts create mode 100644 packages/arm-timeseriesinsights/lib/operations/index.ts create mode 100644 packages/arm-timeseriesinsights/lib/operations/operations.ts create mode 100644 packages/arm-timeseriesinsights/lib/operations/referenceDataSets.ts create mode 100644 packages/arm-timeseriesinsights/lib/timeSeriesInsightsClient.ts create mode 100644 packages/arm-timeseriesinsights/lib/timeSeriesInsightsClientContext.ts create mode 100644 packages/arm-timeseriesinsights/package.json create mode 100644 packages/arm-timeseriesinsights/tsconfig.esm.json create mode 100644 packages/arm-timeseriesinsights/tsconfig.json create mode 100644 packages/arm-timeseriesinsights/webpack.config.js diff --git a/packages/arm-timeseriesinsights/.npmignore b/packages/arm-timeseriesinsights/.npmignore new file mode 100644 index 000000000000..3b46bc6202d8 --- /dev/null +++ b/packages/arm-timeseriesinsights/.npmignore @@ -0,0 +1,35 @@ +#git +.git +.gitignore +#gulp +gulpfile.js +#documentation +doc/ +docs/ +#dependencies +node_modules/ +#samples +sample/ +samples/ +#tests +test/ +tests/ +coverage/ +#tools and scripts +tools/ +scripts/ +#IDE settings +*.sln +.vscode/ +.idea +.editorconfig +.ntvs_analysis.* +#build tools +.travis.yml +.jenkins.yml +.codeclimate.yml +appveyor.yml +# Nuget packages # +.nuget/ +packages/ +packages.config diff --git a/packages/arm-timeseriesinsights/LICENSE.txt b/packages/arm-timeseriesinsights/LICENSE.txt new file mode 100644 index 000000000000..a70e8cf66038 --- /dev/null +++ b/packages/arm-timeseriesinsights/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018 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/packages/arm-timeseriesinsights/README.md b/packages/arm-timeseriesinsights/README.md new file mode 100644 index 000000000000..2a0d374dc100 --- /dev/null +++ b/packages/arm-timeseriesinsights/README.md @@ -0,0 +1,67 @@ +# Azure TimeSeriesInsightsClient SDK for JavaScript +This package contains an isomorphic SDK for TimeSeriesInsightsClient. + +## Currently supported environments +- Node.js version 6.x.x or higher +- Browser JavaScript + +## How to Install +``` +npm install arm-timeseriesinsights +``` + + +## How to use + +### nodejs - Authentication, client creation and list operations as an example written in TypeScript. + +```ts +import * as msRest from "ms-rest-js"; +import * as msRestAzure from "ms-rest-azure-js"; +import * as msRestNodeAuth from "ms-rest-nodeauth"; +import { TimeSeriesInsightsClient, TimeSeriesInsightsModels, TimeSeriesInsightsMappers } from "arm-timeseriesinsights"; +const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; + +msRestNodeAuth.interactiveLogin().then((creds) => { + const client = new TimeSeriesInsightsClient(creds, subscriptionId); + client.operations.list().then((result) => { + console.log("The result is:"); + console.log(result); + }); +}).catch((err) => { + console.error(err); +}); +``` + +### browser - Authentication, client creation and list operations as an example written in JavaScript. + +- index.html +```html + + + + arm-timeseriesinsights sample + + + + + + + + +``` + +# Related projects + - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) diff --git a/packages/arm-timeseriesinsights/lib/models/accessPoliciesMappers.ts b/packages/arm-timeseriesinsights/lib/models/accessPoliciesMappers.ts new file mode 100644 index 000000000000..19d7914f7e62 --- /dev/null +++ b/packages/arm-timeseriesinsights/lib/models/accessPoliciesMappers.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + discriminators, + AccessPolicyCreateOrUpdateParameters, + AccessPolicyResource, + Resource, + BaseResource, + CloudError, + AccessPolicyUpdateParameters, + AccessPolicyListResponse, + TrackedResource, + EnvironmentResource, + Sku, + PartitionKeyProperty, + EnvironmentStatus, + IngressEnvironmentStatus, + EnvironmentStateDetails, + EventSourceResource, + EventHubEventSourceResource, + IoTHubEventSourceResource, + ReferenceDataSetResource, + ReferenceDataSetKeyProperty +} from "../models/mappers"; + diff --git a/packages/arm-timeseriesinsights/lib/models/environmentsMappers.ts b/packages/arm-timeseriesinsights/lib/models/environmentsMappers.ts new file mode 100644 index 000000000000..bf3269075ee8 --- /dev/null +++ b/packages/arm-timeseriesinsights/lib/models/environmentsMappers.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + discriminators, + EnvironmentCreateOrUpdateParameters, + CreateOrUpdateTrackedResourceProperties, + Sku, + PartitionKeyProperty, + EnvironmentResource, + TrackedResource, + Resource, + BaseResource, + EnvironmentStatus, + IngressEnvironmentStatus, + EnvironmentStateDetails, + CloudError, + EnvironmentUpdateParameters, + EnvironmentListResponse, + EventSourceCreateOrUpdateParameters, + EventHubEventSourceCreateOrUpdateParameters, + IoTHubEventSourceCreateOrUpdateParameters, + EventSourceResource, + EventHubEventSourceResource, + IoTHubEventSourceResource, + ReferenceDataSetCreateOrUpdateParameters, + ReferenceDataSetKeyProperty, + ReferenceDataSetResource, + AccessPolicyResource +} from "../models/mappers"; + diff --git a/packages/arm-timeseriesinsights/lib/models/eventSourcesMappers.ts b/packages/arm-timeseriesinsights/lib/models/eventSourcesMappers.ts new file mode 100644 index 000000000000..a6fa54c524f1 --- /dev/null +++ b/packages/arm-timeseriesinsights/lib/models/eventSourcesMappers.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + discriminators, + EventSourceCreateOrUpdateParameters, + CreateOrUpdateTrackedResourceProperties, + EventSourceResource, + TrackedResource, + Resource, + BaseResource, + CloudError, + EventSourceUpdateParameters, + EventSourceListResponse, + EnvironmentCreateOrUpdateParameters, + Sku, + PartitionKeyProperty, + EnvironmentResource, + EnvironmentStatus, + IngressEnvironmentStatus, + EnvironmentStateDetails, + EventHubEventSourceCreateOrUpdateParameters, + IoTHubEventSourceCreateOrUpdateParameters, + EventHubEventSourceUpdateParameters, + LocalTimestamp, + LocalTimestampTimeZoneOffset, + IoTHubEventSourceUpdateParameters, + EventHubEventSourceResource, + IoTHubEventSourceResource, + ReferenceDataSetCreateOrUpdateParameters, + ReferenceDataSetKeyProperty, + ReferenceDataSetResource, + AccessPolicyResource +} from "../models/mappers"; + diff --git a/packages/arm-timeseriesinsights/lib/models/index.ts b/packages/arm-timeseriesinsights/lib/models/index.ts new file mode 100644 index 000000000000..8c89bcceb855 --- /dev/null +++ b/packages/arm-timeseriesinsights/lib/models/index.ts @@ -0,0 +1,1787 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 "ms-rest-azure-js"; +import * as msRest from "ms-rest-js"; + +export { BaseResource, CloudError }; + + +/** + * @interface + * An interface representing OperationDisplay. + * Contains the localized display information for this particular operation / + * action. + * + */ +export interface OperationDisplay { + /** + * @member {string} [provider] The localized friendly form of the resource + * provider name. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly provider?: string; + /** + * @member {string} [resource] The localized friendly form of the resource + * type related to this action/operation. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly resource?: string; + /** + * @member {string} [operation] The localized friendly name for the + * operation. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly operation?: string; + /** + * @member {string} [description] The localized friendly description for the + * operation. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly description?: string; +} + +/** + * @interface + * An interface representing Operation. + * A Time Series Insights REST API operation + * + */ +export interface Operation { + /** + * @member {string} [name] The name of the operation being performed on this + * particular object. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {OperationDisplay} [display] Contains the localized display + * information for this particular operation / action. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly display?: OperationDisplay; +} + +/** + * @interface + * An interface representing Resource. + * Time Series Insights resource + * + * @extends BaseResource + */ +export interface Resource extends BaseResource { + /** + * @member {string} [id] Resource Id + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [name] Resource name + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [type] Resource type + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; +} + +/** + * @interface + * An interface representing TrackedResource. + * Time Series Insights resource that is tracked by Azure Resource Manager. + * + * @extends Resource + */ +export interface TrackedResource extends Resource { + /** + * @member {string} location Resource location + */ + location: string; + /** + * @member {{ [propertyName: string]: string }} [tags] Resource tags + */ + tags?: { [propertyName: string]: string }; +} + +/** + * @interface + * An interface representing ResourceProperties. + * Properties that are common to all tracked resources. + * + */ +export interface ResourceProperties { + /** + * @member {ProvisioningState} [provisioningState] Provisioning state of the + * resource. Possible values include: 'Accepted', 'Creating', 'Updating', + * 'Succeeded', 'Failed', 'Deleting' + */ + provisioningState?: ProvisioningState; + /** + * @member {Date} [creationTime] The time the resource was created. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly creationTime?: Date; +} + +/** + * @interface + * An interface representing Sku. + * The sku determines the capacity of the environment, the SLA (in + * queries-per-minute and total capacity), and the billing rate. + * + */ +export interface Sku { + /** + * @member {SkuName} name The name of this SKU. Possible values include: + * 'S1', 'S2' + */ + name: SkuName; + /** + * @member {number} capacity The capacity of the sku. This value can be + * changed to support scale out of environments after they have been created. + */ + capacity: number; +} + +/** + * @interface + * An interface representing CreateOrUpdateTrackedResourceProperties. + * Properties required to create any resource tracked by Azure Resource + * Manager. + * + */ +export interface CreateOrUpdateTrackedResourceProperties { + /** + * @member {string} location The location of the resource. + */ + location: string; + /** + * @member {{ [propertyName: string]: string }} [tags] Key-value pairs of + * additional properties for the resource. + */ + tags?: { [propertyName: string]: string }; +} + +/** + * @interface + * An interface representing PartitionKeyProperty. + * The structure of the property that a partition key can have. An environment + * can have multiple such properties. + * + */ +export interface PartitionKeyProperty { + /** + * @member {string} [name] The name of the property. + */ + name?: string; + /** + * @member {PropertyType} [type] The type of the property. Possible values + * include: 'String' + */ + type?: PropertyType; +} + +/** + * @interface + * An interface representing EnvironmentCreateOrUpdateParameters. + * Parameters supplied to the CreateOrUpdate Environment operation. + * + * @extends CreateOrUpdateTrackedResourceProperties + */ +export interface EnvironmentCreateOrUpdateParameters extends CreateOrUpdateTrackedResourceProperties { + /** + * @member {Sku} sku The sku determines the capacity of the environment, the + * SLA (in queries-per-minute and total capacity), and the billing rate. + */ + sku: Sku; + /** + * @member {string} dataRetentionTime ISO8601 timespan specifying the minimum + * number of days the environment's events will be available for query. + */ + dataRetentionTime: string; + /** + * @member {StorageLimitExceededBehavior} [storageLimitExceededBehavior] The + * behavior the Time Series Insights service should take when the + * environment's capacity has been exceeded. If "PauseIngress" is specified, + * new events will not be read from the event source. If "PurgeOldData" is + * specified, new events will continue to be read and old events will be + * deleted from the environment. The default behavior is PurgeOldData. + * Possible values include: 'PurgeOldData', 'PauseIngress' + */ + storageLimitExceededBehavior?: StorageLimitExceededBehavior; + /** + * @member {PartitionKeyProperty[]} [partitionKeyProperties] The list of + * partition keys according to which the data in the environment will be + * ordered. + */ + partitionKeyProperties?: PartitionKeyProperty[]; +} + +/** + * @interface + * An interface representing EnvironmentUpdateParameters. + * Parameters supplied to the Update Environment operation. + * + */ +export interface EnvironmentUpdateParameters { + /** + * @member {Sku} [sku] The sku of the environment. + */ + sku?: Sku; + /** + * @member {{ [propertyName: string]: string }} [tags] Key-value pairs of + * additional properties for the environment. + */ + tags?: { [propertyName: string]: string }; + /** + * @member {string} [dataRetentionTime] ISO8601 timespan specifying the + * minimum number of days the environment's events will be available for + * query. + */ + dataRetentionTime?: string; + /** + * @member {StorageLimitExceededBehavior} [storageLimitExceededBehavior] The + * behavior the Time Series Insights service should take when the + * environment's capacity has been exceeded. If "PauseIngress" is specified, + * new events will not be read from the event source. If "PurgeOldData" is + * specified, new events will continue to be read and old events will be + * deleted from the environment. The default behavior is PurgeOldData. + * Possible values include: 'PurgeOldData', 'PauseIngress' + */ + storageLimitExceededBehavior?: StorageLimitExceededBehavior; + /** + * @member {PartitionKeyProperty[]} [partitionKeyProperties] The list of + * event properties which will be used to partition data in the environment. + */ + partitionKeyProperties?: PartitionKeyProperty[]; +} + +/** + * @interface + * An interface representing EnvironmentStateDetails. + * An object that contains the details about an environment's state. + * + */ +export interface EnvironmentStateDetails { + /** + * @member {string} [code] Contains the code that represents the reason of an + * environment being in a particular state. Can be used to programatically + * handle specific cases. + */ + code?: string; + /** + * @member {string} [message] A message that describes the state in detail. + */ + message?: string; +} + +/** + * @interface + * An interface representing IngressEnvironmentStatus. + * An object that represents the status of ingress on an environment. + * + */ +export interface IngressEnvironmentStatus { + /** + * @member {IngressState} [state] This string represents the state of ingress + * operations on an environment. It can be "Disabled", "Ready", "Running", + * "Paused" or "Unknown". Possible values include: 'Disabled', 'Ready', + * 'Running', 'Paused', 'Unknown' + */ + state?: IngressState; + /** + * @member {EnvironmentStateDetails} [stateDetails] An object that contains + * the details about an environment's state. + */ + stateDetails?: EnvironmentStateDetails; +} + +/** + * @interface + * An interface representing EnvironmentStatus. + * An object that represents the status of the environment, and its internal + * state in the Time Series Insights service. + * + */ +export interface EnvironmentStatus { + /** + * @member {IngressEnvironmentStatus} [ingress] An object that represents the + * status of ingress on an environment. + */ + ingress?: IngressEnvironmentStatus; +} + +/** + * @interface + * An interface representing EnvironmentResource. + * An environment is a set of time-series data avaliable for query, and is the + * top level Azure Time Series Insights resource. + * + * @extends TrackedResource + */ +export interface EnvironmentResource extends TrackedResource { + /** + * @member {Sku} [sku] The sku determines the capacity of the environment, + * the SLA (in queries-per-minute and total capacity), and the billing rate. + */ + sku?: Sku; + /** + * @member {string} dataRetentionTime ISO8601 timespan specifying the minimum + * number of days the environment's events will be available for query. + */ + dataRetentionTime: string; + /** + * @member {StorageLimitExceededBehavior} [storageLimitExceededBehavior] The + * behavior the Time Series Insights service should take when the + * environment's capacity has been exceeded. If "PauseIngress" is specified, + * new events will not be read from the event source. If "PurgeOldData" is + * specified, new events will continue to be read and old events will be + * deleted from the environment. The default behavior is PurgeOldData. + * Possible values include: 'PurgeOldData', 'PauseIngress' + */ + storageLimitExceededBehavior?: StorageLimitExceededBehavior; + /** + * @member {PartitionKeyProperty[]} [partitionKeyProperties] The list of + * partition keys according to which the data in the environment will be + * ordered. + */ + partitionKeyProperties?: PartitionKeyProperty[]; + /** + * @member {ProvisioningState} [provisioningState] Provisioning state of the + * resource. Possible values include: 'Accepted', 'Creating', 'Updating', + * 'Succeeded', 'Failed', 'Deleting' + */ + provisioningState?: ProvisioningState; + /** + * @member {Date} [creationTime] The time the resource was created. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly creationTime?: Date; + /** + * @member {string} [dataAccessId] An id used to access the environment data, + * e.g. to query the environment's events or upload reference data for the + * environment. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly dataAccessId?: string; + /** + * @member {string} [dataAccessFqdn] The fully qualified domain name used to + * access the environment data, e.g. to query the environment's events or + * upload reference data for the environment. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly dataAccessFqdn?: string; + /** + * @member {EnvironmentStatus} [status] An object that represents the status + * of the environment, and its internal state in the Time Series Insights + * service. + */ + status?: EnvironmentStatus; +} + +/** + * @interface + * An interface representing EnvironmentListResponse. + * The response of the List Environments operation. + * + */ +export interface EnvironmentListResponse { + /** + * @member {EnvironmentResource[]} [value] Result of the List Environments + * operation. + */ + value?: EnvironmentResource[]; +} + +/** + * Contains the possible cases for EventSourceCreateOrUpdateParameters. + */ +export type EventSourceCreateOrUpdateParametersUnion = EventSourceCreateOrUpdateParameters | EventHubEventSourceCreateOrUpdateParameters | IoTHubEventSourceCreateOrUpdateParameters; + +/** + * @interface + * An interface representing EventSourceCreateOrUpdateParameters. + * Parameters supplied to the Create or Update Event Source operation. + * + */ +export interface EventSourceCreateOrUpdateParameters { + /** + * @member {string} kind Polymorphic Discriminator + */ + kind: "EventSourceCreateOrUpdateParameters"; + /** + * @member {string} location The location of the resource. + */ + location: string; + /** + * @member {{ [propertyName: string]: string }} [tags] Key-value pairs of + * additional properties for the resource. + */ + tags?: { [propertyName: string]: string }; +} + +/** + * @interface + * An interface representing EventHubEventSourceCreateOrUpdateParameters. + * Parameters supplied to the Create or Update Event Source operation for an + * EventHub event source. + * + */ +export interface EventHubEventSourceCreateOrUpdateParameters { + /** + * @member {string} kind Polymorphic Discriminator + */ + kind: "Microsoft.EventHub"; + /** + * @member {string} location The location of the resource. + */ + location: string; + /** + * @member {{ [propertyName: string]: string }} [tags] Key-value pairs of + * additional properties for the resource. + */ + tags?: { [propertyName: string]: string }; + /** + * @member {ProvisioningState} [provisioningState] Provisioning state of the + * resource. Possible values include: 'Accepted', 'Creating', 'Updating', + * 'Succeeded', 'Failed', 'Deleting' + */ + provisioningState?: ProvisioningState; + /** + * @member {Date} [creationTime] The time the resource was created. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly creationTime?: Date; + /** + * @member {string} [timestampPropertyName] The event property that will be + * used as the event source's timestamp. If a value isn't specified for + * timestampPropertyName, or if null or empty-string is specified, the event + * creation time will be used. + */ + timestampPropertyName?: string; + /** + * @member {string} eventSourceResourceId The resource id of the event source + * in Azure Resource Manager. + */ + eventSourceResourceId: string; + /** + * @member {string} serviceBusNamespace The name of the service bus that + * contains the event hub. + */ + serviceBusNamespace: string; + /** + * @member {string} eventHubName The name of the event hub. + */ + eventHubName: string; + /** + * @member {string} consumerGroupName The name of the event hub's consumer + * group that holds the partitions from which events will be read. + */ + consumerGroupName: string; + /** + * @member {string} keyName The name of the SAS key that grants the Time + * Series Insights service access to the event hub. The shared access + * policies for this key must grant 'Listen' permissions to the event hub. + */ + keyName: string; + /** + * @member {string} sharedAccessKey The value of the shared access key that + * grants the Time Series Insights service read access to the event hub. This + * property is not shown in event source responses. + */ + sharedAccessKey: string; +} + +/** + * @interface + * An interface representing IoTHubEventSourceCreateOrUpdateParameters. + * Parameters supplied to the Create or Update Event Source operation for an + * IoTHub event source. + * + */ +export interface IoTHubEventSourceCreateOrUpdateParameters { + /** + * @member {string} kind Polymorphic Discriminator + */ + kind: "Microsoft.IoTHub"; + /** + * @member {string} location The location of the resource. + */ + location: string; + /** + * @member {{ [propertyName: string]: string }} [tags] Key-value pairs of + * additional properties for the resource. + */ + tags?: { [propertyName: string]: string }; + /** + * @member {ProvisioningState} [provisioningState] Provisioning state of the + * resource. Possible values include: 'Accepted', 'Creating', 'Updating', + * 'Succeeded', 'Failed', 'Deleting' + */ + provisioningState?: ProvisioningState; + /** + * @member {Date} [creationTime] The time the resource was created. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly creationTime?: Date; + /** + * @member {string} [timestampPropertyName] The event property that will be + * used as the event source's timestamp. If a value isn't specified for + * timestampPropertyName, or if null or empty-string is specified, the event + * creation time will be used. + */ + timestampPropertyName?: string; + /** + * @member {string} eventSourceResourceId The resource id of the event source + * in Azure Resource Manager. + */ + eventSourceResourceId: string; + /** + * @member {string} iotHubName The name of the iot hub. + */ + iotHubName: string; + /** + * @member {string} consumerGroupName The name of the iot hub's consumer + * group that holds the partitions from which events will be read. + */ + consumerGroupName: string; + /** + * @member {string} keyName The name of the Shared Access Policy key that + * grants the Time Series Insights service access to the iot hub. This shared + * access policy key must grant 'service connect' permissions to the iot hub. + */ + keyName: string; + /** + * @member {string} sharedAccessKey The value of the Shared Access Policy key + * that grants the Time Series Insights service read access to the iot hub. + * This property is not shown in event source responses. + */ + sharedAccessKey: string; +} + +/** + * @interface + * An interface representing EventSourceUpdateParameters. + * Parameters supplied to the Update Event Source operation. + * + */ +export interface EventSourceUpdateParameters { + /** + * @member {{ [propertyName: string]: string }} [tags] Key-value pairs of + * additional properties for the event source. + */ + tags?: { [propertyName: string]: string }; +} + +/** + * @interface + * An interface representing EventHubEventSourceUpdateParameters. + * Parameters supplied to the Update Event Source operation to update an + * EventHub event source. + * + * @extends EventSourceUpdateParameters + */ +export interface EventHubEventSourceUpdateParameters extends EventSourceUpdateParameters { + /** + * @member {string} [timestampPropertyName] The event property that will be + * used as the event source's timestamp. If a value isn't specified for + * timestampPropertyName, or if null or empty-string is specified, the event + * creation time will be used. + */ + timestampPropertyName?: string; + /** + * @member {LocalTimestamp} [localTimestamp] An object that represents the + * local timestamp property. It contains the format of local timestamp that + * needs to be used and the corresponding timezone offset information. If a + * value isn't specified for localTimestamp, or if null, then the local + * timestamp will not be ingressed with the events. + */ + localTimestamp?: LocalTimestamp; + /** + * @member {string} [sharedAccessKey] The value of the shared access key that + * grants the Time Series Insights service read access to the event hub. This + * property is not shown in event source responses. + */ + sharedAccessKey?: string; +} + +/** + * @interface + * An interface representing IoTHubEventSourceUpdateParameters. + * Parameters supplied to the Update Event Source operation to update an IoTHub + * event source. + * + * @extends EventSourceUpdateParameters + */ +export interface IoTHubEventSourceUpdateParameters extends EventSourceUpdateParameters { + /** + * @member {string} [timestampPropertyName] The event property that will be + * used as the event source's timestamp. If a value isn't specified for + * timestampPropertyName, or if null or empty-string is specified, the event + * creation time will be used. + */ + timestampPropertyName?: string; + /** + * @member {LocalTimestamp} [localTimestamp] An object that represents the + * local timestamp property. It contains the format of local timestamp that + * needs to be used and the corresponding timezone offset information. If a + * value isn't specified for localTimestamp, or if null, then the local + * timestamp will not be ingressed with the events. + */ + localTimestamp?: LocalTimestamp; + /** + * @member {string} [sharedAccessKey] The value of the shared access key that + * grants the Time Series Insights service read access to the iot hub. This + * property is not shown in event source responses. + */ + sharedAccessKey?: string; +} + +/** + * Contains the possible cases for EventSourceResource. + */ +export type EventSourceResourceUnion = EventSourceResource | EventHubEventSourceResource | IoTHubEventSourceResource; + +/** + * @interface + * An interface representing EventSourceResource. + * An environment receives data from one or more event sources. Each event + * source has associated connection info that allows the Time Series Insights + * ingress pipeline to connect to and pull data from the event source + * + */ +export interface EventSourceResource { + /** + * @member {string} kind Polymorphic Discriminator + */ + kind: "EventSourceResource"; + /** + * @member {string} [id] Resource Id + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [name] Resource name + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [type] Resource type + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; + /** + * @member {string} location Resource location + */ + location: string; + /** + * @member {{ [propertyName: string]: string }} [tags] Resource tags + */ + tags?: { [propertyName: string]: string }; +} + +/** + * @interface + * An interface representing EventSourceListResponse. + * The response of the List EventSources operation. + * + */ +export interface EventSourceListResponse { + /** + * @member {EventSourceResourceUnion[]} [value] Result of the List + * EventSources operation. + */ + value?: EventSourceResourceUnion[]; +} + +/** + * @interface + * An interface representing EventHubEventSourceResource. + * An event source that receives its data from an Azure EventHub. + * + */ +export interface EventHubEventSourceResource { + /** + * @member {string} kind Polymorphic Discriminator + */ + kind: "Microsoft.EventHub"; + /** + * @member {string} [id] Resource Id + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [name] Resource name + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [type] Resource type + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; + /** + * @member {string} location Resource location + */ + location: string; + /** + * @member {{ [propertyName: string]: string }} [tags] Resource tags + */ + tags?: { [propertyName: string]: string }; + /** + * @member {ProvisioningState} [provisioningState] Provisioning state of the + * resource. Possible values include: 'Accepted', 'Creating', 'Updating', + * 'Succeeded', 'Failed', 'Deleting' + */ + provisioningState?: ProvisioningState; + /** + * @member {Date} [creationTime] The time the resource was created. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly creationTime?: Date; + /** + * @member {string} [timestampPropertyName] The event property that will be + * used as the event source's timestamp. If a value isn't specified for + * timestampPropertyName, or if null or empty-string is specified, the event + * creation time will be used. + */ + timestampPropertyName?: string; + /** + * @member {string} eventSourceResourceId The resource id of the event source + * in Azure Resource Manager. + */ + eventSourceResourceId: string; + /** + * @member {string} serviceBusNamespace The name of the service bus that + * contains the event hub. + */ + serviceBusNamespace: string; + /** + * @member {string} eventHubName The name of the event hub. + */ + eventHubName: string; + /** + * @member {string} consumerGroupName The name of the event hub's consumer + * group that holds the partitions from which events will be read. + */ + consumerGroupName: string; + /** + * @member {string} keyName The name of the SAS key that grants the Time + * Series Insights service access to the event hub. The shared access + * policies for this key must grant 'Listen' permissions to the event hub. + */ + keyName: string; +} + +/** + * @interface + * An interface representing IoTHubEventSourceResource. + * An event source that receives its data from an Azure IoTHub. + * + */ +export interface IoTHubEventSourceResource { + /** + * @member {string} kind Polymorphic Discriminator + */ + kind: "Microsoft.IotHub"; + /** + * @member {string} [id] Resource Id + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [name] Resource name + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [type] Resource type + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; + /** + * @member {string} location Resource location + */ + location: string; + /** + * @member {{ [propertyName: string]: string }} [tags] Resource tags + */ + tags?: { [propertyName: string]: string }; + /** + * @member {ProvisioningState} [provisioningState] Provisioning state of the + * resource. Possible values include: 'Accepted', 'Creating', 'Updating', + * 'Succeeded', 'Failed', 'Deleting' + */ + provisioningState?: ProvisioningState; + /** + * @member {Date} [creationTime] The time the resource was created. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly creationTime?: Date; + /** + * @member {string} [timestampPropertyName] The event property that will be + * used as the event source's timestamp. If a value isn't specified for + * timestampPropertyName, or if null or empty-string is specified, the event + * creation time will be used. + */ + timestampPropertyName?: string; + /** + * @member {string} eventSourceResourceId The resource id of the event source + * in Azure Resource Manager. + */ + eventSourceResourceId: string; + /** + * @member {string} iotHubName The name of the iot hub. + */ + iotHubName: string; + /** + * @member {string} consumerGroupName The name of the iot hub's consumer + * group that holds the partitions from which events will be read. + */ + consumerGroupName: string; + /** + * @member {string} keyName The name of the Shared Access Policy key that + * grants the Time Series Insights service access to the iot hub. This shared + * access policy key must grant 'service connect' permissions to the iot hub. + */ + keyName: string; +} + +/** + * @interface + * An interface representing EventSourceCommonProperties. + * Properties of the event source. + * + * @extends ResourceProperties + */ +export interface EventSourceCommonProperties extends ResourceProperties { + /** + * @member {string} [timestampPropertyName] The event property that will be + * used as the event source's timestamp. If a value isn't specified for + * timestampPropertyName, or if null or empty-string is specified, the event + * creation time will be used. + */ + timestampPropertyName?: string; +} + +/** + * @interface + * An interface representing AzureEventSourceProperties. + * Properties of an event source that reads events from an event broker in + * Azure. + * + * @extends EventSourceCommonProperties + */ +export interface AzureEventSourceProperties extends EventSourceCommonProperties { + /** + * @member {string} eventSourceResourceId The resource id of the event source + * in Azure Resource Manager. + */ + eventSourceResourceId: string; +} + +/** + * @interface + * An interface representing EventHubEventSourceCommonProperties. + * Properties of the EventHub event source. + * + * @extends AzureEventSourceProperties + */ +export interface EventHubEventSourceCommonProperties extends AzureEventSourceProperties { + /** + * @member {string} serviceBusNamespace The name of the service bus that + * contains the event hub. + */ + serviceBusNamespace: string; + /** + * @member {string} eventHubName The name of the event hub. + */ + eventHubName: string; + /** + * @member {string} consumerGroupName The name of the event hub's consumer + * group that holds the partitions from which events will be read. + */ + consumerGroupName: string; + /** + * @member {string} keyName The name of the SAS key that grants the Time + * Series Insights service access to the event hub. The shared access + * policies for this key must grant 'Listen' permissions to the event hub. + */ + keyName: string; +} + +/** + * @interface + * An interface representing IoTHubEventSourceCommonProperties. + * Properties of the IoTHub event source. + * + * @extends AzureEventSourceProperties + */ +export interface IoTHubEventSourceCommonProperties extends AzureEventSourceProperties { + /** + * @member {string} iotHubName The name of the iot hub. + */ + iotHubName: string; + /** + * @member {string} consumerGroupName The name of the iot hub's consumer + * group that holds the partitions from which events will be read. + */ + consumerGroupName: string; + /** + * @member {string} keyName The name of the Shared Access Policy key that + * grants the Time Series Insights service access to the iot hub. This shared + * access policy key must grant 'service connect' permissions to the iot hub. + */ + keyName: string; +} + +/** + * @interface + * An interface representing LocalTimestampTimeZoneOffset. + * An object that represents the offset information for the local timestamp + * format specified. Should not be specified for LocalTimestampFormat - + * Embedded. + * + */ +export interface LocalTimestampTimeZoneOffset { + /** + * @member {string} [propertyName] The event property that will be contain + * the offset information to calculate the local timestamp. When the + * LocalTimestampFormat is Iana, the property name will contain the name of + * the column which contains IANA Timezone Name (eg: Americas/Los Angeles). + * When LocalTimestampFormat is Timespan, it contains the name of property + * which contains values representing the offset (eg: P1D or 1.00:00:00) + */ + propertyName?: string; +} + +/** + * @interface + * An interface representing LocalTimestamp. + * An object that represents the local timestamp property. It contains the + * format of local timestamp that needs to be used and the corresponding + * timezone offset information. If a value isn't specified for localTimestamp, + * or if null, then the local timestamp will not be ingressed with the events. + * + */ +export interface LocalTimestamp { + /** + * @member {LocalTimestampFormat} [format] An enum that represents the format + * of the local timestamp property that needs to be set. Possible values + * include: 'Embedded', 'Iana', 'TimeSpan' + */ + format?: LocalTimestampFormat; + /** + * @member {LocalTimestampTimeZoneOffset} [timeZoneOffset] An object that + * represents the offset information for the local timestamp format + * specified. Should not be specified for LocalTimestampFormat - Embedded. + */ + timeZoneOffset?: LocalTimestampTimeZoneOffset; +} + +/** + * @interface + * An interface representing EventSourceMutableProperties. + * An object that represents a set of mutable event source resource properties. + * + */ +export interface EventSourceMutableProperties { + /** + * @member {string} [timestampPropertyName] The event property that will be + * used as the event source's timestamp. If a value isn't specified for + * timestampPropertyName, or if null or empty-string is specified, the event + * creation time will be used. + */ + timestampPropertyName?: string; + /** + * @member {LocalTimestamp} [localTimestamp] An object that represents the + * local timestamp property. It contains the format of local timestamp that + * needs to be used and the corresponding timezone offset information. If a + * value isn't specified for localTimestamp, or if null, then the local + * timestamp will not be ingressed with the events. + */ + localTimestamp?: LocalTimestamp; +} + +/** + * @interface + * An interface representing ReferenceDataSetKeyProperty. + * A key property for the reference data set. A reference data set can have + * multiple key properties. + * + */ +export interface ReferenceDataSetKeyProperty { + /** + * @member {string} [name] The name of the key property. + */ + name?: string; + /** + * @member {ReferenceDataKeyPropertyType} [type] The type of the key + * property. Possible values include: 'String', 'Double', 'Bool', 'DateTime' + */ + type?: ReferenceDataKeyPropertyType; +} + +/** + * @interface + * An interface representing ReferenceDataSetCreateOrUpdateParameters. + * @extends CreateOrUpdateTrackedResourceProperties + */ +export interface ReferenceDataSetCreateOrUpdateParameters extends CreateOrUpdateTrackedResourceProperties { + /** + * @member {ReferenceDataSetKeyProperty[]} keyProperties The list of key + * properties for the reference data set. + */ + keyProperties: ReferenceDataSetKeyProperty[]; + /** + * @member {DataStringComparisonBehavior} [dataStringComparisonBehavior] The + * reference data set key comparison behavior can be set using this property. + * By default, the value is 'Ordinal' - which means case sensitive key + * comparison will be performed while joining reference data with events or + * while adding new reference data. When 'OrdinalIgnoreCase' is set, case + * insensitive comparison will be used. Possible values include: 'Ordinal', + * 'OrdinalIgnoreCase' + */ + dataStringComparisonBehavior?: DataStringComparisonBehavior; +} + +/** + * @interface + * An interface representing ReferenceDataSetUpdateParameters. + * Parameters supplied to the Update Reference Data Set operation. + * + */ +export interface ReferenceDataSetUpdateParameters { + /** + * @member {{ [propertyName: string]: string }} [tags] Key-value pairs of + * additional properties for the reference data set. + */ + tags?: { [propertyName: string]: string }; +} + +/** + * @interface + * An interface representing ReferenceDataSetResource. + * A reference data set provides metadata about the events in an environment. + * Metadata in the reference data set will be joined with events as they are + * read from event sources. The metadata that makes up the reference data set + * is uploaded or modified through the Time Series Insights data plane APIs. + * + * @extends TrackedResource + */ +export interface ReferenceDataSetResource extends TrackedResource { + /** + * @member {ReferenceDataSetKeyProperty[]} keyProperties The list of key + * properties for the reference data set. + */ + keyProperties: ReferenceDataSetKeyProperty[]; + /** + * @member {DataStringComparisonBehavior} [dataStringComparisonBehavior] The + * reference data set key comparison behavior can be set using this property. + * By default, the value is 'Ordinal' - which means case sensitive key + * comparison will be performed while joining reference data with events or + * while adding new reference data. When 'OrdinalIgnoreCase' is set, case + * insensitive comparison will be used. Possible values include: 'Ordinal', + * 'OrdinalIgnoreCase' + */ + dataStringComparisonBehavior?: DataStringComparisonBehavior; + /** + * @member {ProvisioningState} [provisioningState] Provisioning state of the + * resource. Possible values include: 'Accepted', 'Creating', 'Updating', + * 'Succeeded', 'Failed', 'Deleting' + */ + provisioningState?: ProvisioningState; + /** + * @member {Date} [creationTime] The time the resource was created. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly creationTime?: Date; +} + +/** + * @interface + * An interface representing ReferenceDataSetListResponse. + * The response of the List Reference Data Sets operation. + * + */ +export interface ReferenceDataSetListResponse { + /** + * @member {ReferenceDataSetResource[]} [value] Result of the List Reference + * Data Sets operation. + */ + value?: ReferenceDataSetResource[]; +} + +/** + * @interface + * An interface representing AccessPolicyCreateOrUpdateParameters. + */ +export interface AccessPolicyCreateOrUpdateParameters { + /** + * @member {string} [principalObjectId] The objectId of the principal in + * Azure Active Directory. + */ + principalObjectId?: string; + /** + * @member {string} [description] An description of the access policy. + */ + description?: string; + /** + * @member {AccessPolicyRole[]} [roles] The list of roles the principal is + * assigned on the environment. + */ + roles?: AccessPolicyRole[]; +} + +/** + * @interface + * An interface representing AccessPolicyUpdateParameters. + */ +export interface AccessPolicyUpdateParameters { + /** + * @member {string} [description] An description of the access policy. + */ + description?: string; + /** + * @member {AccessPolicyRole[]} [roles] The list of roles the principal is + * assigned on the environment. + */ + roles?: AccessPolicyRole[]; +} + +/** + * @interface + * An interface representing AccessPolicyResource. + * An access policy is used to grant users and applications access to the + * environment. Roles are assigned to service principals in Azure Active + * Directory. These roles define the actions the principal can perform through + * the Time Series Insights data plane APIs. + * + * @extends Resource + */ +export interface AccessPolicyResource extends Resource { + /** + * @member {string} [principalObjectId] The objectId of the principal in + * Azure Active Directory. + */ + principalObjectId?: string; + /** + * @member {string} [description] An description of the access policy. + */ + description?: string; + /** + * @member {AccessPolicyRole[]} [roles] The list of roles the principal is + * assigned on the environment. + */ + roles?: AccessPolicyRole[]; +} + +/** + * @interface + * An interface representing AccessPolicyListResponse. + * The response of the List access policies operation. + * + */ +export interface AccessPolicyListResponse { + /** + * @member {AccessPolicyResource[]} [value] Result of the List access + * policies operation. + */ + value?: AccessPolicyResource[]; +} + +/** + * @interface + * An interface representing EnvironmentsGetOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface EnvironmentsGetOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {string} [expand] Setting $expand=status will include the status + * of the internal services of the environment in the Time Series Insights + * service. + */ + expand?: string; +} + +/** + * @interface + * An interface representing TimeSeriesInsightsClientOptions. + * @extends AzureServiceClientOptions + */ +export interface TimeSeriesInsightsClientOptions extends AzureServiceClientOptions { + /** + * @member {string} [baseUri] + */ + baseUri?: string; +} + + +/** + * @interface + * An interface representing the OperationListResult. + * Result of the request to list Time Series Insights operations. It contains a + * list of operations and a URL link to get the next set of results. + * + * @extends Array + */ +export interface OperationListResult extends Array { + /** + * @member {string} [nextLink] 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: 'Accepted', 'Creating', 'Updating', 'Succeeded', + * 'Failed', 'Deleting' + * @readonly + * @enum {string} + */ +export enum ProvisioningState { + Accepted = 'Accepted', + Creating = 'Creating', + Updating = 'Updating', + Succeeded = 'Succeeded', + Failed = 'Failed', + Deleting = 'Deleting', +} + +/** + * Defines values for SkuName. + * Possible values include: 'S1', 'S2' + * @readonly + * @enum {string} + */ +export enum SkuName { + S1 = 'S1', + S2 = 'S2', +} + +/** + * Defines values for StorageLimitExceededBehavior. + * Possible values include: 'PurgeOldData', 'PauseIngress' + * @readonly + * @enum {string} + */ +export enum StorageLimitExceededBehavior { + PurgeOldData = 'PurgeOldData', + PauseIngress = 'PauseIngress', +} + +/** + * Defines values for PropertyType. + * Possible values include: 'String' + * There could be more values for this enum apart from the ones defined here.If + * you want to set a value that is not from the known values then you can do + * the following: + * let param: PropertyType = + * "someUnknownValueThatWillStillBeValid"; + * @readonly + * @enum {string} + */ +export enum PropertyType { + String = 'String', +} + +/** + * Defines values for IngressState. + * Possible values include: 'Disabled', 'Ready', 'Running', 'Paused', 'Unknown' + * @readonly + * @enum {string} + */ +export enum IngressState { + Disabled = 'Disabled', + Ready = 'Ready', + Running = 'Running', + Paused = 'Paused', + Unknown = 'Unknown', +} + +/** + * Defines values for LocalTimestampFormat. + * Possible values include: 'Embedded', 'Iana', 'TimeSpan' + * @readonly + * @enum {string} + */ +export enum LocalTimestampFormat { + Embedded = 'Embedded', + Iana = 'Iana', + TimeSpan = 'TimeSpan', +} + +/** + * Defines values for ReferenceDataKeyPropertyType. + * Possible values include: 'String', 'Double', 'Bool', 'DateTime' + * @readonly + * @enum {string} + */ +export enum ReferenceDataKeyPropertyType { + String = 'String', + Double = 'Double', + Bool = 'Bool', + DateTime = 'DateTime', +} + +/** + * Defines values for DataStringComparisonBehavior. + * Possible values include: 'Ordinal', 'OrdinalIgnoreCase' + * @readonly + * @enum {string} + */ +export enum DataStringComparisonBehavior { + Ordinal = 'Ordinal', + OrdinalIgnoreCase = 'OrdinalIgnoreCase', +} + +/** + * Defines values for AccessPolicyRole. + * Possible values include: 'Reader', 'Contributor' + * @readonly + * @enum {string} + */ +export enum AccessPolicyRole { + Reader = 'Reader', + Contributor = 'Contributor', +} + +/** + * Contains response data for the list operation. + */ +export type OperationsListResponse = 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 OperationsListNextResponse = 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 createOrUpdate operation. + */ +export type EnvironmentsCreateOrUpdateResponse = EnvironmentResource & { + /** + * 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: EnvironmentResource; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type EnvironmentsGetResponse = EnvironmentResource & { + /** + * 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: EnvironmentResource; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type EnvironmentsUpdateResponse = EnvironmentResource & { + /** + * 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: EnvironmentResource; + }; +}; + +/** + * Contains response data for the listByResourceGroup operation. + */ +export type EnvironmentsListByResourceGroupResponse = EnvironmentListResponse & { + /** + * 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: EnvironmentListResponse; + }; +}; + +/** + * Contains response data for the listBySubscription operation. + */ +export type EnvironmentsListBySubscriptionResponse = EnvironmentListResponse & { + /** + * 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: EnvironmentListResponse; + }; +}; + +/** + * Contains response data for the beginCreateOrUpdate operation. + */ +export type EnvironmentsBeginCreateOrUpdateResponse = EnvironmentResource & { + /** + * 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: EnvironmentResource; + }; +}; + +/** + * Contains response data for the beginUpdate operation. + */ +export type EnvironmentsBeginUpdateResponse = EnvironmentResource & { + /** + * 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: EnvironmentResource; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type EventSourcesCreateOrUpdateResponse = EventSourceResourceUnion & { + /** + * 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: EventSourceResourceUnion; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type EventSourcesGetResponse = EventSourceResourceUnion & { + /** + * 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: EventSourceResourceUnion; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type EventSourcesUpdateResponse = EventSourceResourceUnion & { + /** + * 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: EventSourceResourceUnion; + }; +}; + +/** + * Contains response data for the listByEnvironment operation. + */ +export type EventSourcesListByEnvironmentResponse = EventSourceListResponse & { + /** + * 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: EventSourceListResponse; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type ReferenceDataSetsCreateOrUpdateResponse = ReferenceDataSetResource & { + /** + * 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: ReferenceDataSetResource; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type ReferenceDataSetsGetResponse = ReferenceDataSetResource & { + /** + * 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: ReferenceDataSetResource; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type ReferenceDataSetsUpdateResponse = ReferenceDataSetResource & { + /** + * 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: ReferenceDataSetResource; + }; +}; + +/** + * Contains response data for the listByEnvironment operation. + */ +export type ReferenceDataSetsListByEnvironmentResponse = ReferenceDataSetListResponse & { + /** + * 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: ReferenceDataSetListResponse; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type AccessPoliciesCreateOrUpdateResponse = AccessPolicyResource & { + /** + * 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: AccessPolicyResource; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type AccessPoliciesGetResponse = AccessPolicyResource & { + /** + * 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: AccessPolicyResource; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type AccessPoliciesUpdateResponse = AccessPolicyResource & { + /** + * 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: AccessPolicyResource; + }; +}; + +/** + * Contains response data for the listByEnvironment operation. + */ +export type AccessPoliciesListByEnvironmentResponse = AccessPolicyListResponse & { + /** + * 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: AccessPolicyListResponse; + }; +}; diff --git a/packages/arm-timeseriesinsights/lib/models/mappers.ts b/packages/arm-timeseriesinsights/lib/models/mappers.ts new file mode 100644 index 000000000000..473a410ab839 --- /dev/null +++ b/packages/arm-timeseriesinsights/lib/models/mappers.ts @@ -0,0 +1,1481 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 "ms-rest-azure-js"; +import * as msRest from "ms-rest-js"; + +export const CloudError = CloudErrorMapper; +export const BaseResource = BaseResourceMapper; + +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" + } + }, + display: { + readOnly: true, + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + } + } + } +}; + +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 TrackedResource: msRest.CompositeMapper = { + serializedName: "TrackedResource", + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + location: { + required: true, + serializedName: "location", + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const ResourceProperties: msRest.CompositeMapper = { + serializedName: "ResourceProperties", + type: { + name: "Composite", + className: "ResourceProperties", + modelProperties: { + provisioningState: { + serializedName: "provisioningState", + type: { + name: "Enum", + allowedValues: [ + "Accepted", + "Creating", + "Updating", + "Succeeded", + "Failed", + "Deleting" + ] + } + }, + creationTime: { + readOnly: true, + serializedName: "creationTime", + type: { + name: "DateTime" + } + } + } + } +}; + +export const Sku: msRest.CompositeMapper = { + serializedName: "Sku", + type: { + name: "Composite", + className: "Sku", + modelProperties: { + name: { + required: true, + serializedName: "name", + type: { + name: "Enum", + allowedValues: [ + "S1", + "S2" + ] + } + }, + capacity: { + required: true, + serializedName: "capacity", + constraints: { + InclusiveMaximum: 10, + InclusiveMinimum: 1 + }, + type: { + name: "Number" + } + } + } + } +}; + +export const CreateOrUpdateTrackedResourceProperties: msRest.CompositeMapper = { + serializedName: "CreateOrUpdateTrackedResourceProperties", + type: { + name: "Composite", + className: "CreateOrUpdateTrackedResourceProperties", + modelProperties: { + location: { + required: true, + serializedName: "location", + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const PartitionKeyProperty: msRest.CompositeMapper = { + serializedName: "PartitionKeyProperty", + type: { + name: "Composite", + className: "PartitionKeyProperty", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const EnvironmentCreateOrUpdateParameters: msRest.CompositeMapper = { + serializedName: "EnvironmentCreateOrUpdateParameters", + type: { + name: "Composite", + className: "EnvironmentCreateOrUpdateParameters", + modelProperties: { + ...CreateOrUpdateTrackedResourceProperties.type.modelProperties, + sku: { + required: true, + serializedName: "sku", + type: { + name: "Composite", + className: "Sku" + } + }, + dataRetentionTime: { + required: true, + serializedName: "properties.dataRetentionTime", + type: { + name: "TimeSpan" + } + }, + storageLimitExceededBehavior: { + serializedName: "properties.storageLimitExceededBehavior", + type: { + name: "Enum", + allowedValues: [ + "PurgeOldData", + "PauseIngress" + ] + } + }, + partitionKeyProperties: { + serializedName: "properties.partitionKeyProperties", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PartitionKeyProperty" + } + } + } + } + } + } +}; + +export const EnvironmentUpdateParameters: msRest.CompositeMapper = { + serializedName: "EnvironmentUpdateParameters", + type: { + name: "Composite", + className: "EnvironmentUpdateParameters", + modelProperties: { + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "Sku" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + }, + dataRetentionTime: { + serializedName: "properties.dataRetentionTime", + type: { + name: "TimeSpan" + } + }, + storageLimitExceededBehavior: { + serializedName: "properties.storageLimitExceededBehavior", + type: { + name: "Enum", + allowedValues: [ + "PurgeOldData", + "PauseIngress" + ] + } + }, + partitionKeyProperties: { + serializedName: "properties.partitionKeyProperties", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PartitionKeyProperty" + } + } + } + } + } + } +}; + +export const EnvironmentStateDetails: msRest.CompositeMapper = { + serializedName: "EnvironmentStateDetails", + type: { + name: "Composite", + className: "EnvironmentStateDetails", + modelProperties: { + code: { + serializedName: "code", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const IngressEnvironmentStatus: msRest.CompositeMapper = { + serializedName: "IngressEnvironmentStatus", + type: { + name: "Composite", + className: "IngressEnvironmentStatus", + modelProperties: { + state: { + serializedName: "state", + type: { + name: "Enum", + allowedValues: [ + "Disabled", + "Ready", + "Running", + "Paused", + "Unknown" + ] + } + }, + stateDetails: { + serializedName: "stateDetails", + type: { + name: "Composite", + className: "EnvironmentStateDetails" + } + } + } + } +}; + +export const EnvironmentStatus: msRest.CompositeMapper = { + serializedName: "EnvironmentStatus", + type: { + name: "Composite", + className: "EnvironmentStatus", + modelProperties: { + ingress: { + serializedName: "ingress", + type: { + name: "Composite", + className: "IngressEnvironmentStatus" + } + } + } + } +}; + +export const EnvironmentResource: msRest.CompositeMapper = { + serializedName: "EnvironmentResource", + type: { + name: "Composite", + className: "EnvironmentResource", + modelProperties: { + ...TrackedResource.type.modelProperties, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "Sku" + } + }, + dataRetentionTime: { + required: true, + serializedName: "properties.dataRetentionTime", + type: { + name: "TimeSpan" + } + }, + storageLimitExceededBehavior: { + serializedName: "properties.storageLimitExceededBehavior", + type: { + name: "Enum", + allowedValues: [ + "PurgeOldData", + "PauseIngress" + ] + } + }, + partitionKeyProperties: { + serializedName: "properties.partitionKeyProperties", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PartitionKeyProperty" + } + } + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + type: { + name: "Enum", + allowedValues: [ + "Accepted", + "Creating", + "Updating", + "Succeeded", + "Failed", + "Deleting" + ] + } + }, + creationTime: { + readOnly: true, + serializedName: "properties.creationTime", + type: { + name: "DateTime" + } + }, + dataAccessId: { + readOnly: true, + serializedName: "properties.dataAccessId", + type: { + name: "Uuid" + } + }, + dataAccessFqdn: { + readOnly: true, + serializedName: "properties.dataAccessFqdn", + type: { + name: "String" + } + }, + status: { + serializedName: "properties.status", + type: { + name: "Composite", + className: "EnvironmentStatus" + } + } + } + } +}; + +export const EnvironmentListResponse: msRest.CompositeMapper = { + serializedName: "EnvironmentListResponse", + type: { + name: "Composite", + className: "EnvironmentListResponse", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EnvironmentResource" + } + } + } + } + } + } +}; + +export const EventSourceCreateOrUpdateParameters: msRest.CompositeMapper = { + serializedName: "EventSourceCreateOrUpdateParameters", + type: { + name: "Composite", + polymorphicDiscriminator: { + serializedName: "kind", + clientName: "kind" + }, + uberParent: "EventSourceCreateOrUpdateParameters", + className: "EventSourceCreateOrUpdateParameters", + modelProperties: { + ...CreateOrUpdateTrackedResourceProperties.type.modelProperties, + kind: { + required: true, + serializedName: "kind", + type: { + name: "String" + } + } + } + } +}; + +export const EventHubEventSourceCreateOrUpdateParameters: msRest.CompositeMapper = { + serializedName: "Microsoft.EventHub", + type: { + name: "Composite", + className: "EventHubEventSourceCreateOrUpdateParameters", + modelProperties: { + ...EventSourceCreateOrUpdateParameters.type.modelProperties, + provisioningState: { + serializedName: "properties.provisioningState", + type: { + name: "Enum", + allowedValues: [ + "Accepted", + "Creating", + "Updating", + "Succeeded", + "Failed", + "Deleting" + ] + } + }, + creationTime: { + readOnly: true, + serializedName: "properties.creationTime", + type: { + name: "DateTime" + } + }, + timestampPropertyName: { + serializedName: "properties.timestampPropertyName", + type: { + name: "String" + } + }, + eventSourceResourceId: { + required: true, + serializedName: "properties.eventSourceResourceId", + type: { + name: "String" + } + }, + serviceBusNamespace: { + required: true, + serializedName: "properties.serviceBusNamespace", + type: { + name: "String" + } + }, + eventHubName: { + required: true, + serializedName: "properties.eventHubName", + type: { + name: "String" + } + }, + consumerGroupName: { + required: true, + serializedName: "properties.consumerGroupName", + type: { + name: "String" + } + }, + keyName: { + required: true, + serializedName: "properties.keyName", + type: { + name: "String" + } + }, + sharedAccessKey: { + required: true, + serializedName: "properties.sharedAccessKey", + type: { + name: "String" + } + } + } + } +}; + +export const IoTHubEventSourceCreateOrUpdateParameters: msRest.CompositeMapper = { + serializedName: "Microsoft.IoTHub", + type: { + name: "Composite", + className: "IoTHubEventSourceCreateOrUpdateParameters", + modelProperties: { + ...EventSourceCreateOrUpdateParameters.type.modelProperties, + provisioningState: { + serializedName: "properties.provisioningState", + type: { + name: "Enum", + allowedValues: [ + "Accepted", + "Creating", + "Updating", + "Succeeded", + "Failed", + "Deleting" + ] + } + }, + creationTime: { + readOnly: true, + serializedName: "properties.creationTime", + type: { + name: "DateTime" + } + }, + timestampPropertyName: { + serializedName: "properties.timestampPropertyName", + type: { + name: "String" + } + }, + eventSourceResourceId: { + required: true, + serializedName: "properties.eventSourceResourceId", + type: { + name: "String" + } + }, + iotHubName: { + required: true, + serializedName: "properties.iotHubName", + type: { + name: "String" + } + }, + consumerGroupName: { + required: true, + serializedName: "properties.consumerGroupName", + type: { + name: "String" + } + }, + keyName: { + required: true, + serializedName: "properties.keyName", + type: { + name: "String" + } + }, + sharedAccessKey: { + required: true, + serializedName: "properties.sharedAccessKey", + type: { + name: "String" + } + } + } + } +}; + +export const EventSourceUpdateParameters: msRest.CompositeMapper = { + serializedName: "EventSourceUpdateParameters", + type: { + name: "Composite", + className: "EventSourceUpdateParameters", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const EventHubEventSourceUpdateParameters: msRest.CompositeMapper = { + serializedName: "EventHubEventSourceUpdateParameters", + type: { + name: "Composite", + className: "EventHubEventSourceUpdateParameters", + modelProperties: { + ...EventSourceUpdateParameters.type.modelProperties, + timestampPropertyName: { + serializedName: "properties.timestampPropertyName", + type: { + name: "String" + } + }, + localTimestamp: { + serializedName: "properties.localTimestamp", + type: { + name: "Composite", + className: "LocalTimestamp" + } + }, + sharedAccessKey: { + serializedName: "properties.sharedAccessKey", + type: { + name: "String" + } + } + } + } +}; + +export const IoTHubEventSourceUpdateParameters: msRest.CompositeMapper = { + serializedName: "IoTHubEventSourceUpdateParameters", + type: { + name: "Composite", + className: "IoTHubEventSourceUpdateParameters", + modelProperties: { + ...EventSourceUpdateParameters.type.modelProperties, + timestampPropertyName: { + serializedName: "properties.timestampPropertyName", + type: { + name: "String" + } + }, + localTimestamp: { + serializedName: "properties.localTimestamp", + type: { + name: "Composite", + className: "LocalTimestamp" + } + }, + sharedAccessKey: { + serializedName: "properties.sharedAccessKey", + type: { + name: "String" + } + } + } + } +}; + +export const EventSourceResource: msRest.CompositeMapper = { + serializedName: "EventSourceResource", + type: { + name: "Composite", + polymorphicDiscriminator: { + serializedName: "kind", + clientName: "kind" + }, + uberParent: "EventSourceResource", + className: "EventSourceResource", + modelProperties: { + ...TrackedResource.type.modelProperties, + kind: { + required: true, + serializedName: "kind", + type: { + name: "String" + } + } + } + } +}; + +export const EventSourceListResponse: msRest.CompositeMapper = { + serializedName: "EventSourceListResponse", + type: { + name: "Composite", + className: "EventSourceListResponse", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + polymorphicDiscriminator: { + serializedName: "kind", + clientName: "kind" + }, + uberParent: "EventSourceResource", + className: "EventSourceResource" + } + } + } + } + } + } +}; + +export const EventHubEventSourceResource: msRest.CompositeMapper = { + serializedName: "Microsoft.EventHub", + type: { + name: "Composite", + className: "EventHubEventSourceResource", + modelProperties: { + ...EventSourceResource.type.modelProperties, + provisioningState: { + serializedName: "properties.provisioningState", + type: { + name: "Enum", + allowedValues: [ + "Accepted", + "Creating", + "Updating", + "Succeeded", + "Failed", + "Deleting" + ] + } + }, + creationTime: { + readOnly: true, + serializedName: "properties.creationTime", + type: { + name: "DateTime" + } + }, + timestampPropertyName: { + serializedName: "properties.timestampPropertyName", + type: { + name: "String" + } + }, + eventSourceResourceId: { + required: true, + serializedName: "properties.eventSourceResourceId", + type: { + name: "String" + } + }, + serviceBusNamespace: { + required: true, + serializedName: "properties.serviceBusNamespace", + type: { + name: "String" + } + }, + eventHubName: { + required: true, + serializedName: "properties.eventHubName", + type: { + name: "String" + } + }, + consumerGroupName: { + required: true, + serializedName: "properties.consumerGroupName", + type: { + name: "String" + } + }, + keyName: { + required: true, + serializedName: "properties.keyName", + type: { + name: "String" + } + } + } + } +}; + +export const IoTHubEventSourceResource: msRest.CompositeMapper = { + serializedName: "Microsoft.IotHub", + type: { + name: "Composite", + className: "IoTHubEventSourceResource", + modelProperties: { + ...EventSourceResource.type.modelProperties, + provisioningState: { + serializedName: "properties.provisioningState", + type: { + name: "Enum", + allowedValues: [ + "Accepted", + "Creating", + "Updating", + "Succeeded", + "Failed", + "Deleting" + ] + } + }, + creationTime: { + readOnly: true, + serializedName: "properties.creationTime", + type: { + name: "DateTime" + } + }, + timestampPropertyName: { + serializedName: "properties.timestampPropertyName", + type: { + name: "String" + } + }, + eventSourceResourceId: { + required: true, + serializedName: "properties.eventSourceResourceId", + type: { + name: "String" + } + }, + iotHubName: { + required: true, + serializedName: "properties.iotHubName", + type: { + name: "String" + } + }, + consumerGroupName: { + required: true, + serializedName: "properties.consumerGroupName", + type: { + name: "String" + } + }, + keyName: { + required: true, + serializedName: "properties.keyName", + type: { + name: "String" + } + } + } + } +}; + +export const EventSourceCommonProperties: msRest.CompositeMapper = { + serializedName: "EventSourceCommonProperties", + type: { + name: "Composite", + className: "EventSourceCommonProperties", + modelProperties: { + ...ResourceProperties.type.modelProperties, + timestampPropertyName: { + serializedName: "timestampPropertyName", + type: { + name: "String" + } + } + } + } +}; + +export const AzureEventSourceProperties: msRest.CompositeMapper = { + serializedName: "AzureEventSourceProperties", + type: { + name: "Composite", + className: "AzureEventSourceProperties", + modelProperties: { + ...EventSourceCommonProperties.type.modelProperties, + eventSourceResourceId: { + required: true, + serializedName: "eventSourceResourceId", + type: { + name: "String" + } + } + } + } +}; + +export const EventHubEventSourceCommonProperties: msRest.CompositeMapper = { + serializedName: "EventHubEventSourceCommonProperties", + type: { + name: "Composite", + className: "EventHubEventSourceCommonProperties", + modelProperties: { + ...AzureEventSourceProperties.type.modelProperties, + serviceBusNamespace: { + required: true, + serializedName: "serviceBusNamespace", + type: { + name: "String" + } + }, + eventHubName: { + required: true, + serializedName: "eventHubName", + type: { + name: "String" + } + }, + consumerGroupName: { + required: true, + serializedName: "consumerGroupName", + type: { + name: "String" + } + }, + keyName: { + required: true, + serializedName: "keyName", + type: { + name: "String" + } + } + } + } +}; + +export const IoTHubEventSourceCommonProperties: msRest.CompositeMapper = { + serializedName: "IoTHubEventSourceCommonProperties", + type: { + name: "Composite", + className: "IoTHubEventSourceCommonProperties", + modelProperties: { + ...AzureEventSourceProperties.type.modelProperties, + iotHubName: { + required: true, + serializedName: "iotHubName", + type: { + name: "String" + } + }, + consumerGroupName: { + required: true, + serializedName: "consumerGroupName", + type: { + name: "String" + } + }, + keyName: { + required: true, + serializedName: "keyName", + type: { + name: "String" + } + } + } + } +}; + +export const LocalTimestampTimeZoneOffset: msRest.CompositeMapper = { + serializedName: "LocalTimestamp_timeZoneOffset", + type: { + name: "Composite", + className: "LocalTimestampTimeZoneOffset", + modelProperties: { + propertyName: { + serializedName: "propertyName", + type: { + name: "String" + } + } + } + } +}; + +export const LocalTimestamp: msRest.CompositeMapper = { + serializedName: "LocalTimestamp", + type: { + name: "Composite", + className: "LocalTimestamp", + modelProperties: { + format: { + serializedName: "format", + type: { + name: "Enum", + allowedValues: [ + "Embedded", + "Iana", + "TimeSpan" + ] + } + }, + timeZoneOffset: { + serializedName: "timeZoneOffset", + type: { + name: "Composite", + className: "LocalTimestampTimeZoneOffset" + } + } + } + } +}; + +export const EventSourceMutableProperties: msRest.CompositeMapper = { + serializedName: "EventSourceMutableProperties", + type: { + name: "Composite", + className: "EventSourceMutableProperties", + modelProperties: { + timestampPropertyName: { + serializedName: "timestampPropertyName", + type: { + name: "String" + } + }, + localTimestamp: { + serializedName: "localTimestamp", + type: { + name: "Composite", + className: "LocalTimestamp" + } + } + } + } +}; + +export const ReferenceDataSetKeyProperty: msRest.CompositeMapper = { + serializedName: "ReferenceDataSetKeyProperty", + type: { + name: "Composite", + className: "ReferenceDataSetKeyProperty", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "Enum", + allowedValues: [ + "String", + "Double", + "Bool", + "DateTime" + ] + } + } + } + } +}; + +export const ReferenceDataSetCreateOrUpdateParameters: msRest.CompositeMapper = { + serializedName: "ReferenceDataSetCreateOrUpdateParameters", + type: { + name: "Composite", + className: "ReferenceDataSetCreateOrUpdateParameters", + modelProperties: { + ...CreateOrUpdateTrackedResourceProperties.type.modelProperties, + keyProperties: { + required: true, + serializedName: "properties.keyProperties", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ReferenceDataSetKeyProperty" + } + } + } + }, + dataStringComparisonBehavior: { + serializedName: "properties.dataStringComparisonBehavior", + type: { + name: "Enum", + allowedValues: [ + "Ordinal", + "OrdinalIgnoreCase" + ] + } + } + } + } +}; + +export const ReferenceDataSetUpdateParameters: msRest.CompositeMapper = { + serializedName: "ReferenceDataSetUpdateParameters", + type: { + name: "Composite", + className: "ReferenceDataSetUpdateParameters", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const ReferenceDataSetResource: msRest.CompositeMapper = { + serializedName: "ReferenceDataSetResource", + type: { + name: "Composite", + className: "ReferenceDataSetResource", + modelProperties: { + ...TrackedResource.type.modelProperties, + keyProperties: { + required: true, + serializedName: "properties.keyProperties", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ReferenceDataSetKeyProperty" + } + } + } + }, + dataStringComparisonBehavior: { + serializedName: "properties.dataStringComparisonBehavior", + type: { + name: "Enum", + allowedValues: [ + "Ordinal", + "OrdinalIgnoreCase" + ] + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + type: { + name: "Enum", + allowedValues: [ + "Accepted", + "Creating", + "Updating", + "Succeeded", + "Failed", + "Deleting" + ] + } + }, + creationTime: { + readOnly: true, + serializedName: "properties.creationTime", + type: { + name: "DateTime" + } + } + } + } +}; + +export const ReferenceDataSetListResponse: msRest.CompositeMapper = { + serializedName: "ReferenceDataSetListResponse", + type: { + name: "Composite", + className: "ReferenceDataSetListResponse", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ReferenceDataSetResource" + } + } + } + } + } + } +}; + +export const AccessPolicyCreateOrUpdateParameters: msRest.CompositeMapper = { + serializedName: "AccessPolicyCreateOrUpdateParameters", + type: { + name: "Composite", + className: "AccessPolicyCreateOrUpdateParameters", + modelProperties: { + principalObjectId: { + serializedName: "properties.principalObjectId", + type: { + name: "String" + } + }, + description: { + serializedName: "properties.description", + type: { + name: "String" + } + }, + roles: { + serializedName: "properties.roles", + type: { + name: "Sequence", + element: { + type: { + name: "Enum", + allowedValues: [ + "Reader", + "Contributor" + ] + } + } + } + } + } + } +}; + +export const AccessPolicyUpdateParameters: msRest.CompositeMapper = { + serializedName: "AccessPolicyUpdateParameters", + type: { + name: "Composite", + className: "AccessPolicyUpdateParameters", + modelProperties: { + description: { + serializedName: "properties.description", + type: { + name: "String" + } + }, + roles: { + serializedName: "properties.roles", + type: { + name: "Sequence", + element: { + type: { + name: "Enum", + allowedValues: [ + "Reader", + "Contributor" + ] + } + } + } + } + } + } +}; + +export const AccessPolicyResource: msRest.CompositeMapper = { + serializedName: "AccessPolicyResource", + type: { + name: "Composite", + className: "AccessPolicyResource", + modelProperties: { + ...Resource.type.modelProperties, + principalObjectId: { + serializedName: "properties.principalObjectId", + type: { + name: "String" + } + }, + description: { + serializedName: "properties.description", + type: { + name: "String" + } + }, + roles: { + serializedName: "properties.roles", + type: { + name: "Sequence", + element: { + type: { + name: "Enum", + allowedValues: [ + "Reader", + "Contributor" + ] + } + } + } + } + } + } +}; + +export const AccessPolicyListResponse: msRest.CompositeMapper = { + serializedName: "AccessPolicyListResponse", + type: { + name: "Composite", + className: "AccessPolicyListResponse", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AccessPolicyResource" + } + } + } + } + } + } +}; + +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" + } + } + } + } +}; + +export const discriminators = { + 'CreateOrUpdateTrackedResourceProperties.EventSourceCreateOrUpdateParameters' : EventSourceCreateOrUpdateParameters, + 'CreateOrUpdateTrackedResourceProperties.Microsoft.EventHub' : EventHubEventSourceCreateOrUpdateParameters, + 'CreateOrUpdateTrackedResourceProperties.Microsoft.IoTHub' : IoTHubEventSourceCreateOrUpdateParameters, + 'BaseResource.EventSourceResource' : EventSourceResource, + 'BaseResource.Microsoft.EventHub' : EventHubEventSourceResource, + 'BaseResource.Microsoft.IotHub' : IoTHubEventSourceResource +}; diff --git a/packages/arm-timeseriesinsights/lib/models/operationsMappers.ts b/packages/arm-timeseriesinsights/lib/models/operationsMappers.ts new file mode 100644 index 000000000000..19f09b391246 --- /dev/null +++ b/packages/arm-timeseriesinsights/lib/models/operationsMappers.ts @@ -0,0 +1,18 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + discriminators, + OperationListResult, + Operation, + OperationDisplay, + CloudError +} from "../models/mappers"; + diff --git a/packages/arm-timeseriesinsights/lib/models/parameters.ts b/packages/arm-timeseriesinsights/lib/models/parameters.ts new file mode 100644 index 000000000000..c56184a00d80 --- /dev/null +++ b/packages/arm-timeseriesinsights/lib/models/parameters.ts @@ -0,0 +1,175 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 "ms-rest-js"; + +export const acceptLanguage: msRest.OperationParameter = { + parameterPath: "acceptLanguage", + mapper: { + serializedName: "accept-language", + defaultValue: 'en-US', + type: { + name: "String" + } + } +}; +export const accessPolicyName0: msRest.OperationURLParameter = { + parameterPath: "accessPolicyName", + mapper: { + required: true, + serializedName: "accessPolicyName", + constraints: { + MaxLength: 90, + MinLength: 1, + Pattern: /^[-\w\._\(\)]+$/ + }, + type: { + name: "String" + } + } +}; +export const accessPolicyName1: msRest.OperationURLParameter = { + parameterPath: "accessPolicyName", + mapper: { + required: true, + serializedName: "accessPolicyName", + type: { + name: "String" + } + } +}; +export const apiVersion: msRest.OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + required: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; +export const environmentName0: msRest.OperationURLParameter = { + parameterPath: "environmentName", + mapper: { + required: true, + serializedName: "environmentName", + constraints: { + MaxLength: 90, + MinLength: 1, + Pattern: /^[-\w\._\(\)]+$/ + }, + type: { + name: "String" + } + } +}; +export const environmentName1: msRest.OperationURLParameter = { + parameterPath: "environmentName", + mapper: { + required: true, + serializedName: "environmentName", + type: { + name: "String" + } + } +}; +export const eventSourceName0: msRest.OperationURLParameter = { + parameterPath: "eventSourceName", + mapper: { + required: true, + serializedName: "eventSourceName", + constraints: { + MaxLength: 90, + MinLength: 1, + Pattern: /^[-\w\._\(\)]+$/ + }, + type: { + name: "String" + } + } +}; +export const eventSourceName1: msRest.OperationURLParameter = { + parameterPath: "eventSourceName", + mapper: { + required: true, + serializedName: "eventSourceName", + type: { + name: "String" + } + } +}; +export const expand: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "expand" + ], + mapper: { + serializedName: "$expand", + type: { + name: "String" + } + } +}; +export const nextPageLink: msRest.OperationURLParameter = { + parameterPath: "nextPageLink", + mapper: { + required: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const referenceDataSetName0: msRest.OperationURLParameter = { + parameterPath: "referenceDataSetName", + mapper: { + required: true, + serializedName: "referenceDataSetName", + constraints: { + MaxLength: 63, + MinLength: 3, + Pattern: /^[A-Za-z0-9]/ + }, + type: { + name: "String" + } + } +}; +export const referenceDataSetName1: msRest.OperationURLParameter = { + parameterPath: "referenceDataSetName", + mapper: { + required: true, + serializedName: "referenceDataSetName", + 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/packages/arm-timeseriesinsights/lib/models/referenceDataSetsMappers.ts b/packages/arm-timeseriesinsights/lib/models/referenceDataSetsMappers.ts new file mode 100644 index 000000000000..45f89be21677 --- /dev/null +++ b/packages/arm-timeseriesinsights/lib/models/referenceDataSetsMappers.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + discriminators, + ReferenceDataSetCreateOrUpdateParameters, + CreateOrUpdateTrackedResourceProperties, + ReferenceDataSetKeyProperty, + ReferenceDataSetResource, + TrackedResource, + Resource, + BaseResource, + CloudError, + ReferenceDataSetUpdateParameters, + ReferenceDataSetListResponse, + EnvironmentCreateOrUpdateParameters, + Sku, + PartitionKeyProperty, + EnvironmentResource, + EnvironmentStatus, + IngressEnvironmentStatus, + EnvironmentStateDetails, + EventSourceCreateOrUpdateParameters, + EventHubEventSourceCreateOrUpdateParameters, + IoTHubEventSourceCreateOrUpdateParameters, + EventSourceResource, + EventHubEventSourceResource, + IoTHubEventSourceResource, + AccessPolicyResource +} from "../models/mappers"; + diff --git a/packages/arm-timeseriesinsights/lib/operations/accessPolicies.ts b/packages/arm-timeseriesinsights/lib/operations/accessPolicies.ts new file mode 100644 index 000000000000..75948ed75ca0 --- /dev/null +++ b/packages/arm-timeseriesinsights/lib/operations/accessPolicies.ts @@ -0,0 +1,388 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 "ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/accessPoliciesMappers"; +import * as Parameters from "../models/parameters"; +import { TimeSeriesInsightsClientContext } from "../timeSeriesInsightsClientContext"; + +/** Class representing a AccessPolicies. */ +export class AccessPolicies { + private readonly client: TimeSeriesInsightsClientContext; + + /** + * Create a AccessPolicies. + * @param {TimeSeriesInsightsClientContext} client Reference to the service client. + */ + constructor(client: TimeSeriesInsightsClientContext) { + this.client = client; + } + + /** + * Create or update an access policy in the specified environment. + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param accessPolicyName Name of the access policy. + * @param parameters Parameters for creating an access policy. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, environmentName: string, accessPolicyName: string, parameters: Models.AccessPolicyCreateOrUpdateParameters, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param accessPolicyName Name of the access policy. + * @param parameters Parameters for creating an access policy. + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, environmentName: string, accessPolicyName: string, parameters: Models.AccessPolicyCreateOrUpdateParameters, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param accessPolicyName Name of the access policy. + * @param parameters Parameters for creating an access policy. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, environmentName: string, accessPolicyName: string, parameters: Models.AccessPolicyCreateOrUpdateParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(resourceGroupName: string, environmentName: string, accessPolicyName: string, parameters: Models.AccessPolicyCreateOrUpdateParameters, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + environmentName, + accessPolicyName, + parameters, + options + }, + createOrUpdateOperationSpec, + callback) as Promise; + } + + /** + * Gets the access policy with the specified name in the specified environment. + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param accessPolicyName The name of the Time Series Insights access policy associated with the + * specified environment. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, environmentName: string, accessPolicyName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param accessPolicyName The name of the Time Series Insights access policy associated with the + * specified environment. + * @param callback The callback + */ + get(resourceGroupName: string, environmentName: string, accessPolicyName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param accessPolicyName The name of the Time Series Insights access policy associated with the + * specified environment. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, environmentName: string, accessPolicyName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, environmentName: string, accessPolicyName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + environmentName, + accessPolicyName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Updates the access policy with the specified name in the specified subscription, resource group, + * and environment. + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param accessPolicyName The name of the Time Series Insights access policy associated with the + * specified environment. + * @param accessPolicyUpdateParameters Request object that contains the updated information for the + * access policy. + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, environmentName: string, accessPolicyName: string, accessPolicyUpdateParameters: Models.AccessPolicyUpdateParameters, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param accessPolicyName The name of the Time Series Insights access policy associated with the + * specified environment. + * @param accessPolicyUpdateParameters Request object that contains the updated information for the + * access policy. + * @param callback The callback + */ + update(resourceGroupName: string, environmentName: string, accessPolicyName: string, accessPolicyUpdateParameters: Models.AccessPolicyUpdateParameters, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param accessPolicyName The name of the Time Series Insights access policy associated with the + * specified environment. + * @param accessPolicyUpdateParameters Request object that contains the updated information for the + * access policy. + * @param options The optional parameters + * @param callback The callback + */ + update(resourceGroupName: string, environmentName: string, accessPolicyName: string, accessPolicyUpdateParameters: Models.AccessPolicyUpdateParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + update(resourceGroupName: string, environmentName: string, accessPolicyName: string, accessPolicyUpdateParameters: Models.AccessPolicyUpdateParameters, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + environmentName, + accessPolicyName, + accessPolicyUpdateParameters, + options + }, + updateOperationSpec, + callback) as Promise; + } + + /** + * Deletes the access policy with the specified name in the specified subscription, resource group, + * and environment + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param accessPolicyName The name of the Time Series Insights access policy associated with the + * specified environment. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, environmentName: string, accessPolicyName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param accessPolicyName The name of the Time Series Insights access policy associated with the + * specified environment. + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, environmentName: string, accessPolicyName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param accessPolicyName The name of the Time Series Insights access policy associated with the + * specified environment. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, environmentName: string, accessPolicyName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroupName: string, environmentName: string, accessPolicyName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + environmentName, + accessPolicyName, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * Lists all the available access policies associated with the environment. + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param [options] The optional parameters + * @returns Promise + */ + listByEnvironment(resourceGroupName: string, environmentName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param callback The callback + */ + listByEnvironment(resourceGroupName: string, environmentName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param options The optional parameters + * @param callback The callback + */ + listByEnvironment(resourceGroupName: string, environmentName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByEnvironment(resourceGroupName: string, environmentName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + environmentName, + options + }, + listByEnvironmentOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const createOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.environmentName1, + Parameters.accessPolicyName0 + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.AccessPolicyCreateOrUpdateParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.AccessPolicyResource + }, + 201: { + bodyMapper: Mappers.AccessPolicyResource + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.environmentName1, + Parameters.accessPolicyName1 + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.AccessPolicyResource + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const updateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.environmentName1, + Parameters.accessPolicyName1 + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "accessPolicyUpdateParameters", + mapper: { + ...Mappers.AccessPolicyUpdateParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.AccessPolicyResource + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.environmentName1, + Parameters.accessPolicyName1 + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listByEnvironmentOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.environmentName1 + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.AccessPolicyListResponse + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/packages/arm-timeseriesinsights/lib/operations/environments.ts b/packages/arm-timeseriesinsights/lib/operations/environments.ts new file mode 100644 index 000000000000..31c05062971a --- /dev/null +++ b/packages/arm-timeseriesinsights/lib/operations/environments.ts @@ -0,0 +1,392 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 "ms-rest-js"; +import * as msRestAzure from "ms-rest-azure-js"; +import * as Models from "../models"; +import * as Mappers from "../models/environmentsMappers"; +import * as Parameters from "../models/parameters"; +import { TimeSeriesInsightsClientContext } from "../timeSeriesInsightsClientContext"; + +/** Class representing a Environments. */ +export class Environments { + private readonly client: TimeSeriesInsightsClientContext; + + /** + * Create a Environments. + * @param {TimeSeriesInsightsClientContext} client Reference to the service client. + */ + constructor(client: TimeSeriesInsightsClientContext) { + this.client = client; + } + + /** + * Create or update an environment in the specified subscription and resource group. + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName Name of the environment + * @param parameters Parameters for creating an environment resource. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, environmentName: string, parameters: Models.EnvironmentCreateOrUpdateParameters, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateOrUpdate(resourceGroupName,environmentName,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Gets the environment with the specified name in the specified subscription and resource group. + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, environmentName: string, options?: Models.EnvironmentsGetOptionalParams): Promise; + /** + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param callback The callback + */ + get(resourceGroupName: string, environmentName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, environmentName: string, options: Models.EnvironmentsGetOptionalParams, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, environmentName: string, options?: Models.EnvironmentsGetOptionalParams, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + environmentName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Updates the environment with the specified name in the specified subscription and resource + * group. + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param environmentUpdateParameters Request object that contains the updated information for the + * environment. + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, environmentName: string, environmentUpdateParameters: Models.EnvironmentUpdateParameters, options?: msRest.RequestOptionsBase): Promise { + return this.beginUpdate(resourceGroupName,environmentName,environmentUpdateParameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Deletes the environment with the specified name in the specified subscription and resource + * group. + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, environmentName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, environmentName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, environmentName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroupName: string, environmentName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + environmentName, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * Lists all the available environments associated with the subscription and within the specified + * resource group. + * @param resourceGroupName Name of an Azure Resource group. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of an Azure Resource group. + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of an Azure Resource group. + * @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, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + options + }, + listByResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * Lists all the available environments within a subscription, irrespective of the resource groups. + * @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, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listBySubscriptionOperationSpec, + callback) as Promise; + } + + /** + * Create or update an environment in the specified subscription and resource group. + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName Name of the environment + * @param parameters Parameters for creating an environment resource. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateOrUpdate(resourceGroupName: string, environmentName: string, parameters: Models.EnvironmentCreateOrUpdateParameters, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + environmentName, + parameters, + options + }, + beginCreateOrUpdateOperationSpec, + options); + } + + /** + * Updates the environment with the specified name in the specified subscription and resource + * group. + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param environmentUpdateParameters Request object that contains the updated information for the + * environment. + * @param [options] The optional parameters + * @returns Promise + */ + beginUpdate(resourceGroupName: string, environmentName: string, environmentUpdateParameters: Models.EnvironmentUpdateParameters, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + environmentName, + environmentUpdateParameters, + options + }, + beginUpdateOperationSpec, + options); + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.environmentName1 + ], + queryParameters: [ + Parameters.expand, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.EnvironmentResource + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.environmentName1 + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listByResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.EnvironmentListResponse + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listBySubscriptionOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.TimeSeriesInsights/environments", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.EnvironmentListResponse + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.environmentName0 + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.EnvironmentCreateOrUpdateParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.EnvironmentResource + }, + 201: { + bodyMapper: Mappers.EnvironmentResource + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.environmentName1 + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "environmentUpdateParameters", + mapper: { + ...Mappers.EnvironmentUpdateParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.EnvironmentResource + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/packages/arm-timeseriesinsights/lib/operations/eventSources.ts b/packages/arm-timeseriesinsights/lib/operations/eventSources.ts new file mode 100644 index 000000000000..37590d66292f --- /dev/null +++ b/packages/arm-timeseriesinsights/lib/operations/eventSources.ts @@ -0,0 +1,389 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 "ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/eventSourcesMappers"; +import * as Parameters from "../models/parameters"; +import { TimeSeriesInsightsClientContext } from "../timeSeriesInsightsClientContext"; + +/** Class representing a EventSources. */ +export class EventSources { + private readonly client: TimeSeriesInsightsClientContext; + + /** + * Create a EventSources. + * @param {TimeSeriesInsightsClientContext} client Reference to the service client. + */ + constructor(client: TimeSeriesInsightsClientContext) { + this.client = client; + } + + /** + * Create or update an event source under the specified environment. + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param eventSourceName Name of the event source. + * @param parameters Parameters for creating an event source resource. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, environmentName: string, eventSourceName: string, parameters: Models.EventSourceCreateOrUpdateParametersUnion, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param eventSourceName Name of the event source. + * @param parameters Parameters for creating an event source resource. + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, environmentName: string, eventSourceName: string, parameters: Models.EventSourceCreateOrUpdateParametersUnion, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param eventSourceName Name of the event source. + * @param parameters Parameters for creating an event source resource. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, environmentName: string, eventSourceName: string, parameters: Models.EventSourceCreateOrUpdateParametersUnion, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(resourceGroupName: string, environmentName: string, eventSourceName: string, parameters: Models.EventSourceCreateOrUpdateParametersUnion, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + environmentName, + eventSourceName, + parameters, + options + }, + createOrUpdateOperationSpec, + callback) as Promise; + } + + /** + * Gets the event source with the specified name in the specified environment. + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param eventSourceName The name of the Time Series Insights event source associated with the + * specified environment. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, environmentName: string, eventSourceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param eventSourceName The name of the Time Series Insights event source associated with the + * specified environment. + * @param callback The callback + */ + get(resourceGroupName: string, environmentName: string, eventSourceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param eventSourceName The name of the Time Series Insights event source associated with the + * specified environment. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, environmentName: string, eventSourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, environmentName: string, eventSourceName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + environmentName, + eventSourceName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Updates the event source with the specified name in the specified subscription, resource group, + * and environment. + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param eventSourceName The name of the Time Series Insights event source associated with the + * specified environment. + * @param eventSourceUpdateParameters Request object that contains the updated information for the + * event source. + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, environmentName: string, eventSourceName: string, eventSourceUpdateParameters: Models.EventSourceUpdateParameters, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param eventSourceName The name of the Time Series Insights event source associated with the + * specified environment. + * @param eventSourceUpdateParameters Request object that contains the updated information for the + * event source. + * @param callback The callback + */ + update(resourceGroupName: string, environmentName: string, eventSourceName: string, eventSourceUpdateParameters: Models.EventSourceUpdateParameters, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param eventSourceName The name of the Time Series Insights event source associated with the + * specified environment. + * @param eventSourceUpdateParameters Request object that contains the updated information for the + * event source. + * @param options The optional parameters + * @param callback The callback + */ + update(resourceGroupName: string, environmentName: string, eventSourceName: string, eventSourceUpdateParameters: Models.EventSourceUpdateParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + update(resourceGroupName: string, environmentName: string, eventSourceName: string, eventSourceUpdateParameters: Models.EventSourceUpdateParameters, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + environmentName, + eventSourceName, + eventSourceUpdateParameters, + options + }, + updateOperationSpec, + callback) as Promise; + } + + /** + * Deletes the event source with the specified name in the specified subscription, resource group, + * and environment + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param eventSourceName The name of the Time Series Insights event source associated with the + * specified environment. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, environmentName: string, eventSourceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param eventSourceName The name of the Time Series Insights event source associated with the + * specified environment. + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, environmentName: string, eventSourceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param eventSourceName The name of the Time Series Insights event source associated with the + * specified environment. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, environmentName: string, eventSourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroupName: string, environmentName: string, eventSourceName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + environmentName, + eventSourceName, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * Lists all the available event sources associated with the subscription and within the specified + * resource group and environment. + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param [options] The optional parameters + * @returns Promise + */ + listByEnvironment(resourceGroupName: string, environmentName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param callback The callback + */ + listByEnvironment(resourceGroupName: string, environmentName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param options The optional parameters + * @param callback The callback + */ + listByEnvironment(resourceGroupName: string, environmentName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByEnvironment(resourceGroupName: string, environmentName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + environmentName, + options + }, + listByEnvironmentOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const createOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.environmentName1, + Parameters.eventSourceName0 + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.EventSourceCreateOrUpdateParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.EventSourceResource + }, + 201: { + bodyMapper: Mappers.EventSourceResource + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.environmentName1, + Parameters.eventSourceName1 + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.EventSourceResource + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const updateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.environmentName1, + Parameters.eventSourceName1 + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "eventSourceUpdateParameters", + mapper: { + ...Mappers.EventSourceUpdateParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.EventSourceResource + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.environmentName1, + Parameters.eventSourceName1 + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listByEnvironmentOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.environmentName1 + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.EventSourceListResponse + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/packages/arm-timeseriesinsights/lib/operations/index.ts b/packages/arm-timeseriesinsights/lib/operations/index.ts new file mode 100644 index 000000000000..2ad013779b5f --- /dev/null +++ b/packages/arm-timeseriesinsights/lib/operations/index.ts @@ -0,0 +1,15 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export * from "./operations"; +export * from "./environments"; +export * from "./eventSources"; +export * from "./referenceDataSets"; +export * from "./accessPolicies"; diff --git a/packages/arm-timeseriesinsights/lib/operations/operations.ts b/packages/arm-timeseriesinsights/lib/operations/operations.ts new file mode 100644 index 000000000000..ad9ecdf37b6d --- /dev/null +++ b/packages/arm-timeseriesinsights/lib/operations/operations.ts @@ -0,0 +1,123 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 "ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/operationsMappers"; +import * as Parameters from "../models/parameters"; +import { TimeSeriesInsightsClientContext } from "../timeSeriesInsightsClientContext"; + +/** Class representing a Operations. */ +export class Operations { + private readonly client: TimeSeriesInsightsClientContext; + + /** + * Create a Operations. + * @param {TimeSeriesInsightsClientContext} client Reference to the service client. + */ + constructor(client: TimeSeriesInsightsClientContext) { + this.client = client; + } + + /** + * Lists all of the available Time Series Insights related operations. + * @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, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Lists all of the available Time Series Insights related operations. + * @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, 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.TimeSeriesInsights/operations", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/packages/arm-timeseriesinsights/lib/operations/referenceDataSets.ts b/packages/arm-timeseriesinsights/lib/operations/referenceDataSets.ts new file mode 100644 index 000000000000..840c067b06ef --- /dev/null +++ b/packages/arm-timeseriesinsights/lib/operations/referenceDataSets.ts @@ -0,0 +1,389 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 "ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/referenceDataSetsMappers"; +import * as Parameters from "../models/parameters"; +import { TimeSeriesInsightsClientContext } from "../timeSeriesInsightsClientContext"; + +/** Class representing a ReferenceDataSets. */ +export class ReferenceDataSets { + private readonly client: TimeSeriesInsightsClientContext; + + /** + * Create a ReferenceDataSets. + * @param {TimeSeriesInsightsClientContext} client Reference to the service client. + */ + constructor(client: TimeSeriesInsightsClientContext) { + this.client = client; + } + + /** + * Create or update a reference data set in the specified environment. + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param referenceDataSetName Name of the reference data set. + * @param parameters Parameters for creating a reference data set. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, environmentName: string, referenceDataSetName: string, parameters: Models.ReferenceDataSetCreateOrUpdateParameters, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param referenceDataSetName Name of the reference data set. + * @param parameters Parameters for creating a reference data set. + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, environmentName: string, referenceDataSetName: string, parameters: Models.ReferenceDataSetCreateOrUpdateParameters, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param referenceDataSetName Name of the reference data set. + * @param parameters Parameters for creating a reference data set. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, environmentName: string, referenceDataSetName: string, parameters: Models.ReferenceDataSetCreateOrUpdateParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(resourceGroupName: string, environmentName: string, referenceDataSetName: string, parameters: Models.ReferenceDataSetCreateOrUpdateParameters, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + environmentName, + referenceDataSetName, + parameters, + options + }, + createOrUpdateOperationSpec, + callback) as Promise; + } + + /** + * Gets the reference data set with the specified name in the specified environment. + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param referenceDataSetName The name of the Time Series Insights reference data set associated + * with the specified environment. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, environmentName: string, referenceDataSetName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param referenceDataSetName The name of the Time Series Insights reference data set associated + * with the specified environment. + * @param callback The callback + */ + get(resourceGroupName: string, environmentName: string, referenceDataSetName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param referenceDataSetName The name of the Time Series Insights reference data set associated + * with the specified environment. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, environmentName: string, referenceDataSetName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, environmentName: string, referenceDataSetName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + environmentName, + referenceDataSetName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Updates the reference data set with the specified name in the specified subscription, resource + * group, and environment. + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param referenceDataSetName The name of the Time Series Insights reference data set associated + * with the specified environment. + * @param referenceDataSetUpdateParameters Request object that contains the updated information for + * the reference data set. + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, environmentName: string, referenceDataSetName: string, referenceDataSetUpdateParameters: Models.ReferenceDataSetUpdateParameters, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param referenceDataSetName The name of the Time Series Insights reference data set associated + * with the specified environment. + * @param referenceDataSetUpdateParameters Request object that contains the updated information for + * the reference data set. + * @param callback The callback + */ + update(resourceGroupName: string, environmentName: string, referenceDataSetName: string, referenceDataSetUpdateParameters: Models.ReferenceDataSetUpdateParameters, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param referenceDataSetName The name of the Time Series Insights reference data set associated + * with the specified environment. + * @param referenceDataSetUpdateParameters Request object that contains the updated information for + * the reference data set. + * @param options The optional parameters + * @param callback The callback + */ + update(resourceGroupName: string, environmentName: string, referenceDataSetName: string, referenceDataSetUpdateParameters: Models.ReferenceDataSetUpdateParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + update(resourceGroupName: string, environmentName: string, referenceDataSetName: string, referenceDataSetUpdateParameters: Models.ReferenceDataSetUpdateParameters, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + environmentName, + referenceDataSetName, + referenceDataSetUpdateParameters, + options + }, + updateOperationSpec, + callback) as Promise; + } + + /** + * Deletes the reference data set with the specified name in the specified subscription, resource + * group, and environment + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param referenceDataSetName The name of the Time Series Insights reference data set associated + * with the specified environment. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, environmentName: string, referenceDataSetName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param referenceDataSetName The name of the Time Series Insights reference data set associated + * with the specified environment. + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, environmentName: string, referenceDataSetName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param referenceDataSetName The name of the Time Series Insights reference data set associated + * with the specified environment. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, environmentName: string, referenceDataSetName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroupName: string, environmentName: string, referenceDataSetName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + environmentName, + referenceDataSetName, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * Lists all the available reference data sets associated with the subscription and within the + * specified resource group and environment. + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param [options] The optional parameters + * @returns Promise + */ + listByEnvironment(resourceGroupName: string, environmentName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param callback The callback + */ + listByEnvironment(resourceGroupName: string, environmentName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param options The optional parameters + * @param callback The callback + */ + listByEnvironment(resourceGroupName: string, environmentName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByEnvironment(resourceGroupName: string, environmentName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + environmentName, + options + }, + listByEnvironmentOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const createOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.environmentName1, + Parameters.referenceDataSetName0 + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.ReferenceDataSetCreateOrUpdateParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.ReferenceDataSetResource + }, + 201: { + bodyMapper: Mappers.ReferenceDataSetResource + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.environmentName1, + Parameters.referenceDataSetName1 + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ReferenceDataSetResource + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const updateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.environmentName1, + Parameters.referenceDataSetName1 + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "referenceDataSetUpdateParameters", + mapper: { + ...Mappers.ReferenceDataSetUpdateParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.ReferenceDataSetResource + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.environmentName1, + Parameters.referenceDataSetName1 + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listByEnvironmentOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.environmentName1 + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ReferenceDataSetListResponse + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/packages/arm-timeseriesinsights/lib/timeSeriesInsightsClient.ts b/packages/arm-timeseriesinsights/lib/timeSeriesInsightsClient.ts new file mode 100644 index 000000000000..7eeec3b83f02 --- /dev/null +++ b/packages/arm-timeseriesinsights/lib/timeSeriesInsightsClient.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 "ms-rest-js"; +import * as Models from "./models"; +import * as Mappers from "./models/mappers"; +import * as operations from "./operations"; +import { TimeSeriesInsightsClientContext } from "./timeSeriesInsightsClientContext"; + + +class TimeSeriesInsightsClient extends TimeSeriesInsightsClientContext { + // Operation groups + operations: operations.Operations; + environments: operations.Environments; + eventSources: operations.EventSources; + referenceDataSets: operations.ReferenceDataSets; + accessPolicies: operations.AccessPolicies; + + /** + * Initializes a new instance of the TimeSeriesInsightsClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId Azure Subscription ID. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.TimeSeriesInsightsClientOptions) { + super(credentials, subscriptionId, options); + this.operations = new operations.Operations(this); + this.environments = new operations.Environments(this); + this.eventSources = new operations.EventSources(this); + this.referenceDataSets = new operations.ReferenceDataSets(this); + this.accessPolicies = new operations.AccessPolicies(this); + } +} + +// Operation Specifications + +export { + TimeSeriesInsightsClient, + TimeSeriesInsightsClientContext, + Models as TimeSeriesInsightsModels, + Mappers as TimeSeriesInsightsMappers +}; +export * from "./operations"; diff --git a/packages/arm-timeseriesinsights/lib/timeSeriesInsightsClientContext.ts b/packages/arm-timeseriesinsights/lib/timeSeriesInsightsClientContext.ts new file mode 100644 index 000000000000..9f97d3487c98 --- /dev/null +++ b/packages/arm-timeseriesinsights/lib/timeSeriesInsightsClientContext.ts @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 "ms-rest-js"; +import * as msRestAzure from "ms-rest-azure-js"; + +const packageName = "arm-timeseriesinsights"; +const packageVersion = "1.0.0"; + +export class TimeSeriesInsightsClientContext extends msRestAzure.AzureServiceClient { + + credentials: msRest.ServiceClientCredentials; + + subscriptionId: string; + + apiVersion: string; + + acceptLanguage: string; + + longRunningOperationRetryTimeout: number; + + /** + * Initializes a new instance of the TimeSeriesInsightsClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId Azure Subscription ID. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.TimeSeriesInsightsClientOptions) { + if (credentials == undefined) { + throw new Error('\'credentials\' cannot be null.'); + } + if (subscriptionId == undefined) { + throw new Error('\'subscriptionId\' cannot be null.'); + } + + if (!options) { + options = {}; + } + super(credentials, options); + + this.apiVersion = '2017-11-15'; + 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; + + this.addUserAgentInfo(`${packageName}/${packageVersion}`); + 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/packages/arm-timeseriesinsights/package.json b/packages/arm-timeseriesinsights/package.json new file mode 100644 index 000000000000..67af863d3b00 --- /dev/null +++ b/packages/arm-timeseriesinsights/package.json @@ -0,0 +1,39 @@ +{ + "name": "arm-timeseriesinsights", + "author": "Microsoft Corporation", + "description": "TimeSeriesInsightsClient Library with typescript type definitions for node.js and browser.", + "version": "1.0.0", + "dependencies": { + "ms-rest-azure-js": "~0.17.165", + "ms-rest-js": "~0.22.434" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "license": "MIT", + "main": "./cjs/timeSeriesInsightsClient.js", + "module": "./esm/timeSeriesInsightsClient.js", + "types": "./cjs/timeSeriesInsightsClient.d.ts", + "devDependencies": { + "tslib": "^1.9.3", + "typescript": "^3.0.3", + "webpack": "^4.17.2", + "webpack-cli": "^3.1.0" + }, + "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/packages/arm-timeseriesinsights", + "repository": { + "type": "git", + "url": "https://github.com/azure/azure-sdk-for-js.git" + }, + "bugs": { + "url": "https://github.com/azure/azure-sdk-for-js/issues" + }, + "scripts": { + "build": "tsc && tsc -p tsconfig.esm.json && webpack", + "prepare": "npm run build" + } +} diff --git a/packages/arm-timeseriesinsights/tsconfig.esm.json b/packages/arm-timeseriesinsights/tsconfig.esm.json new file mode 100644 index 000000000000..0b3aed07505c --- /dev/null +++ b/packages/arm-timeseriesinsights/tsconfig.esm.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "outDir": "./esm", + "module": "es6", + "target": "es5" + } +} diff --git a/packages/arm-timeseriesinsights/tsconfig.json b/packages/arm-timeseriesinsights/tsconfig.json new file mode 100644 index 000000000000..d5b25971c029 --- /dev/null +++ b/packages/arm-timeseriesinsights/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "module": "commonjs", + "moduleResolution": "node", + "strict": true, + "target": "es6", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": ["es6"], + "declaration": true, + "outDir": "./cjs" + }, + "include": ["./lib/**/*"], + "exclude": ["node_modules"] +} diff --git a/packages/arm-timeseriesinsights/webpack.config.js b/packages/arm-timeseriesinsights/webpack.config.js new file mode 100644 index 000000000000..25e7603176fa --- /dev/null +++ b/packages/arm-timeseriesinsights/webpack.config.js @@ -0,0 +1,30 @@ +// This is a template webpack config file with minimal configuration. +// Users are free to create their own webpack configuration files in their application. +const path = require('path'); + +/** + * @type {import('webpack').Configuration} + */ +const config = { + mode: 'production', + entry: './esm/timeSeriesInsightsClient.js', + devtool: 'source-map', + output: { + filename: 'timeSeriesInsightsClientBundle.js', + path: __dirname, + libraryTarget: 'var', + library: 'timeSeriesInsightsClient' + }, + // "ms-rest-js" and "ms-rest-azure-js" are dependencies of this library. + // Customer is expected to import/include this library in browser javascript + // (probably using the script tag in their html file). + externals: { + "ms-rest-js": "msRest", + "ms-rest-azure-js": "msRestAzure" + }, + resolve: { + extensions: [".tsx", ".ts", ".js"] + } +}; + +module.exports = config;