Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { O365JobBackupType } from './o365-job-json';
import { O365JobSchedulePolicyRequestJson } from './o365-job-schedule-policy-request-json';

/**
* O365 Create Job request json
* O365 Create & Modify Job request json
*/
export interface O365CreateJobRequestJson {
export interface O365JobRequestJson {
name: string;
description?: string;
backup_type: O365JobBackupType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,62 +1,64 @@
import {
GroupSelectedItem,
O365CreateJobRequestJson,
PartialOrganizationSelectedItem, SiteSelectedItem, UserSelectedItem
} from './__json__/o365-create-job-request-json';
O365JobRequestJson,
PartialOrganizationSelectedItem,
SiteSelectedItem,
UserSelectedItem
} from './__json__/o365-job-request-json';
import { O365JobBackupType } from './__json__/o365-job-json';
import { O365JobSchedulePolicyRequest } from './o365-job-schedule-policy-request';

/**
* O365 Create Job Request
* O365 Create & Modify Job Request
*/
/* istanbul ignore next: autogenerated */
export class O365CreateJobRequest {
export class O365JobRequest {

constructor(private _json: O365CreateJobRequestJson) {
constructor(private _json: O365JobRequestJson) {
}

/**
* Get O365 Job creation request name
* Get O365 Job creation / modification request name
* @returns {string}
*/
get name(): string {
return this._json.name;
}

/**
* Get O365 Job creation request description
* Get O365 Job creation / modification request description
* @returns {string | undefined}
*/
get description(): string | undefined {
return this._json.description;
}

/**
* Get O365 Job creation request backup type
* Get O365 Job creation / modification request backup type
* @returns {O365JobBackupType}
*/
get backupType(): O365JobBackupType {
return this._json.backup_type;
}

/**
* Get O365 Job creation request run now status
* Get O365 Job creation / modification request run now status
* @returns {boolean}
*/
get runNow(): boolean {
return this._json.run_now;
}

/**
* Get O365 Job creation request job schedule request
* Get O365 Job creation / modification request job schedule request
* @returns {O365JobSchedulePolicyRequest}
*/
get jobScheduleRequest(): O365JobSchedulePolicyRequest {
return new O365JobSchedulePolicyRequest(this._json.job_schedule_policy_request);
}

/**
* Get O365 Job creation request selected items request
* Get O365 Job creation / modification request selected items request
* @returns {Array<PartialOrganizationSelectedItem | GroupSelectedItem | UserSelectedItem | SiteSelectedItem>
* | undefined}
*/
Expand All @@ -66,7 +68,7 @@ export class O365CreateJobRequest {
}

/**
* Get O365 Job creation request excluded items request
* Get O365 Job creation / modification request excluded items request
* @returns {Array<PartialOrganizationSelectedItem | GroupSelectedItem | UserSelectedItem | SiteSelectedItem>
* | undefined}
*/
Expand All @@ -77,9 +79,9 @@ export class O365CreateJobRequest {

/**
* Get the json representation of this class.
* @returns {O365CreateJobRequestJson}
* @returns {O365JobRequestJson}
*/
get json(): O365CreateJobRequestJson {
get json(): O365JobRequestJson {
return Object.assign({}, this._json);
}

Expand Down
14 changes: 14 additions & 0 deletions src/sdk/model/o365/o365-job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { O365RestoreSessionJson } from './__json__/o365-restore-session-json';
import { O365RestoreSessionStartRequest } from './o365-restore-session-start-request';
import { O365JobSchedulePolicyRequest } from './o365-job-schedule-policy-request';
import { O365BackupJobSelectedExcludedItems } from './__json__/o365-job-selected-excluded-items';
import { O365JobRequest } from './o365-job-request';

/**
* O365 Backup Job entity
Expand Down Expand Up @@ -245,6 +246,19 @@ export class O365Job extends Entity {
});
}

/**
* Modify an O365 backup job
* @param {O365JobRequest} request
* @returns {Promise<O365Job>}
*/
/* istanbul ignore next: autogenerated */
async updateJob(request: O365JobRequest): Promise<O365Job> {
return Iland.getHttp().put(`/o365-jobs/${this.uuid}/actions/modifyJob`, request.json).then((response) => {
this._json = response.data as O365JobJson;
return this;
});
}

/**
* Delete O365 Backup Job
* @return {Promise<any>}
Expand Down
6 changes: 3 additions & 3 deletions src/sdk/model/o365/o365-organization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { O365User } from './o365-user';
import { O365UserJson } from './__json__/o365-user-json';
import { O365Group } from './o365-group';
import { O365GroupJson } from './__json__/o365-group-json';
import { O365CreateJobRequest } from './o365-create-job-request';
import { O365JobRequest } from './o365-job-request';
import { O365ModifyCredentialsRequest } from './o365-modify-credentials-request';
import { O365SharePointSite } from './o365-sharepoint-site';
import { O365SharePointSiteJson } from './__json__/o365-sharepoint-site-json';
Expand Down Expand Up @@ -368,11 +368,11 @@ export class O365Organization extends Entity {

/**
* Create an o365 backup job for this organization
* @param o365CreateJobRequest {O365CreateJobRequest}
* @param o365CreateJobRequest {O365JobRequest}
* @returns {Promise<O365Job>} the backup job created
*/
/* istanbul ignore next: autogenerated */
async createBackupJob(o365CreateJobRequest: O365CreateJobRequest): Promise<O365Job> {
async createBackupJob(o365CreateJobRequest: O365JobRequest): Promise<O365Job> {
return Iland.getHttp().post(`/o365-organizations/${this.uuid}/actions/create-job`, o365CreateJobRequest.json)
.then((response) => {
const json = response.data as O365JobJson;
Expand Down