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 08a634ff796d..f53db989aa04 100644 --- a/sdk/attestation/arm-attestation/README.md +++ b/sdk/attestation/arm-attestation/README.md @@ -15,7 +15,7 @@ npm install @azure/arm-attestation ### How to use -#### nodejs - Authentication, client creation and list operations as an example written in TypeScript. +#### nodejs - client creation and list operations 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 { AttestationManagementClient, AttestationManagementModels, AttestationManagementMappers } from "@azure/arm-attestation"; +const msRestNodeAuth = require("@azure/ms-rest-nodeauth"); +const { AttestationManagementClient } = require("@azure/arm-attestation"); const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; msRestNodeAuth.interactiveLogin().then((creds) => { 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 1657aee1b92f..329c51e3d9fa 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 @@ -19,6 +18,7 @@ class AttestationManagementClient extends AttestationManagementClientContext { // Operation groups operations: operations.Operations; attestationProviders: operations.AttestationProviders; + privateEndpointConnections: operations.PrivateEndpointConnections; /** * Initializes a new instance of the AttestationManagementClient class. @@ -30,6 +30,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 c07885699d86..e95ee9f470e7 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 diff --git a/sdk/attestation/arm-attestation/src/models/attestationProvidersMappers.ts b/sdk/attestation/arm-attestation/src/models/attestationProvidersMappers.ts index fcead856c16c..3d874af7b3cd 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,7 @@ export { CloudError, JSONWebKey, JSONWebKeySet, + PrivateEndpointConnection, 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..ea1b1630d673 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; } @@ -118,6 +118,17 @@ export interface Resource extends BaseResource { readonly type?: string; } +/** + * The Private Endpoint Connection resource. + */ +export interface PrivateEndpointConnection extends Resource { + /** + * Provisioning state of the private endpoint connection. 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 +155,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 +166,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 +189,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 +209,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 +245,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 +276,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 +312,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 +323,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 +367,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 +391,14 @@ export type CreatedByType = 'User' | 'Application' | 'ManagedIdentity' | 'Key'; */ export type AttestationServiceStatus = 'Ready' | 'NotReady' | 'Error'; +/** + * 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 +558,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..5aefe132282a 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. @@ -176,6 +176,23 @@ export const Resource: msRest.CompositeMapper = { } }; +export const PrivateEndpointConnection: msRest.CompositeMapper = { + serializedName: "PrivateEndpointConnection", + type: { + name: "Composite", + className: "PrivateEndpointConnection", + modelProperties: { + ...Resource.type.modelProperties, + provisioningState: { + serializedName: "properties.provisioningState", + type: { + name: "String" + } + } + } + } +}; + export const TrackedResource: msRest.CompositeMapper = { serializedName: "TrackedResource", type: { @@ -237,6 +254,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 +330,6 @@ export const JSONWebKey: msRest.CompositeMapper = { className: "JSONWebKey", modelProperties: { alg: { - required: true, serializedName: "alg", type: { name: "String" @@ -343,7 +372,6 @@ export const JSONWebKey: msRest.CompositeMapper = { } }, kid: { - required: true, serializedName: "kid", type: { name: "String" @@ -381,7 +409,6 @@ export const JSONWebKey: msRest.CompositeMapper = { } }, use: { - required: true, serializedName: "use", type: { name: "String" @@ -517,3 +544,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..cbad59dddba7 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,11 +42,34 @@ 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, + serializedName: "providerName", + type: { + name: "String" + } + } +}; +export const providerName1: msRest.OperationURLParameter = { parameterPath: "providerName", mapper: { required: true, serializedName: "providerName", + constraints: { + Pattern: /^[a-zA-Z0-9-]{3,24}$/ + }, 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..b8188d518569 --- /dev/null +++ b/sdk/attestation/arm-attestation/src/models/privateEndpointConnectionsMappers.ts @@ -0,0 +1,25 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + AttestationProvider, + AttestationServiceCreationParams, + AttestationServiceCreationSpecificParams, + AttestationServicePatchParams, + AzureEntityResource, + BaseResource, + CloudError, + JSONWebKey, + JSONWebKeySet, + PrivateEndpointConnection, + PrivateEndpointConnectionListResult, + 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..4f56aa75b3e6 --- /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/attestationProvider/{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 +};