diff --git a/sdk/attestation/arm-attestation/LICENSE.txt b/sdk/attestation/arm-attestation/LICENSE.txt index ea8fb1516028..2d3163745319 100644 --- a/sdk/attestation/arm-attestation/LICENSE.txt +++ b/sdk/attestation/arm-attestation/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2020 Microsoft +Copyright (c) 2021 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/attestation/arm-attestation/README.md b/sdk/attestation/arm-attestation/README.md index e26c14c75674..ad4cfdb30616 100644 --- a/sdk/attestation/arm-attestation/README.md +++ b/sdk/attestation/arm-attestation/README.md @@ -1,11 +1,11 @@ ## Azure AttestationManagementClient SDK for JavaScript -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for AttestationManagementClient. +This package contains an isomorphic SDK (runs both in node.js and in browsers) for AttestationManagementClient. ### Currently supported environments - [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. +- Latest versions of Safari, Chrome, Edge and Firefox. ### Prerequisites @@ -21,7 +21,6 @@ Install both packages using the below command: ```bash npm install --save @azure/arm-attestation @azure/identity ``` - > **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features. If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options. @@ -37,7 +36,6 @@ If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/ In the below samples, we pass the credential and the Azure subscription id to instantiate the client. Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started. - #### nodejs - Authentication, client creation, and list operations as an example written in JavaScript. ##### Sample code @@ -51,7 +49,6 @@ const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; // Please note that you can also use credentials from the `@azure/ms-rest-nodeauth` package instead. const creds = new DefaultAzureCredential(); const client = new AttestationManagementClient(creds, subscriptionId); - client.operations.list().then((result) => { console.log("The result is:"); console.log(result); @@ -86,7 +83,7 @@ In browser applications, we recommend using the `InteractiveBrowserCredential` t const credential = new InteractiveBrowserCredential( { clientId: "", - tenantId: "" + tenant: "" }); const client = new Azure.ArmAttestation.AttestationManagementClient(creds, subscriptionId); client.operations.list().then((result) => { diff --git a/sdk/attestation/arm-attestation/package.json b/sdk/attestation/arm-attestation/package.json index 57f19ab93f16..85a0715342f5 100644 --- a/sdk/attestation/arm-attestation/package.json +++ b/sdk/attestation/arm-attestation/package.json @@ -27,7 +27,7 @@ "rollup-plugin-sourcemaps": "^0.4.2", "uglify-js": "^3.6.0" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/feature/v4/sdk/attestation/arm-attestation", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/attestation/arm-attestation", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" diff --git a/sdk/attestation/arm-attestation/rollup.config.js b/sdk/attestation/arm-attestation/rollup.config.js index 562646229ed1..03e842eb63ea 100644 --- a/sdk/attestation/arm-attestation/rollup.config.js +++ b/sdk/attestation/arm-attestation/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/attestation/arm-attestation/src/attestationManagementClient.ts b/sdk/attestation/arm-attestation/src/attestationManagementClient.ts index ab2f54efb640..7821a5272146 100644 --- a/sdk/attestation/arm-attestation/src/attestationManagementClient.ts +++ b/sdk/attestation/arm-attestation/src/attestationManagementClient.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,7 @@ class AttestationManagementClient extends AttestationManagementClientContext { // Operation groups operations: operations.Operations; attestationProviders: operations.AttestationProviders; + privateEndpointConnections: operations.PrivateEndpointConnections; /** * Initializes a new instance of the AttestationManagementClient class. @@ -36,6 +36,7 @@ class AttestationManagementClient extends AttestationManagementClientContext { super(credentials, subscriptionId, options); this.operations = new operations.Operations(this); this.attestationProviders = new operations.AttestationProviders(this); + this.privateEndpointConnections = new operations.PrivateEndpointConnections(this); } } diff --git a/sdk/attestation/arm-attestation/src/attestationManagementClientContext.ts b/sdk/attestation/arm-attestation/src/attestationManagementClientContext.ts index 1a47e2225abf..7ab6ab8f9d52 100644 --- a/sdk/attestation/arm-attestation/src/attestationManagementClientContext.ts +++ b/sdk/attestation/arm-attestation/src/attestationManagementClientContext.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 @@ -10,8 +9,8 @@ import * as Models from "./models"; import * as msRest from "@azure/ms-rest-js"; -import { TokenCredential } from "@azure/core-auth"; import * as msRestAzure from "@azure/ms-rest-azure-js"; +import { TokenCredential } from "@azure/core-auth"; const packageName = "@azure/arm-attestation"; const packageVersion = "1.1.1"; diff --git a/sdk/attestation/arm-attestation/src/models/attestationProvidersMappers.ts b/sdk/attestation/arm-attestation/src/models/attestationProvidersMappers.ts index fcead856c16c..e2c7c0059985 100644 --- a/sdk/attestation/arm-attestation/src/models/attestationProvidersMappers.ts +++ b/sdk/attestation/arm-attestation/src/models/attestationProvidersMappers.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. @@ -17,6 +17,9 @@ export { CloudError, JSONWebKey, JSONWebKeySet, + PrivateEndpoint, + PrivateEndpointConnection, + PrivateLinkServiceConnectionState, ProxyResource, Resource, SystemData, diff --git a/sdk/attestation/arm-attestation/src/models/index.ts b/sdk/attestation/arm-attestation/src/models/index.ts index 9e0198f5ff55..e12e79e2c2be 100644 --- a/sdk/attestation/arm-attestation/src/models/index.ts +++ b/sdk/attestation/arm-attestation/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. @@ -38,7 +38,7 @@ export interface SystemData { */ lastModifiedByType?: CreatedByType; /** - * The type of identity that last modified the resource. + * The timestamp of resource last modification (UTC) */ lastModifiedAt?: Date; } @@ -94,6 +94,37 @@ export interface OperationList { value?: OperationsDefinition[]; } +/** + * The Private Endpoint resource. + */ +export interface PrivateEndpoint { + /** + * The ARM identifier for Private Endpoint + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; +} + +/** + * A collection of information about the state of the connection between service consumer and + * provider. + */ +export interface PrivateLinkServiceConnectionState { + /** + * Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. Possible values include: 'Pending', 'Approved', 'Rejected' + */ + status?: PrivateEndpointServiceConnectionStatus; + /** + * The reason for approval/rejection of the connection. + */ + description?: string; + /** + * A message indicating if changes on the service provider require any updates on the consumer. + */ + actionsRequired?: string; +} + /** * Common fields that are returned in the response for all Azure Resource Manager resources * @summary Resource @@ -118,6 +149,26 @@ export interface Resource extends BaseResource { readonly type?: string; } +/** + * The Private Endpoint Connection resource. + */ +export interface PrivateEndpointConnection extends Resource { + /** + * The resource of private end point. + */ + privateEndpoint?: PrivateEndpoint; + /** + * A collection of information about the state of the connection between service consumer and + * provider. + */ + privateLinkServiceConnectionState: PrivateLinkServiceConnectionState; + /** + * The provisioning state of the private endpoint connection resource. Possible values include: + * 'Succeeded', 'Creating', 'Deleting', 'Failed' + */ + provisioningState?: PrivateEndpointConnectionProvisioningState; +} + /** * The resource model definition for an Azure Resource Manager tracked top level resource which has * 'tags' and a 'location' @@ -144,7 +195,7 @@ export interface AttestationProvider extends TrackedResource { */ readonly systemData?: SystemData; /** - * Trust model for the attestation service instance. + * Trust model for the attestation provider. */ trustModel?: string; /** @@ -155,6 +206,11 @@ export interface AttestationProvider extends TrackedResource { * Gets the uri of attestation service */ attestUri?: string; + /** + * List of private endpoint connections associated with the attestation provider. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly privateEndpointConnections?: PrivateEndpointConnection[]; } /** @@ -173,11 +229,11 @@ export interface AttestationProviderListResult { } /** - * Parameters for patching an attestation service instance + * Parameters for patching an attestation provider */ export interface AttestationServicePatchParams extends BaseResource { /** - * The tags that will be assigned to the attestation service instance. + * The tags that will be assigned to the attestation provider. */ tags?: { [propertyName: string]: string }; } @@ -193,7 +249,7 @@ export interface JSONWebKey { * established by [JWA] or be a value that contains a Collision- * Resistant Name. */ - alg: string; + alg?: string; /** * The "crv" (curve) parameter identifies the curve type */ @@ -229,7 +285,7 @@ export interface JSONWebKey { * equivalent alternatives by the application using them.) The "kid" * value is a case-sensitive string. */ - kid: string; + kid?: string; /** * The "kty" (key type) parameter identifies the cryptographic algorithm * family used with the key, such as "RSA" or "EC". "kty" values should @@ -260,7 +316,7 @@ export interface JSONWebKey { * a public key is used for encrypting data or verifying the signature * on data. Values are commonly "sig" (signature) or "enc" (encryption). */ - use: string; + use?: string; /** * X coordinate for the Elliptic Curve point */ @@ -296,7 +352,7 @@ export interface JSONWebKeySet { } /** - * Client supplied parameters used to create a new attestation service instance. + * Client supplied parameters used to create a new attestation provider. */ export interface AttestationServiceCreationSpecificParams { /** @@ -307,19 +363,19 @@ export interface AttestationServiceCreationSpecificParams { } /** - * Parameters for creating an attestation service instance + * Parameters for creating an attestation provider */ export interface AttestationServiceCreationParams extends BaseResource { /** - * The supported Azure location where the attestation service instance should be created. + * The supported Azure location where the attestation provider should be created. */ location: string; /** - * The tags that will be assigned to the attestation service instance. + * The tags that will be assigned to the attestation provider. */ tags?: { [propertyName: string]: string }; /** - * Properties of the attestation service instance + * Properties of the attestation provider */ properties: AttestationServiceCreationSpecificParams; } @@ -351,6 +407,14 @@ export interface AttestationManagementClientOptions extends AzureServiceClientOp baseUri?: string; } +/** + * @interface + * List of private endpoint connection associated with the specified storage account + * @extends Array + */ +export interface PrivateEndpointConnectionListResult extends Array { +} + /** * Defines values for CreatedByType. * Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' @@ -367,6 +431,22 @@ export type CreatedByType = 'User' | 'Application' | 'ManagedIdentity' | 'Key'; */ export type AttestationServiceStatus = 'Ready' | 'NotReady' | 'Error'; +/** + * Defines values for PrivateEndpointServiceConnectionStatus. + * Possible values include: 'Pending', 'Approved', 'Rejected' + * @readonly + * @enum {string} + */ +export type PrivateEndpointServiceConnectionStatus = 'Pending' | 'Approved' | 'Rejected'; + +/** + * Defines values for PrivateEndpointConnectionProvisioningState. + * Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Failed' + * @readonly + * @enum {string} + */ +export type PrivateEndpointConnectionProvisioningState = 'Succeeded' | 'Creating' | 'Deleting' | 'Failed'; + /** * Contains response data for the list operation. */ @@ -526,3 +606,63 @@ export type AttestationProvidersGetDefaultByLocationResponse = AttestationProvid parsedBody: AttestationProvider; }; }; + +/** + * Contains response data for the list operation. + */ +export type PrivateEndpointConnectionsListResponse = PrivateEndpointConnectionListResult & { + /** + * 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: PrivateEndpointConnectionListResult; + }; +}; + +/** + * 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 create operation. + */ +export type PrivateEndpointConnectionsCreateResponse = 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/attestation/arm-attestation/src/models/mappers.ts b/sdk/attestation/arm-attestation/src/models/mappers.ts index 47b461c6d7b7..c7a4f8dfd16a 100644 --- a/sdk/attestation/arm-attestation/src/models/mappers.ts +++ b/sdk/attestation/arm-attestation/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. @@ -145,6 +145,51 @@ export const OperationList: msRest.CompositeMapper = { } }; +export const PrivateEndpoint: msRest.CompositeMapper = { + serializedName: "PrivateEndpoint", + type: { + name: "Composite", + className: "PrivateEndpoint", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + } + } + } +}; + +export const PrivateLinkServiceConnectionState: msRest.CompositeMapper = { + serializedName: "PrivateLinkServiceConnectionState", + type: { + name: "Composite", + className: "PrivateLinkServiceConnectionState", + modelProperties: { + status: { + serializedName: "status", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + }, + actionsRequired: { + serializedName: "actionsRequired", + type: { + name: "String" + } + } + } + } +}; + export const Resource: msRest.CompositeMapper = { serializedName: "Resource", type: { @@ -176,6 +221,38 @@ export const Resource: msRest.CompositeMapper = { } }; +export const PrivateEndpointConnection: msRest.CompositeMapper = { + serializedName: "PrivateEndpointConnection", + type: { + name: "Composite", + className: "PrivateEndpointConnection", + modelProperties: { + ...Resource.type.modelProperties, + privateEndpoint: { + serializedName: "properties.privateEndpoint", + type: { + name: "Composite", + className: "PrivateEndpoint" + } + }, + privateLinkServiceConnectionState: { + required: true, + serializedName: "properties.privateLinkServiceConnectionState", + type: { + name: "Composite", + className: "PrivateLinkServiceConnectionState" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + type: { + name: "String" + } + } + } + } +}; + export const TrackedResource: msRest.CompositeMapper = { serializedName: "TrackedResource", type: { @@ -237,6 +314,19 @@ export const AttestationProvider: msRest.CompositeMapper = { type: { name: "String" } + }, + privateEndpointConnections: { + readOnly: true, + serializedName: "properties.privateEndpointConnections", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection" + } + } + } } } } @@ -300,7 +390,6 @@ export const JSONWebKey: msRest.CompositeMapper = { className: "JSONWebKey", modelProperties: { alg: { - required: true, serializedName: "alg", type: { name: "String" @@ -343,7 +432,6 @@ export const JSONWebKey: msRest.CompositeMapper = { } }, kid: { - required: true, serializedName: "kid", type: { name: "String" @@ -381,7 +469,6 @@ export const JSONWebKey: msRest.CompositeMapper = { } }, use: { - required: true, serializedName: "use", type: { name: "String" @@ -517,3 +604,25 @@ export const AzureEntityResource: msRest.CompositeMapper = { } } }; + +export const PrivateEndpointConnectionListResult: msRest.CompositeMapper = { + serializedName: "PrivateEndpointConnectionListResult", + type: { + name: "Composite", + className: "PrivateEndpointConnectionListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection" + } + } + } + } + } + } +}; diff --git a/sdk/attestation/arm-attestation/src/models/operationsMappers.ts b/sdk/attestation/arm-attestation/src/models/operationsMappers.ts index de9b9fa3908e..e67745ec4eae 100644 --- a/sdk/attestation/arm-attestation/src/models/operationsMappers.ts +++ b/sdk/attestation/arm-attestation/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/attestation/arm-attestation/src/models/parameters.ts b/sdk/attestation/arm-attestation/src/models/parameters.ts index dddd4f15efe6..7b3dccc78891 100644 --- a/sdk/attestation/arm-attestation/src/models/parameters.ts +++ b/sdk/attestation/arm-attestation/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 @@ -43,7 +42,17 @@ export const location: msRest.OperationURLParameter = { } } }; -export const providerName: msRest.OperationURLParameter = { +export const privateEndpointConnectionName: msRest.OperationURLParameter = { + parameterPath: "privateEndpointConnectionName", + mapper: { + required: true, + serializedName: "privateEndpointConnectionName", + type: { + name: "String" + } + } +}; +export const providerName0: msRest.OperationURLParameter = { parameterPath: "providerName", mapper: { required: true, @@ -53,6 +62,19 @@ export const providerName: msRest.OperationURLParameter = { } } }; +export const providerName1: msRest.OperationURLParameter = { + parameterPath: "providerName", + mapper: { + required: true, + serializedName: "providerName", + constraints: { + Pattern: /^[a-zA-Z0-9-]{3,24}$/ + }, + type: { + name: "String" + } + } +}; export const resourceGroupName: msRest.OperationURLParameter = { parameterPath: "resourceGroupName", mapper: { @@ -60,8 +82,7 @@ export const resourceGroupName: msRest.OperationURLParameter = { serializedName: "resourceGroupName", constraints: { MaxLength: 90, - MinLength: 1, - Pattern: /^[-\w\._\(\)]+$/ + MinLength: 1 }, type: { name: "String" diff --git a/sdk/attestation/arm-attestation/src/models/privateEndpointConnectionsMappers.ts b/sdk/attestation/arm-attestation/src/models/privateEndpointConnectionsMappers.ts new file mode 100644 index 000000000000..b825416d6265 --- /dev/null +++ b/sdk/attestation/arm-attestation/src/models/privateEndpointConnectionsMappers.ts @@ -0,0 +1,27 @@ +/* + * 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 { + AttestationProvider, + AttestationServiceCreationParams, + AttestationServiceCreationSpecificParams, + AttestationServicePatchParams, + AzureEntityResource, + BaseResource, + CloudError, + JSONWebKey, + JSONWebKeySet, + PrivateEndpoint, + PrivateEndpointConnection, + PrivateEndpointConnectionListResult, + PrivateLinkServiceConnectionState, + ProxyResource, + Resource, + SystemData, + TrackedResource +} from "../models/mappers"; diff --git a/sdk/attestation/arm-attestation/src/operations/attestationProviders.ts b/sdk/attestation/arm-attestation/src/operations/attestationProviders.ts index b15ef848d02b..dcaa31eae08a 100644 --- a/sdk/attestation/arm-attestation/src/operations/attestationProviders.ts +++ b/sdk/attestation/arm-attestation/src/operations/attestationProviders.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 @@ -29,20 +28,20 @@ export class AttestationProviders { /** * Get the status of Attestation Provider. * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param providerName Name of the attestation service instance + * @param providerName Name of the attestation provider. * @param [options] The optional parameters * @returns Promise */ get(resourceGroupName: string, providerName: string, options?: msRest.RequestOptionsBase): Promise; /** * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param providerName Name of the attestation service instance + * @param providerName Name of the attestation provider. * @param callback The callback */ get(resourceGroupName: string, providerName: string, callback: msRest.ServiceCallback): void; /** * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param providerName Name of the attestation service instance + * @param providerName Name of the attestation provider. * @param options The optional parameters * @param callback The callback */ @@ -59,9 +58,9 @@ export class AttestationProviders { } /** - * Creates a new Attestation Provider instance. + * Creates a new Attestation Provider. * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param providerName Name of the attestation service instance. + * @param providerName Name of the attestation provider. * @param creationParams Client supplied parameters. * @param [options] The optional parameters * @returns Promise @@ -69,14 +68,14 @@ export class AttestationProviders { create(resourceGroupName: string, providerName: string, creationParams: Models.AttestationServiceCreationParams, options?: msRest.RequestOptionsBase): Promise; /** * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param providerName Name of the attestation service instance. + * @param providerName Name of the attestation provider. * @param creationParams Client supplied parameters. * @param callback The callback */ create(resourceGroupName: string, providerName: string, creationParams: Models.AttestationServiceCreationParams, callback: msRest.ServiceCallback): void; /** * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param providerName Name of the attestation service instance. + * @param providerName Name of the attestation provider. * @param creationParams Client supplied parameters. * @param options The optional parameters * @param callback The callback @@ -97,7 +96,7 @@ export class AttestationProviders { /** * Updates the Attestation Provider. * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param providerName Name of the attestation service instance. + * @param providerName Name of the attestation provider. * @param updateParams Client supplied parameters. * @param [options] The optional parameters * @returns Promise @@ -105,14 +104,14 @@ export class AttestationProviders { update(resourceGroupName: string, providerName: string, updateParams: Models.AttestationServicePatchParams, options?: msRest.RequestOptionsBase): Promise; /** * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param providerName Name of the attestation service instance. + * @param providerName Name of the attestation provider. * @param updateParams Client supplied parameters. * @param callback The callback */ update(resourceGroupName: string, providerName: string, updateParams: Models.AttestationServicePatchParams, callback: msRest.ServiceCallback): void; /** * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param providerName Name of the attestation service instance. + * @param providerName Name of the attestation provider. * @param updateParams Client supplied parameters. * @param options The optional parameters * @param callback The callback @@ -275,7 +274,7 @@ const getOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.providerName + Parameters.providerName0 ], queryParameters: [ Parameters.apiVersion @@ -300,7 +299,7 @@ const createOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.providerName + Parameters.providerName0 ], queryParameters: [ Parameters.apiVersion @@ -335,7 +334,7 @@ const updateOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.providerName + Parameters.providerName0 ], queryParameters: [ Parameters.apiVersion @@ -367,7 +366,7 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.providerName + Parameters.providerName0 ], queryParameters: [ Parameters.apiVersion diff --git a/sdk/attestation/arm-attestation/src/operations/index.ts b/sdk/attestation/arm-attestation/src/operations/index.ts index b8a242e5b5b4..b7e47e52dbfd 100644 --- a/sdk/attestation/arm-attestation/src/operations/index.ts +++ b/sdk/attestation/arm-attestation/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 @@ -10,3 +9,4 @@ export * from "./operations"; export * from "./attestationProviders"; +export * from "./privateEndpointConnections"; diff --git a/sdk/attestation/arm-attestation/src/operations/operations.ts b/sdk/attestation/arm-attestation/src/operations/operations.ts index 71d7e5859cdb..8eb3e157bb4f 100644 --- a/sdk/attestation/arm-attestation/src/operations/operations.ts +++ b/sdk/attestation/arm-attestation/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 diff --git a/sdk/attestation/arm-attestation/src/operations/privateEndpointConnections.ts b/sdk/attestation/arm-attestation/src/operations/privateEndpointConnections.ts new file mode 100644 index 000000000000..d4391d2d41c9 --- /dev/null +++ b/sdk/attestation/arm-attestation/src/operations/privateEndpointConnections.ts @@ -0,0 +1,292 @@ +/* + * 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/privateEndpointConnectionsMappers"; +import * as Parameters from "../models/parameters"; +import { AttestationManagementClientContext } from "../attestationManagementClientContext"; + +/** Class representing a PrivateEndpointConnections. */ +export class PrivateEndpointConnections { + private readonly client: AttestationManagementClientContext; + + /** + * Create a PrivateEndpointConnections. + * @param {AttestationManagementClientContext} client Reference to the service client. + */ + constructor(client: AttestationManagementClientContext) { + this.client = client; + } + + /** + * List all the private endpoint connections associated with the attestation provider. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName The name of the attestation provider. + * @param [options] The optional parameters + * @returns Promise + */ + list(resourceGroupName: string, providerName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName The name of the attestation provider. + * @param callback The callback + */ + list(resourceGroupName: string, providerName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName The name of the attestation provider. + * @param options The optional parameters + * @param callback The callback + */ + list(resourceGroupName: string, providerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(resourceGroupName: string, providerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + providerName, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Gets the specified private endpoint connection associated with the attestation provider. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName The name of the attestation provider. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the + * attestation providers. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, providerName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName The name of the attestation provider. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the + * attestation providers. + * @param callback The callback + */ + get(resourceGroupName: string, providerName: string, privateEndpointConnectionName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName The name of the attestation provider. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the + * attestation providers. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, providerName: string, privateEndpointConnectionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, providerName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + providerName, + privateEndpointConnectionName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Update the state of specified private endpoint connection associated with the attestation + * provider. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName The name of the attestation provider. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the + * attestation providers. + * @param properties The private endpoint connection properties. + * @param [options] The optional parameters + * @returns Promise + */ + create(resourceGroupName: string, providerName: string, privateEndpointConnectionName: string, properties: Models.PrivateEndpointConnection, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName The name of the attestation provider. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the + * attestation providers. + * @param properties The private endpoint connection properties. + * @param callback The callback + */ + create(resourceGroupName: string, providerName: string, privateEndpointConnectionName: string, properties: Models.PrivateEndpointConnection, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName The name of the attestation provider. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the + * attestation providers. + * @param properties The private endpoint connection properties. + * @param options The optional parameters + * @param callback The callback + */ + create(resourceGroupName: string, providerName: string, privateEndpointConnectionName: string, properties: Models.PrivateEndpointConnection, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + create(resourceGroupName: string, providerName: string, privateEndpointConnectionName: string, properties: Models.PrivateEndpointConnection, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + providerName, + privateEndpointConnectionName, + properties, + options + }, + createOperationSpec, + callback) as Promise; + } + + /** + * Deletes the specified private endpoint connection associated with the attestation provider. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName The name of the attestation provider. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the + * attestation providers. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, providerName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName The name of the attestation provider. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the + * attestation providers. + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, providerName: string, privateEndpointConnectionName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName The name of the attestation provider. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the + * attestation providers. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, providerName: string, privateEndpointConnectionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroupName: string, providerName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + providerName, + privateEndpointConnectionName, + options + }, + deleteMethodOperationSpec, + callback); + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Attestation/attestationProviders/{providerName}/privateEndpointConnections", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.providerName1, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnectionListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Attestation/attestationProviders/{providerName}/privateEndpointConnections/{privateEndpointConnectionName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.providerName1, + Parameters.subscriptionId, + Parameters.privateEndpointConnectionName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const createOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Attestation/attestationProviders/{providerName}/privateEndpointConnections/{privateEndpointConnectionName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.providerName1, + Parameters.subscriptionId, + Parameters.privateEndpointConnectionName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "properties", + mapper: { + ...Mappers.PrivateEndpointConnection, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Attestation/attestationProviders/{providerName}/privateEndpointConnections/{privateEndpointConnectionName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.providerName1, + Parameters.subscriptionId, + Parameters.privateEndpointConnectionName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +};