/// <summary> /// This method is used by the client to modify the specific properties of an Address Book object. /// </summary> /// <param name="modPropsRequestBody">The ModProps request type request body.</param> /// <returns>The response body of the ModProps request type.</returns> public ModPropsResponseBody ModProps(ModPropsRequestBody modPropsRequestBody) { CommonResponse commonResponse = this.SendAddressBookRequest(modPropsRequestBody, RequestType.ModProps); ModPropsResponseBody modPropsResponseBody = ModPropsResponseBody.Parse(commonResponse.ResponseBodyRawData); this.VerifyModPropsResponseBody(modPropsResponseBody); return(modPropsResponseBody); }
/// <summary> /// Parse the ModProps request type response body. /// </summary> /// <param name="rawData">The raw data of response.</param> /// <returns>The ModProps request type response body.</returns> public static ModPropsResponseBody Parse(byte[] rawData) { ModPropsResponseBody responseBody = new ModPropsResponseBody(); int index = 0; responseBody.StatusCode = BitConverter.ToUInt32(rawData, index); index += 4; responseBody.ErrorCode = BitConverter.ToUInt32(rawData, index); index += 4; responseBody.AuxiliaryBufferSize = BitConverter.ToUInt32(rawData, index); index += 4; responseBody.AuxiliaryBuffer = new byte[responseBody.AuxiliaryBufferSize]; Array.Copy(rawData, index, responseBody.AuxiliaryBuffer, 0, responseBody.AuxiliaryBufferSize); return responseBody; }
/// <summary> /// Parse the ModProps request type response body. /// </summary> /// <param name="rawData">The raw data of response.</param> /// <returns>The ModProps request type response body.</returns> public static ModPropsResponseBody Parse(byte[] rawData) { ModPropsResponseBody responseBody = new ModPropsResponseBody(); int index = 0; responseBody.StatusCode = BitConverter.ToUInt32(rawData, index); index += 4; responseBody.ErrorCode = BitConverter.ToUInt32(rawData, index); index += 4; responseBody.AuxiliaryBufferSize = BitConverter.ToUInt32(rawData, index); index += 4; responseBody.AuxiliaryBuffer = new byte[responseBody.AuxiliaryBufferSize]; Array.Copy(rawData, index, responseBody.AuxiliaryBuffer, 0, responseBody.AuxiliaryBufferSize); return(responseBody); }
/// <summary> /// Verify the requirements related to ModProps request type response body. /// </summary> /// <param name="modPropsResponseBody">The response body of ModProps request type.</param> private void VerifyModPropsResponseBody(ModPropsResponseBody modPropsResponseBody) { // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCMAPIHTTP_R796"); // Verify MS-OXCMAPIHTTP requirement: MS-OXCMAPIHTTP_R796 this.Site.CaptureRequirementIfIsInstanceOfType( modPropsResponseBody.StatusCode, typeof(uint), 796, @"[In ModProps Request Type Success Response Body] StatusCode: An unsigned integer that specifies the status of the request."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCMAPIHTTP_R797"); // Verify MS-OXCMAPIHTTP requirement: MS-OXCMAPIHTTP_R797 this.Site.CaptureRequirementIfAreEqual<uint>( 0, modPropsResponseBody.StatusCode, 797, @"[In ModProps Request Type Success Response Body] [StatusCode] This field MUST be set to 0x00000000."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCMAPIHTTP_R798"); // Verify MS-OXCMAPIHTTP requirement: MS-OXCMAPIHTTP_R798 this.Site.CaptureRequirementIfIsInstanceOfType( modPropsResponseBody.ErrorCode, typeof(uint), 798, @"[In ModProps Request Type Success Response Body] ErrorCode: An unsigned integer that specifies the return status of the operation."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCMAPIHTTP_R799"); // Verify MS-OXCMAPIHTTP requirement: MS-OXCMAPIHTTP_R799 this.Site.CaptureRequirementIfIsInstanceOfType( modPropsResponseBody.AuxiliaryBufferSize, typeof(uint), 799, @"[In ModProps Request Type Success Response Body] AuxiliaryBufferSize: An unsigned integer that specifies the size, in bytes, of the AuxiliaryBuffer field."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCMAPIHTTP_R800"); // Verify MS-OXCMAPIHTTP requirement: MS-OXCMAPIHTTP_R800 this.Site.CaptureRequirementIfIsInstanceOfType( modPropsResponseBody.AuxiliaryBuffer, typeof(byte[]), 800, @"[In ModProps Request Type Success Response Body] AuxiliaryBuffer: An array of bytes that constitute the auxiliary payload data returned from the server."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCMAPIHTTP_R801"); // Verify MS-OXCMAPIHTTP requirement: MS-OXCMAPIHTTP_R801 this.Site.CaptureRequirementIfAreEqual<uint>( modPropsResponseBody.AuxiliaryBufferSize, (uint)modPropsResponseBody.AuxiliaryBuffer.Length, 801, @"[In ModProps Request Type Success Response Body] [AuxiliaryBuffer] The size of this field, in bytes, is specified by the AuxiliaryBufferSize field."); }