/ComplexProperties/PeopleInsights/Person.cs

https://github.com/OfficeDev/ews-managed-api · C# · 415 lines · 261 code · 32 blank · 122 comment · 1 complexity · ba32877e3787ab855853b233bb662afa MD5 · raw file

  1. /*
  2. * Exchange Web Services Managed API
  3. *
  4. * Copyright (c) Microsoft Corporation
  5. * All rights reserved.
  6. *
  7. * MIT License
  8. *
  9. * Permission is hereby granted, free of charge, to any person obtaining a copy of this
  10. * software and associated documentation files (the "Software"), to deal in the Software
  11. * without restriction, including without limitation the rights to use, copy, modify, merge,
  12. * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
  13. * to whom the Software is furnished to do so, subject to the following conditions:
  14. *
  15. * The above copyright notice and this permission notice shall be included in all copies or
  16. * substantial portions of the Software.
  17. *
  18. * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
  19. * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  20. * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
  21. * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  22. * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  23. * DEALINGS IN THE SOFTWARE.
  24. */
  25. namespace Microsoft.Exchange.WebServices.Data
  26. {
  27. /// <summary>
  28. /// Represents the Person.
  29. /// </summary>
  30. public class Person : ComplexProperty
  31. {
  32. /// <summary>
  33. /// Initializes a local instance of <see cref="Person"/>
  34. /// </summary>
  35. public Person()
  36. : base()
  37. {
  38. }
  39. /// <summary>
  40. /// Gets the EmailAddress.
  41. /// </summary>
  42. public string EmailAddress
  43. {
  44. get;
  45. internal set;
  46. }
  47. /// <summary>
  48. /// Gets the collection of insights.
  49. /// </summary>
  50. public PersonInsightCollection Insights
  51. {
  52. get;
  53. internal set;
  54. }
  55. /// <summary>
  56. /// Gets the display name.
  57. /// </summary>
  58. public string FullName
  59. {
  60. get;
  61. internal set;
  62. }
  63. /// <summary>
  64. /// Gets the display name.
  65. /// </summary>
  66. public string DisplayName
  67. {
  68. get;
  69. internal set;
  70. }
  71. /// <summary>
  72. /// Gets the given name.
  73. /// </summary>
  74. public string GivenName
  75. {
  76. get;
  77. internal set;
  78. }
  79. /// <summary>
  80. /// Gets the surname.
  81. /// </summary>
  82. public string Surname
  83. {
  84. get;
  85. internal set;
  86. }
  87. /// <summary>
  88. /// Gets the phone number.
  89. /// </summary>
  90. public string PhoneNumber
  91. {
  92. get;
  93. internal set;
  94. }
  95. /// <summary>
  96. /// Gets the sms number.
  97. /// </summary>
  98. public string SMSNumber
  99. {
  100. get;
  101. internal set;
  102. }
  103. /// <summary>
  104. /// Gets the facebook profile link.
  105. /// </summary>
  106. public string FacebookProfileLink
  107. {
  108. get;
  109. internal set;
  110. }
  111. /// <summary>
  112. /// Gets the linkedin profile link.
  113. /// </summary>
  114. public string LinkedInProfileLink
  115. {
  116. get;
  117. internal set;
  118. }
  119. /// <summary>
  120. /// Gets the list of skills.
  121. /// </summary>
  122. public SkillInsightValueCollection Skills
  123. {
  124. get;
  125. internal set;
  126. }
  127. /// <summary>
  128. /// Gets the professional biography.
  129. /// </summary>
  130. public string ProfessionalBiography
  131. {
  132. get;
  133. internal set;
  134. }
  135. /// <summary>
  136. /// Gets the management chain.
  137. /// </summary>
  138. public ProfileInsightValueCollection ManagementChain
  139. {
  140. get;
  141. internal set;
  142. }
  143. /// <summary>
  144. /// Gets the list of direct reports.
  145. /// </summary>
  146. public ProfileInsightValueCollection DirectReports
  147. {
  148. get;
  149. internal set;
  150. }
  151. /// <summary>
  152. /// Gets the list of peers.
  153. /// </summary>
  154. public ProfileInsightValueCollection Peers
  155. {
  156. get;
  157. internal set;
  158. }
  159. /// <summary>
  160. /// Gets the team size.
  161. /// </summary>
  162. public string TeamSize
  163. {
  164. get;
  165. internal set;
  166. }
  167. /// <summary>
  168. /// Gets the current job.
  169. /// </summary>
  170. public JobInsightValueCollection CurrentJob
  171. {
  172. get;
  173. internal set;
  174. }
  175. /// <summary>
  176. /// Gets the birthday.
  177. /// </summary>
  178. public string Birthday
  179. {
  180. get;
  181. internal set;
  182. }
  183. /// <summary>
  184. /// Gets the hometown.
  185. /// </summary>
  186. public string Hometown
  187. {
  188. get;
  189. internal set;
  190. }
  191. /// <summary>
  192. /// Gets the current location.
  193. /// </summary>
  194. public string CurrentLocation
  195. {
  196. get;
  197. internal set;
  198. }
  199. /// <summary>
  200. /// Gets the company profile.
  201. /// </summary>
  202. public CompanyInsightValueCollection CompanyProfile
  203. {
  204. get;
  205. internal set;
  206. }
  207. /// <summary>
  208. /// Gets the office.
  209. /// </summary>
  210. public string Office
  211. {
  212. get;
  213. internal set;
  214. }
  215. /// <summary>
  216. /// Gets the headline.
  217. /// </summary>
  218. public string Headline
  219. {
  220. get;
  221. internal set;
  222. }
  223. /// <summary>
  224. /// Gets the list of mutual connections.
  225. /// </summary>
  226. public ProfileInsightValueCollection MutualConnections
  227. {
  228. get;
  229. internal set;
  230. }
  231. /// <summary>
  232. /// Gets the title.
  233. /// </summary>
  234. public string Title
  235. {
  236. get;
  237. internal set;
  238. }
  239. /// <summary>
  240. /// Gets the mutual manager.
  241. /// </summary>
  242. public ProfileInsightValue MutualManager
  243. {
  244. get;
  245. internal set;
  246. }
  247. /// <summary>
  248. /// Gets the alias.
  249. /// </summary>
  250. public string Alias
  251. {
  252. get;
  253. internal set;
  254. }
  255. /// <summary>
  256. /// Gets the Department.
  257. /// </summary>
  258. public string Department
  259. {
  260. get;
  261. internal set;
  262. }
  263. /// <summary>
  264. /// Gets the user profile picture.
  265. /// </summary>
  266. public UserProfilePicture UserProfilePicture
  267. {
  268. get;
  269. internal set;
  270. }
  271. /// <summary>
  272. /// Tries to read element from XML.
  273. /// </summary>
  274. /// <param name="reader">The reader.</param>
  275. /// <returns>True if element was read.</returns>
  276. internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
  277. {
  278. switch (reader.LocalName)
  279. {
  280. case XmlElementNames.EmailAddress:
  281. this.EmailAddress = reader.ReadElementValue();
  282. break;
  283. case XmlElementNames.FullName:
  284. this.FullName = reader.ReadElementValue();
  285. break;
  286. case XmlElementNames.DisplayName:
  287. this.DisplayName = reader.ReadElementValue();
  288. break;
  289. case XmlElementNames.GivenName:
  290. this.GivenName = reader.ReadElementValue();
  291. break;
  292. case XmlElementNames.Surname:
  293. this.Surname = reader.ReadElementValue();
  294. break;
  295. case XmlElementNames.PhoneNumber:
  296. this.PhoneNumber = reader.ReadElementValue();
  297. break;
  298. case XmlElementNames.SMSNumber:
  299. this.SMSNumber = reader.ReadElementValue();
  300. break;
  301. case XmlElementNames.FacebookProfileLink:
  302. this.FacebookProfileLink = reader.ReadElementValue();
  303. break;
  304. case XmlElementNames.LinkedInProfileLink:
  305. this.LinkedInProfileLink = reader.ReadElementValue();
  306. break;
  307. case XmlElementNames.ProfessionalBiography:
  308. this.ProfessionalBiography = reader.ReadElementValue();
  309. break;
  310. case XmlElementNames.TeamSize:
  311. this.TeamSize = reader.ReadElementValue();
  312. break;
  313. case XmlElementNames.Birthday:
  314. this.Birthday = reader.ReadElementValue();
  315. break;
  316. case XmlElementNames.Hometown:
  317. this.Hometown = reader.ReadElementValue();
  318. break;
  319. case XmlElementNames.CurrentLocation:
  320. this.CurrentLocation = reader.ReadElementValue();
  321. break;
  322. case XmlElementNames.Office:
  323. this.Office = reader.ReadElementValue();
  324. break;
  325. case XmlElementNames.Headline:
  326. this.Headline = reader.ReadElementValue();
  327. break;
  328. case XmlElementNames.Title:
  329. this.Title = reader.ReadElementValue();
  330. break;
  331. case XmlElementNames.Alias:
  332. this.Alias = reader.ReadElementValue();
  333. break;
  334. case XmlElementNames.Department:
  335. this.Department = reader.ReadElementValue();
  336. break;
  337. case XmlElementNames.MutualManager:
  338. this.MutualManager = new ProfileInsightValue();
  339. this.MutualManager.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.MutualManager);
  340. break;
  341. case XmlElementNames.ManagementChain:
  342. this.ManagementChain = new ProfileInsightValueCollection(XmlElementNames.Item);
  343. this.ManagementChain.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.ManagementChain);
  344. break;
  345. case XmlElementNames.DirectReports:
  346. this.DirectReports = new ProfileInsightValueCollection(XmlElementNames.Item);
  347. this.DirectReports.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.DirectReports);
  348. break;
  349. case XmlElementNames.Peers:
  350. this.Peers = new ProfileInsightValueCollection(XmlElementNames.Item);
  351. this.Peers.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.Peers);
  352. break;
  353. case XmlElementNames.MutualConnections:
  354. this.MutualConnections = new ProfileInsightValueCollection(XmlElementNames.Item);
  355. this.MutualConnections.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.MutualConnections);
  356. break;
  357. case XmlElementNames.Skills:
  358. this.Skills = new SkillInsightValueCollection(XmlElementNames.Item);
  359. this.Skills.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.Skills);
  360. break;
  361. case XmlElementNames.CurrentJob:
  362. this.CurrentJob = new JobInsightValueCollection(XmlElementNames.Item);
  363. this.CurrentJob.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.CurrentJob);
  364. break;
  365. case XmlElementNames.CompanyProfile:
  366. this.CompanyProfile = new CompanyInsightValueCollection(XmlElementNames.Item);
  367. this.CompanyProfile.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.CompanyProfile);
  368. break;
  369. case XmlElementNames.Insights:
  370. this.Insights = new PersonInsightCollection();
  371. this.Insights.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.Insights);
  372. break;
  373. case XmlElementNames.UserProfilePicture:
  374. this.UserProfilePicture = new UserProfilePicture();
  375. this.UserProfilePicture.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.UserProfilePicture);
  376. break;
  377. default:
  378. return base.TryReadElementFromXml(reader);
  379. }
  380. return true;
  381. }
  382. }
  383. }