Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

[AutoPR] automation/resource-manager #2483

Merged
7 commits merged into from
Mar 28, 2018
56 changes: 48 additions & 8 deletions lib/services/automationManagement/lib/automationClient.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,32 @@

import { ServiceClientCredentials } from 'ms-rest';
import { AzureServiceClient, AzureServiceClientOptions } from 'ms-rest-azure';
import * as models from "./models";
import * as operations from "./operations";

declare class AutomationClient extends AzureServiceClient {
/**
* AutomationClientOptions for AutomationClient.
*/
declare interface AutomationClientOptions extends AzureServiceClientOptions {
/**
* @property {string} [clientRequestId] - Identifies this specific client request.
*/
clientRequestId?: string;
/**
* @property {string} [acceptLanguage] - Gets or sets the preferred language for the response.
*/
acceptLanguage?: string;
/**
* @property {number} [longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.
*/
longRunningOperationRetryTimeout?: number;
/**
* @property {boolean} [generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.
*/
generateClientRequestId?: boolean;
}

export default class AutomationClient extends AzureServiceClient {
/**
* Initializes a new instance of the AutomationClient class.
* @constructor
Expand All @@ -22,6 +45,10 @@ declare class AutomationClient extends AzureServiceClient {
*
* @param {string} subscriptionId - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
*
* @param {string} resourceGroupName - The resource group name.
*
* @param {string} automationAccountName - The name of the automation account.
*
* @param {string} [baseUri] - The base URI of the service.
*
* @param {object} [options] - The parameter options
Expand All @@ -33,21 +60,27 @@ declare class AutomationClient extends AzureServiceClient {
*
* @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy
*
* @param {string} [options.clientRequestId] - Identifies this specific client request.
*
* @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response.
*
* @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.
*
* @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.
*
*/
constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions);
constructor(credentials: ServiceClientCredentials, subscriptionId: string, resourceGroupName: string, automationAccountName: string, baseUri?: string, options?: AutomationClientOptions);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

method signature change. major version bump


credentials: ServiceClientCredentials;

apiVersion: string;

subscriptionId: string;

resourceGroupName: string;

clientRequestId: string;

automationAccountName: string;

acceptLanguage: string;

longRunningOperationRetryTimeout: number;
Expand All @@ -64,26 +97,33 @@ declare class AutomationClient extends AzureServiceClient {
connectionTypeOperations: operations.ConnectionTypeOperations;
credentialOperations: operations.CredentialOperations;
dscCompilationJobOperations: operations.DscCompilationJobOperations;
dscCompilationJobStream: operations.DscCompilationJobStream;
dscConfigurationOperations: operations.DscConfigurationOperations;
agentRegistrationInformation: operations.AgentRegistrationInformation;
dscNodeOperations: operations.DscNodeOperations;
nodeReports: operations.NodeReports;
dscNodeConfigurationOperations: operations.DscNodeConfigurationOperations;
hybridRunbookWorkerGroupOperations: operations.HybridRunbookWorkerGroupOperations;
jobOperations: operations.JobOperations;
jobStreamOperations: operations.JobStreamOperations;
jobScheduleOperations: operations.JobScheduleOperations;
linkedWorkspaceOperations: operations.LinkedWorkspaceOperations;
activityOperations: operations.ActivityOperations;
moduleOperations: operations.ModuleOperations;
objectDataTypes: operations.ObjectDataTypes;
fields: operations.Fields;
runbookDraftOperations: operations.RunbookDraftOperations;
runbookOperations: operations.RunbookOperations;
testJobStreams: operations.TestJobStreams;
testJobs: operations.TestJobs;
testJobOperations: operations.TestJobOperations;
scheduleOperations: operations.ScheduleOperations;
variableOperations: operations.VariableOperations;
webhookOperations: operations.WebhookOperations;
softwareUpdateConfigurations: operations.SoftwareUpdateConfigurations;
softwareUpdateConfigurationRuns: operations.SoftwareUpdateConfigurationRuns;
softwareUpdateConfigurationMachineRuns: operations.SoftwareUpdateConfigurationMachineRuns;
sourceControlOperations: operations.SourceControlOperations;
sourceControlSyncJobOperations: operations.SourceControlSyncJobOperations;
jobOperations: operations.JobOperations;
jobStreamOperations: operations.JobStreamOperations;
}

export = AutomationClient;
export { AutomationClient, models as AutomationModels };
33 changes: 28 additions & 5 deletions lib/services/automationManagement/lib/automationClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,37 @@ class AutomationClient extends ServiceClient {
* Create a AutomationClient.
* @param {credentials} credentials - Credentials needed for the client to connect to Azure.
* @param {string} subscriptionId - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
* @param {string} resourceGroupName - The resource group name.
* @param {string} automationAccountName - The name of the automation account.
* @param {string} [baseUri] - The base URI of the service.
* @param {object} [options] - The parameter options
* @param {Array} [options.filters] - Filters to be added to the request pipeline
* @param {object} [options.requestOptions] - Options for the underlying request object
* {@link https://github.com/request/request#requestoptions-callback Options doc}
* @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy
* @param {string} [options.clientRequestId] - Identifies this specific client request.
* @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response.
* @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.
* @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.
*/
constructor(credentials, subscriptionId, baseUri, options) {
constructor(credentials, subscriptionId, resourceGroupName, automationAccountName, baseUri, options) {
if (credentials === null || credentials === undefined) {
throw new Error('\'credentials\' cannot be null.');
}
if (subscriptionId === null || subscriptionId === undefined) {
throw new Error('\'subscriptionId\' cannot be null.');
}
if (resourceGroupName === null || resourceGroupName === undefined) {
throw new Error('\'resourceGroupName\' cannot be null.');
}
if (automationAccountName === null || automationAccountName === undefined) {
throw new Error('\'automationAccountName\' cannot be null.');
}

if (!options) options = {};

super(credentials, options);

this.apiVersion = '2015-10-31';
this.acceptLanguage = 'en-US';
this.longRunningOperationRetryTimeout = 30;
this.generateClientRequestId = true;
Expand All @@ -60,9 +68,14 @@ class AutomationClient extends ServiceClient {
}
this.credentials = credentials;
this.subscriptionId = subscriptionId;
this.resourceGroupName = resourceGroupName;
this.automationAccountName = automationAccountName;

let packageInfo = this.getPackageJsonInfo(__dirname);
this.addUserAgentInfo(`${packageInfo.name}/${packageInfo.version}`);
if(options.clientRequestId !== null && options.clientRequestId !== undefined) {
this.clientRequestId = options.clientRequestId;
}
if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
this.acceptLanguage = options.acceptLanguage;
}
Expand All @@ -81,30 +94,40 @@ class AutomationClient extends ServiceClient {
this.connectionTypeOperations = new operations.ConnectionTypeOperations(this);
this.credentialOperations = new operations.CredentialOperations(this);
this.dscCompilationJobOperations = new operations.DscCompilationJobOperations(this);
this.dscCompilationJobStream = new operations.DscCompilationJobStream(this);
this.dscConfigurationOperations = new operations.DscConfigurationOperations(this);
this.agentRegistrationInformation = new operations.AgentRegistrationInformation(this);
this.dscNodeOperations = new operations.DscNodeOperations(this);
this.nodeReports = new operations.NodeReports(this);
this.dscNodeConfigurationOperations = new operations.DscNodeConfigurationOperations(this);
this.hybridRunbookWorkerGroupOperations = new operations.HybridRunbookWorkerGroupOperations(this);
this.jobOperations = new operations.JobOperations(this);
this.jobStreamOperations = new operations.JobStreamOperations(this);
this.jobScheduleOperations = new operations.JobScheduleOperations(this);
this.linkedWorkspaceOperations = new operations.LinkedWorkspaceOperations(this);
this.activityOperations = new operations.ActivityOperations(this);
this.moduleOperations = new operations.ModuleOperations(this);
this.objectDataTypes = new operations.ObjectDataTypes(this);
this.fields = new operations.Fields(this);
this.runbookDraftOperations = new operations.RunbookDraftOperations(this);
this.runbookOperations = new operations.RunbookOperations(this);
this.testJobStreams = new operations.TestJobStreams(this);
this.testJobs = new operations.TestJobs(this);
this.testJobOperations = new operations.TestJobOperations(this);
this.scheduleOperations = new operations.ScheduleOperations(this);
this.variableOperations = new operations.VariableOperations(this);
this.webhookOperations = new operations.WebhookOperations(this);
this.softwareUpdateConfigurations = new operations.SoftwareUpdateConfigurations(this);
this.softwareUpdateConfigurationRuns = new operations.SoftwareUpdateConfigurationRuns(this);
this.softwareUpdateConfigurationMachineRuns = new operations.SoftwareUpdateConfigurationMachineRuns(this);
this.sourceControlOperations = new operations.SourceControlOperations(this);
this.sourceControlSyncJobOperations = new operations.SourceControlSyncJobOperations(this);
this.jobOperations = new operations.JobOperations(this);
this.jobStreamOperations = new operations.JobStreamOperations(this);
this.models = models;
msRest.addSerializationMixin(this);
}

}

module.exports = AutomationClient;
module.exports['default'] = AutomationClient;
module.exports.AutomationClient = AutomationClient;
module.exports.AutomationModels = models;
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class AgentRegistrationRegenerateKeyParameter {
/**
* Create a AgentRegistrationRegenerateKeyParameter.
* @member {string} keyName Gets or sets the agent registration key name -
* Primary or Secondary. Possible values include: 'Primary', 'Secondary'
* primary or secondary. Possible values include: 'primary', 'secondary'
* @member {string} [name] Gets or sets the name of the resource.
* @member {string} [location] Gets or sets the location of the resource.
* @member {object} [tags] Gets or sets the tags attached to the resource.
Expand Down
15 changes: 14 additions & 1 deletion lib/services/automationManagement/lib/models/certificate.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,19 @@

'use strict';

const models = require('./index');

/**
* Definition of the certificate.
*
* @extends models['BaseResource']
*/
class Certificate {
class Certificate extends models['BaseResource'] {
/**
* Create a Certificate.
* @member {string} [id] Gets the id of the resource.
* @member {string} [name] Gets the name of the certificate.
* @member {string} [type] Resource type
* @member {string} [thumbprint] Gets the thumbprint of the certificate.
* @member {date} [expiryTime] Gets the expiry time of the certificate.
* @member {boolean} [isExportable] Gets the is exportable flag of the
Expand All @@ -28,6 +32,7 @@ class Certificate {
* @member {string} [description] Gets or sets the description.
*/
constructor() {
super();
}

/**
Expand Down Expand Up @@ -60,6 +65,14 @@ class Certificate {
name: 'String'
}
},
type: {
required: false,
readOnly: true,
serializedName: 'type',
type: {
name: 'String'
}
},
thumbprint: {
required: false,
readOnly: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
class CertificateUpdateParameters {
/**
* Create a CertificateUpdateParameters.
* @member {string} name Gets or sets the name of the certificate.
* @member {string} [name] Gets or sets the name of the certificate.
* @member {string} [description] Gets or sets the description of the
* certificate.
*/
Expand All @@ -39,7 +39,7 @@ class CertificateUpdateParameters {
className: 'CertificateUpdateParameters',
modelProperties: {
name: {
required: true,
required: false,
serializedName: 'name',
type: {
name: 'String'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/

'use strict';

/**
* object returned when requesting a collection of software update
* configuration
*
*/
class CollectionItemUpdateConfiguration {
/**
* Create a CollectionItemUpdateConfiguration.
* @member {array} [azureVirtualMachines] List of azure resource Ids for
* azure virtual machines targeted by the software update configuration.
* @member {moment.duration} [duration] Maximum time allowed for the software
* update configuration run. Duration needs to be specified using the format
* PT[n]H[n]M[n]S as per ISO8601
*/
constructor() {
}

/**
* Defines the metadata of CollectionItemUpdateConfiguration
*
* @returns {object} metadata of CollectionItemUpdateConfiguration
*
*/
mapper() {
return {
required: false,
serializedName: 'collectionItemUpdateConfiguration',
type: {
name: 'Composite',
className: 'CollectionItemUpdateConfiguration',
modelProperties: {
azureVirtualMachines: {
required: false,
serializedName: 'azureVirtualMachines',
type: {
name: 'Sequence',
element: {
required: false,
serializedName: 'StringElementType',
type: {
name: 'String'
}
}
}
},
duration: {
required: false,
serializedName: 'duration',
type: {
name: 'TimeSpan'
}
}
}
}
};
}
}

module.exports = CollectionItemUpdateConfiguration;
13 changes: 12 additions & 1 deletion lib/services/automationManagement/lib/models/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ const models = require('./index');
/**
* Definition of the connection.
*
* @extends models['BaseResource']
*/
class Connection {
class Connection extends models['BaseResource'] {
/**
* Create a Connection.
* @member {string} [id] Gets the id of the resource.
* @member {string} [name] Gets the name of the connection.
* @member {string} [type] Resource type
* @member {object} [connectionType] Gets or sets the connectionType of the
* connection.
* @member {string} [connectionType.name] Gets or sets the name of the
Expand All @@ -32,6 +34,7 @@ class Connection {
* @member {string} [description] Gets or sets the description.
*/
constructor() {
super();
}

/**
Expand Down Expand Up @@ -64,6 +67,14 @@ class Connection {
name: 'String'
}
},
type: {
required: false,
readOnly: true,
serializedName: 'type',
type: {
name: 'String'
}
},
connectionType: {
required: false,
serializedName: 'properties.connectionType',
Expand Down
Loading