Skip to content

Commit

Permalink
CodeGen from PR 12195 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge c22daaeb25259ff2816b41763bb1eb8f3e4c56f0 into 5ffa05df8f46a74aaf8e406001f184d86ced0fc3
  • Loading branch information
SDKAuto committed Dec 22, 2020
1 parent f558cff commit b777428
Show file tree
Hide file tree
Showing 12 changed files with 198 additions and 87 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ npm install @azure/arm-kubernetesconfiguration

### How to use

#### nodejs - Authentication, client creation and get sourceControlConfigurations as an example written in TypeScript.
#### nodejs - client creation and get sourceControlConfigurations 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 { SourceControlConfigurationClient, SourceControlConfigurationModels, SourceControlConfigurationMappers } from "@azure/arm-kubernetesconfiguration";
const msRestNodeAuth = require("@azure/ms-rest-nodeauth");
const { SourceControlConfigurationClient } = require("@azure/arm-kubernetesconfiguration");
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];

msRestNodeAuth.interactiveLogin().then((creds) => {
Expand Down
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,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 @@ -11,6 +11,43 @@ import * as msRest from "@azure/ms-rest-js";

export { BaseResource, CloudError };

/**
* Top level metadata
* https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources
*/
export interface SystemData {
/**
* A string identifier for the identity that created the resource
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly createdBy?: string;
/**
* The type of identity that created the resource: user, application, managedIdentity, key
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly createdByType?: string;
/**
* The timestamp of resource creation (UTC)
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly createdAt?: Date;
/**
* A string identifier for the identity that last modified the resource
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly lastModifiedBy?: string;
/**
* The type of identity that last modified the resource: user, application, managedIdentity, key
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly lastModifiedByType?: string;
/**
* The timestamp of resource last modification (UTC)
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly lastModifiedAt?: Date;
}

/**
* The Resource model definition.
*/
Expand All @@ -30,6 +67,11 @@ export interface Resource extends BaseResource {
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly type?: string;
/**
* Top level metadata
* https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources
*/
systemData?: SystemData;
}

/**
Expand All @@ -54,19 +96,12 @@ export interface Result {
export interface ErrorDefinition {
/**
* Service specific error code which serves as the substatus for the HTTP error code.
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly code?: string;
code: string;
/**
* Description of the error.
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly message?: string;
/**
* Internal error details.
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly details?: ErrorDefinition[];
message: string;
}

/**
Expand All @@ -88,7 +123,7 @@ export interface ComplianceStatus {
* 'Noncompliant', 'Installed', 'Failed'
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly complianceState?: ComplianceState;
readonly complianceState?: ComplianceStateType;
/**
* Datetime the configuration was last applied.
*/
Expand All @@ -100,7 +135,7 @@ export interface ComplianceStatus {
/**
* Level of the message. Possible values include: 'Error', 'Warning', 'Information'
*/
messageLevel?: MessageLevel;
messageLevel?: MessageLevelType;
}

/**
Expand All @@ -118,7 +153,7 @@ export interface HelmOperatorProperties {
}

/**
* The SourceControl Configuration object.
* The SourceControl Configuration object returned in Get & Put response.
*/
export interface SourceControlConfiguration extends ProxyResource {
/**
Expand All @@ -142,22 +177,30 @@ export interface SourceControlConfiguration extends ProxyResource {
* Any Parameters for the Operator instance in string format.
*/
operatorParams?: string;
/**
* Name-value pairs of protected configuration settings for the configuration
*/
configurationProtectedSettings?: { [propertyName: string]: string };
/**
* Scope at which the operator will be installed. Possible values include: 'cluster',
* 'namespace'. Default value: 'cluster'.
*/
operatorScope?: OperatorScope;
operatorScope?: OperatorScopeType;
/**
* Public Key associated with this SourceControl configuration (either generated within the
* cluster or provided by the user).
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly repositoryPublicKey?: string;
/**
* Option to enable Helm Operator for this git configuration. Possible values include: 'true',
* 'false'
* Base64-encoded known_hosts contents containing public SSH keys required to access private Git
* instances
*/
enableHelmOperator?: EnableHelmOperator;
sshKnownHostsContents?: string;
/**
* Option to enable Helm Operator for this git configuration.
*/
enableHelmOperator?: boolean;
/**
* Properties for Helm operator.
*/
Expand All @@ -167,7 +210,7 @@ export interface SourceControlConfiguration extends ProxyResource {
* 'Deleting', 'Running', 'Succeeded', 'Failed'
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly provisioningState?: ProvisioningState;
readonly provisioningState?: ProvisioningStateType;
/**
* Compliance Status of the Configuration
* **NOTE: This property will not be serialized. It can only be populated by the server.**
Expand Down Expand Up @@ -209,6 +252,11 @@ export interface ResourceProviderOperation {
* Display metadata associated with the operation.
*/
display?: ResourceProviderOperationDisplay;
/**
* The flag that indicates whether the operation applies to data plane.
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly isDataAction?: boolean;
}

/**
Expand Down Expand Up @@ -246,20 +294,20 @@ export interface ResourceProviderOperationList extends Array<ResourceProviderOpe
}

/**
* Defines values for ComplianceState.
* Defines values for ComplianceStateType.
* Possible values include: 'Pending', 'Compliant', 'Noncompliant', 'Installed', 'Failed'
* @readonly
* @enum {string}
*/
export type ComplianceState = 'Pending' | 'Compliant' | 'Noncompliant' | 'Installed' | 'Failed';
export type ComplianceStateType = 'Pending' | 'Compliant' | 'Noncompliant' | 'Installed' | 'Failed';

/**
* Defines values for MessageLevel.
* Defines values for MessageLevelType.
* Possible values include: 'Error', 'Warning', 'Information'
* @readonly
* @enum {string}
*/
export type MessageLevel = 'Error' | 'Warning' | 'Information';
export type MessageLevelType = 'Error' | 'Warning' | 'Information';

/**
* Defines values for OperatorType.
Expand All @@ -270,28 +318,20 @@ export type MessageLevel = 'Error' | 'Warning' | 'Information';
export type OperatorType = 'Flux';

/**
* Defines values for OperatorScope.
* Defines values for OperatorScopeType.
* Possible values include: 'cluster', 'namespace'
* @readonly
* @enum {string}
*/
export type OperatorScope = 'cluster' | 'namespace';

/**
* Defines values for EnableHelmOperator.
* Possible values include: 'true', 'false'
* @readonly
* @enum {string}
*/
export type EnableHelmOperator = 'true' | 'false';
export type OperatorScopeType = 'cluster' | 'namespace';

/**
* Defines values for ProvisioningState.
* Defines values for ProvisioningStateType.
* Possible values include: 'Accepted', 'Deleting', 'Running', 'Succeeded', 'Failed'
* @readonly
* @enum {string}
*/
export type ProvisioningState = 'Accepted' | 'Deleting' | 'Running' | 'Succeeded' | 'Failed';
export type ProvisioningStateType = 'Accepted' | 'Deleting' | 'Running' | 'Succeeded' | 'Failed';

/**
* Defines values for ClusterRp.
Expand Down
Loading

0 comments on commit b777428

Please sign in to comment.