Skip to content

Commit

Permalink
CodeGen from PR 13262 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 551d86f54bcbd06b37865e07bf132b38d96cfcbe into 66f033f54d45a3409e0f6493a5396be8480c2449
  • Loading branch information
SDKAuto committed Mar 3, 2021
1 parent af00c10 commit 67a4c1d
Show file tree
Hide file tree
Showing 15 changed files with 654 additions and 64 deletions.
2 changes: 1 addition & 1 deletion sdk/attestation/arm-attestation/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
9 changes: 4 additions & 5 deletions sdk/attestation/arm-attestation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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) => {
Expand Down
4 changes: 2 additions & 2 deletions sdk/attestation/arm-attestation/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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.
Expand All @@ -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);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -17,6 +17,9 @@ export {
CloudError,
JSONWebKey,
JSONWebKeySet,
PrivateEndpoint,
PrivateEndpointConnection,
PrivateLinkServiceConnectionState,
ProxyResource,
Resource,
SystemData,
Expand Down
168 changes: 154 additions & 14 deletions sdk/attestation/arm-attestation/src/models/index.ts
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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
Expand All @@ -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'
Expand All @@ -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;
/**
Expand All @@ -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[];
}

/**
Expand All @@ -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 };
}
Expand All @@ -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
*/
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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 {
/**
Expand All @@ -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;
}
Expand Down Expand Up @@ -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<PrivateEndpointConnection>
*/
export interface PrivateEndpointConnectionListResult extends Array<PrivateEndpointConnection> {
}

/**
* Defines values for CreatedByType.
* Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key'
Expand All @@ -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.
*/
Expand Down Expand Up @@ -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;
};
};
Loading

0 comments on commit 67a4c1d

Please sign in to comment.