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

Commit

Permalink
[AutoPR automation/resource-manager] Refactoring Job Definitions (#2889)
Browse files Browse the repository at this point in the history
* Generated from 242fce7837617e22108998354a5e903be42a3be3

Refactoring Job Definitions

* Generated from 242fce7837617e22108998354a5e903be42a3be3

Refactoring Job Definitions
  • Loading branch information
AutorestCI authored May 30, 2018
1 parent 5154462 commit 8ab4ca3
Show file tree
Hide file tree
Showing 9 changed files with 134 additions and 164 deletions.
193 changes: 88 additions & 105 deletions lib/services/automationManagement/lib/models/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1212,6 +1212,31 @@ export interface DscCompilationJobCreateParameters {
tags?: { [propertyName: string]: string };
}

/**
* @class
* Initializes a new instance of the JobStream class.
* @constructor
* Definition of the job stream.
*
* @member {string} [id] Gets or sets the id of the resource.
* @member {string} [jobStreamId] Gets or sets the id of the job stream.
* @member {date} [time] Gets or sets the creation time of the job.
* @member {string} [streamType] Gets or sets the stream type. Possible values
* include: 'Progress', 'Output', 'Warning', 'Error', 'Debug', 'Verbose', 'Any'
* @member {string} [streamText] Gets or sets the stream text.
* @member {string} [summary] Gets or sets the summary.
* @member {object} [value] Gets or sets the values of the job stream.
*/
export interface JobStream {
id?: string;
jobStreamId?: string;
time?: Date;
streamType?: string;
streamText?: string;
summary?: string;
value?: { [propertyName: string]: any };
}

/**
* @class
* Initializes a new instance of the DscConfigurationCreateOrUpdateParameters class.
Expand Down Expand Up @@ -1582,86 +1607,6 @@ export interface HybridRunbookWorkerGroupUpdateParameters {
credential?: RunAsCredentialAssociationProperty;
}

/**
* @class
* Initializes a new instance of the Job class.
* @constructor
* Definition of the job.
*
* @member {object} [runbook] Gets or sets the runbook.
* @member {string} [runbook.name] Gets or sets the name of the runbook.
* @member {string} [startedBy] Gets or sets the job started by.
* @member {string} [runOn] Gets or sets the runOn which specifies the group
* name where the job is to be executed.
* @member {uuid} [jobId] Gets or sets the id of the job.
* @member {date} [creationTime] Gets or sets the creation time of the job.
* @member {string} [status] Gets or sets the status of the job. Possible
* values include: 'New', 'Activating', 'Running', 'Completed', 'Failed',
* 'Stopped', 'Blocked', 'Suspended', 'Disconnected', 'Suspending', 'Stopping',
* 'Resuming', 'Removing'
* @member {string} [statusDetails] Gets or sets the status details of the job.
* @member {date} [startTime] Gets or sets the start time of the job.
* @member {date} [endTime] Gets or sets the end time of the job.
* @member {string} [exception] Gets or sets the exception of the job.
* @member {date} [lastModifiedTime] Gets or sets the last modified time of the
* job.
* @member {date} [lastStatusModifiedTime] Gets or sets the last status
* modified time of the job.
* @member {object} [parameters] Gets or sets the parameters of the job.
* @member {object} [provisioningState] The provisioning state of a resource.
* @member {string} [provisioningState.provisioningState] The provisioning
* state of the resource. Possible values include: 'Failed', 'Succeeded',
* 'Suspended', 'Processing'
*/
export interface Job extends ProxyResource {
runbook?: RunbookAssociationProperty;
startedBy?: string;
runOn?: string;
jobId?: string;
creationTime?: Date;
status?: string;
statusDetails?: string;
startTime?: Date;
endTime?: Date;
exception?: string;
lastModifiedTime?: Date;
lastStatusModifiedTime?: Date;
parameters?: { [propertyName: string]: string };
readonly provisioningState?: JobProvisioningStateProperty;
}

/**
* @class
* Initializes a new instance of the JobCreateParameters class.
* @constructor
* The parameters supplied to the create job operation.
*
* @member {object} runbook Gets or sets the runbook.
* @member {string} [runbook.name] Gets or sets the name of the runbook.
* @member {object} [parameters] Gets or sets the parameters of the job.
* @member {string} [runOn] Gets or sets the runOn which specifies the group
* name where the job is to be executed.
*/
export interface JobCreateParameters {
runbook: RunbookAssociationProperty;
parameters?: { [propertyName: string]: string };
runOn?: string;
}

/**
* @class
* Initializes a new instance of the JobListResult class.
* @constructor
* The response model for the list job operation.
*
* @member {array} [value] Gets or sets a list of jobs.
* @member {string} [nextLink] Gets or sets the next link.
*/
export interface JobListResult {
value?: Job[];
nextLink?: string;
}

/**
* @class
* Initializes a new instance of the ScheduleAssociationProperty class.
Expand Down Expand Up @@ -1725,31 +1670,6 @@ export interface JobSchedule {
parameters?: { [propertyName: string]: string };
}

/**
* @class
* Initializes a new instance of the JobStream class.
* @constructor
* Definition of the job stream.
*
* @member {string} [id] Gets or sets the id of the resource.
* @member {string} [jobStreamId] Gets or sets the id of the job stream.
* @member {date} [time] Gets or sets the creation time of the job.
* @member {string} [streamType] Gets or sets the stream type. Possible values
* include: 'Progress', 'Output', 'Warning', 'Error', 'Debug', 'Verbose', 'Any'
* @member {string} [streamText] Gets or sets the stream text.
* @member {string} [summary] Gets or sets the summary.
* @member {object} [value] Gets or sets the values of the job stream.
*/
export interface JobStream {
id?: string;
jobStreamId?: string;
time?: Date;
streamType?: string;
streamText?: string;
summary?: string;
value?: { [propertyName: string]: any };
}

/**
* @class
* Initializes a new instance of the LinkedWorkspace class.
Expand Down Expand Up @@ -2304,6 +2224,51 @@ export interface WebhookUpdateParameters {
description?: string;
}

/**
* @class
* Initializes a new instance of the Job class.
* @constructor
* Definition of the job.
*
* @member {object} [runbook] Gets or sets the runbook.
* @member {string} [runbook.name] Gets or sets the name of the runbook.
* @member {string} [startedBy] Gets or sets the job started by.
* @member {string} [runOn] Gets or sets the runOn which specifies the group
* name where the job is to be executed.
* @member {uuid} [jobId] Gets or sets the id of the job.
* @member {date} [creationTime] Gets or sets the creation time of the job.
* @member {string} [status] Gets or sets the status of the job. Possible
* values include: 'New', 'Activating', 'Running', 'Completed', 'Failed',
* 'Stopped', 'Blocked', 'Suspended', 'Disconnected', 'Suspending', 'Stopping',
* 'Resuming', 'Removing'
* @member {string} [statusDetails] Gets or sets the status details of the job.
* @member {date} [startTime] Gets or sets the start time of the job.
* @member {date} [endTime] Gets or sets the end time of the job.
* @member {string} [exception] Gets or sets the exception of the job.
* @member {date} [lastModifiedTime] Gets or sets the last modified time of the
* job.
* @member {date} [lastStatusModifiedTime] Gets or sets the last status
* modified time of the job.
* @member {object} [parameters] Gets or sets the parameters of the job.
* @member {string} [provisioningState] The provisioning state of a resource.
*/
export interface Job extends ProxyResource {
runbook?: RunbookAssociationProperty;
startedBy?: string;
runOn?: string;
jobId?: string;
creationTime?: Date;
status?: string;
statusDetails?: string;
startTime?: Date;
endTime?: Date;
exception?: string;
lastModifiedTime?: Date;
lastStatusModifiedTime?: Date;
parameters?: { [propertyName: string]: string };
readonly provisioningState?: string;
}

/**
* @class
* Initializes a new instance of the JobCollectionItem class.
Expand Down Expand Up @@ -2337,6 +2302,24 @@ export interface JobCollectionItem extends ProxyResource {
runOn?: string;
}

/**
* @class
* Initializes a new instance of the JobCreateParameters class.
* @constructor
* The parameters supplied to the create job operation.
*
* @member {object} [runbook] Gets or sets the runbook.
* @member {string} [runbook.name] Gets or sets the name of the runbook.
* @member {object} [parameters] Gets or sets the parameters of the job.
* @member {string} [runOn] Gets or sets the runOn which specifies the group
* name where the job is to be executed.
*/
export interface JobCreateParameters {
runbook?: RunbookAssociationProperty;
parameters?: { [propertyName: string]: string };
runOn?: string;
}

/**
* @class
* Initializes a new instance of the WindowsProperties class.
Expand Down
7 changes: 3 additions & 4 deletions lib/services/automationManagement/lib/models/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ exports.AgentRegistrationKeys = require('./agentRegistrationKeys');
exports.AgentRegistration = require('./agentRegistration');
exports.AgentRegistrationRegenerateKeyParameter = require('./agentRegistrationRegenerateKeyParameter');
exports.DscCompilationJobCreateParameters = require('./dscCompilationJobCreateParameters');
exports.JobStream = require('./jobStream');
exports.DscConfigurationCreateOrUpdateParameters = require('./dscConfigurationCreateOrUpdateParameters');
exports.DscConfigurationUpdateParameters = require('./dscConfigurationUpdateParameters');
exports.DscMetaConfiguration = require('./dscMetaConfiguration');
Expand All @@ -86,13 +87,9 @@ exports.HybridRunbookWorker = require('./hybridRunbookWorker');
exports.RunAsCredentialAssociationProperty = require('./runAsCredentialAssociationProperty');
exports.HybridRunbookWorkerGroup = require('./hybridRunbookWorkerGroup');
exports.HybridRunbookWorkerGroupUpdateParameters = require('./hybridRunbookWorkerGroupUpdateParameters');
exports.Job = require('./job');
exports.JobCreateParameters = require('./jobCreateParameters');
exports.JobListResult = require('./jobListResult');
exports.ScheduleAssociationProperty = require('./scheduleAssociationProperty');
exports.JobScheduleCreateParameters = require('./jobScheduleCreateParameters');
exports.JobSchedule = require('./jobSchedule');
exports.JobStream = require('./jobStream');
exports.LinkedWorkspace = require('./linkedWorkspace');
exports.ModuleCreateOrUpdateParameters = require('./moduleCreateOrUpdateParameters');
exports.ModuleUpdateParameters = require('./moduleUpdateParameters');
Expand All @@ -113,7 +110,9 @@ exports.VariableCreateOrUpdateParameters = require('./variableCreateOrUpdatePara
exports.VariableUpdateParameters = require('./variableUpdateParameters');
exports.WebhookCreateOrUpdateParameters = require('./webhookCreateOrUpdateParameters');
exports.WebhookUpdateParameters = require('./webhookUpdateParameters');
exports.Job = require('./job');
exports.JobCollectionItem = require('./jobCollectionItem');
exports.JobCreateParameters = require('./jobCreateParameters');
exports.WindowsProperties = require('./windowsProperties');
exports.LinuxProperties = require('./linuxProperties');
exports.UpdateConfiguration = require('./updateConfiguration');
Expand Down
8 changes: 2 additions & 6 deletions lib/services/automationManagement/lib/models/job.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@ class Job extends models['ProxyResource'] {
* @member {date} [lastStatusModifiedTime] Gets or sets the last status
* modified time of the job.
* @member {object} [parameters] Gets or sets the parameters of the job.
* @member {object} [provisioningState] The provisioning state of a resource.
* @member {string} [provisioningState.provisioningState] The provisioning
* state of the resource. Possible values include: 'Failed', 'Succeeded',
* 'Suspended', 'Processing'
* @member {string} [provisioningState] The provisioning state of a resource.
*/
constructor() {
super();
Expand Down Expand Up @@ -192,8 +189,7 @@ class Job extends models['ProxyResource'] {
readOnly: true,
serializedName: 'properties.provisioningState',
type: {
name: 'Composite',
className: 'JobProvisioningStateProperty'
name: 'String'
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const models = require('./index');
class JobCreateParameters {
/**
* Create a JobCreateParameters.
* @member {object} runbook Gets or sets the runbook.
* @member {object} [runbook] Gets or sets the runbook.
* @member {string} [runbook.name] Gets or sets the name of the runbook.
* @member {object} [parameters] Gets or sets the parameters of the job.
* @member {string} [runOn] Gets or sets the runOn which specifies the group
Expand All @@ -43,7 +43,7 @@ class JobCreateParameters {
className: 'JobCreateParameters',
modelProperties: {
runbook: {
required: true,
required: false,
serializedName: 'properties.runbook',
type: {
name: 'Composite',
Expand Down
4 changes: 2 additions & 2 deletions lib/services/automationManagement/lib/operations/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9969,7 +9969,7 @@ export interface JobOperations {
* @param {object} parameters The parameters supplied to the create job
* operation.
*
* @param {object} parameters.runbook Gets or sets the runbook.
* @param {object} [parameters.runbook] Gets or sets the runbook.
*
* @param {string} [parameters.runbook.name] Gets or sets the name of the
* runbook.
Expand Down Expand Up @@ -10008,7 +10008,7 @@ export interface JobOperations {
* @param {object} parameters The parameters supplied to the create job
* operation.
*
* @param {object} parameters.runbook Gets or sets the runbook.
* @param {object} [parameters.runbook] Gets or sets the runbook.
*
* @param {string} [parameters.runbook.name] Gets or sets the name of the
* runbook.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ function _get(resourceGroupName, automationAccountName, jobName, options, callba
* @param {object} parameters The parameters supplied to the create job
* operation.
*
* @param {object} parameters.runbook Gets or sets the runbook.
* @param {object} [parameters.runbook] Gets or sets the runbook.
*
* @param {string} [parameters.runbook.name] Gets or sets the name of the
* runbook.
Expand Down Expand Up @@ -2039,7 +2039,7 @@ class JobOperations {
* @param {object} parameters The parameters supplied to the create job
* operation.
*
* @param {object} parameters.runbook Gets or sets the runbook.
* @param {object} [parameters.runbook] Gets or sets the runbook.
*
* @param {string} [parameters.runbook.name] Gets or sets the name of the
* runbook.
Expand Down Expand Up @@ -2090,7 +2090,7 @@ class JobOperations {
* @param {object} parameters The parameters supplied to the create job
* operation.
*
* @param {object} parameters.runbook Gets or sets the runbook.
* @param {object} [parameters.runbook] Gets or sets the runbook.
*
* @param {string} [parameters.runbook.name] Gets or sets the name of the
* runbook.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,12 @@ function _getById(resourceGroupName, automationAccountName, softwareUpdateConfig
try {
parsedErrorResponse = JSON.parse(responseBody);
if (parsedErrorResponse) {
let internalError = null;
if (parsedErrorResponse.error) internalError = parsedErrorResponse.error;
error.code = internalError ? internalError.code : parsedErrorResponse.code;
error.message = internalError ? internalError.message : parsedErrorResponse.message;
if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
}
if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
let resultMapper = new client.models['ErrorResponse']().mapper();
let resultMapper = new client.models['CloudError']().mapper();
error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
}
} catch (defaultError) {
Expand Down Expand Up @@ -350,13 +349,12 @@ function _list(resourceGroupName, automationAccountName, options, callback) {
try {
parsedErrorResponse = JSON.parse(responseBody);
if (parsedErrorResponse) {
let internalError = null;
if (parsedErrorResponse.error) internalError = parsedErrorResponse.error;
error.code = internalError ? internalError.code : parsedErrorResponse.code;
error.message = internalError ? internalError.message : parsedErrorResponse.message;
if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
}
if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
let resultMapper = new client.models['ErrorResponse']().mapper();
let resultMapper = new client.models['CloudError']().mapper();
error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
}
} catch (defaultError) {
Expand Down
Loading

0 comments on commit 8ab4ca3

Please sign in to comment.