diff --git a/sdk/digitaltwins/arm-digitaltwins/README.md b/sdk/digitaltwins/arm-digitaltwins/README.md index dd2ba59b1c74..0f74fb4e79d7 100644 --- a/sdk/digitaltwins/arm-digitaltwins/README.md +++ b/sdk/digitaltwins/arm-digitaltwins/README.md @@ -15,7 +15,7 @@ npm install @azure/arm-digitaltwins ### How to use -#### nodejs - Authentication, client creation and get digitalTwins as an example written in TypeScript. +#### nodejs - client creation and get digitalTwins as an example written in TypeScript. ##### Install @azure/ms-rest-nodeauth @@ -26,11 +26,10 @@ npm install @azure/ms-rest-nodeauth@"^3.0.0" ##### Sample code +While the below sample uses the interactive login, other authentication options can be found in the [README.md file of @azure/ms-rest-nodeauth](https://www.npmjs.com/package/@azure/ms-rest-nodeauth) package ```typescript -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as msRestNodeAuth from "@azure/ms-rest-nodeauth"; -import { AzureDigitalTwinsManagementClient, AzureDigitalTwinsManagementModels, AzureDigitalTwinsManagementMappers } from "@azure/arm-digitaltwins"; +const msRestNodeAuth = require("@azure/ms-rest-nodeauth"); +const { AzureDigitalTwinsManagementClient } = require("@azure/arm-digitaltwins"); const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; msRestNodeAuth.interactiveLogin().then((creds) => { diff --git a/sdk/digitaltwins/arm-digitaltwins/rollup.config.js b/sdk/digitaltwins/arm-digitaltwins/rollup.config.js index 46d37439f82d..8370182a953c 100644 --- a/sdk/digitaltwins/arm-digitaltwins/rollup.config.js +++ b/sdk/digitaltwins/arm-digitaltwins/rollup.config.js @@ -21,8 +21,8 @@ const config = { "@azure/ms-rest-azure-js": "msRestAzure" }, banner: `/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. diff --git a/sdk/digitaltwins/arm-digitaltwins/src/azureDigitalTwinsManagementClient.ts b/sdk/digitaltwins/arm-digitaltwins/src/azureDigitalTwinsManagementClient.ts index 163ed3e01e52..a2c8ab2fc8ab 100644 --- a/sdk/digitaltwins/arm-digitaltwins/src/azureDigitalTwinsManagementClient.ts +++ b/sdk/digitaltwins/arm-digitaltwins/src/azureDigitalTwinsManagementClient.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -20,6 +19,8 @@ class AzureDigitalTwinsManagementClient extends AzureDigitalTwinsManagementClien digitalTwins: operations.DigitalTwins; digitalTwinsEndpoint: operations.DigitalTwinsEndpoint; operations: operations.Operations; + privateLinkResources: operations.PrivateLinkResources; + privateEndpointConnections: operations.PrivateEndpointConnections; /** * Initializes a new instance of the AzureDigitalTwinsManagementClient class. @@ -32,6 +33,8 @@ class AzureDigitalTwinsManagementClient extends AzureDigitalTwinsManagementClien this.digitalTwins = new operations.DigitalTwins(this); this.digitalTwinsEndpoint = new operations.DigitalTwinsEndpoint(this); this.operations = new operations.Operations(this); + this.privateLinkResources = new operations.PrivateLinkResources(this); + this.privateEndpointConnections = new operations.PrivateEndpointConnections(this); } } diff --git a/sdk/digitaltwins/arm-digitaltwins/src/azureDigitalTwinsManagementClientContext.ts b/sdk/digitaltwins/arm-digitaltwins/src/azureDigitalTwinsManagementClientContext.ts index 8cd74a1979ce..720aa15f871e 100644 --- a/sdk/digitaltwins/arm-digitaltwins/src/azureDigitalTwinsManagementClientContext.ts +++ b/sdk/digitaltwins/arm-digitaltwins/src/azureDigitalTwinsManagementClientContext.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -44,7 +43,7 @@ export class AzureDigitalTwinsManagementClientContext extends msRestAzure.AzureS super(credentials, options); - this.apiVersion = '2020-10-31'; + this.apiVersion = '2020-12-01'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; diff --git a/sdk/digitaltwins/arm-digitaltwins/src/models/digitalTwinsEndpointMappers.ts b/sdk/digitaltwins/arm-digitaltwins/src/models/digitalTwinsEndpointMappers.ts index 055f00f52b58..ad8ada29d2f4 100644 --- a/sdk/digitaltwins/arm-digitaltwins/src/models/digitalTwinsEndpointMappers.ts +++ b/sdk/digitaltwins/arm-digitaltwins/src/models/digitalTwinsEndpointMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -9,15 +9,23 @@ export { discriminators, BaseResource, + ConnectionProperties, + ConnectionPropertiesPrivateEndpoint, + ConnectionPropertiesPrivateLinkServiceConnectionState, + ConnectionState, DigitalTwinsDescription, DigitalTwinsEndpointResource, DigitalTwinsEndpointResourceListResult, DigitalTwinsEndpointResourceProperties, + DigitalTwinsIdentity, DigitalTwinsResource, ErrorDefinition, ErrorResponse, EventGrid, EventHub, ExternalResource, + PrivateEndpoint, + PrivateEndpointConnection, + PrivateEndpointConnectionProperties, ServiceBus } from "../models/mappers"; diff --git a/sdk/digitaltwins/arm-digitaltwins/src/models/digitalTwinsMappers.ts b/sdk/digitaltwins/arm-digitaltwins/src/models/digitalTwinsMappers.ts index 81bb0227c51f..dc8fe3f04d4b 100644 --- a/sdk/digitaltwins/arm-digitaltwins/src/models/digitalTwinsMappers.ts +++ b/sdk/digitaltwins/arm-digitaltwins/src/models/digitalTwinsMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -11,16 +11,25 @@ export { BaseResource, CheckNameRequest, CheckNameResult, + ConnectionProperties, + ConnectionPropertiesPrivateEndpoint, + ConnectionPropertiesPrivateLinkServiceConnectionState, + ConnectionState, DigitalTwinsDescription, DigitalTwinsDescriptionListResult, DigitalTwinsEndpointResource, DigitalTwinsEndpointResourceProperties, + DigitalTwinsIdentity, DigitalTwinsPatchDescription, + DigitalTwinsPatchProperties, DigitalTwinsResource, ErrorDefinition, ErrorResponse, EventGrid, EventHub, ExternalResource, + PrivateEndpoint, + PrivateEndpointConnection, + PrivateEndpointConnectionProperties, ServiceBus } from "../models/mappers"; diff --git a/sdk/digitaltwins/arm-digitaltwins/src/models/index.ts b/sdk/digitaltwins/arm-digitaltwins/src/models/index.ts index 01ad3d820724..792edb1f6cd8 100644 --- a/sdk/digitaltwins/arm-digitaltwins/src/models/index.ts +++ b/sdk/digitaltwins/arm-digitaltwins/src/models/index.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -11,6 +11,63 @@ import * as msRest from "@azure/ms-rest-js"; export { BaseResource, CloudError }; +/** + * The properties of a DigitalTwinsInstance. + */ +export interface DigitalTwinsPatchProperties { + /** + * Public network access for the DigitalTwinsInstance. Possible values include: 'Enabled', + * 'Disabled' + */ + publicNetworkAccess?: PublicNetworkAccess; +} + +/** + * The properties of a private endpoint connection. + */ +export interface ConnectionProperties { + /** + * The provisioning state. Possible values include: 'Pending', 'Approved', 'Rejected', + * 'Disconnected' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly provisioningState?: ConnectionPropertiesProvisioningState; + privateEndpoint?: ConnectionPropertiesPrivateEndpoint; + /** + * The list of group ids for the private endpoint connection. + */ + groupIds?: string[]; + privateLinkServiceConnectionState?: ConnectionPropertiesPrivateLinkServiceConnectionState; +} + +/** + * An interface representing PrivateEndpointConnectionProperties. + */ +export interface PrivateEndpointConnectionProperties extends ConnectionProperties { +} + +/** + * The private endpoint connection of a Digital Twin. + */ +export interface PrivateEndpointConnection extends BaseResource { + /** + * The resource identifier. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * The resource name. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * The resource type. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; + properties: PrivateEndpointConnectionProperties; +} + /** * The common properties of a DigitalTwinsInstance. */ @@ -38,6 +95,10 @@ export interface DigitalTwinsResource extends BaseResource { * The resource tags. */ tags?: { [propertyName: string]: string }; + /** + * The managed identity for the DigitalTwinsInstance. + */ + identity?: DigitalTwinsIdentity; } /** @@ -55,8 +116,8 @@ export interface DigitalTwinsDescription extends DigitalTwinsResource { */ readonly lastUpdatedTime?: Date; /** - * The provisioning state. Possible values include: 'Provisioning', 'Deleting', 'Succeeded', - * 'Failed', 'Canceled', 'Deleted', 'Warning', 'Suspending', 'Restoring', 'Moving' + * The provisioning state. Possible values include: 'Provisioning', 'Deleting', 'Updating', + * 'Succeeded', 'Failed', 'Canceled', 'Deleted', 'Warning', 'Suspending', 'Restoring', 'Moving' * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly provisioningState?: ProvisioningState; @@ -65,6 +126,37 @@ export interface DigitalTwinsDescription extends DigitalTwinsResource { * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly hostName?: string; + privateEndpointConnections?: PrivateEndpointConnection[]; + /** + * Public network access for the DigitalTwinsInstance. Possible values include: 'Enabled', + * 'Disabled' + */ + publicNetworkAccess?: PublicNetworkAccess; +} + +/** + * The managed identity for the DigitalTwinsInstance. + */ +export interface DigitalTwinsIdentity { + /** + * The type of Managed Identity used by the DigitalTwinsInstance. Only SystemAssigned is + * supported. Possible values include: 'None', 'SystemAssigned' + */ + type?: DigitalTwinsIdentityType; + /** + * The object id of the Managed Identity Resource. This will be sent to the RP from ARM via the + * x-ms-identity-principal-id header in the PUT request if the resource has a + * systemAssigned(implicit) identity + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly principalId?: string; + /** + * The tenant id of the Managed Identity Resource. This will be sent to the RP from ARM via the + * x-ms-client-tenant-id header in the PUT request if the resource has a systemAssigned(implicit) + * identity + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly tenantId?: string; } /** @@ -72,9 +164,17 @@ export interface DigitalTwinsDescription extends DigitalTwinsResource { */ export interface DigitalTwinsPatchDescription { /** - * Instance tags + * Instance patch properties */ tags?: { [propertyName: string]: string }; + /** + * The managed identity for the DigitalTwinsInstance. + */ + identity?: DigitalTwinsIdentity; + /** + * Properties for the DigitalTwinsInstance. + */ + properties?: DigitalTwinsPatchProperties; } /** @@ -235,9 +335,18 @@ export interface DigitalTwinsEndpointResourceProperties { */ readonly createdTime?: Date; /** - * Dead letter storage secret. Will be obfuscated during read. + * Specifies the authentication type being used for connecting to the endpoint. Possible values + * include: 'KeyBased', 'IdentityBased' + */ + authenticationType?: AuthenticationType; + /** + * Dead letter storage secret for key-based authentication. Will be obfuscated during read. */ deadLetterSecret?: string; + /** + * Dead letter storage URL for identity-based authentication. + */ + deadLetterUri?: string; } /** @@ -247,7 +356,7 @@ export interface DigitalTwinsEndpointResource extends ExternalResource { /** * DigitalTwinsInstance endpoint resource properties. */ - properties?: DigitalTwinsEndpointResourcePropertiesUnion; + properties: DigitalTwinsEndpointResourcePropertiesUnion; } /** @@ -270,17 +379,37 @@ export interface ServiceBus { */ readonly createdTime?: Date; /** - * Dead letter storage secret. Will be obfuscated during read. + * Specifies the authentication type being used for connecting to the endpoint. Possible values + * include: 'KeyBased', 'IdentityBased' + */ + authenticationType?: AuthenticationType; + /** + * Dead letter storage secret for key-based authentication. Will be obfuscated during read. */ deadLetterSecret?: string; /** - * PrimaryConnectionString of the endpoint. Will be obfuscated during read. + * Dead letter storage URL for identity-based authentication. + */ + deadLetterUri?: string; + /** + * PrimaryConnectionString of the endpoint for key-based authentication. Will be obfuscated + * during read. */ - primaryConnectionString: string; + primaryConnectionString?: string; /** - * SecondaryConnectionString of the endpoint. Will be obfuscated during read. + * SecondaryConnectionString of the endpoint for key-based authentication. Will be obfuscated + * during read. */ secondaryConnectionString?: string; + /** + * The URL of the ServiceBus namespace for identity-based authentication. It must include the + * protocol sb:// + */ + endpointUri?: string; + /** + * The ServiceBus Topic name for identity-based authentication + */ + entityPath?: string; } /** @@ -303,17 +432,37 @@ export interface EventHub { */ readonly createdTime?: Date; /** - * Dead letter storage secret. Will be obfuscated during read. + * Specifies the authentication type being used for connecting to the endpoint. Possible values + * include: 'KeyBased', 'IdentityBased' + */ + authenticationType?: AuthenticationType; + /** + * Dead letter storage secret for key-based authentication. Will be obfuscated during read. */ deadLetterSecret?: string; /** - * PrimaryConnectionString of the endpoint. Will be obfuscated during read. + * Dead letter storage URL for identity-based authentication. + */ + deadLetterUri?: string; + /** + * PrimaryConnectionString of the endpoint for key-based authentication. Will be obfuscated + * during read. */ - connectionStringPrimaryKey: string; + connectionStringPrimaryKey?: string; /** - * SecondaryConnectionString of the endpoint. Will be obfuscated during read. + * SecondaryConnectionString of the endpoint for key-based authentication. Will be obfuscated + * during read. */ connectionStringSecondaryKey?: string; + /** + * The URL of the EventHub namespace for identity-based authentication. It must include the + * protocol sb:// + */ + endpointUri?: string; + /** + * The EventHub name in the EventHub namespace for identity-based authentication. + */ + entityPath?: string; } /** @@ -336,9 +485,18 @@ export interface EventGrid { */ readonly createdTime?: Date; /** - * Dead letter storage secret. Will be obfuscated during read. + * Specifies the authentication type being used for connecting to the endpoint. Possible values + * include: 'KeyBased', 'IdentityBased' + */ + authenticationType?: AuthenticationType; + /** + * Dead letter storage secret for key-based authentication. Will be obfuscated during read. */ deadLetterSecret?: string; + /** + * Dead letter storage URL for identity-based authentication. + */ + deadLetterUri?: string; /** * EventGrid Topic Endpoint */ @@ -354,43 +512,110 @@ export interface EventGrid { } /** - * Optional Parameters. + * The properties for a group information object. */ -export interface DigitalTwinsUpdateOptionalParams extends msRest.RequestOptionsBase { +export interface GroupIdInformationProperties { /** - * Instance tags + * The group id */ - tags?: { [propertyName: string]: string }; + groupId?: string; + /** + * The required members for a specific group id. + */ + requiredMembers?: string[]; + /** + * The required DNS zones for a specific group id. + */ + requiredZoneNames?: string[]; } /** - * Optional Parameters. + * An interface representing GroupIdInformationPropertiesModel. */ -export interface DigitalTwinsBeginUpdateOptionalParams extends msRest.RequestOptionsBase { +export interface GroupIdInformationPropertiesModel extends GroupIdInformationProperties { +} + +/** + * The group information for creating a private endpoint on Digital Twin. + */ +export interface GroupIdInformation { + properties: GroupIdInformationPropertiesModel; /** - * Instance tags + * The resource identifier. */ - tags?: { [propertyName: string]: string }; + id?: string; + /** + * The resource name. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * The resource type. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; } /** - * Optional Parameters. + * The available private link connections for a Digital Twin. */ -export interface DigitalTwinsEndpointCreateOrUpdateOptionalParams extends msRest.RequestOptionsBase { +export interface PrivateEndpointConnectionsResponse { /** - * DigitalTwinsInstance endpoint resource properties. + * The list of available private link connections for a Digital Twin. */ - properties?: DigitalTwinsEndpointResourcePropertiesUnion; + value?: PrivateEndpointConnection[]; } /** - * Optional Parameters. + * The available private link resources for a Digital Twin. */ -export interface DigitalTwinsEndpointBeginCreateOrUpdateOptionalParams extends msRest.RequestOptionsBase { +export interface GroupIdInformationResponse { /** - * DigitalTwinsInstance endpoint resource properties. + * The list of available private link resources for a Digital Twin. */ - properties?: DigitalTwinsEndpointResourcePropertiesUnion; + value?: GroupIdInformation[]; +} + +/** + * The current state of a private endpoint connection. + */ +export interface ConnectionState { + /** + * The status of a private endpoint connection. Possible values include: 'Pending', 'Approved', + * 'Rejected', 'Disconnected' + */ + status: PrivateLinkServiceConnectionStatus; + /** + * The description for the current state of a private endpoint connection. + */ + description: string; + /** + * Actions required for a private endpoint connection. + */ + actionsRequired?: string; +} + +/** + * The private endpoint property of a private endpoint connection. + */ +export interface PrivateEndpoint { + /** + * The resource identifier. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; +} + +/** + * An interface representing ConnectionPropertiesPrivateEndpoint. + */ +export interface ConnectionPropertiesPrivateEndpoint extends PrivateEndpoint { +} + +/** + * An interface representing ConnectionPropertiesPrivateLinkServiceConnectionState. + */ +export interface ConnectionPropertiesPrivateLinkServiceConnectionState extends ConnectionState { } /** @@ -437,14 +662,30 @@ export interface OperationListResult extends Array { nextLink?: string; } +/** + * Defines values for PublicNetworkAccess. + * Possible values include: 'Enabled', 'Disabled' + * @readonly + * @enum {string} + */ +export type PublicNetworkAccess = 'Enabled' | 'Disabled'; + /** * Defines values for ProvisioningState. - * Possible values include: 'Provisioning', 'Deleting', 'Succeeded', 'Failed', 'Canceled', - * 'Deleted', 'Warning', 'Suspending', 'Restoring', 'Moving' + * Possible values include: 'Provisioning', 'Deleting', 'Updating', 'Succeeded', 'Failed', + * 'Canceled', 'Deleted', 'Warning', 'Suspending', 'Restoring', 'Moving' * @readonly * @enum {string} */ -export type ProvisioningState = 'Provisioning' | 'Deleting' | 'Succeeded' | 'Failed' | 'Canceled' | 'Deleted' | 'Warning' | 'Suspending' | 'Restoring' | 'Moving'; +export type ProvisioningState = 'Provisioning' | 'Deleting' | 'Updating' | 'Succeeded' | 'Failed' | 'Canceled' | 'Deleted' | 'Warning' | 'Suspending' | 'Restoring' | 'Moving'; + +/** + * Defines values for DigitalTwinsIdentityType. + * Possible values include: 'None', 'SystemAssigned' + * @readonly + * @enum {string} + */ +export type DigitalTwinsIdentityType = 'None' | 'SystemAssigned'; /** * Defines values for Reason. @@ -463,6 +704,30 @@ export type Reason = 'Invalid' | 'AlreadyExists'; */ export type EndpointProvisioningState = 'Provisioning' | 'Deleting' | 'Succeeded' | 'Failed' | 'Canceled' | 'Deleted' | 'Warning' | 'Suspending' | 'Restoring' | 'Moving' | 'Disabled'; +/** + * Defines values for AuthenticationType. + * Possible values include: 'KeyBased', 'IdentityBased' + * @readonly + * @enum {string} + */ +export type AuthenticationType = 'KeyBased' | 'IdentityBased'; + +/** + * Defines values for PrivateLinkServiceConnectionStatus. + * Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected' + * @readonly + * @enum {string} + */ +export type PrivateLinkServiceConnectionStatus = 'Pending' | 'Approved' | 'Rejected' | 'Disconnected'; + +/** + * Defines values for ConnectionPropertiesProvisioningState. + * Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected' + * @readonly + * @enum {string} + */ +export type ConnectionPropertiesProvisioningState = 'Pending' | 'Approved' | 'Rejected' | 'Disconnected'; + /** * Contains response data for the get operation. */ @@ -882,3 +1147,123 @@ export type OperationsListNextResponse = OperationListResult & { parsedBody: OperationListResult; }; }; + +/** + * Contains response data for the list operation. + */ +export type PrivateLinkResourcesListResponse = GroupIdInformationResponse & { + /** + * 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: GroupIdInformationResponse; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type PrivateLinkResourcesGetResponse = GroupIdInformation & { + /** + * 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: GroupIdInformation; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type PrivateEndpointConnectionsListResponse = PrivateEndpointConnectionsResponse & { + /** + * 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: PrivateEndpointConnectionsResponse; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection & { + /** + * 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: PrivateEndpointConnection; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type PrivateEndpointConnectionsCreateOrUpdateResponse = PrivateEndpointConnection & { + /** + * 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: PrivateEndpointConnection; + }; +}; + +/** + * Contains response data for the beginCreateOrUpdate operation. + */ +export type PrivateEndpointConnectionsBeginCreateOrUpdateResponse = PrivateEndpointConnection & { + /** + * 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: PrivateEndpointConnection; + }; +}; diff --git a/sdk/digitaltwins/arm-digitaltwins/src/models/mappers.ts b/sdk/digitaltwins/arm-digitaltwins/src/models/mappers.ts index 61b298b8d66b..fe0df279f389 100644 --- a/sdk/digitaltwins/arm-digitaltwins/src/models/mappers.ts +++ b/sdk/digitaltwins/arm-digitaltwins/src/models/mappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -12,6 +12,119 @@ import * as msRest from "@azure/ms-rest-js"; export const CloudError = CloudErrorMapper; export const BaseResource = BaseResourceMapper; +export const DigitalTwinsPatchProperties: msRest.CompositeMapper = { + serializedName: "DigitalTwinsPatchProperties", + type: { + name: "Composite", + className: "DigitalTwinsPatchProperties", + modelProperties: { + publicNetworkAccess: { + nullable: true, + serializedName: "publicNetworkAccess", + type: { + name: "String" + } + } + } + } +}; + +export const ConnectionProperties: msRest.CompositeMapper = { + serializedName: "ConnectionProperties", + type: { + name: "Composite", + className: "ConnectionProperties", + modelProperties: { + provisioningState: { + nullable: true, + readOnly: true, + serializedName: "provisioningState", + type: { + name: "String" + } + }, + privateEndpoint: { + serializedName: "privateEndpoint", + type: { + name: "Composite", + className: "ConnectionPropertiesPrivateEndpoint" + } + }, + groupIds: { + serializedName: "groupIds", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + privateLinkServiceConnectionState: { + serializedName: "privateLinkServiceConnectionState", + type: { + name: "Composite", + className: "ConnectionPropertiesPrivateLinkServiceConnectionState" + } + } + } + } +}; + +export const PrivateEndpointConnectionProperties: msRest.CompositeMapper = { + serializedName: "PrivateEndpointConnection_properties", + type: { + name: "Composite", + className: "PrivateEndpointConnectionProperties", + modelProperties: { + ...ConnectionProperties.type.modelProperties + } + } +}; + +export const PrivateEndpointConnection: msRest.CompositeMapper = { + serializedName: "PrivateEndpointConnection", + type: { + name: "Composite", + className: "PrivateEndpointConnection", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + constraints: { + Pattern: /^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$/ + }, + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + properties: { + required: true, + serializedName: "properties", + type: { + name: "Composite", + className: "PrivateEndpointConnectionProperties" + } + } + } + } +}; + export const DigitalTwinsResource: msRest.CompositeMapper = { serializedName: "DigitalTwinsResource", type: { @@ -60,6 +173,14 @@ export const DigitalTwinsResource: msRest.CompositeMapper = { } } } + }, + identity: { + nullable: true, + serializedName: "identity", + type: { + name: "Composite", + className: "DigitalTwinsIdentity" + } } } } @@ -100,6 +221,57 @@ export const DigitalTwinsDescription: msRest.CompositeMapper = { type: { name: "String" } + }, + privateEndpointConnections: { + serializedName: "properties.privateEndpointConnections", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection" + } + } + } + }, + publicNetworkAccess: { + nullable: true, + serializedName: "properties.publicNetworkAccess", + type: { + name: "String" + } + } + } + } +}; + +export const DigitalTwinsIdentity: msRest.CompositeMapper = { + serializedName: "DigitalTwinsIdentity", + type: { + name: "Composite", + className: "DigitalTwinsIdentity", + modelProperties: { + type: { + serializedName: "type", + type: { + name: "String" + } + }, + principalId: { + nullable: true, + readOnly: true, + serializedName: "principalId", + type: { + name: "String" + } + }, + tenantId: { + nullable: true, + readOnly: true, + serializedName: "tenantId", + type: { + name: "String" + } } } } @@ -122,6 +294,22 @@ export const DigitalTwinsPatchDescription: msRest.CompositeMapper = { } } } + }, + identity: { + nullable: true, + serializedName: "identity", + type: { + name: "Composite", + className: "DigitalTwinsIdentity" + } + }, + properties: { + nullable: true, + serializedName: "properties", + type: { + name: "Composite", + className: "DigitalTwinsPatchProperties" + } } } } @@ -376,6 +564,12 @@ export const DigitalTwinsEndpointResourceProperties: msRest.CompositeMapper = { name: "DateTime" } }, + authenticationType: { + serializedName: "authenticationType", + type: { + name: "String" + } + }, deadLetterSecret: { nullable: true, serializedName: "deadLetterSecret", @@ -383,6 +577,13 @@ export const DigitalTwinsEndpointResourceProperties: msRest.CompositeMapper = { name: "String" } }, + deadLetterUri: { + nullable: true, + serializedName: "deadLetterUri", + type: { + name: "String" + } + }, endpointType: { required: true, serializedName: "endpointType", @@ -402,6 +603,7 @@ export const DigitalTwinsEndpointResource: msRest.CompositeMapper = { modelProperties: { ...ExternalResource.type.modelProperties, properties: { + required: true, serializedName: "properties", type: { name: "Composite", @@ -422,7 +624,6 @@ export const ServiceBus: msRest.CompositeMapper = { modelProperties: { ...DigitalTwinsEndpointResourceProperties.type.modelProperties, primaryConnectionString: { - required: true, nullable: true, serializedName: "primaryConnectionString", type: { @@ -435,6 +636,20 @@ export const ServiceBus: msRest.CompositeMapper = { type: { name: "String" } + }, + endpointUri: { + nullable: true, + serializedName: "endpointUri", + type: { + name: "String" + } + }, + entityPath: { + nullable: true, + serializedName: "entityPath", + type: { + name: "String" + } } } } @@ -450,7 +665,6 @@ export const EventHub: msRest.CompositeMapper = { modelProperties: { ...DigitalTwinsEndpointResourceProperties.type.modelProperties, connectionStringPrimaryKey: { - required: true, nullable: true, serializedName: "connectionStringPrimaryKey", type: { @@ -463,6 +677,20 @@ export const EventHub: msRest.CompositeMapper = { type: { name: "String" } + }, + endpointUri: { + nullable: true, + serializedName: "endpointUri", + type: { + name: "String" + } + }, + entityPath: { + nullable: true, + serializedName: "entityPath", + type: { + name: "String" + } } } } @@ -503,6 +731,209 @@ export const EventGrid: msRest.CompositeMapper = { } }; +export const GroupIdInformationProperties: msRest.CompositeMapper = { + serializedName: "GroupIdInformationProperties", + type: { + name: "Composite", + className: "GroupIdInformationProperties", + modelProperties: { + groupId: { + serializedName: "groupId", + type: { + name: "String" + } + }, + requiredMembers: { + serializedName: "requiredMembers", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + requiredZoneNames: { + serializedName: "requiredZoneNames", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const GroupIdInformationPropertiesModel: msRest.CompositeMapper = { + serializedName: "GroupIdInformation_properties", + type: { + name: "Composite", + className: "GroupIdInformationPropertiesModel", + modelProperties: { + ...GroupIdInformationProperties.type.modelProperties + } + } +}; + +export const GroupIdInformation: msRest.CompositeMapper = { + serializedName: "GroupIdInformation", + type: { + name: "Composite", + className: "GroupIdInformation", + modelProperties: { + properties: { + required: true, + serializedName: "properties", + type: { + name: "Composite", + className: "GroupIdInformationPropertiesModel" + } + }, + id: { + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + constraints: { + Pattern: /^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$/ + }, + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const PrivateEndpointConnectionsResponse: msRest.CompositeMapper = { + serializedName: "PrivateEndpointConnectionsResponse", + type: { + name: "Composite", + className: "PrivateEndpointConnectionsResponse", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection" + } + } + } + } + } + } +}; + +export const GroupIdInformationResponse: msRest.CompositeMapper = { + serializedName: "GroupIdInformationResponse", + type: { + name: "Composite", + className: "GroupIdInformationResponse", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "GroupIdInformation" + } + } + } + } + } + } +}; + +export const ConnectionState: msRest.CompositeMapper = { + serializedName: "ConnectionState", + type: { + name: "Composite", + className: "ConnectionState", + modelProperties: { + status: { + required: true, + serializedName: "status", + type: { + name: "String" + } + }, + description: { + required: true, + serializedName: "description", + type: { + name: "String" + } + }, + actionsRequired: { + serializedName: "actionsRequired", + type: { + name: "String" + } + } + } + } +}; + +export const PrivateEndpoint: msRest.CompositeMapper = { + serializedName: "PrivateEndpoint", + type: { + name: "Composite", + className: "PrivateEndpoint", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + } + } + } +}; + +export const ConnectionPropertiesPrivateEndpoint: msRest.CompositeMapper = { + serializedName: "ConnectionProperties_privateEndpoint", + type: { + name: "Composite", + className: "ConnectionPropertiesPrivateEndpoint", + modelProperties: { + ...PrivateEndpoint.type.modelProperties + } + } +}; + +export const ConnectionPropertiesPrivateLinkServiceConnectionState: msRest.CompositeMapper = { + serializedName: "ConnectionProperties_privateLinkServiceConnectionState", + type: { + name: "Composite", + className: "ConnectionPropertiesPrivateLinkServiceConnectionState", + modelProperties: { + ...ConnectionState.type.modelProperties + } + } +}; + export const DigitalTwinsDescriptionListResult: msRest.CompositeMapper = { serializedName: "DigitalTwinsDescriptionListResult", type: { diff --git a/sdk/digitaltwins/arm-digitaltwins/src/models/operationsMappers.ts b/sdk/digitaltwins/arm-digitaltwins/src/models/operationsMappers.ts index dfd94974ce24..7e9414298012 100644 --- a/sdk/digitaltwins/arm-digitaltwins/src/models/operationsMappers.ts +++ b/sdk/digitaltwins/arm-digitaltwins/src/models/operationsMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. diff --git a/sdk/digitaltwins/arm-digitaltwins/src/models/parameters.ts b/sdk/digitaltwins/arm-digitaltwins/src/models/parameters.ts index 113ca15ff529..b3433febfe9c 100644 --- a/sdk/digitaltwins/arm-digitaltwins/src/models/parameters.ts +++ b/sdk/digitaltwins/arm-digitaltwins/src/models/parameters.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -26,7 +25,7 @@ export const apiVersion: msRest.OperationQueryParameter = { required: true, isConstant: true, serializedName: "api-version", - defaultValue: '2020-10-31', + defaultValue: '2020-12-01', constraints: { MinLength: 10 }, @@ -74,13 +73,23 @@ export const nextPageLink: msRest.OperationURLParameter = { }, skipEncoding: true }; +export const privateEndpointConnectionName: msRest.OperationURLParameter = { + parameterPath: "privateEndpointConnectionName", + mapper: { + required: true, + serializedName: "privateEndpointConnectionName", + type: { + name: "String" + } + } +}; export const resourceGroupName: msRest.OperationURLParameter = { parameterPath: "resourceGroupName", mapper: { required: true, serializedName: "resourceGroupName", constraints: { - MaxLength: 64, + MaxLength: 90, MinLength: 1 }, type: { @@ -88,6 +97,16 @@ export const resourceGroupName: msRest.OperationURLParameter = { } } }; +export const resourceId: msRest.OperationURLParameter = { + parameterPath: "resourceId", + mapper: { + required: true, + serializedName: "resourceId", + type: { + name: "String" + } + } +}; export const resourceName: msRest.OperationURLParameter = { parameterPath: "resourceName", mapper: { diff --git a/sdk/digitaltwins/arm-digitaltwins/src/models/privateEndpointConnectionsMappers.ts b/sdk/digitaltwins/arm-digitaltwins/src/models/privateEndpointConnectionsMappers.ts new file mode 100644 index 000000000000..cc645f0d1445 --- /dev/null +++ b/sdk/digitaltwins/arm-digitaltwins/src/models/privateEndpointConnectionsMappers.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + discriminators, + BaseResource, + ConnectionProperties, + ConnectionPropertiesPrivateEndpoint, + ConnectionPropertiesPrivateLinkServiceConnectionState, + ConnectionState, + DigitalTwinsDescription, + DigitalTwinsEndpointResource, + DigitalTwinsEndpointResourceProperties, + DigitalTwinsIdentity, + DigitalTwinsResource, + ErrorDefinition, + ErrorResponse, + EventGrid, + EventHub, + ExternalResource, + PrivateEndpoint, + PrivateEndpointConnection, + PrivateEndpointConnectionProperties, + PrivateEndpointConnectionsResponse, + ServiceBus +} from "../models/mappers"; diff --git a/sdk/digitaltwins/arm-digitaltwins/src/models/privateLinkResourcesMappers.ts b/sdk/digitaltwins/arm-digitaltwins/src/models/privateLinkResourcesMappers.ts new file mode 100644 index 000000000000..b32c507be757 --- /dev/null +++ b/sdk/digitaltwins/arm-digitaltwins/src/models/privateLinkResourcesMappers.ts @@ -0,0 +1,17 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + discriminators, + ErrorDefinition, + ErrorResponse, + GroupIdInformation, + GroupIdInformationProperties, + GroupIdInformationPropertiesModel, + GroupIdInformationResponse +} from "../models/mappers"; diff --git a/sdk/digitaltwins/arm-digitaltwins/src/operations/digitalTwins.ts b/sdk/digitaltwins/arm-digitaltwins/src/operations/digitalTwins.ts index efcaf26e86ea..1f6c59065f49 100644 --- a/sdk/digitaltwins/arm-digitaltwins/src/operations/digitalTwins.ts +++ b/sdk/digitaltwins/arm-digitaltwins/src/operations/digitalTwins.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -78,11 +77,12 @@ export class DigitalTwins { * Update metadata of DigitalTwinsInstance. * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. * @param resourceName The name of the DigitalTwinsInstance. + * @param digitalTwinsPatchDescription The DigitalTwinsInstance and security metadata. * @param [options] The optional parameters * @returns Promise */ - update(resourceGroupName: string, resourceName: string, options?: Models.DigitalTwinsUpdateOptionalParams): Promise { - return this.beginUpdate(resourceGroupName,resourceName,options) + update(resourceGroupName: string, resourceName: string, digitalTwinsPatchDescription: Models.DigitalTwinsPatchDescription, options?: msRest.RequestOptionsBase): Promise { + return this.beginUpdate(resourceGroupName,resourceName,digitalTwinsPatchDescription,options) .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; } @@ -208,14 +208,16 @@ export class DigitalTwins { * Update metadata of DigitalTwinsInstance. * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. * @param resourceName The name of the DigitalTwinsInstance. + * @param digitalTwinsPatchDescription The DigitalTwinsInstance and security metadata. * @param [options] The optional parameters * @returns Promise */ - beginUpdate(resourceGroupName: string, resourceName: string, options?: Models.DigitalTwinsBeginUpdateOptionalParams): Promise { + beginUpdate(resourceGroupName: string, resourceName: string, digitalTwinsPatchDescription: Models.DigitalTwinsPatchDescription, options?: msRest.RequestOptionsBase): Promise { return this.client.sendLRORequest( { resourceGroupName, resourceName, + digitalTwinsPatchDescription, options }, beginUpdateOperationSpec, @@ -454,12 +456,7 @@ const beginUpdateOperationSpec: msRest.OperationSpec = { Parameters.acceptLanguage ], requestBody: { - parameterPath: { - tags: [ - "options", - "tags" - ] - }, + parameterPath: "digitalTwinsPatchDescription", mapper: { ...Mappers.DigitalTwinsPatchDescription, required: true @@ -469,6 +466,9 @@ const beginUpdateOperationSpec: msRest.OperationSpec = { 200: { bodyMapper: Mappers.DigitalTwinsDescription }, + 202: { + bodyMapper: Mappers.DigitalTwinsDescription + }, default: { bodyMapper: Mappers.ErrorResponse } @@ -512,6 +512,9 @@ const listNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], @@ -533,6 +536,9 @@ const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], diff --git a/sdk/digitaltwins/arm-digitaltwins/src/operations/digitalTwinsEndpoint.ts b/sdk/digitaltwins/arm-digitaltwins/src/operations/digitalTwinsEndpoint.ts index 5bf63e2afe9d..fd2df72a76a3 100644 --- a/sdk/digitaltwins/arm-digitaltwins/src/operations/digitalTwinsEndpoint.ts +++ b/sdk/digitaltwins/arm-digitaltwins/src/operations/digitalTwinsEndpoint.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -100,11 +99,12 @@ export class DigitalTwinsEndpoint { * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. * @param resourceName The name of the DigitalTwinsInstance. * @param endpointName Name of Endpoint Resource. + * @param properties DigitalTwinsInstance endpoint resource properties. * @param [options] The optional parameters * @returns Promise */ - createOrUpdate(resourceGroupName: string, resourceName: string, endpointName: string, options?: Models.DigitalTwinsEndpointCreateOrUpdateOptionalParams): Promise { - return this.beginCreateOrUpdate(resourceGroupName,resourceName,endpointName,options) + createOrUpdate(resourceGroupName: string, resourceName: string, endpointName: string, properties: Models.DigitalTwinsEndpointResourcePropertiesUnion, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateOrUpdate(resourceGroupName,resourceName,endpointName,properties,options) .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; } @@ -126,15 +126,17 @@ export class DigitalTwinsEndpoint { * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. * @param resourceName The name of the DigitalTwinsInstance. * @param endpointName Name of Endpoint Resource. + * @param properties DigitalTwinsInstance endpoint resource properties. * @param [options] The optional parameters * @returns Promise */ - beginCreateOrUpdate(resourceGroupName: string, resourceName: string, endpointName: string, options?: Models.DigitalTwinsEndpointBeginCreateOrUpdateOptionalParams): Promise { + beginCreateOrUpdate(resourceGroupName: string, resourceName: string, endpointName: string, properties: Models.DigitalTwinsEndpointResourcePropertiesUnion, options?: msRest.RequestOptionsBase): Promise { return this.client.sendLRORequest( { resourceGroupName, resourceName, endpointName, + properties, options }, beginCreateOrUpdateOperationSpec, @@ -260,10 +262,7 @@ const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { ], requestBody: { parameterPath: { - properties: [ - "options", - "properties" - ] + properties: "properties" }, mapper: { ...Mappers.DigitalTwinsEndpointResource, @@ -321,6 +320,9 @@ const listNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], diff --git a/sdk/digitaltwins/arm-digitaltwins/src/operations/index.ts b/sdk/digitaltwins/arm-digitaltwins/src/operations/index.ts index 5bd4d2d87090..7c807db2a533 100644 --- a/sdk/digitaltwins/arm-digitaltwins/src/operations/index.ts +++ b/sdk/digitaltwins/arm-digitaltwins/src/operations/index.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -11,3 +10,5 @@ export * from "./digitalTwins"; export * from "./digitalTwinsEndpoint"; export * from "./operations"; +export * from "./privateLinkResources"; +export * from "./privateEndpointConnections"; diff --git a/sdk/digitaltwins/arm-digitaltwins/src/operations/operations.ts b/sdk/digitaltwins/arm-digitaltwins/src/operations/operations.ts index 7e211a708a98..afaaeb9cd0dc 100644 --- a/sdk/digitaltwins/arm-digitaltwins/src/operations/operations.ts +++ b/sdk/digitaltwins/arm-digitaltwins/src/operations/operations.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -108,6 +107,9 @@ const listNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], diff --git a/sdk/digitaltwins/arm-digitaltwins/src/operations/privateEndpointConnections.ts b/sdk/digitaltwins/arm-digitaltwins/src/operations/privateEndpointConnections.ts new file mode 100644 index 000000000000..ced8e2a4429e --- /dev/null +++ b/sdk/digitaltwins/arm-digitaltwins/src/operations/privateEndpointConnections.ts @@ -0,0 +1,282 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; +import * as Models from "../models"; +import * as Mappers from "../models/privateEndpointConnectionsMappers"; +import * as Parameters from "../models/parameters"; +import { AzureDigitalTwinsManagementClientContext } from "../azureDigitalTwinsManagementClientContext"; + +/** Class representing a PrivateEndpointConnections. */ +export class PrivateEndpointConnections { + private readonly client: AzureDigitalTwinsManagementClientContext; + + /** + * Create a PrivateEndpointConnections. + * @param {AzureDigitalTwinsManagementClientContext} client Reference to the service client. + */ + constructor(client: AzureDigitalTwinsManagementClientContext) { + this.client = client; + } + + /** + * List private endpoint connection properties. + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param [options] The optional parameters + * @returns Promise + */ + list(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param callback The callback + */ + list(resourceGroupName: string, resourceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param options The optional parameters + * @param callback The callback + */ + list(resourceGroupName: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + resourceName, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Get private endpoint connection properties for the given private endpoint. + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param callback The callback + */ + get(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + resourceName, + privateEndpointConnectionName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Delete private endpoint connection with the specified name. + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMethod(resourceGroupName,resourceName,privateEndpointConnectionName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Update the status of a private endpoint connection with the given name. + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param properties + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, properties: Models.PrivateEndpointConnectionProperties, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateOrUpdate(resourceGroupName,resourceName,privateEndpointConnectionName,properties,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Delete private endpoint connection with the specified name. + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteMethod(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + resourceName, + privateEndpointConnectionName, + options + }, + beginDeleteMethodOperationSpec, + options); + } + + /** + * Update the status of a private endpoint connection with the given name. + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param properties + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateOrUpdate(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, properties: Models.PrivateEndpointConnectionProperties, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + resourceName, + privateEndpointConnectionName, + properties, + options + }, + beginCreateOrUpdateOperationSpec, + options); + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}/privateEndpointConnections", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnectionsResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName, + Parameters.privateEndpointConnectionName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginDeleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName, + Parameters.privateEndpointConnectionName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName, + Parameters.privateEndpointConnectionName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: { + properties: "properties" + }, + mapper: { + ...Mappers.PrivateEndpointConnection, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + 202: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/digitaltwins/arm-digitaltwins/src/operations/privateLinkResources.ts b/sdk/digitaltwins/arm-digitaltwins/src/operations/privateLinkResources.ts new file mode 100644 index 000000000000..dcf85693728c --- /dev/null +++ b/sdk/digitaltwins/arm-digitaltwins/src/operations/privateLinkResources.ts @@ -0,0 +1,148 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/privateLinkResourcesMappers"; +import * as Parameters from "../models/parameters"; +import { AzureDigitalTwinsManagementClientContext } from "../azureDigitalTwinsManagementClientContext"; + +/** Class representing a PrivateLinkResources. */ +export class PrivateLinkResources { + private readonly client: AzureDigitalTwinsManagementClientContext; + + /** + * Create a PrivateLinkResources. + * @param {AzureDigitalTwinsManagementClientContext} client Reference to the service client. + */ + constructor(client: AzureDigitalTwinsManagementClientContext) { + this.client = client; + } + + /** + * List private link resources for given Digital Twin. + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param [options] The optional parameters + * @returns Promise + */ + list(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param callback The callback + */ + list(resourceGroupName: string, resourceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param options The optional parameters + * @param callback The callback + */ + list(resourceGroupName: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + resourceName, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Get the specified private link resource for the given Digital Twin. + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param resourceId The name of the private link resource. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, resourceName: string, resourceId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param resourceId The name of the private link resource. + * @param callback The callback + */ + get(resourceGroupName: string, resourceName: string, resourceId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param resourceId The name of the private link resource. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, resourceName: string, resourceId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, resourceName: string, resourceId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + resourceName, + resourceId, + options + }, + getOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}/privateLinkResources", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.GroupIdInformationResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}/privateLinkResources/{resourceId}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName, + Parameters.resourceId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.GroupIdInformation + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +};