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
14 changes: 14 additions & 0 deletions src/sdk/model/o365/__json__/o365-job-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export interface SelectedExcludedItems {
partial_org_responses: Array<PartialOrgResponse>;
share_point_site_responses: Array<SharePointSiteResponse>;
user_responses: Array<UserResponse>;
team_responses: Array<TeamResponse>;
}

/**
Expand Down Expand Up @@ -136,6 +137,7 @@ export interface PartialOrgResponse {
mailbox: boolean;
one_drive: boolean;
site: boolean;
teams: boolean;
}

/**
Expand Down Expand Up @@ -175,3 +177,15 @@ export interface InnerUserResponse {
organization_uuid: string;
type: string;
}

/**
* Selected or Excluded Team Response interface
*/
export interface TeamResponse {
description: string;
display_name: string;
is_backed_up: boolean;
mail: string;
native_id: string;
organization_uuid: string;
}
26 changes: 23 additions & 3 deletions src/sdk/model/o365/__json__/o365-job-request-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ export interface O365JobRequestJson {
run_now: boolean;
job_schedule_policy_request: O365JobSchedulePolicyRequestJson;
o365_job_selected_item_requests?: Array<PartialOrganizationSelectedItem |
GroupSelectedItem | UserSelectedItem | SiteSelectedItem>;
GroupSelectedItem | UserSelectedItem | SiteSelectedItem | TeamSelectedItem>;
o365_job_excluded_item_requests?: Array<PartialOrganizationSelectedItem |
GroupSelectedItem | UserSelectedItem | SiteSelectedItem>;
GroupSelectedItem | UserSelectedItem | SiteSelectedItem | TeamSelectedItem>;
}

/**
Expand All @@ -25,6 +25,7 @@ export interface PartialOrganizationSelectedItem {
archive_mailbox: boolean;
one_drive: boolean;
site: boolean;
teams: boolean;
}

/**
Expand Down Expand Up @@ -97,7 +98,26 @@ export interface SelectedItemNestedSite {
backed_up: boolean;
}

/**
* O365 Team selected item
*/
export interface TeamSelectedItem {
type: O365ItemRequestType; // Team
team: SelectedItemNestedTeam;
}

/**
* O365 Team nested selected item
*/
export interface SelectedItemNestedTeam {
native_id: string;
backed_up: boolean;
display_name: string;
mail: string;
name: string;
}

/**
* Enumeration of the available included/excluded items type of an O365 Backup Job
*/
export type O365ItemRequestType = 'User' | 'Site' | 'Group' | 'PartialOrganization';
export type O365ItemRequestType = 'User' | 'Site' | 'Team' | 'Group' | 'PartialOrganization';
19 changes: 14 additions & 5 deletions src/sdk/model/o365/__json__/o365-job-selected-excluded-items.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import {
GroupResponse,
PartialOrgResponse,
SelectedExcludedItems,
SharePointSiteResponse,
UserResponse
GroupResponse,
PartialOrgResponse,
SelectedExcludedItems,
SharePointSiteResponse,
UserResponse,
TeamResponse
} from './o365-job-json';

/**
Expand Down Expand Up @@ -47,6 +48,14 @@ export class O365BackupJobSelectedExcludedItems {
return this._json.share_point_site_responses;
}

/**
* Get the O365 Backup Job selected or excluded Team responses
* @returns {Array<TeamResponse>}
*/
get teamResponses(): Array<TeamResponse> {
return this._json.team_responses;
}

