-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
270 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/js/Core/Requests/GetDiscoverySearchConfigurationRequest.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,103 @@ | ||
import {SimpleServiceRequestBase} from "./SimpleServiceRequestBase"; | ||
import {GetHoldOnMailboxesResponse} from "../Responses/GetHoldOnMailboxesResponse"; | ||
import {ExchangeVersion} from "../../Enumerations/ExchangeVersion"; | ||
import {EwsServiceXmlReader} from "../EwsServiceXmlReader"; | ||
import {EwsServiceXmlWriter} from "../EwsServiceXmlWriter"; | ||
import { EwsServiceXmlWriter } from "../EwsServiceXmlWriter"; | ||
import { ExchangeService } from "../ExchangeService"; | ||
import { ExchangeVersion } from "../../Enumerations/ExchangeVersion"; | ||
import { GetHoldOnMailboxesResponse } from "../Responses/GetHoldOnMailboxesResponse"; | ||
import { IPromise } from "../../Interfaces"; | ||
import { ServiceValidationException } from "../../Exceptions/ServiceValidationException"; | ||
import { StringHelper } from "../../ExtensionMethods"; | ||
import { Strings } from "../../Strings"; | ||
import { XmlElementNames } from "../XmlElementNames"; | ||
import { XmlNamespace } from "../../Enumerations/XmlNamespace"; | ||
|
||
import { SimpleServiceRequestBase } from "./SimpleServiceRequestBase"; | ||
/** | ||
* ## @internal *Not Implemented* | ||
* @internal Represents a GetHoldOnMailboxesRequest request. | ||
* | ||
* @sealed | ||
*/ | ||
export class GetHoldOnMailboxesRequest extends SimpleServiceRequestBase { | ||
HoldId: string; | ||
Execute(): GetHoldOnMailboxesResponse { throw new Error("GetHoldOnMailboxesRequest.ts - Execute : Not implemented."); } | ||
GetMinimumRequiredServerVersion(): ExchangeVersion { throw new Error("GetHoldOnMailboxesRequest.ts - GetMinimumRequiredServerVersion : Not implemented."); } | ||
GetResponseXmlElementName(): string { throw new Error("GetHoldOnMailboxesRequest.ts - GetResponseXmlElementName : Not implemented."); } | ||
GetXmlElementName(): string { throw new Error("GetHoldOnMailboxesRequest.ts - GetXmlElementName : Not implemented."); } | ||
ParseResponse(reader: EwsServiceXmlReader): any { throw new Error("GetHoldOnMailboxesRequest.ts - ParseResponse : Not implemented."); } | ||
Validate(): any { throw new Error("GetHoldOnMailboxesRequest.ts - Validate : Not implemented."); } | ||
WriteElementsToXml(writer: EwsServiceXmlWriter): any { throw new Error("GetHoldOnMailboxesRequest.ts - WriteElementsToXml : Not implemented."); } | ||
|
||
/** | ||
* Hold id | ||
*/ | ||
HoldId: string = null; | ||
|
||
/** | ||
* @internal Initializes a new instance of the **GetDiscoverySearchConfigurationRequest** class. | ||
* | ||
* @param {ExchangeService} service The service. | ||
*/ | ||
constructor(service: ExchangeService) { | ||
super(service); | ||
} | ||
|
||
/** | ||
* @internal Executes this request. | ||
* | ||
* @return {IPromise<GetHoldOnMailboxesResponse>} Service response :Promise. | ||
*/ | ||
Execute(): IPromise<GetHoldOnMailboxesResponse> { | ||
return this.InternalExecute().then((serviceResponse: GetHoldOnMailboxesResponse) => { | ||
return serviceResponse; | ||
}); | ||
} | ||
|
||
/** | ||
* @internal Gets the request version. | ||
* | ||
* @return {ExchangeVersion} Earliest Exchange version in which this request is supported. | ||
*/ | ||
GetMinimumRequiredServerVersion(): ExchangeVersion { | ||
return ExchangeVersion.Exchange2013; | ||
} | ||
|
||
/** | ||
* @internal Gets the name of the response XML element. | ||
* | ||
* @return {string} XML element name. | ||
*/ | ||
GetResponseXmlElementName(): string { | ||
return XmlElementNames.GetHoldOnMailboxesResponse; | ||
} | ||
|
||
/** | ||
* @internal Gets the name of the XML element. | ||
* | ||
* @return {string} XML element name. | ||
*/ | ||
GetXmlElementName(): string { | ||
return XmlElementNames.GetHoldOnMailboxes; | ||
} | ||
|
||
/** | ||
* @internal Parses the response. | ||
* | ||
* @param {any} jsonBody The js object response body. | ||
* @return {any} Response object. | ||
*/ | ||
ParseResponse(jsonBody: any): any { | ||
let response: GetHoldOnMailboxesResponse = new GetHoldOnMailboxesResponse(); | ||
response.LoadFromXmlJsObject(jsonBody, this.Service); | ||
return response; | ||
} | ||
|
||
/** | ||
* @internal Validate request. | ||
*/ | ||
Validate(): void { | ||
super.Validate(); | ||
|
||
if (StringHelper.IsNullOrEmpty(this.HoldId)) { | ||
throw new ServiceValidationException(Strings.HoldIdParameterIsNotSpecified); | ||
} | ||
} | ||
|
||
/** | ||
* @internal Writes the elements to XML writer. | ||
* | ||
* @param {EwsServiceXmlWriter} writer The writer. | ||
*/ | ||
WriteElementsToXml(writer: EwsServiceXmlWriter): void { | ||
writer.WriteElementValue(XmlNamespace.Messages, XmlElementNames.HoldId, this.HoldId); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/js/Core/Responses/GetDiscoverySearchConfigurationResponse.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,42 @@ | ||
import {ServiceResponse} from "./ServiceResponse"; | ||
import {MailboxHoldResult} from "../../MailboxSearch/MailboxHoldResult"; | ||
import {JsonObject} from "../JsonObject"; | ||
import {ExchangeService} from "../ExchangeService"; | ||
import {EwsServiceXmlReader} from "../EwsServiceXmlReader"; | ||
import { ExchangeService } from "../ExchangeService"; | ||
import { MailboxHoldResult } from "../../MailboxSearch/MailboxHoldResult"; | ||
import { XmlElementNames } from "../XmlElementNames"; | ||
|
||
import { ServiceResponse } from "./ServiceResponse"; | ||
/** | ||
* ## *Not Implemented* | ||
* Represents the GetHoldOnMailboxes response. | ||
* | ||
* @sealed | ||
*/ | ||
export class GetHoldOnMailboxesResponse extends ServiceResponse { | ||
HoldResult: MailboxHoldResult; | ||
private holdResult: MailboxHoldResult; | ||
ReadElementsFromJson(responseObject: JsonObject, service: ExchangeService): any { throw new Error("GetHoldOnMailboxesResponse.ts - ReadElementsFromJson : Not implemented."); } | ||
ReadElementsFromXmlJsObject(reader: EwsServiceXmlReader): any { throw new Error("GetHoldOnMailboxesResponse.ts - ReadElementsFromXmlJsObject : Not implemented."); } | ||
|
||
private holdResult: MailboxHoldResult = null; | ||
|
||
/** | ||
* Mailbox hold result | ||
*/ | ||
get HoldResult(): MailboxHoldResult { | ||
return this.holdResult; | ||
} | ||
|
||
/** | ||
* @internal Initializes a new instance of the **GetHoldOnMailboxesResponse** class. | ||
*/ | ||
constructor() { | ||
super(); | ||
} | ||
|
||
/** | ||
* @internal Reads response elements from Xml JsObject. | ||
* | ||
* @param {any} jsObject The response object. | ||
* @param {ExchangeService} service The service. | ||
*/ | ||
ReadElementsFromXmlJsObject(jsObject: any, service: ExchangeService): void { | ||
//super.ReadElementsFromXmlJsObject(jsObject, service); | ||
|
||
if (jsObject[XmlElementNames.MailboxHoldResult]) { | ||
this.holdResult = MailboxHoldResult.LoadFromXmlJsObject(jsObject[XmlElementNames.MailboxHoldResult], service); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,72 @@ | ||
import {MailboxHoldStatus} from "./MailboxHoldStatus"; | ||
import {JsonObject} from "../Core/JsonObject"; | ||
import {EwsServiceXmlReader} from "../Core/EwsServiceXmlReader"; | ||
import { EwsServiceJsonReader } from '../Core/EwsServiceJsonReader'; | ||
import { ExchangeService } from './../Core/ExchangeService'; | ||
import { HoldStatus } from "../Enumerations/HoldStatus"; | ||
import { MailboxHoldStatus } from "./MailboxHoldStatus"; | ||
import { XmlElementNames } from "../Core/XmlElementNames"; | ||
|
||
/** | ||
* Represents mailbox hold result | ||
* | ||
* @sealed | ||
*/ | ||
export class MailboxHoldResult { | ||
HoldId: string; | ||
Query: string; | ||
Statuses: MailboxHoldStatus[]; | ||
LoadFromJson(jsonObject: JsonObject): MailboxHoldResult { throw new Error("MailboxHoldResult.ts - LoadFromJson : Not implemented."); } | ||
LoadFromXml(reader: EwsServiceXmlReader): MailboxHoldResult { throw new Error("MailboxHoldResult.ts - LoadFromXml : Not implemented."); } | ||
} | ||
|
||
/** | ||
* Hold id | ||
*/ | ||
HoldId: string = null; | ||
|
||
/** | ||
* Query | ||
*/ | ||
Query: string = null; | ||
|
||
/** | ||
* Collection of mailbox status | ||
*/ | ||
Statuses: MailboxHoldStatus[] = null; | ||
|
||
/** | ||
* @internal Loads service object from XML. | ||
* | ||
* @param {any} jsObject Json Object converted from XML. | ||
* @param {ExchangeService} service The service. | ||
* @return {MailboxHoldResult} Mailbox hold object | ||
*/ | ||
static LoadFromXmlJsObject(jsObject: any, service: ExchangeService): MailboxHoldResult { | ||
let statuses: MailboxHoldStatus[] = []; | ||
let holdResult: MailboxHoldResult = new MailboxHoldResult(); | ||
|
||
if (jsObject[XmlElementNames.HoldId]) { | ||
holdResult.HoldId = jsObject[XmlElementNames.HoldId]; | ||
} | ||
|
||
if (jsObject[XmlElementNames.Query]) { | ||
holdResult.Query = jsObject[XmlElementNames.Query]; | ||
} | ||
|
||
//} | ||
if (jsObject[XmlElementNames.MailboxHoldStatuses]) { | ||
for (let statusObject of EwsServiceJsonReader.ReadAsArray(jsObject[XmlElementNames.MailboxHoldStatuses], XmlElementNames.MailboxHoldStatus)) { | ||
|
||
let status: MailboxHoldStatus = new MailboxHoldStatus(); | ||
|
||
if (statusObject[XmlElementNames.Mailbox]) { | ||
status.Mailbox = statusObject[XmlElementNames.Mailbox]; | ||
} | ||
if (statusObject[XmlElementNames.Status]) { | ||
status.Status = HoldStatus[<string>statusObject[XmlElementNames.Status]]; | ||
} | ||
|
||
if (statusObject[XmlElementNames.AdditionalInfo]) { | ||
status.AdditionalInfo = statusObject[XmlElementNames.AdditionalInfo]; | ||
} | ||
|
||
statuses.push(status); | ||
} | ||
} | ||
|
||
holdResult.Statuses = statuses.length == 0 ? null : statuses; | ||
|
||
return holdResult; | ||
} | ||
} |
Oops, something went wrong.