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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"transform": {
"\\.(ts)$": "<rootDir>/node_modules/ts-jest/preprocessor.js"
},
"testRegex": "/.*.test.+(unit|int).ts$",
"testRegex": "/.*.test.+(unit).ts$",
"clearMocks": true,
"bail": false,
"testPathIgnorePatterns": [
Expand Down
1 change: 1 addition & 0 deletions src/sdk/model/o365/__json__/o365-team-file-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export interface O365TeamFileJson {
name: string;
modified_by: string;
modified: number;
parent_id: string;
size_bytes: number;
type: string;
version: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* O365 Teams restore options request JSON properties
*/
export interface O365TeamsRestoreOptionsRequestJson {
user: string;
password: string;
restore_settings?: boolean;
restore_missing_items?: boolean;
restore_members?: boolean;
restore_changed_items?: boolean;
file_version?: O365TeamsFileVersion;
file_last_version_action?: O365TeamsFileLastVersionAction;
item_ids?: Array<string>;
from?: number;
to?: number;
}

/**
* O365 Teams file version enum
*/
export enum O365TeamsFileVersion {
ALL = 'all',
LAST = 'last'
}

/**
* O365 Teams file last version action enum
*/
export enum O365TeamsFileLastVersionAction {
OVERWRITE = 'overwrite',
MERGE = 'merge'
}
108 changes: 108 additions & 0 deletions src/sdk/model/o365/o365-restore-session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import { O365TeamTabJson } from './__json__/o365-team-tab-json';
import { Http } from '../../service/http/http';
import { Task } from '../task/task';
import { TaskJson } from '../task/__json__/task-json';
import { O365TeamsRestoreOptionsRequest } from './o365-teams-restore-options-request';

/**
* O365 Restore Session
Expand Down Expand Up @@ -884,6 +885,35 @@ export class O365RestoreSession extends Entity {
});
}

/**
* Restore all O365 Teams
* @param {O365TeamsRestoreOptionsRequest} request
* @returns {Promise<Task>}
*/
/* istanbul ignore next: autogenerated */
async restoreAllTeams(request: O365TeamsRestoreOptionsRequest): Promise<Task> {
return Iland.getHttp().post(`/o365-restore-sessions/${this.uuid}/teams/action/restore-all-teams`, request.json)
.then((response) => {
const json = response.data as TaskJson;
return new Task(json);
});
}

/**
* Restore a O365 Team
* @param {string} teamId
* @param {O365TeamsRestoreOptionsRequest} request
* @returns {Promise<Task>}
*/
/* istanbul ignore next: autogenerated */
async restoreTeam(teamId: string, request: O365TeamsRestoreOptionsRequest): Promise<Task> {
return Iland.getHttp().post(`/o365-restore-sessions/${this.uuid}/teams/${teamId}/action/restore-team`, request.json)
.then((response) => {
const json = response.data as TaskJson;
return new Task(json);
});
}

/**
* Get O365 Team Channels
* Proxying directly to vbo: page and pageSize are used as offset and limit respectively
Expand All @@ -908,6 +938,19 @@ export class O365RestoreSession extends Entity {
});
}

/**
* Restore a O365 Team channel
* @param {string} teamId
* @param {string} channelId
* @param {O365TeamsRestoreOptionsRequest} request
* @returns {Promise<any>}
*/
/* istanbul ignore next: autogenerated */
async restoreTeamChannel(teamId: string, channelId: string, request: O365TeamsRestoreOptionsRequest): Promise<any> {
// tslint:disable-next-line:max-line-length
return Iland.getHttp().post(`/o365-restore-sessions/${this.uuid}/teams/${teamId}/channels/${channelId}/action/restore-channel`, request.json);
}

/**
* Get O365 Team Files
* Proxying directly to vbo: page and pageSize are used as offset and limit respectively
Expand All @@ -934,6 +977,32 @@ export class O365RestoreSession extends Entity {
});
}

/**
* Restore all O365 Team Files
* @param {string} teamId
* @param {string} channelId
* @param {O365TeamsRestoreOptionsRequest} request
* @returns {Promise<any>}
*/
/* istanbul ignore next: autogenerated */
async restoreAllTeamFiles(teamId: string, channelId: string, request: O365TeamsRestoreOptionsRequest): Promise<any> {
// tslint:disable-next-line:max-line-length
return Iland.getHttp().post(`/o365-restore-sessions/${this.uuid}/teams/${teamId}/channels/${channelId}/files/action/restore-all-files`, request.json);
}

/**
* Restore a O365 Team File
* @param {string} teamId
* @param {string} channelId
* @param {O365TeamsRestoreOptionsRequest} request
* @returns {Promise<any>}
*/
/* istanbul ignore next: autogenerated */
async restoreTeamFile(teamId: string, channelId: string, request: O365TeamsRestoreOptionsRequest): Promise<any> {
// tslint:disable-next-line:max-line-length
return Iland.getHttp().post(`/o365-restore-sessions/${this.uuid}/teams/${teamId}/channels/${channelId}/files/action/restore-files`, request.json);
}

/**
* Get O365 Team Posts
* Proxying directly to vbo: page and pageSize are used as offset and limit respectively
Expand All @@ -960,6 +1029,32 @@ export class O365RestoreSession extends Entity {
});
}

/**
* Restore all O365 Team Posts
* @param {string} teamId
* @param {string} channelId
* @param {O365TeamsRestoreOptionsRequest} request
* @returns {Promise<any>}
*/
/* istanbul ignore next: autogenerated */
async restoreAllTeamPosts(teamId: string, channelId: string, request: O365TeamsRestoreOptionsRequest): Promise<any> {
// tslint:disable-next-line:max-line-length
return Iland.getHttp().post(`/o365-restore-sessions/${this.uuid}/teams/${teamId}/channels/${channelId}/posts/action/restore-all-posts`, request.json);
}

/**
* Restore a O365 Team Post
* @param {string} teamId
* @param {string} channelId
* @param {O365TeamsRestoreOptionsRequest} request
* @returns {Promise<any>}
*/
/* istanbul ignore next: autogenerated */
async restoreTeamPost(teamId: string, channelId: string, request: O365TeamsRestoreOptionsRequest): Promise<any> {
// tslint:disable-next-line:max-line-length
return Iland.getHttp().post(`/o365-restore-sessions/${this.uuid}/teams/${teamId}/channels/${channelId}/posts/action/restore-posts`, request.json);
}

/**
* Get O365 Team Channel Tabs
* Proxying directly to vbo: page and pageSize are used as offset and limit respectively
Expand All @@ -984,4 +1079,17 @@ export class O365RestoreSession extends Entity {
});
}

/**
* Restore a O365 Team Tab
* @param {string} teamId
* @param {string} channelId
* @param {O365TeamsRestoreOptionsRequest} request
* @returns {Promise<any>}
*/
/* istanbul ignore next: autogenerated */
async restoreTeamTab(teamId: string, channelId: string, request: O365TeamsRestoreOptionsRequest): Promise<any> {
// tslint:disable-next-line:max-line-length
return Iland.getHttp().post(`/o365-restore-sessions/${this.uuid}/teams/${teamId}/channels/${channelId}/tabs/action/restore-tabs`, request.json);
}

}
8 changes: 8 additions & 0 deletions src/sdk/model/o365/o365-team-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ export class O365TeamFile {
return this._json.modified;
}

/**
* Get the parent folder ID of the sub file/folder.
* @returns {string}
*/
get parentId(): string {
return this._json.parent_id;
}

/**
* Get the file size.
* @returns {number}
Expand Down
118 changes: 118 additions & 0 deletions src/sdk/model/o365/o365-teams-restore-options-request.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
import {
O365TeamsRestoreOptionsRequestJson,
O365TeamsFileVersion,
O365TeamsFileLastVersionAction
} from './__json__/o365-teams-restore-options-request-json';

/**
* O365 Teams restore options request
*/
/* istanbul ignore next: autogenerated */
export class O365TeamsRestoreOptionsRequest {
constructor(private _json: O365TeamsRestoreOptionsRequestJson) {
}

/**
* Get the user you want to use for authenticating with the O365 Teams organization
* @returns {string}
*/
get user(): string {
return this._json.user;
}

/**
* Get the password you want to use for authenticating with the O365 Teams organization
* @returns {string}
*/
get password(): string {
return this._json.password;
}

/**
* Get whether to restore settings of the restored O365 Team
* @returns {boolean | undefined}
*/
get restoreSettings(): boolean | undefined {
return this._json.restore_settings;
}

/**
* Get whether to restore Team items that are missing in the original location
* @returns {boolean | undefined}
*/
get restoreMissingItems(): boolean | undefined {
return this._json.restore_missing_items;
}

/**
* Get whether to restore members of the restored O365 Team along with their roles
* @returns {boolean | undefined}
*/
get restoreMembers(): boolean | undefined {
return this._json.restore_members;
}

/**
* Get whether to restore team items that have changed since the time when the backup was created
* @returns {boolean | undefined}
*/
get restoreChangedItems(): boolean | undefined {
return this._json.restore_changed_items;
}

/**
* Get version of file to restore
* @returns {O365TeamsFileVersion | undefined}
*/
get fileVersion(): O365TeamsFileVersion | undefined {
return this._json.file_version;
}

/**
* Get the action to perform with the latest file restored
* @returns {O365TeamsFileLastVersionAction | undefined}
*/
get fileLastVersionAction(): O365TeamsFileLastVersionAction | undefined {
return this._json.file_last_version_action;
}

/**
* Get the ids of O365 Team items
* @returns {Array<string> | undefined}
*/
get itemIds(): Array<string> | undefined {
return this._json.item_ids;
}

/**
* Get the start date to export channel posts from
* @returns {number | undefined}
*/
get from(): number | undefined {
return this._json.from;
}

/**
* Get the end date to export channel posts until
* @returns {number | undefined}
*/
get to(): number | undefined {
return this._json.to;
}

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

/**
* Get the string representation of this class.
* @returns {string}
*/
toString(): string {
return JSON.stringify(this._json, undefined, 2);
}
}