/**
* Get the json representation of this class.
* @returns {SelectedExcludedItems}
Expand Down
11 changes: 11 additions & 0 deletions src/sdk/model/o365/__json__/o365-team-json.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* O365 Team JSON properties
*/
export interface O365TeamJson {
description: string;
display_name: string;
is_backed_up: boolean;
mail: string;
native_id: string;
organization_uuid: string;
}
15 changes: 8 additions & 7 deletions src/sdk/model/o365/o365-job-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import {
O365JobRequestJson,
PartialOrganizationSelectedItem,
SiteSelectedItem,
UserSelectedItem
UserSelectedItem,
TeamSelectedItem
} from './__json__/o365-job-request-json';
import { O365JobBackupType } from './__json__/o365-job-json';
import { O365JobSchedulePolicyRequest } from './o365-job-schedule-policy-request';
Expand Down Expand Up @@ -59,21 +60,21 @@ export class O365JobRequest {

/**
* Get O365 Job creation / modification request selected items request
* @returns {Array<PartialOrganizationSelectedItem | GroupSelectedItem | UserSelectedItem | SiteSelectedItem>
* | undefined}
* @returns {Array<PartialOrganizationSelectedItem | GroupSelectedItem | UserSelectedItem | SiteSelectedItem |
* TeamSelectedItem> | undefined}
*/
get selectedItemsRequest(): Array<PartialOrganizationSelectedItem |
GroupSelectedItem | UserSelectedItem | SiteSelectedItem> | undefined {
GroupSelectedItem | UserSelectedItem | SiteSelectedItem | TeamSelectedItem> | undefined {
return this._json.o365_job_selected_item_requests;
}

/**
* Get O365 Job creation / modification request excluded items request
* @returns {Array<PartialOrganizationSelectedItem | GroupSelectedItem | UserSelectedItem | SiteSelectedItem>
* | undefined}
* @returns {Array<PartialOrganizationSelectedItem | GroupSelectedItem | UserSelectedItem | SiteSelectedItem |
* TeamSelectedItem> | undefined}
*/
get excludedItemsRequest(): Array<PartialOrganizationSelectedItem |
GroupSelectedItem | UserSelectedItem | SiteSelectedItem> | undefined {
GroupSelectedItem | UserSelectedItem | SiteSelectedItem | TeamSelectedItem> | undefined {
return this._json.o365_job_excluded_item_requests;
}

Expand Down
21 changes: 21 additions & 0 deletions src/sdk/model/o365/o365-organization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import { O365SharePointSiteJson } from './__json__/o365-sharepoint-site-json';
import { O365BackupRepository } from '../company/o365-backup-repository';
import { O365BackupRepositoryJson } from '../company/__json__/o365-backup-repository-json';
import { Http } from '../../service/http/http';
import { O365Team } from './o365-team';
import { O365TeamJson } from './__json__/o365-team-json';

/**
* O365 Organization
Expand Down Expand Up @@ -409,6 +411,25 @@ export class O365Organization extends Entity {
});
}

/**
* Get the O365 Organization's Teams
* @param page
* @param pageSize
* @returns {Promise<Array<O365Team>>}
*/
/* istanbul ignore next: autogenerated */
async getOrgTeams(page?: number, pageSize?: number): Promise<Array<O365Team>> {
return Iland.getHttp().get(`o365-organizations/${this.uuid}/teams`, {
params: {
page: page || 0,
pageSize: pageSize || 50
}
}).then((response) => {
const json = response.data.data as Array<O365TeamJson>;
return json.map((it) => new O365Team(it));
});
}

/**
* Get the O365 Organization's backup repositories to use in creation of a Backup Job
* @returns {Promise<Array<O365BackupRepository>>}
Expand Down
75 changes: 75 additions & 0 deletions src/sdk/model/o365/o365-team.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import { O365TeamJson } from './__json__/o365-team-json';

/**
* O365 Team
*/
/* istanbul ignore next: autogenerated */
export class O365Team {

constructor(private _json: O365TeamJson) {
}

/**
* Get the O365 Team description
* @returns {string}
*/
get description(): string {
return this._json.description;
}

/**
* Get the O365 Team display name
* @returns {string}
*/
get displayName(): string {
return this._json.display_name;
}

/**
* Get whether the Office 365 Team is backed up
* @returns {boolean}
*/
get isBackedUp(): boolean {
return this._json.is_backed_up;
}

/**
* Get the O365 Team mail
* @returns {string}
*/
get mail(): string {
return this._json.mail;
}

/**
* Get the native id of O365 Team
* @returns {string}
*/
get nativeId(): string {
return this._json.native_id;
}

/**
* Get the O365 VBO Organization iland platform UUID
* @returns {string}
*/
get organizationUuid(): string {
return this._json.organization_uuid;
}

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

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