From 8bf6230a82e158de2528eb61b6ab4c0031397ced Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 5 Jan 2021 03:08:20 +0000 Subject: [PATCH] CodeGen from PR 11821 in Azure/azure-rest-api-specs Merge d6cc1e11586d44032f3d5c3f470f9005ed6261e3 into 219b11952a50073f88124bd540e082143ac1936f --- sdk/attestation/arm-attestation/LICENSE.txt | 2 +- sdk/attestation/arm-attestation/README.md | 9 +-- .../arm-attestation/rollup.config.js | 4 +- .../src/attestationManagementClient.ts | 5 +- .../src/attestationManagementClientContext.ts | 7 +- .../src/models/attestationProvidersMappers.ts | 5 +- .../arm-attestation/src/models/index.ts | 63 ++------------- .../arm-attestation/src/models/mappers.ts | 80 ++----------------- .../src/models/operationsMappers.ts | 7 +- .../arm-attestation/src/models/parameters.ts | 7 +- .../src/operations/attestationProviders.ts | 7 +- .../arm-attestation/src/operations/index.ts | 5 +- .../src/operations/operations.ts | 5 +- 13 files changed, 42 insertions(+), 164 deletions(-) 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..4d0a61470e19 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 diff --git a/sdk/attestation/arm-attestation/src/attestationManagementClientContext.ts b/sdk/attestation/arm-attestation/src/attestationManagementClientContext.ts index c07885699d86..32801e175268 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 @@ -44,7 +43,7 @@ export class AttestationManagementClientContext extends msRestAzure.AzureService super(credentials, options); - this.apiVersion = '2020-10-01'; + this.apiVersion = '2018-09-01-preview'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; diff --git a/sdk/attestation/arm-attestation/src/models/attestationProvidersMappers.ts b/sdk/attestation/arm-attestation/src/models/attestationProvidersMappers.ts index fcead856c16c..e31c290598ff 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. @@ -19,6 +19,5 @@ export { JSONWebKeySet, ProxyResource, Resource, - SystemData, TrackedResource } from "../models/mappers"; diff --git a/sdk/attestation/arm-attestation/src/models/index.ts b/sdk/attestation/arm-attestation/src/models/index.ts index 9e0198f5ff55..bf2964c434eb 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. @@ -11,38 +11,6 @@ import * as msRest from "@azure/ms-rest-js"; export { BaseResource, CloudError }; -/** - * Metadata pertaining to creation and last modification of the resource. - */ -export interface SystemData { - /** - * The identity that created the resource. - */ - createdBy?: string; - /** - * The type of identity that created the resource. Possible values include: 'User', - * 'Application', 'ManagedIdentity', 'Key' - */ - createdByType?: CreatedByType; - /** - * The timestamp of resource creation (UTC). - */ - createdAt?: Date; - /** - * The identity that last modified the resource. - */ - lastModifiedBy?: string; - /** - * The type of identity that last modified the resource. Possible values include: 'User', - * 'Application', 'ManagedIdentity', 'Key' - */ - lastModifiedByType?: CreatedByType; - /** - * The type of identity that last modified the resource. - */ - lastModifiedAt?: Date; -} - /** * Display object with properties of the operation. */ @@ -83,11 +51,6 @@ export interface OperationsDefinition { * List of supported operations. */ export interface OperationList { - /** - * The system metadata relating to this resource - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly systemData?: SystemData; /** * List of supported operations. */ @@ -138,11 +101,6 @@ export interface TrackedResource extends Resource { * Attestation service response message. */ export interface AttestationProvider extends TrackedResource { - /** - * The system metadata relating to this resource - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly systemData?: SystemData; /** * Trust model for the attestation service instance. */ @@ -161,11 +119,6 @@ export interface AttestationProvider extends TrackedResource { * Attestation Providers List. */ export interface AttestationProviderListResult { - /** - * The system metadata relating to this resource - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly systemData?: SystemData; /** * Attestation Provider array. */ @@ -299,6 +252,10 @@ export interface JSONWebKeySet { * Client supplied parameters used to create a new attestation service instance. */ export interface AttestationServiceCreationSpecificParams { + /** + * Name of attestation policy. + */ + attestationPolicy?: string; /** * JSON Web Key Set defining a set of X.509 Certificates that will represent the parent * certificate for the signing certificate used for policy operations @@ -351,14 +308,6 @@ export interface AttestationManagementClientOptions extends AzureServiceClientOp baseUri?: string; } -/** - * Defines values for CreatedByType. - * Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' - * @readonly - * @enum {string} - */ -export type CreatedByType = 'User' | 'Application' | 'ManagedIdentity' | 'Key'; - /** * Defines values for AttestationServiceStatus. * Possible values include: 'Ready', 'NotReady', 'Error' diff --git a/sdk/attestation/arm-attestation/src/models/mappers.ts b/sdk/attestation/arm-attestation/src/models/mappers.ts index 47b461c6d7b7..20ccb49d6e9f 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. @@ -12,52 +12,6 @@ import * as msRest from "@azure/ms-rest-js"; export const CloudError = CloudErrorMapper; export const BaseResource = BaseResourceMapper; -export const SystemData: msRest.CompositeMapper = { - serializedName: "systemData", - type: { - name: "Composite", - className: "SystemData", - modelProperties: { - createdBy: { - serializedName: "createdBy", - type: { - name: "String" - } - }, - createdByType: { - serializedName: "createdByType", - type: { - name: "String" - } - }, - createdAt: { - serializedName: "createdAt", - type: { - name: "DateTime" - } - }, - lastModifiedBy: { - serializedName: "lastModifiedBy", - type: { - name: "String" - } - }, - lastModifiedByType: { - serializedName: "lastModifiedByType", - type: { - name: "String" - } - }, - lastModifiedAt: { - serializedName: "lastModifiedAt", - type: { - name: "DateTime" - } - } - } - } -}; - export const OperationsDisplayDefinition: msRest.CompositeMapper = { serializedName: "OperationsDisplayDefinition", type: { @@ -121,14 +75,6 @@ export const OperationList: msRest.CompositeMapper = { name: "Composite", className: "OperationList", modelProperties: { - systemData: { - readOnly: true, - serializedName: "systemData", - type: { - name: "Composite", - className: "SystemData" - } - }, value: { serializedName: "value", type: { @@ -212,14 +158,6 @@ export const AttestationProvider: msRest.CompositeMapper = { className: "AttestationProvider", modelProperties: { ...TrackedResource.type.modelProperties, - systemData: { - readOnly: true, - serializedName: "systemData", - type: { - name: "Composite", - className: "SystemData" - } - }, trustModel: { serializedName: "properties.trustModel", type: { @@ -248,14 +186,6 @@ export const AttestationProviderListResult: msRest.CompositeMapper = { name: "Composite", className: "AttestationProviderListResult", modelProperties: { - systemData: { - readOnly: true, - serializedName: "systemData", - type: { - name: "Composite", - className: "SystemData" - } - }, value: { serializedName: "value", type: { @@ -442,6 +372,12 @@ export const AttestationServiceCreationSpecificParams: msRest.CompositeMapper = name: "Composite", className: "AttestationServiceCreationSpecificParams", modelProperties: { + attestationPolicy: { + serializedName: "attestationPolicy", + type: { + name: "String" + } + }, policySigningCertificates: { serializedName: "policySigningCertificates", type: { diff --git a/sdk/attestation/arm-attestation/src/models/operationsMappers.ts b/sdk/attestation/arm-attestation/src/models/operationsMappers.ts index de9b9fa3908e..be87140e9cd6 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. @@ -10,6 +10,5 @@ export { CloudError, OperationList, OperationsDefinition, - OperationsDisplayDefinition, - SystemData + OperationsDisplayDefinition } from "../models/mappers"; diff --git a/sdk/attestation/arm-attestation/src/models/parameters.ts b/sdk/attestation/arm-attestation/src/models/parameters.ts index dddd4f15efe6..eddda9209aee 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 @@ -24,7 +23,9 @@ export const apiVersion: msRest.OperationQueryParameter = { parameterPath: "apiVersion", mapper: { required: true, + isConstant: true, serializedName: "api-version", + defaultValue: '2018-09-01-preview', type: { name: "String" } diff --git a/sdk/attestation/arm-attestation/src/operations/attestationProviders.ts b/sdk/attestation/arm-attestation/src/operations/attestationProviders.ts index b15ef848d02b..583d5e23befd 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 @@ -59,7 +58,7 @@ export class AttestationProviders { } /** - * Creates a new Attestation Provider instance. + * Creates or 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 creationParams Client supplied parameters. diff --git a/sdk/attestation/arm-attestation/src/operations/index.ts b/sdk/attestation/arm-attestation/src/operations/index.ts index b8a242e5b5b4..ea8f07752eb4 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 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