diff --git a/.gitignore b/.gitignore index 89cb0b08..20938efd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,184 +1,184 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - -# User-specific files -*.suo -*.user -*.userosscache -*.sln.docstates - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -build/ -bld/ -[Bb]in/ -[Oo]bj/ - -# Roslyn cache directories -*.ide/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -#NUNIT -*.VisualState.xml -TestResult.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -*_i.c -*_p.c -*_i.h -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opensdf -*.sdf -*.cachefile - -# Visual Studio profiler -*.psess -*.vsp -*.vspx - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding addin-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# NCrunch -_NCrunch_* -.*crunch*.local.xml - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# TODO: Comment the next line if you want to checkin your web deploy settings -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# NuGet Packages -*.nupkg -# The packages folder can be ignored because of Package Restore -**/packages/* -# except build/, which is used as an MSBuild target. -!**/packages/build/ -# If using the old MSBuild-Integrated Package Restore, uncomment this: -#!**/packages/repositories.config - -# Windows Azure Build Output -csx/ -*.build.csdef - -# Windows Store app package directory -AppPackages/ - -# Others -sql/ -*.Cache -ClientBin/ -[Ss]tyle[Cc]op.* -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.pfx -*.publishsettings -node_modules/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm - -# SQL Server files -*.mdf -*.ldf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings - -# Microsoft Fakes +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +build/ +bld/ +[Bb]in/ +[Oo]bj/ + +# Roslyn cache directories +*.ide/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +#NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding addin-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# If using the old MSBuild-Integrated Package Restore, uncomment this: +#!**/packages/repositories.config + +# Windows Azure Build Output +csx/ +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +sql/ +*.Cache +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes FakesAssemblies/ \ No newline at end of file diff --git a/Attributes/AttachableAttribute.cs b/Attributes/AttachableAttribute.cs index 4dfa40fe..56a3f467 100644 --- a/Attributes/AttachableAttribute.cs +++ b/Attributes/AttachableAttribute.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the AttachableAttribute attribute. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -28,4 +43,4 @@ internal AttachableAttribute() { } } -} +} \ No newline at end of file diff --git a/Attributes/EwsEnumAttribute.cs b/Attributes/EwsEnumAttribute.cs index 89ef5180..b3eaf0ff 100644 --- a/Attributes/EwsEnumAttribute.cs +++ b/Attributes/EwsEnumAttribute.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the EwsEnumAttribute attribute -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -47,4 +62,4 @@ internal string SchemaName } } } -} +} \ No newline at end of file diff --git a/Attributes/RequiredServerVersionAttribute.cs b/Attributes/RequiredServerVersionAttribute.cs index 01e8b6cb..017c5aeb 100644 --- a/Attributes/RequiredServerVersionAttribute.cs +++ b/Attributes/RequiredServerVersionAttribute.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the RequiredServerVersion attribute -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -46,4 +61,4 @@ internal ExchangeVersion Version } } } -} +} \ No newline at end of file diff --git a/Attributes/SchemaAttribute.cs b/Attributes/SchemaAttribute.cs index add8a8b9..e3ff1366 100644 --- a/Attributes/SchemaAttribute.cs +++ b/Attributes/SchemaAttribute.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SchemaAttribute attribute. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -27,4 +42,4 @@ internal SchemaAttribute() { } } -} +} \ No newline at end of file diff --git a/Attributes/ServiceObjectDefinitionAttribute.cs b/Attributes/ServiceObjectDefinitionAttribute.cs index f90d983b..4f82131d 100644 --- a/Attributes/ServiceObjectDefinitionAttribute.cs +++ b/Attributes/ServiceObjectDefinitionAttribute.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ServiceObjectDefinitionAttribute attribute -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -52,4 +67,4 @@ public bool ReturnedByServer set { this.returnedByServer = value; } } } -} +} \ No newline at end of file diff --git a/Autodiscover/AlternateMailbox.cs b/Autodiscover/AlternateMailbox.cs index d1e3dc4b..6b227f66 100644 --- a/Autodiscover/AlternateMailbox.cs +++ b/Autodiscover/AlternateMailbox.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the AlternateMailbox class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Autodiscover { @@ -133,4 +148,4 @@ public string OwnerSmtpAddress internal set { this.ownerSmtpAddress = value; } } } -} +} \ No newline at end of file diff --git a/Autodiscover/AlternateMailboxCollection.cs b/Autodiscover/AlternateMailboxCollection.cs index 5e4bc32d..41945a93 100644 --- a/Autodiscover/AlternateMailboxCollection.cs +++ b/Autodiscover/AlternateMailboxCollection.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the AlternateMailboxCollection class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Autodiscover { @@ -58,4 +73,4 @@ public List Entries get; private set; } } -} +} \ No newline at end of file diff --git a/Autodiscover/AutodiscoverDnsClient.cs b/Autodiscover/AutodiscoverDnsClient.cs index 177cb739..c08aba0b 100644 --- a/Autodiscover/AutodiscoverDnsClient.cs +++ b/Autodiscover/AutodiscoverDnsClient.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//------------------------------------------------------------------------------ -// Defines the AutodiscoverDnsClient class. -//------------------------------------------------------------------------------ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Autodiscover { diff --git a/Autodiscover/AutodiscoverError.cs b/Autodiscover/AutodiscoverError.cs index dd0cd1ec..0e9ef994 100644 --- a/Autodiscover/AutodiscoverError.cs +++ b/Autodiscover/AutodiscoverError.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the AutodiscoverError class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Autodiscover { @@ -117,4 +132,4 @@ public string DebugData get { return this.debugData; } } } -} +} \ No newline at end of file diff --git a/Autodiscover/AutodiscoverResponseCollection.cs b/Autodiscover/AutodiscoverResponseCollection.cs index 1741019d..46a4d26a 100644 --- a/Autodiscover/AutodiscoverResponseCollection.cs +++ b/Autodiscover/AutodiscoverResponseCollection.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the AutodiscoverResponseCollection class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Autodiscover { @@ -151,4 +166,4 @@ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() #endregion } -} +} \ No newline at end of file diff --git a/Autodiscover/AutodiscoverService.cs b/Autodiscover/AutodiscoverService.cs index 35c09b8c..1d54831c 100644 --- a/Autodiscover/AutodiscoverService.cs +++ b/Autodiscover/AutodiscoverService.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ExchangeService class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Autodiscover { @@ -438,7 +453,7 @@ private TSettings InternalGetLegacyUserSettings( } // Assume caller is not inside the Intranet, regardless of whether SCP Urls - // were returned or not. SCP Urls are only relevent if one of them returns + // were returned or not. SCP Urls are only relevant if one of them returns // valid Autodiscover settings. this.isExternal = true; @@ -524,7 +539,7 @@ private TSettings InternalGetLegacyUserSettings( EwsUtilities.Assert( false, "Autodiscover.GetConfigurationSettings", - "An unexpected error has occured. This code path should never be reached."); + "An unexpected error has occurred. This code path should never be reached."); break; } } @@ -694,7 +709,7 @@ private bool TryLastChanceHostRedirection( this.DisableScpLookupIfDuplicateRedirection(settings.RedirectTarget, redirectionEmailAddresses); settings = this.InternalGetLegacyUserSettings( - emailAddress, + settings.RedirectTarget, redirectionEmailAddresses, ref currentHop); return true; @@ -1913,4 +1928,4 @@ public Func> GetScpUrlsForDomainCallback #endregion } -} +} \ No newline at end of file diff --git a/Autodiscover/ComparisonHelpers.cs b/Autodiscover/ComparisonHelpers.cs index 74873a9c..e6b90576 100644 --- a/Autodiscover/ComparisonHelpers.cs +++ b/Autodiscover/ComparisonHelpers.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ComparisonHelpers class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Autodiscover { @@ -41,4 +56,4 @@ internal static bool CaseInsensitiveContains(this ICollection collection, string return false; } } -} +} \ No newline at end of file diff --git a/Autodiscover/ConfigurationSettings/ConfigurationSettingsBase.cs b/Autodiscover/ConfigurationSettings/ConfigurationSettingsBase.cs index 643c7789..9ed447fe 100644 --- a/Autodiscover/ConfigurationSettings/ConfigurationSettingsBase.cs +++ b/Autodiscover/ConfigurationSettings/ConfigurationSettingsBase.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ConfigurationSettingsBase class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Autodiscover { @@ -116,4 +131,4 @@ internal AutodiscoverError Error get { return this.error; } } } -} +} \ No newline at end of file diff --git a/Autodiscover/ConfigurationSettings/Outlook/OutlookAccount.cs b/Autodiscover/ConfigurationSettings/Outlook/OutlookAccount.cs index a11428b7..d1b18a7b 100644 --- a/Autodiscover/ConfigurationSettings/Outlook/OutlookAccount.cs +++ b/Autodiscover/ConfigurationSettings/Outlook/OutlookAccount.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the OutlookAccount class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Autodiscover { @@ -148,4 +163,4 @@ internal string RedirectTarget get; set; } } -} +} \ No newline at end of file diff --git a/Autodiscover/ConfigurationSettings/Outlook/OutlookConfigurationSettings.cs b/Autodiscover/ConfigurationSettings/Outlook/OutlookConfigurationSettings.cs index 6bf475e1..e8399834 100644 --- a/Autodiscover/ConfigurationSettings/Outlook/OutlookConfigurationSettings.cs +++ b/Autodiscover/ConfigurationSettings/Outlook/OutlookConfigurationSettings.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the OutlookConfigurationSettings class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Autodiscover { @@ -217,4 +232,4 @@ internal override string RedirectTarget } } } -} +} \ No newline at end of file diff --git a/Autodiscover/ConfigurationSettings/Outlook/OutlookProtocol.cs b/Autodiscover/ConfigurationSettings/Outlook/OutlookProtocol.cs index 1a361cb2..737f6ddb 100644 --- a/Autodiscover/ConfigurationSettings/Outlook/OutlookProtocol.cs +++ b/Autodiscover/ConfigurationSettings/Outlook/OutlookProtocol.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the OutlookProtocol class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Autodiscover { @@ -510,4 +525,4 @@ internal static List AvailableUserSettings } } } -} +} \ No newline at end of file diff --git a/Autodiscover/ConfigurationSettings/Outlook/OutlookUser.cs b/Autodiscover/ConfigurationSettings/Outlook/OutlookUser.cs index 632fd0da..92621d01 100644 --- a/Autodiscover/ConfigurationSettings/Outlook/OutlookUser.cs +++ b/Autodiscover/ConfigurationSettings/Outlook/OutlookUser.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the OutlookUser class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Autodiscover { @@ -123,4 +138,4 @@ internal static IEnumerable AvailableUserSettings get { return converterDictionary.Member.Keys; } } } -} +} \ No newline at end of file diff --git a/Autodiscover/DirectoryHelper.cs b/Autodiscover/DirectoryHelper.cs index 33718cbc..da01415c 100644 --- a/Autodiscover/DirectoryHelper.cs +++ b/Autodiscover/DirectoryHelper.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the DirectoryHelper class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Autodiscover { @@ -179,7 +194,7 @@ private List GetScpUrlList( // Stop the current search, start another from a new location. this.TraceMessage( string.Format( - "SCP pointer for '{0}' is found in '{1}', restarting seach in '{2}'", + "SCP pointer for '{0}' is found in '{1}', restarting search in '{2}'", domainMatch, scpDirEntry.Path, scpPtrLdapPath)); @@ -389,4 +404,4 @@ internal ExchangeServiceBase Service #endregion } -} +} \ No newline at end of file diff --git a/Autodiscover/DocumentSharingLocation.cs b/Autodiscover/DocumentSharingLocation.cs index c1d6dbe8..80799d41 100644 --- a/Autodiscover/DocumentSharingLocation.cs +++ b/Autodiscover/DocumentSharingLocation.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the DocumentSharingLocation class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Autodiscover { @@ -285,4 +300,4 @@ internal static DocumentSharingLocation LoadFromXml(EwsXmlReader reader) return location; } } -} +} \ No newline at end of file diff --git a/Autodiscover/DocumentSharingLocationCollection.cs b/Autodiscover/DocumentSharingLocationCollection.cs index db2a9971..e93d8d4b 100644 --- a/Autodiscover/DocumentSharingLocationCollection.cs +++ b/Autodiscover/DocumentSharingLocationCollection.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the DocumentSharingLocationCollection class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Autodiscover { @@ -59,4 +74,4 @@ public List Entries get; private set; } } -} +} \ No newline at end of file diff --git a/Autodiscover/DomainSettingError.cs b/Autodiscover/DomainSettingError.cs index 436456af..15f8c60f 100644 --- a/Autodiscover/DomainSettingError.cs +++ b/Autodiscover/DomainSettingError.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the DomainSettingError class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Autodiscover { @@ -85,4 +100,4 @@ public string SettingName get { return this.settingName; } } } -} +} \ No newline at end of file diff --git a/Autodiscover/ProtocolConnection.cs b/Autodiscover/ProtocolConnection.cs index 6f56cb6a..a0a82d96 100644 --- a/Autodiscover/ProtocolConnection.cs +++ b/Autodiscover/ProtocolConnection.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ProtocolConnection class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Autodiscover { @@ -105,4 +120,4 @@ public int Port set { this.port = value; } } } -} +} \ No newline at end of file diff --git a/Autodiscover/ProtocolConnectionCollection.cs b/Autodiscover/ProtocolConnectionCollection.cs index f60f091b..282a9bd5 100644 --- a/Autodiscover/ProtocolConnectionCollection.cs +++ b/Autodiscover/ProtocolConnectionCollection.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ProtocolConnectionCollection class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Autodiscover { @@ -68,4 +83,4 @@ public List Connections internal set { this.connections = value; } } } -} +} \ No newline at end of file diff --git a/Autodiscover/Requests/AutodiscoverRequest.cs b/Autodiscover/Requests/AutodiscoverRequest.cs index cef629bc..3ced2404 100644 --- a/Autodiscover/Requests/AutodiscoverRequest.cs +++ b/Autodiscover/Requests/AutodiscoverRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the AutodiscoverRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Autodiscover { @@ -626,4 +641,4 @@ internal Uri Url get { return this.url; } } } -} +} \ No newline at end of file diff --git a/Autodiscover/Requests/GetDomainSettingsRequest.cs b/Autodiscover/Requests/GetDomainSettingsRequest.cs index 3ae681e9..5c883b78 100644 --- a/Autodiscover/Requests/GetDomainSettingsRequest.cs +++ b/Autodiscover/Requests/GetDomainSettingsRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetDomainSettingsRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Autodiscover { @@ -213,4 +228,4 @@ internal ExchangeVersion? RequestedVersion set { requestedVersion = value; } } } -} +} \ No newline at end of file diff --git a/Autodiscover/Requests/GetUserSettingsRequest.cs b/Autodiscover/Requests/GetUserSettingsRequest.cs index 1d699e01..31e9c751 100644 --- a/Autodiscover/Requests/GetUserSettingsRequest.cs +++ b/Autodiscover/Requests/GetUserSettingsRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetUserSettingsRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Autodiscover { @@ -273,4 +288,4 @@ internal string PartnerTokenReference private set; } } -} +} \ No newline at end of file diff --git a/Autodiscover/Responses/AutodiscoverResponse.cs b/Autodiscover/Responses/AutodiscoverResponse.cs index 2719b75a..2f1095f3 100644 --- a/Autodiscover/Responses/AutodiscoverResponse.cs +++ b/Autodiscover/Responses/AutodiscoverResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the AutodiscoverResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Autodiscover { @@ -83,4 +98,4 @@ internal Uri RedirectionUrl #endregion } -} +} \ No newline at end of file diff --git a/Autodiscover/Responses/GetDomainSettingsResponse.cs b/Autodiscover/Responses/GetDomainSettingsResponse.cs index 327f6e0e..6cf8a9f5 100644 --- a/Autodiscover/Responses/GetDomainSettingsResponse.cs +++ b/Autodiscover/Responses/GetDomainSettingsResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetDomainSettingsResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Autodiscover { @@ -199,4 +214,4 @@ private void LoadDomainSettingErrorsFromXml(EwsXmlReader reader) } } } -} +} \ No newline at end of file diff --git a/Autodiscover/Responses/GetDomainSettingsResponseCollection.cs b/Autodiscover/Responses/GetDomainSettingsResponseCollection.cs index 5cf56c7f..43ffbe0c 100644 --- a/Autodiscover/Responses/GetDomainSettingsResponseCollection.cs +++ b/Autodiscover/Responses/GetDomainSettingsResponseCollection.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetDomainSettingsResponseCollection class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Autodiscover { @@ -56,4 +71,4 @@ internal override string GetResponseInstanceXmlElementName() return XmlElementNames.DomainResponse; } } -} +} \ No newline at end of file diff --git a/Autodiscover/Responses/GetUserSettingsResponse.cs b/Autodiscover/Responses/GetUserSettingsResponse.cs index 1625caab..f0efc6e5 100644 --- a/Autodiscover/Responses/GetUserSettingsResponse.cs +++ b/Autodiscover/Responses/GetUserSettingsResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetUserSettingsResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Autodiscover { @@ -242,4 +257,4 @@ private void LoadUserSettingErrorsFromXml(EwsXmlReader reader) } } } -} +} \ No newline at end of file diff --git a/Autodiscover/Responses/GetUserSettingsResponseCollection.cs b/Autodiscover/Responses/GetUserSettingsResponseCollection.cs index 9e7bb080..c17191c4 100644 --- a/Autodiscover/Responses/GetUserSettingsResponseCollection.cs +++ b/Autodiscover/Responses/GetUserSettingsResponseCollection.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetUserSettingsResponseCollection class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Autodiscover { @@ -56,4 +71,4 @@ internal override string GetResponseInstanceXmlElementName() return XmlElementNames.UserResponse; } } -} +} \ No newline at end of file diff --git a/Autodiscover/UserSettingError.cs b/Autodiscover/UserSettingError.cs index 03657302..c736f695 100644 --- a/Autodiscover/UserSettingError.cs +++ b/Autodiscover/UserSettingError.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the UserSettingError class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Autodiscover { @@ -101,4 +116,4 @@ public string SettingName get; internal set; } } -} +} \ No newline at end of file diff --git a/Autodiscover/WebClientUrl.cs b/Autodiscover/WebClientUrl.cs index 11a39726..e2ee41ed 100644 --- a/Autodiscover/WebClientUrl.cs +++ b/Autodiscover/WebClientUrl.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the WebClientUrl class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Autodiscover { @@ -88,4 +103,4 @@ public string Url internal set { this.url = value; } } } -} +} \ No newline at end of file diff --git a/Autodiscover/WebClientUrlCollection.cs b/Autodiscover/WebClientUrlCollection.cs index ced7971c..3a85970d 100644 --- a/Autodiscover/WebClientUrlCollection.cs +++ b/Autodiscover/WebClientUrlCollection.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the WebClientUrlCollection class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Autodiscover { @@ -59,4 +74,4 @@ public List Urls get { return this.urls; } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/AddressEntity.cs b/ComplexProperties/AddressEntity.cs index 1d0aea5a..8c5f4801 100644 --- a/ComplexProperties/AddressEntity.cs +++ b/ComplexProperties/AddressEntity.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the AddressEntity class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -49,4 +64,4 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/AddressEntityCollection.cs b/ComplexProperties/AddressEntityCollection.cs index 361d303c..3752e508 100644 --- a/ComplexProperties/AddressEntityCollection.cs +++ b/ComplexProperties/AddressEntityCollection.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the AddressEntityCollection class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -50,15 +65,6 @@ internal override AddressEntity CreateComplexProperty(string xmlElementName) return new AddressEntity(); } - /// - /// Creates the default complex property. - /// - /// AddressEntity. - internal override AddressEntity CreateDefaultComplexProperty() - { - return new AddressEntity(); - } - /// /// Gets the name of the collection item XML element. /// @@ -69,4 +75,4 @@ internal override string GetCollectionItemXmlElementName(AddressEntity complexPr return XmlElementNames.NlgAddress; } } -} +} \ No newline at end of file diff --git a/ComplexProperties/AppointmentOccurrenceId.cs b/ComplexProperties/AppointmentOccurrenceId.cs index 8a596646..71569b7b 100644 --- a/ComplexProperties/AppointmentOccurrenceId.cs +++ b/ComplexProperties/AppointmentOccurrenceId.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the AppointmentOccurrenceId class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -45,7 +60,7 @@ public int OccurrenceIndex set { - // The occurence index has to be positive integer. + // The occurrence index has to be positive integer. if (value < 1) { throw new ArgumentException(Strings.OccurrenceIndexMustBeGreaterThanZero); @@ -73,23 +88,5 @@ internal override void WriteAttributesToXml(EwsServiceXmlWriter writer) writer.WriteAttributeValue(XmlAttributeNames.RecurringMasterId, this.UniqueId); writer.WriteAttributeValue(XmlAttributeNames.InstanceIndex, this.OccurrenceIndex); } - - /// - /// Serializes the property to a Json value. - /// - /// - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonProperty = new JsonObject(); - - jsonProperty.AddTypeParameter(this.GetXmlElementName()); - jsonProperty.Add(XmlAttributeNames.RecurringMasterId, this.UniqueId); - jsonProperty.Add(XmlAttributeNames.InstanceIndex, this.OccurrenceIndex); - - return jsonProperty; - } } -} +} \ No newline at end of file diff --git a/ComplexProperties/ApprovalRequestData.cs b/ComplexProperties/ApprovalRequestData.cs index fa50759c..6fef1322 100644 --- a/ComplexProperties/ApprovalRequestData.cs +++ b/ComplexProperties/ApprovalRequestData.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ApprovalRequestData class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -55,35 +70,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.IsUndecidedApprovalRequest: - this.isUndecidedApprovalRequest = jsonProperty.ReadAsBool(key); - break; - case XmlElementNames.ApprovalDecision: - this.approvalDecision = jsonProperty.ReadAsInt(key); - break; - case XmlElementNames.ApprovalDecisionMaker: - this.approvalDecisionMaker = jsonProperty.ReadAsString(key); - break; - case XmlElementNames.ApprovalDecisionTime: - this.approvalDecisionTime = service.ConvertUniversalDateTimeStringToLocalDateTime(jsonProperty.ReadAsString(key)).Value; - break; - default: - break; - } - } - } - /// /// Gets a value indicating whether this is an undecided approval request. /// @@ -116,4 +102,4 @@ public DateTime ApprovalDecisionTime get { return this.approvalDecisionTime; } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/ArchiveTag.cs b/ComplexProperties/ArchiveTag.cs index 87888ce7..15db2297 100644 --- a/ComplexProperties/ArchiveTag.cs +++ b/ComplexProperties/ArchiveTag.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ArchiveTag class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -37,4 +52,4 @@ public ArchiveTag(bool isExplicit, Guid retentionId) this.RetentionId = retentionId; } } -} +} \ No newline at end of file diff --git a/ComplexProperties/Attachment.cs b/ComplexProperties/Attachment.cs index c83ecbbf..142bb708 100644 --- a/ComplexProperties/Attachment.cs +++ b/ComplexProperties/Attachment.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the Attachment class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -267,67 +282,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json. - /// - /// The json property. - /// - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.AttachmentId: - this.LoadAttachmentIdFromJson(jsonProperty.ReadAsJsonObject(key)); - break; - case XmlElementNames.Name: - this.name = jsonProperty.ReadAsString(key); - break; - case XmlElementNames.ContentType: - this.contentType = jsonProperty.ReadAsString(key); - break; - case XmlElementNames.ContentId: - this.contentId = jsonProperty.ReadAsString(key); - break; - case XmlElementNames.ContentLocation: - this.contentLocation = jsonProperty.ReadAsString(key); - break; - case XmlElementNames.Size: - this.size = jsonProperty.ReadAsInt(key); - break; - case XmlElementNames.LastModifiedTime: - this.lastModifiedTime = service.ConvertUniversalDateTimeStringToLocalDateTime(jsonProperty.ReadAsString(key)).Value; - break; - case XmlElementNames.IsInline: - this.isInline = jsonProperty.ReadAsBool(key); - break; - default: - break; - } - } - } - - /// - /// Loads the attachment id from json. - /// - /// The json object. - private void LoadAttachmentIdFromJson(JsonObject jsonObject) - { - this.id = jsonObject.ReadAsString(XmlAttributeNames.Id); - - if (this.Owner != null && - jsonObject.ContainsKey(XmlAttributeNames.RootItemChangeKey)) - { - string rootItemChangeKey = jsonObject.ReadAsString(XmlAttributeNames.RootItemChangeKey); - - if (!string.IsNullOrEmpty(rootItemChangeKey)) - { - this.Owner.RootItemId.ChangeKey = rootItemChangeKey; - } - } - } - /// /// Writes elements to XML. /// @@ -344,30 +298,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) } } - /// - /// Serializes the property to a Json value. - /// - /// - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonProperty = new JsonObject(); - - jsonProperty.AddTypeParameter(this.GetXmlElementName()); - jsonProperty.Add(XmlElementNames.Name, this.Name); - jsonProperty.Add(XmlElementNames.ContentType, this.ContentType); - jsonProperty.Add(XmlElementNames.ContentId, this.ContentId); - jsonProperty.Add(XmlElementNames.ContentLocation, this.ContentLocation); - if (service.RequestedServerVersion > ExchangeVersion.Exchange2007_SP1) - { - jsonProperty.Add(XmlElementNames.IsInline, this.IsInline); - } - - return jsonProperty; - } - /// /// Load the attachment. /// @@ -397,4 +327,4 @@ public void Load() this.InternalLoad(null, null); } } -} +} \ No newline at end of file diff --git a/ComplexProperties/AttachmentCollection.cs b/ComplexProperties/AttachmentCollection.cs index da2fe492..b6c6521f 100644 --- a/ComplexProperties/AttachmentCollection.cs +++ b/ComplexProperties/AttachmentCollection.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Implements an attachment collection. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -139,6 +154,26 @@ public FileAttachment AddFileAttachment(string name, byte[] content) return fileAttachment; } + /// + /// Adds a reference attachment to the collection + /// + /// The display name of the new attachment. + /// The fully-qualified path identifying the attachment + /// A ReferenceAttachment instance + public ReferenceAttachment AddReferenceAttachment( + string name, + string attachLongPathName) + { + ReferenceAttachment referenceAttachment = new ReferenceAttachment(this.owner); + + referenceAttachment.Name = name; + referenceAttachment.AttachLongPathName = attachLongPathName; + + this.InternalAdd(referenceAttachment); + + return referenceAttachment; + } + /// /// Adds an item attachment to the collection /// @@ -210,20 +245,13 @@ internal override Attachment CreateComplexProperty(string xmlElementName) return new FileAttachment(this.owner); case XmlElementNames.ItemAttachment: return new ItemAttachment(this.owner); + case XmlElementNames.ReferenceAttachment: + return new ReferenceAttachment(this.owner); default: return null; } } - /// - /// Creates the default complex property. - /// - /// An Attachment instance. - internal override Attachment CreateDefaultComplexProperty() - { - throw new JsonDeserializationNotImplementedException(); - } - /// /// Determines the name of the XML element associated with the complexProperty parameter. /// @@ -235,6 +263,10 @@ internal override string GetCollectionItemXmlElementName(Attachment complexPrope { return XmlElementNames.FileAttachment; } + else if (complexProperty is ReferenceAttachment) + { + return XmlElementNames.ReferenceAttachment; + } else { return XmlElementNames.ItemAttachment; diff --git a/ComplexProperties/Attendee.cs b/ComplexProperties/Attendee.cs index 669a1fd7..aebf485d 100644 --- a/ComplexProperties/Attendee.cs +++ b/ComplexProperties/Attendee.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the Attendee class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -124,4 +139,4 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) writer.WriteEndElement(); } } -} +} \ No newline at end of file diff --git a/ComplexProperties/AttendeeCollection.cs b/ComplexProperties/AttendeeCollection.cs index b7738ecb..c073a5e5 100644 --- a/ComplexProperties/AttendeeCollection.cs +++ b/ComplexProperties/AttendeeCollection.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//------------------------------------------------------------------------------ -// Implements a collection of attendees. -//------------------------------------------------------------------------------ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -118,15 +133,6 @@ internal override Attendee CreateComplexProperty(string xmlElementName) } } - /// - /// Creates the default complex property. - /// - /// - internal override Attendee CreateDefaultComplexProperty() - { - return new Attendee(); - } - /// /// Retrieves the XML element name corresponding to the provided Attendee object. /// @@ -137,4 +143,4 @@ internal override string GetCollectionItemXmlElementName(Attendee attendee) return XmlElementNames.Attendee; } } -} +} \ No newline at end of file diff --git a/ComplexProperties/AttributedString.cs b/ComplexProperties/AttributedString.cs new file mode 100644 index 00000000..68097d2b --- /dev/null +++ b/ComplexProperties/AttributedString.cs @@ -0,0 +1,152 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + using System; + using System.Collections.Generic; + using System.Xml; + + /// + /// Represents an attributed string, a string with a value and a list of attributions. + /// + public sealed class AttributedString : ComplexProperty + { + /// + /// Internal attribution store + /// + private List attributionList; + + /// + /// String value + /// + public string Value { get; set; } + + /// + /// Attribution values + /// + public IList Attributions { get; set; } + + /// + /// Default constructor + /// + public AttributedString() + : base() + { + } + + /// + /// Constructor + /// + public AttributedString(string value) + : this() + { + EwsUtilities.ValidateParam(value, "value"); + this.Value = value; + } + + /// + /// Constructor + /// + /// String value + /// A list of attributions + public AttributedString(string value, IList attributions) + : this(value) + { + if (attributions == null) + { + throw new ArgumentNullException("attributions"); + } + + foreach (string s in attributions) + { + EwsUtilities.ValidateParam(s, "attributions"); + } + + this.Attributions = attributions; + } + + /// + /// Defines an implicit conversion from a regular string to an attributedString. + /// + /// String value of the attributed string being created + /// An attributed string initialized with the specified value + public static implicit operator AttributedString(string value) + { + return new AttributedString(value); + } + + /// + /// Tries to read an attributed string blob represented in XML. + /// + /// XML reader + /// Whether reading succeeded + internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) + { + switch (reader.LocalName) + { + case XmlElementNames.Value: + this.Value = reader.ReadElementValue(); + return true; + case XmlElementNames.Attributions: + return this.LoadAttributionsFromXml(reader); + default: + return false; + } + } + + /// + /// Read attribution blobs from XML + /// + /// XML reader + /// Whether reading succeeded + internal bool LoadAttributionsFromXml(EwsServiceXmlReader reader) + { + if (!reader.IsEmptyElement) + { + string localName = reader.LocalName; + this.attributionList = new List(); + + do + { + reader.Read(); + if (reader.NodeType == XmlNodeType.Element && + reader.LocalName == XmlElementNames.Attribution) + { + string s = reader.ReadElementValue(); + if (!string.IsNullOrEmpty(s)) + { + this.attributionList.Add(s); + } + } + } + while (!reader.IsEndElement(XmlNamespace.Types, localName)); + this.Attributions = this.attributionList.ToArray(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/ComplexProperties/AttributedStringCollection.cs b/ComplexProperties/AttributedStringCollection.cs new file mode 100644 index 00000000..690a2abe --- /dev/null +++ b/ComplexProperties/AttributedStringCollection.cs @@ -0,0 +1,169 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + using System.Collections.Generic; + + /// + /// Represents a collection of attributed strings + /// + public sealed class AttributedStringCollection : ComplexPropertyCollection + { + /// + /// Collection parent XML element name + /// + private readonly string collectionItemXmlElementName; + + /// + /// Creates a new instance of the class. + /// + internal AttributedStringCollection() + : this(XmlElementNames.StringAttributedValue) + { + } + + /// + /// Creates a new instance of the class. + /// + /// Name of the collection item XML element. + internal AttributedStringCollection(string collectionItemXmlElementName) + : base() + { + EwsUtilities.ValidateParam(collectionItemXmlElementName, "collectionItemXmlElementName"); + this.collectionItemXmlElementName = collectionItemXmlElementName; + } + + /// + /// Adds an attributed string to the collection. + /// + /// Attributed string to be added + public void Add(AttributedString attributedString) + { + this.InternalAdd(attributedString); + } + + /// + /// Adds multiple attributed strings to the collection. + /// + /// Attributed strings to be added + public void AddRange(IEnumerable attributedStrings) + { + if (attributedStrings != null) + { + foreach (AttributedString attributedString in attributedStrings) + { + this.Add(attributedString); + } + } + } + + /// + /// Adds an attributed string to the collection. + /// + /// The SMTP address used to initialize the e-mail address. + /// An AttributedString object initialized with the provided SMTP address. + public AttributedString Add(string stringValue) + { + AttributedString attributedString = new AttributedString(stringValue); + + this.Add(attributedString); + + return attributedString; + } + + /// + /// Adds a string value and list of attributions + /// + /// String value of the attributed string being added + /// Attributions of the attributed string being added + /// The added attributedString object + public AttributedString Add(string stringValue, IList attributions) + { + AttributedString attributedString = new AttributedString(stringValue, attributions); + + this.Add(attributedString); + + return attributedString; + } + + /// + /// Clears the collection. + /// + public void Clear() + { + this.InternalClear(); + } + + /// + /// Removes an attributed string from the collection. + /// + /// Attributed string to be removed + /// Whether succeeded + public bool Remove(AttributedString attributedString) + { + EwsUtilities.ValidateParam(attributedString, "attributedString"); + + return this.InternalRemove(attributedString); + } + + /// + /// Creates an AttributedString object from an XML element name. + /// + /// The XML element name from which to create the attributed string object + /// An AttributedString object + internal override AttributedString CreateComplexProperty(string xmlElementName) + { + EwsUtilities.ValidateParam(xmlElementName, "xmlElementName"); + if (xmlElementName == this.collectionItemXmlElementName) + { + return new AttributedString(); + } + else + { + return null; + } + } + + /// + /// Retrieves the XML element name corresponding to the provided AttributedString object. + /// + /// The AttributedString object from which to determine the XML element name. + /// The XML element name corresponding to the provided AttributedString object. + internal override string GetCollectionItemXmlElementName(AttributedString attributedString) + { + return this.collectionItemXmlElementName; + } + + /// + /// Determine whether we should write collection to XML or not. + /// + /// Always true, even if the collection is empty. + internal override bool ShouldWriteToRequest() + { + return true; + } + } +} \ No newline at end of file diff --git a/ComplexProperties/Attribution.cs b/ComplexProperties/Attribution.cs new file mode 100644 index 00000000..74c971e1 --- /dev/null +++ b/ComplexProperties/Attribution.cs @@ -0,0 +1,152 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + /// + /// Represents an attribution of an attributed string + /// + public sealed class Attribution : ComplexProperty + { + /// + /// Attribution id + /// + public string Id { get; set; } + + /// + /// Attribution source + /// + public ItemId SourceId { get; set; } + + /// + /// Display name + /// + public string DisplayName { get; set; } + + /// + /// Whether writable + /// + public bool IsWritable { get; set; } + + /// + /// Whether a quick contact + /// + public bool IsQuickContact { get; set; } + + /// + /// Whether hidden + /// + public bool IsHidden { get; set; } + + /// + /// Folder id + /// + public FolderId FolderId { get; set; } + + /// + /// Default constructor + /// + public Attribution() + : base() + { + } + + /// + /// Creates an instance with required values only + /// + /// Attribution id + /// Source Id + /// Display name + public Attribution(string id, ItemId sourceId, string displayName) + : this(id, sourceId, displayName, false, false, false, null) + { + } + + /// + /// Creates an instance with all values + /// + /// Attribution id + /// Source Id + /// Display name + /// Whether writable + /// Wther quick contact + /// Whether hidden + /// Folder id + public Attribution(string id, ItemId sourceId, string displayName, bool isWritable, bool isQuickContact, bool isHidden, FolderId folderId) + : this() + { + EwsUtilities.ValidateParam(id, "id"); + EwsUtilities.ValidateParam(displayName, "displayName"); + + this.Id = id; + this.SourceId = sourceId; + this.DisplayName = displayName; + this.IsWritable = isWritable; + this.IsQuickContact = isQuickContact; + this.IsHidden = isHidden; + this.FolderId = folderId; + } + + /// + /// Tries to read element from XML + /// + /// XML reader + /// Whether reading succeeded + internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) + { + switch (reader.LocalName) + { + case XmlElementNames.Id: + this.Id = reader.ReadElementValue(); + break; + case XmlElementNames.SourceId: + this.SourceId = new ItemId(); + this.SourceId.LoadFromXml(reader, reader.LocalName); + break; + case XmlElementNames.DisplayName: + this.DisplayName = reader.ReadElementValue(); + break; + case XmlElementNames.IsWritable: + this.IsWritable = reader.ReadElementValue(); + break; + case XmlElementNames.IsQuickContact: + this.IsQuickContact = reader.ReadElementValue(); + break; + case XmlElementNames.IsHidden: + this.IsHidden = reader.ReadElementValue(); + break; + case XmlElementNames.FolderId: + this.FolderId = new FolderId(); + this.FolderId.LoadFromXml(reader, reader.LocalName); + break; + + default: + return base.TryReadElementFromXml(reader); + } + + return true; + } + } +} \ No newline at end of file diff --git a/ComplexProperties/AttributionCollection.cs b/ComplexProperties/AttributionCollection.cs new file mode 100644 index 00000000..38745299 --- /dev/null +++ b/ComplexProperties/AttributionCollection.cs @@ -0,0 +1,128 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + using System.Collections.Generic; + + /// + /// Represents a collection of attributions + /// + public sealed class AttributionCollection : ComplexPropertyCollection + { + /// + /// XML element name + /// + private readonly string collectionItemXmlElementName; + + /// + /// Creates a new instance of the class. + /// + internal AttributionCollection() + : this(XmlElementNames.Attribution) + { + } + + /// + /// Creates a new instance of the class. + /// + /// Name of the collection item XML element. + internal AttributionCollection(string collectionItemXmlElementName) + : base() + { + EwsUtilities.ValidateParam(collectionItemXmlElementName, "collectionItemXmlElementName"); + this.collectionItemXmlElementName = collectionItemXmlElementName; + } + + /// + /// Adds an attribution to the collection. + /// + /// Attributions to be added + public void Add(Attribution attribution) + { + this.InternalAdd(attribution); + } + + /// + /// Adds multiple attributions to the collection. + /// + /// Attributions to be added + public void AddRange(IEnumerable attributions) + { + if (attributions != null) + { + foreach (Attribution attribution in attributions) + { + this.Add(attribution); + } + } + } + + /// + /// Clears the collection. + /// + public void Clear() + { + this.InternalClear(); + } + + /// + /// Creates an attribution object from an XML element name. + /// + /// Attribution XML node name + /// The attribution object created + internal override Attribution CreateComplexProperty(string xmlElementName) + { + EwsUtilities.ValidateParam(xmlElementName, "xmlElementName"); + if (xmlElementName == this.collectionItemXmlElementName) + { + return new Attribution(); + } + else + { + return null; + } + } + + /// + /// Retrieves the XML element name corresponding to the provided attribution object. + /// + /// The attribution object from which to determine the XML element name. + /// The XML element name corresponding to the provided attribution object. + internal override string GetCollectionItemXmlElementName(Attribution attribution) + { + return this.collectionItemXmlElementName; + } + + /// + /// Determine whether we should write collection to XML or not. + /// + /// Always true, even if the collection is empty. + internal override bool ShouldWriteToRequest() + { + return true; + } + } +} \ No newline at end of file diff --git a/ComplexProperties/Availability/CalendarEvent.cs b/ComplexProperties/Availability/CalendarEvent.cs index c3192c9f..dd47e4a0 100644 --- a/ComplexProperties/Availability/CalendarEvent.cs +++ b/ComplexProperties/Availability/CalendarEvent.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Implements the CalendarEvent class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -91,39 +106,5 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) return false; } } - - /// - /// Loads from json. - /// - /// The json property. - /// - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.StartTime: - this.startTime = EwsUtilities.ParseAsUnbiasedDatetimescopedToServicetimeZone( - jsonProperty.ReadAsString(key), - service); - break; - case XmlElementNames.EndTime: - this.endTime = EwsUtilities.ParseAsUnbiasedDatetimescopedToServicetimeZone( - jsonProperty.ReadAsString(key), - service); - break; - case XmlElementNames.BusyType: - this.freeBusyStatus = jsonProperty.ReadEnumValue(key); - break; - case XmlElementNames.CalendarEventDetails: - this.details = new CalendarEventDetails(); - this.details.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service); - break; - default: - break; - } - } - } } -} +} \ No newline at end of file diff --git a/ComplexProperties/Availability/CalendarEventDetails.cs b/ComplexProperties/Availability/CalendarEventDetails.cs index 14f7e5c7..34124b65 100644 --- a/ComplexProperties/Availability/CalendarEventDetails.cs +++ b/ComplexProperties/Availability/CalendarEventDetails.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Implements the CalendarEventDetails class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -74,47 +89,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json. - /// - /// The json property. - /// - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.ID: - this.storeId = jsonProperty.ReadAsString(key); - break; - case XmlElementNames.Subject: - this.subject = jsonProperty.ReadAsString(key); - break; - case XmlElementNames.Location: - this.location = jsonProperty.ReadAsString(key); - break; - case XmlElementNames.IsMeeting: - this.isMeeting = jsonProperty.ReadAsBool(key); - break; - case XmlElementNames.IsRecurring: - this.isRecurring = jsonProperty.ReadAsBool(key); - break; - case XmlElementNames.IsException: - this.isException = jsonProperty.ReadAsBool(key); - break; - case XmlElementNames.IsReminderSet: - this.isReminderSet = jsonProperty.ReadAsBool(key); - break; - case XmlElementNames.IsPrivate: - this.isPrivate = jsonProperty.ReadAsBool(key); - break; - default: - break; - } - } - } - /// /// Gets the store Id of the calendar event. /// @@ -179,4 +153,4 @@ public bool IsPrivate get { return this.isPrivate; } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/Availability/Conflict.cs b/ComplexProperties/Availability/Conflict.cs index 13aec1be..edcaa69a 100644 --- a/ComplexProperties/Availability/Conflict.cs +++ b/ComplexProperties/Availability/Conflict.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the Conflict class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -65,38 +80,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json. - /// - /// The json property. - /// - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.NumberOfMembers: - this.numberOfMembers = jsonProperty.ReadAsInt(key); - break; - case XmlElementNames.NumberOfMembersAvailable: - this.numberOfMembersAvailable = jsonProperty.ReadAsInt(key); - break; - case XmlElementNames.NumberOfMembersWithConflict: - this.numberOfMembersWithConflict = jsonProperty.ReadAsInt(key); - break; - case XmlElementNames.NumberOfMembersWithNoData: - this.numberOfMembersWithNoData = jsonProperty.ReadAsInt(key); - break; - case XmlElementNames.BusyType: - this.freeBusyStatus = jsonProperty.ReadEnumValue(key); - break; - default: - break; - } - } - } - /// /// Gets the type of the conflict. /// @@ -150,4 +133,4 @@ public LegacyFreeBusyStatus FreeBusyStatus get { return this.freeBusyStatus; } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/Availability/OofSettings.cs b/ComplexProperties/Availability/OofSettings.cs index 225f52ff..b2415c74 100644 --- a/ComplexProperties/Availability/OofSettings.cs +++ b/ComplexProperties/Availability/OofSettings.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the OofSettings class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -87,41 +102,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json. - /// - /// The json property. - /// - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.OofState: - this.state = jsonProperty.ReadEnumValue(key); - break; - case XmlElementNames.ExternalAudience: - this.externalAudience = jsonProperty.ReadEnumValue(key); - break; - case XmlElementNames.Duration: - this.duration = new TimeWindow(); - this.duration.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service); - break; - case XmlElementNames.InternalReply: - this.internalReply = new OofReply(); - this.internalReply.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service); - break; - case XmlElementNames.ExternalReply: - this.externalReply = new OofReply(); - this.externalReply.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service); - break; - default: - break; - } - } - } - /// /// Writes elements to XML. /// @@ -155,31 +135,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) XmlElementNames.ExternalReply); } - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonProperty = new JsonObject(); - - jsonProperty.Add(XmlElementNames.OofState, this.State); - jsonProperty.Add(XmlElementNames.ExternalAudience, this.ExternalAudience); - - if (this.Duration != null && this.State == OofState.Scheduled) - { - jsonProperty.Add(XmlElementNames.Duration, this.Duration.InternalToJson(service)); - } - - if (this.InternalReply != null) - { - jsonProperty.Add(XmlElementNames.InternalReply, this.InternalReply.InternalToJson(service)); - } - - if (this.ExternalReply != null) - { - jsonProperty.Add(XmlElementNames.ExternalReply, this.ExternalReply.InternalToJson(service)); - } - - return jsonProperty; - } - /// /// Gets or sets the user's OOF state. /// @@ -255,4 +210,4 @@ void ISelfValidate.Validate() #endregion } -} +} \ No newline at end of file diff --git a/ComplexProperties/Availability/Suggestion.cs b/ComplexProperties/Availability/Suggestion.cs index 92b7b1a9..d6d83b12 100644 --- a/ComplexProperties/Availability/Suggestion.cs +++ b/ComplexProperties/Availability/Suggestion.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the Suggestion class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -84,26 +99,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - this.date = DateTime.Parse(jsonProperty.ReadAsString(XmlElementNames.Date)); - this.quality = jsonProperty.ReadEnumValue(XmlElementNames.DayQuality); - - foreach (object jsonSuggestion in jsonProperty.ReadAsArray(XmlElementNames.SuggestionArray)) - { - TimeSuggestion timeSuggestion = new TimeSuggestion(); - - timeSuggestion.LoadFromJson(jsonSuggestion as JsonObject, service); - - this.timeSuggestions.Add(timeSuggestion); - } - } - /// /// Gets the date and time of the suggestion. /// diff --git a/ComplexProperties/Availability/TimeSuggestion.cs b/ComplexProperties/Availability/TimeSuggestion.cs index 82205898..584eea03 100644 --- a/ComplexProperties/Availability/TimeSuggestion.cs +++ b/ComplexProperties/Availability/TimeSuggestion.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the TimeSuggestion class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -100,72 +115,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.MeetingTime: - this.meetingTime = EwsUtilities.ParseAsUnbiasedDatetimescopedToServicetimeZone(jsonProperty.ReadAsString(key), service); - break; - case XmlElementNames.IsWorkTime: - this.isWorkTime = jsonProperty.ReadAsBool(key); - break; - case XmlElementNames.SuggestionQuality: - this.quality = jsonProperty.ReadEnumValue(key); - break; - case XmlElementNames.AttendeeConflictDataArray: - object[] jsonConflictArray = jsonProperty.ReadAsArray(key); - foreach (object conflictObject in jsonConflictArray) - { - JsonObject jsonConflict = conflictObject as JsonObject; - if (jsonConflict != null) - { - Conflict conflict = null; - - switch (jsonConflict.ReadTypeString()) - { - case XmlElementNames.UnknownAttendeeConflictData: - conflict = new Conflict(ConflictType.UnknownAttendeeConflict); - break; - case XmlElementNames.TooBigGroupAttendeeConflictData: - conflict = new Conflict(ConflictType.GroupTooBigConflict); - break; - case XmlElementNames.IndividualAttendeeConflictData: - conflict = new Conflict(ConflictType.IndividualAttendeeConflict); - break; - case XmlElementNames.GroupAttendeeConflictData: - conflict = new Conflict(ConflictType.GroupConflict); - break; - default: - EwsUtilities.Assert( - false, - "TimeSuggestion.TryReadElementFromJson", - string.Format("The {0} element name does not map to any AttendeeConflict descendant.", jsonConflict.ReadTypeString())); - - // The following line to please the compiler - break; - } - - conflict.LoadFromJson(jsonConflict, service); - - this.conflicts.Add(conflict); - } - } - - break; - default: - break; - } - } - } - /// /// Gets the suggested time. /// @@ -198,4 +147,4 @@ public Collection Conflicts get { return this.conflicts; } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/Availability/WorkingHours.cs b/ComplexProperties/Availability/WorkingHours.cs index b5c7f815..941d63e1 100644 --- a/ComplexProperties/Availability/WorkingHours.cs +++ b/ComplexProperties/Availability/WorkingHours.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the WorkingHours class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -94,71 +109,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.TimeZone: - LegacyAvailabilityTimeZone legacyTimeZone = new LegacyAvailabilityTimeZone(); - legacyTimeZone.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service); - - this.timeZone = legacyTimeZone.ToTimeZoneInfo(); - - break; - case XmlElementNames.WorkingPeriodArray: - List workingPeriods = new List(); - - object[] workingPeriodsArray = jsonProperty.ReadAsArray(key); - - foreach (object workingPeriodEntry in workingPeriodsArray) - { - JsonObject jsonWorkingPeriodEntry = workingPeriodEntry as JsonObject; - - if (jsonWorkingPeriodEntry != null) - { - WorkingPeriod workingPeriod = new WorkingPeriod(); - - workingPeriod.LoadFromJson(jsonWorkingPeriodEntry, service); - - workingPeriods.Add(workingPeriod); - } - } - - // Availability supports a structure that can technically represent different working - // times for each day of the week. This is apparently how the information is stored in - // Exchange. However, no client (Outlook, OWA) either will let you specify different - // working times for each day of the week, and Outlook won't either honor that complex - // structure if it happens to be in Exchange. - // So here we'll do what Outlook and OWA do: we'll use the start and end times of the - // first working period, but we'll use the week days of all the periods. - this.startTime = workingPeriods[0].StartTime; - this.endTime = workingPeriods[0].EndTime; - - foreach (WorkingPeriod workingPeriod in workingPeriods) - { - foreach (DayOfTheWeek dayOfWeek in workingPeriods[0].DaysOfWeek) - { - if (!this.daysOfTheWeek.Contains(dayOfWeek)) - { - this.daysOfTheWeek.Add(dayOfWeek); - } - } - } - - break; - default: - break; - } - } - } - /// /// Gets the time zone to which the working hours apply. /// @@ -191,4 +141,4 @@ public TimeSpan EndTime get { return this.endTime; } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/Availability/WorkingPeriod.cs b/ComplexProperties/Availability/WorkingPeriod.cs index cc371ea9..d0b138a6 100644 --- a/ComplexProperties/Availability/WorkingPeriod.cs +++ b/ComplexProperties/Availability/WorkingPeriod.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the WorkingPeriod class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -58,35 +73,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.DayOfWeek: - EwsUtilities.ParseEnumValueList( - this.daysOfWeek, - jsonProperty.ReadAsString(key), - ' '); - break; - case XmlElementNames.StartTimeInMinutes: - this.startTime = TimeSpan.FromMinutes(jsonProperty.ReadAsInt(key)); - break; - case XmlElementNames.EndTimeInMinutes: - this.endTime = TimeSpan.FromMinutes(jsonProperty.ReadAsInt(key)); - break; - default: - break; - } - } - } - /// /// Gets a collection of work days. /// @@ -111,4 +97,4 @@ internal TimeSpan EndTime get { return this.endTime; } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/ByteArrayArray.cs b/ComplexProperties/ByteArrayArray.cs index 7e694175..2cc1e4c4 100644 --- a/ComplexProperties/ByteArrayArray.cs +++ b/ComplexProperties/ByteArrayArray.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ByteArrayArray class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -18,7 +33,7 @@ namespace Microsoft.Exchange.WebServices.Data /// /// Represents an array of byte arrays /// - public sealed class ByteArrayArray : ComplexProperty, IJsonCollectionDeserializer + public sealed class ByteArrayArray : ComplexProperty { private const string ItemXmlElementName = "Base64Binary"; private List content = new List(); @@ -53,29 +68,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json collection. - /// - /// The json collection. - /// The service. - void IJsonCollectionDeserializer.CreateFromJsonCollection(object[] jsonCollection, ExchangeService service) - { - foreach (object element in jsonCollection) - { - this.content.Add(Convert.FromBase64String(element as string)); - } - } - - /// - /// Loads from json collection to update the existing collection element. - /// - /// The json collection. - /// The service. - void IJsonCollectionDeserializer.UpdateFromJsonCollection(object[] jsonCollection, ExchangeService service) - { - throw new NotImplementedException(); - } - /// /// Writes the elements to XML. /// @@ -89,22 +81,5 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) writer.WriteEndElement(); } } - - /// - /// Serializes the property to a Json value. - /// - /// - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - List base64Strings = new List(this.content.Count); - foreach (byte[] item in this.content) - { - base64Strings.Add(Convert.ToBase64String(item)); - } - return base64Strings.ToArray(); - } } -} +} \ No newline at end of file diff --git a/ComplexProperties/ChangeHighlights.cs b/ComplexProperties/ChangeHighlights.cs index bd606b45..b2b066a8 100644 --- a/ComplexProperties/ChangeHighlights.cs +++ b/ComplexProperties/ChangeHighlights.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ChangeHighlights class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -63,41 +78,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.HasLocationChanged: - this.hasLocationChanged = jsonProperty.ReadAsBool(key); - break; - case XmlElementNames.Location: - this.location = jsonProperty.ReadAsString(key); - break; - case XmlElementNames.HasStartTimeChanged: - this.hasStartTimeChanged = jsonProperty.ReadAsBool(key); - break; - case XmlElementNames.Start: - this.start = service.ConvertUniversalDateTimeStringToLocalDateTime(jsonProperty.ReadAsString(key)).Value; - break; - case XmlElementNames.HasEndTimeChanged: - this.hasEndTimeChanged = jsonProperty.ReadAsBool(key); - break; - case XmlElementNames.End: - this.end = service.ConvertUniversalDateTimeStringToLocalDateTime(jsonProperty.ReadAsString(key)).Value; - break; - default: - break; - } - } - } - /// /// Gets a value indicating whether the location has changed. /// @@ -146,4 +126,4 @@ public DateTime End get { return this.end; } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/ClientAccessTokenRequest.cs b/ComplexProperties/ClientAccessTokenRequest.cs index 9259477c..a8bf850d 100644 --- a/ComplexProperties/ClientAccessTokenRequest.cs +++ b/ComplexProperties/ClientAccessTokenRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ClientAccessTokenRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -69,4 +84,4 @@ public string Scope get { return this.scope; } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/ClientApp.cs b/ComplexProperties/ClientApp.cs index 29f2cefa..281fbbe0 100644 --- a/ComplexProperties/ClientApp.cs +++ b/ComplexProperties/ClientApp.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ClientApp class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -87,4 +102,4 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/ClientAppMetadata.cs b/ComplexProperties/ClientAppMetadata.cs index 0fc5671c..6e4f426d 100644 --- a/ComplexProperties/ClientAppMetadata.cs +++ b/ComplexProperties/ClientAppMetadata.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ClientAppMetadata class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -78,4 +93,4 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/ClientExtension.cs b/ComplexProperties/ClientExtension.cs index 58573c87..2bb65d9f 100644 --- a/ComplexProperties/ClientExtension.cs +++ b/ComplexProperties/ClientExtension.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ClientExtension class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -267,4 +282,4 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/CompleteName.cs b/ComplexProperties/CompleteName.cs index 7c6e0b02..8ea7f41f 100644 --- a/ComplexProperties/CompleteName.cs +++ b/ComplexProperties/CompleteName.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the CompleteName class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -159,53 +174,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json. - /// - /// The json property. - /// - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.Title: - this.title = jsonProperty.ReadAsString(key); - break; - case XmlElementNames.FirstName: - this.givenName = jsonProperty.ReadAsString(key); - break; - case XmlElementNames.MiddleName: - this.middleName = jsonProperty.ReadAsString(key); - break; - case XmlElementNames.LastName: - this.surname = jsonProperty.ReadAsString(key); - break; - case XmlElementNames.Suffix: - this.suffix = jsonProperty.ReadAsString(key); - break; - case XmlElementNames.Initials: - this.initials = jsonProperty.ReadAsString(key); - break; - case XmlElementNames.FullName: - this.fullName = jsonProperty.ReadAsString(key); - break; - case XmlElementNames.NickName: - this.nickname = jsonProperty.ReadAsString(key); - break; - case XmlElementNames.YomiFirstName: - this.yomiGivenName = jsonProperty.ReadAsString(key); - break; - case XmlElementNames.YomiLastName: - this.yomiSurname = jsonProperty.ReadAsString(key); - break; - default: - break; - } - } - } - /// /// Writes the elements to XML. /// @@ -223,30 +191,5 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.YomiFirstName, this.YomiGivenName); writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.YomiLastName, this.YomiSurname); } - - /// - /// Serializes the property to a Json value. - /// - /// - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonProperty = new JsonObject(); - - jsonProperty.Add(XmlElementNames.Title, this.Title); - jsonProperty.Add(XmlElementNames.FirstName, this.GivenName); - jsonProperty.Add(XmlElementNames.MiddleName, this.MiddleName); - jsonProperty.Add(XmlElementNames.LastName, this.Surname); - jsonProperty.Add(XmlElementNames.Suffix, this.Suffix); - jsonProperty.Add(XmlElementNames.Initials, this.Initials); - jsonProperty.Add(XmlElementNames.FullName, this.FullName); - jsonProperty.Add(XmlElementNames.NickName, this.NickName); - jsonProperty.Add(XmlElementNames.YomiFirstName, this.YomiGivenName); - jsonProperty.Add(XmlElementNames.YomiLastName, this.YomiSurname); - - return jsonProperty; - } } -} +} \ No newline at end of file diff --git a/ComplexProperties/ComplexProperty.cs b/ComplexProperties/ComplexProperty.cs index 5d160d61..20455abc 100644 --- a/ComplexProperties/ComplexProperty.cs +++ b/ComplexProperties/ComplexProperty.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ComplexProperty class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -20,7 +35,7 @@ namespace Microsoft.Exchange.WebServices.Data /// Represents a property that can be sent to or retrieved from EWS. /// [EditorBrowsable(EditorBrowsableState.Never)] - public abstract class ComplexProperty : ISelfValidate, IJsonSerializable + public abstract class ComplexProperty : ISelfValidate { private XmlNamespace xmlNamespace = XmlNamespace.Types; @@ -246,16 +261,6 @@ internal virtual void UpdateFromXml(EwsServiceXmlReader reader, string xmlElemen xmlElementName); } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal virtual void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - throw new NotImplementedException(); - } - /// /// Writes to XML. /// @@ -286,31 +291,6 @@ internal virtual void WriteToXml(EwsServiceXmlWriter writer, string xmlElementNa xmlElementName); } - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object IJsonSerializable.ToJson(ExchangeService service) - { - return this.InternalToJson(service); - } - - /// - /// Serializes the property to a Json value. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - ////internal abstract object InternalToJson(ExchangeService service); - internal virtual object InternalToJson(ExchangeService service) - { - throw new NotImplementedException(); - } - /// /// Occurs when property changed. /// @@ -331,4 +311,4 @@ internal virtual void InternalValidate() { } } -} +} \ No newline at end of file diff --git a/ComplexProperties/ComplexPropertyCollection.cs b/ComplexProperties/ComplexPropertyCollection.cs index d3322345..41b7a356 100644 --- a/ComplexProperties/ComplexPropertyCollection.cs +++ b/ComplexProperties/ComplexPropertyCollection.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ComplexPropertyCollection class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -20,7 +35,7 @@ namespace Microsoft.Exchange.WebServices.Data /// /// ComplexProperty type. [EditorBrowsable(EditorBrowsableState.Never)] - public abstract class ComplexPropertyCollection : ComplexProperty, IEnumerable, ICustomUpdateSerializer, IJsonCollectionDeserializer + public abstract class ComplexPropertyCollection : ComplexProperty, IEnumerable, ICustomUpdateSerializer where TComplexProperty : ComplexProperty { private List items = new List(); @@ -35,12 +50,6 @@ public abstract class ComplexPropertyCollection : ComplexPrope /// Complex property instance. internal abstract TComplexProperty CreateComplexProperty(string xmlElementName); - /// - /// Creates the default complex property. - /// - /// Complex property instance. - internal abstract TComplexProperty CreateDefaultComplexProperty(); - /// /// Gets the name of the collection item XML element. /// @@ -167,88 +176,6 @@ internal override void UpdateFromXml( } } - /// - /// Loads from json. - /// - /// The json collection. - /// The service. - void IJsonCollectionDeserializer.CreateFromJsonCollection(object[] jsonCollection, ExchangeService service) - { - foreach (object jsonObject in jsonCollection) - { - JsonObject jsonProperty = jsonObject as JsonObject; - - if (jsonProperty != null) - { - TComplexProperty complexProperty = null; - - // If type property is present, use it. Otherwise create default property instance. - // Note: polymorphic collections (such as Attachments) need a type property so - // the CreateDefaultComplexProperty call will fail. - if (jsonProperty.HasTypeProperty()) - { - complexProperty = this.CreateComplexProperty(jsonProperty.ReadTypeString()); - } - else - { - complexProperty = this.CreateDefaultComplexProperty(); - } - - if (complexProperty != null) - { - complexProperty.LoadFromJson(jsonProperty, service); - this.InternalAdd(complexProperty, true); - } - } - } - } - - /// - /// Loads from json to update existing property. - /// - /// The json collection. - /// The service. - void IJsonCollectionDeserializer.UpdateFromJsonCollection(object[] jsonCollection, ExchangeService service) - { - if (this.Count != jsonCollection.Length) - { - throw new ServiceLocalException(Strings.PropertyCollectionSizeMismatch); - } - - int index = 0; - foreach (object jsonObject in jsonCollection) - { - JsonObject jsonProperty = jsonObject as JsonObject; - - if (jsonProperty != null) - { - TComplexProperty expectedComplexProperty = null; - - if (jsonProperty.HasTypeProperty()) - { - expectedComplexProperty = this.CreateComplexProperty(jsonProperty.ReadTypeString()); - } - else - { - expectedComplexProperty = this.CreateDefaultComplexProperty(); - } - - TComplexProperty actualComplexProperty = this[index++]; - - if (expectedComplexProperty == null || !expectedComplexProperty.GetType().IsInstanceOfType(actualComplexProperty)) - { - throw new ServiceLocalException(Strings.PropertyTypeIncompatibleWhenUpdatingCollection); - } - - actualComplexProperty.LoadFromJson(jsonProperty, service); - } - else - { - throw new ServiceLocalException(); - } - } - } - /// /// Writes to XML. /// @@ -269,25 +196,6 @@ internal override void WriteToXml( } } - /// - /// Serializes the property to a Json value. - /// - /// - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - List jsonPropertyCollection = new List(); - - foreach (TComplexProperty complexProperty in this) - { - jsonPropertyCollection.Add(complexProperty.InternalToJson(service)); - } - - return jsonPropertyCollection.ToArray(); - } - /// /// Determine whether we should write collection to XML or not. /// @@ -574,50 +482,6 @@ bool ICustomUpdateSerializer.WriteDeleteUpdateToXml(EwsServiceXmlWriter writer, return false; } - /// - /// Writes the update to Json. - /// - /// The service. - /// The ews object. - /// Property definition. - /// The updates. - /// - /// True if property generated serialization. - /// - bool ICustomUpdateSerializer.WriteSetUpdateToJson(ExchangeService service, ServiceObject ewsObject, PropertyDefinition propertyDefinition, List updates) - { - // If the collection is empty, delete the property. - if (this.Count == 0) - { - JsonObject jsonUpdate = new JsonObject(); - - jsonUpdate.AddTypeParameter(ewsObject.GetDeleteFieldXmlElementName()); - jsonUpdate.Add(JsonNames.Path, (propertyDefinition as IJsonSerializable).ToJson(service)); - return true; - } - - // Otherwise, use the default Json serializer. - else - { - return false; - } - } - - /// - /// Writes the deletion update to Json. - /// - /// The service. - /// The ews object. - /// The updates. - /// - /// True if property generated serialization. - /// - bool ICustomUpdateSerializer.WriteDeleteUpdateToJson(ExchangeService service, ServiceObject ewsObject, List updates) - { - // Use the default Json serializer. - return false; - } - #endregion } -} +} \ No newline at end of file diff --git a/ComplexProperties/ContactEntity.cs b/ComplexProperties/ContactEntity.cs index 11672727..e153366c 100644 --- a/ComplexProperties/ContactEntity.cs +++ b/ComplexProperties/ContactEntity.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ContactEntity class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -107,4 +122,4 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/ContactEntityCollection.cs b/ComplexProperties/ContactEntityCollection.cs index 7fe70ee8..0e05a219 100644 --- a/ComplexProperties/ContactEntityCollection.cs +++ b/ComplexProperties/ContactEntityCollection.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ContactEntityCollection class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -50,15 +65,6 @@ internal override ContactEntity CreateComplexProperty(string xmlElementName) return new ContactEntity(); } - /// - /// Creates the default complex property. - /// - /// ContactEntity. - internal override ContactEntity CreateDefaultComplexProperty() - { - return new ContactEntity(); - } - /// /// Gets the name of the collection item XML element. /// @@ -69,4 +75,4 @@ internal override string GetCollectionItemXmlElementName(ContactEntity complexPr return XmlElementNames.NlgContact; } } -} +} \ No newline at end of file diff --git a/ComplexProperties/ContactPhoneEntity.cs b/ComplexProperties/ContactPhoneEntity.cs index d1cd88a6..47c4117f 100644 --- a/ComplexProperties/ContactPhoneEntity.cs +++ b/ComplexProperties/ContactPhoneEntity.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ContactPhoneEntity class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -67,4 +82,4 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/ContactPhoneEntityCollection.cs b/ComplexProperties/ContactPhoneEntityCollection.cs index 4b6fa3de..f73d7527 100644 --- a/ComplexProperties/ContactPhoneEntityCollection.cs +++ b/ComplexProperties/ContactPhoneEntityCollection.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ContactPhoneEntityCollection class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -50,15 +65,6 @@ internal override ContactPhoneEntity CreateComplexProperty(string xmlElementName return new ContactPhoneEntity(); } - /// - /// Creates the default complex property. - /// - /// ContactPhoneEntity. - internal override ContactPhoneEntity CreateDefaultComplexProperty() - { - return new ContactPhoneEntity(); - } - /// /// Gets the name of the collection item XML element. /// @@ -69,4 +75,4 @@ internal override string GetCollectionItemXmlElementName(ContactPhoneEntity comp return XmlElementNames.NlgPhone; } } -} +} \ No newline at end of file diff --git a/ComplexProperties/ConversationId.cs b/ComplexProperties/ConversationId.cs index 21724753..811ac0b0 100644 --- a/ComplexProperties/ConversationId.cs +++ b/ComplexProperties/ConversationId.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ConversationId class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -69,11 +84,6 @@ internal override string GetXmlElementName() return XmlElementNames.ConversationId; } - internal override string GetJsonTypeName() - { - return XmlElementNames.ItemId; - } - /// /// Initializes a new instance of ConversationId. /// diff --git a/ComplexProperties/ConversationNode.cs b/ComplexProperties/ConversationNode.cs index 6e7870fd..ae37abf8 100644 --- a/ComplexProperties/ConversationNode.cs +++ b/ComplexProperties/ConversationNode.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ConversationNode class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -77,34 +92,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - this.InternetMessageId = jsonProperty.ReadAsString(XmlElementNames.ConversationIndex); - - if (jsonProperty.ContainsKey(XmlElementNames.ParentInternetMessageId)) - { - this.ParentInternetMessageId = jsonProperty.ReadAsString(XmlElementNames.ParentInternetMessageId); - } - - if (jsonProperty.ContainsKey(XmlElementNames.Items)) - { - EwsServiceJsonReader jsonReader = new EwsServiceJsonReader(service); - - this.Items = jsonReader.ReadServiceObjectsCollectionFromJson( - jsonProperty, - XmlElementNames.Items, - this.GetObjectInstance, - false, /* clearPropertyBag */ - this.propertySet, /* requestedPropertySet */ - false); /* summaryPropertiesOnly */ - } - } - /// /// Gets the item instance. /// @@ -125,4 +112,4 @@ internal string GetXmlElementName() return XmlElementNames.ConversationNode; } } -} +} \ No newline at end of file diff --git a/ComplexProperties/ConversationNodeCollection.cs b/ComplexProperties/ConversationNodeCollection.cs index f878003a..df11edf8 100644 --- a/ComplexProperties/ConversationNodeCollection.cs +++ b/ComplexProperties/ConversationNodeCollection.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ConversationNodeCollection class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -17,7 +32,7 @@ namespace Microsoft.Exchange.WebServices.Data /// Represents a collection of conversation items. /// [EditorBrowsable(EditorBrowsableState.Never)] - public sealed class ConversationNodeCollection : ComplexPropertyCollection, IJsonCollectionDeserializer + public sealed class ConversationNodeCollection : ComplexPropertyCollection { private PropertySet propertySet; @@ -41,15 +56,6 @@ internal override ConversationNode CreateComplexProperty(string xmlElementName) return new ConversationNode(this.propertySet); } - /// - /// Creates the default complex property. - /// - /// ConversationItem. - internal override ConversationNode CreateDefaultComplexProperty() - { - return new ConversationNode(this.propertySet); - } - /// /// Gets the name of the collection item XML element. /// @@ -59,39 +65,5 @@ internal override string GetCollectionItemXmlElementName(ConversationNode comple { return complexProperty.GetXmlElementName(); } - - #region IJsonCollectionDeserializer Members - - /// - /// Loads from json collection. - /// - /// The json collection. - /// The service. - void IJsonCollectionDeserializer.CreateFromJsonCollection(object[] jsonCollection, ExchangeService service) - { - foreach (object collectionEntry in jsonCollection) - { - JsonObject jsonEntry = collectionEntry as JsonObject; - - if (jsonEntry != null) - { - ConversationNode node = new ConversationNode(this.propertySet); - node.LoadFromJson(jsonEntry, service); - this.InternalAdd(node); - } - } - } - - /// - /// Loads from json collection to update the existing collection element. - /// - /// The json collection. - /// The service. - void IJsonCollectionDeserializer.UpdateFromJsonCollection(object[] jsonCollection, ExchangeService service) - { - throw new NotImplementedException(); - } - - #endregion } -} +} \ No newline at end of file diff --git a/ComplexProperties/ConversationRequest.cs b/ComplexProperties/ConversationRequest.cs index 52ea5b5e..586d6b16 100644 --- a/ComplexProperties/ConversationRequest.cs +++ b/ComplexProperties/ConversationRequest.cs @@ -1,19 +1,34 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ConversationRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { /// /// /// - public sealed class ConversationRequest : ComplexProperty, ISelfValidate, IJsonSerializable + public sealed class ConversationRequest : ComplexProperty, ISelfValidate { /// /// Initializes a new instance of the class. @@ -62,26 +77,6 @@ internal override void WriteToXml(EwsServiceXmlWriter writer, string xmlElementN writer.WriteEndElement(); } - /// - /// Serializes the property to a Json value. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonProperty = new JsonObject(); - - jsonProperty.Add(XmlElementNames.ConversationId, this.ConversationId.InternalToJson(service)); - if (!string.IsNullOrEmpty(this.SyncState)) - { - jsonProperty.Add(XmlElementNames.SyncState, this.SyncState); - } - - return jsonProperty; - } - /// /// Validates this instance. /// @@ -90,4 +85,4 @@ internal override void InternalValidate() EwsUtilities.ValidateParam(this.ConversationId, "ConversationId"); } } -} +} \ No newline at end of file diff --git a/ComplexProperties/ConversationResponse.cs b/ComplexProperties/ConversationResponse.cs index 4d40b035..9dc07024 100644 --- a/ComplexProperties/ConversationResponse.cs +++ b/ComplexProperties/ConversationResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ConversationResponseType class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -74,26 +89,5 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) return false; } } - - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - this.ConversationId = new ConversationId(); - this.ConversationId.LoadFromJson(jsonProperty.ReadAsJsonObject(XmlElementNames.ConversationId), service); - - if (jsonProperty.ContainsKey(XmlElementNames.SyncState)) - { - this.SyncState = jsonProperty.ReadAsString(XmlElementNames.SyncState); - } - - this.ConversationNodes = new ConversationNodeCollection(this.propertySet); - ((IJsonCollectionDeserializer)this.ConversationNodes).CreateFromJsonCollection( - jsonProperty.ReadAsArray(XmlElementNames.ConversationNodes), - service); - } } -} +} \ No newline at end of file diff --git a/ComplexProperties/CreateRuleOperation.cs b/ComplexProperties/CreateRuleOperation.cs index b71a17d4..913aed3c 100644 --- a/ComplexProperties/CreateRuleOperation.cs +++ b/ComplexProperties/CreateRuleOperation.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the CreateRuleOperation class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -63,22 +78,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) this.Rule.WriteToXml(writer, XmlElementNames.Rule); } - /// - /// Serializes the property to a Json value. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonProperty = new JsonObject(); - - jsonProperty.Add(XmlElementNames.Rule, this.Rule.InternalToJson(service)); - - return jsonProperty; - } - /// /// Validates this instance. /// @@ -98,4 +97,4 @@ internal override string XmlElementName } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/DelegatePermissions.cs b/ComplexProperties/DelegatePermissions.cs index 45cc3715..3efbb8c8 100644 --- a/ComplexProperties/DelegatePermissions.cs +++ b/ComplexProperties/DelegatePermissions.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the DelegatePermissions class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -119,24 +134,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) return delegateFolderPermission != null; } - /// - /// Loads from json. - /// - /// The json property. - /// - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - DelegateFolderPermission delegateFolderPermission = null; - - if (this.delegateFolderPermissions.TryGetValue(key, out delegateFolderPermission)) - { - delegateFolderPermission.Initialize(jsonProperty.ReadEnumValue(key)); - } - } - } - /// /// Writes elements to XML. /// @@ -168,61 +165,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) XmlElementNames.JournalFolderPermissionLevel); } - /// - /// Serializes the property to a Json value. - /// - /// - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonProperty = new JsonObject(); - - this.WritePermissionToJson( - jsonProperty, - XmlElementNames.CalendarFolderPermissionLevel); - - this.WritePermissionToJson( - jsonProperty, - XmlElementNames.TasksFolderPermissionLevel); - - this.WritePermissionToJson( - jsonProperty, - XmlElementNames.InboxFolderPermissionLevel); - - this.WritePermissionToJson( - jsonProperty, - XmlElementNames.ContactsFolderPermissionLevel); - - this.WritePermissionToJson( - jsonProperty, - XmlElementNames.NotesFolderPermissionLevel); - - this.WritePermissionToJson( - jsonProperty, - XmlElementNames.JournalFolderPermissionLevel); - - return jsonProperty; - } - - /// - /// Writes the permission to json. - /// - /// The json property. - /// Name of the element. - private void WritePermissionToJson(JsonObject jsonProperty, string elementName) - { - DelegateFolderPermissionLevel delegateFolderPermissionLevel = this.delegateFolderPermissions[elementName].PermissionLevel; - - // UpdateDelegate fails if Custom permission level is round tripped - // - if (delegateFolderPermissionLevel != DelegateFolderPermissionLevel.Custom) - { - jsonProperty.Add(elementName, delegateFolderPermissionLevel); - } - } - /// /// Write permission to Xml. /// @@ -305,4 +247,4 @@ internal void Reset() internal bool IsExistingPermissionLevelCustom { get; private set; } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/DelegateUser.cs b/ComplexProperties/DelegateUser.cs index 303eb6ff..356002f1 100644 --- a/ComplexProperties/DelegateUser.cs +++ b/ComplexProperties/DelegateUser.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the DelegateUser class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -119,37 +134,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json. - /// - /// The json property. - /// - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.UserId: - this.userId = new UserId(); - this.userId.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service); - break; - case XmlElementNames.DelegatePermissions: - this.permissions.Reset(); - this.permissions.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service); - break; - case XmlElementNames.ReceiveCopiesOfMeetingMessages: - this.receiveCopiesOfMeetingMessages = jsonProperty.ReadAsBool(key); - break; - case XmlElementNames.ViewPrivateItems: - this.viewPrivateItems = jsonProperty.ReadAsBool(key); - break; - default: - break; - } - } - } - /// /// Writes elements to XML. /// @@ -170,26 +154,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) this.ViewPrivateItems); } - /// - /// Serializes the property to a Json value. - /// - /// - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonProperty = new JsonObject(); - - jsonProperty.Add(XmlElementNames.UserId, this.UserId.InternalToJson(service)); - jsonProperty.Add(XmlElementNames.DelegatePermissions, this.Permissions.InternalToJson(service)); - - jsonProperty.Add(XmlElementNames.ReceiveCopiesOfMeetingMessages, this.ReceiveCopiesOfMeetingMessages); - jsonProperty.Add(XmlElementNames.ViewPrivateItems, this.ViewPrivateItems); - - return jsonProperty; - } - /// /// Validates this instance. /// @@ -221,4 +185,4 @@ internal void ValidateUpdateDelegate() this.permissions.ValidateUpdateDelegate(); } } -} +} \ No newline at end of file diff --git a/ComplexProperties/DeleteRuleOperation.cs b/ComplexProperties/DeleteRuleOperation.cs index 6bbb093b..1e7900e8 100644 --- a/ComplexProperties/DeleteRuleOperation.cs +++ b/ComplexProperties/DeleteRuleOperation.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the DeleteRuleOperation class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -63,22 +78,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.RuleId, this.RuleId); } - /// - /// Serializes the property to a Json value. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonProperty = new JsonObject(); - - jsonProperty.Add(XmlElementNames.RuleId, this.RuleId); - - return jsonProperty; - } - /// /// Validates this instance. /// @@ -98,4 +97,4 @@ internal override string XmlElementName } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/DeletedOccurrenceInfo.cs b/ComplexProperties/DeletedOccurrenceInfo.cs index a5e1bcd8..65582cb8 100644 --- a/ComplexProperties/DeletedOccurrenceInfo.cs +++ b/ComplexProperties/DeletedOccurrenceInfo.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the DeletedOccurrenceInfo class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -50,19 +65,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json. - /// - /// The json property. - /// - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - if (jsonProperty.ContainsKey(XmlElementNames.Start)) - { - this.originalStart = service.ConvertUniversalDateTimeStringToLocalDateTime(jsonProperty.ReadAsString(XmlElementNames.Start)).Value; - } - } - /// /// Gets the original start date and time of the deleted occurrence. /// @@ -71,4 +73,4 @@ public DateTime OriginalStart get { return this.originalStart; } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/DeletedOccurrenceInfoCollection.cs b/ComplexProperties/DeletedOccurrenceInfoCollection.cs index 574d6980..2dfb02a8 100644 --- a/ComplexProperties/DeletedOccurrenceInfoCollection.cs +++ b/ComplexProperties/DeletedOccurrenceInfoCollection.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the DeletedOccurrenceInfoCollection class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -42,15 +57,6 @@ internal override DeletedOccurrenceInfo CreateComplexProperty(string xmlElementN } } - /// - /// Creates the default complex property. - /// - /// - internal override DeletedOccurrenceInfo CreateDefaultComplexProperty() - { - return new DeletedOccurrenceInfo(); - } - /// /// Gets the name of the collection item XML element. /// @@ -61,4 +67,4 @@ internal override string GetCollectionItemXmlElementName(DeletedOccurrenceInfo c return XmlElementNames.Occurrence; } } -} +} \ No newline at end of file diff --git a/ComplexProperties/DictionaryEntryProperty.cs b/ComplexProperties/DictionaryEntryProperty.cs index b5a0955c..145c61c4 100644 --- a/ComplexProperties/DictionaryEntryProperty.cs +++ b/ComplexProperties/DictionaryEntryProperty.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the DictionaryEntryProperty class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -88,23 +103,6 @@ internal virtual bool WriteSetUpdateToXml( return false; } - /// - /// Writes the set update to json. - /// - /// The service. - /// The ews object. - /// The property definition. - /// The updates. - /// - internal virtual bool WriteSetUpdateToJson( - ExchangeService service, - ServiceObject ewsObject, - PropertyDefinition propertyDefinition, - List updates) - { - return false; - } - /// /// Writes the delete update to XML. /// @@ -115,17 +113,5 @@ internal virtual bool WriteDeleteUpdateToXml(EwsServiceXmlWriter writer, Service { return false; } - - /// - /// Writes the delete update to json. - /// - /// The service. - /// The ews object. - /// The updates. - /// - internal virtual bool WriteDeleteUpdateToJson(ExchangeService service, ServiceObject ewsObject, List updates) - { - return false; - } } -} +} \ No newline at end of file diff --git a/ComplexProperties/DictionaryProperty.cs b/ComplexProperties/DictionaryProperty.cs index 9c2ed220..e72b7fa3 100644 --- a/ComplexProperties/DictionaryProperty.cs +++ b/ComplexProperties/DictionaryProperty.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the DictionaryProperty class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -20,7 +35,7 @@ namespace Microsoft.Exchange.WebServices.Data /// The type of key. /// The type of entry. [EditorBrowsable(EditorBrowsableState.Never)] - public abstract class DictionaryProperty : ComplexProperty, ICustomUpdateSerializer, IJsonCollectionDeserializer + public abstract class DictionaryProperty : ComplexProperty, ICustomUpdateSerializer where TEntry : DictionaryEntryProperty { private Dictionary entries = new Dictionary(); @@ -56,22 +71,6 @@ private void WriteUriToXml(EwsServiceXmlWriter writer, TKey key) writer.WriteEndElement(); } - /// - /// Writes the URI to json. - /// - /// The key. - /// - private JsonObject WriteUriToJson(TKey key) - { - JsonObject jsonUri = new JsonObject(); - - jsonUri.AddTypeParameter(JsonNames.PathToIndexedFieldType); - jsonUri.Add(XmlAttributeNames.FieldURI, this.GetFieldURI()); - jsonUri.Add(XmlAttributeNames.FieldIndex, this.GetFieldIndex(key)); - - return jsonUri; - } - /// /// Gets the index of the field. /// @@ -203,6 +202,7 @@ internal void InternalRemove(TKey key) } this.addedEntries.Remove(key); + this.modifiedEntries.Remove(key); } /// @@ -239,36 +239,6 @@ internal override void LoadFromXml(EwsServiceXmlReader reader, string localEleme } } - /// - /// Loads from json collection. - /// - /// The json collection. - /// The service. - void IJsonCollectionDeserializer.CreateFromJsonCollection(object[] jsonCollection, ExchangeService service) - { - foreach (object collectionEntry in jsonCollection) - { - JsonObject jsonEntry = collectionEntry as JsonObject; - - if (jsonEntry != null) - { - TEntry entry = this.CreateEntryInstance(); - entry.LoadFromJson(jsonEntry, service); - this.InternalAdd(entry); - } - } - } - - /// - /// Loads from json collection to update the existing collection element. - /// - /// The json collection. - /// The service. - void IJsonCollectionDeserializer.UpdateFromJsonCollection(object[] jsonCollection, ExchangeService service) - { - throw new NotImplementedException(); - } - /// /// Writes to XML. /// @@ -302,25 +272,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) } } - /// - /// Serializes the property to a Json value. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - List jsonArray = new List(); - - foreach (KeyValuePair keyValuePair in this.entries) - { - jsonArray.Add(keyValuePair.Value.InternalToJson(service)); - } - - return jsonArray.ToArray(); - } - /// /// Gets the entries. /// @@ -402,86 +353,6 @@ bool ICustomUpdateSerializer.WriteSetUpdateToXml( return true; } - /// - /// Writes the set update to json. - /// - /// The service. - /// The ews object. - /// The property definition. - /// The updates. - /// - bool ICustomUpdateSerializer.WriteSetUpdateToJson( - ExchangeService service, - ServiceObject ewsObject, - PropertyDefinition propertyDefinition, - List updates) - { - List tempEntries = new List(); - - foreach (TKey key in this.addedEntries) - { - tempEntries.Add(this.entries[key]); - } - foreach (TKey key in this.modifiedEntries) - { - tempEntries.Add(this.entries[key]); - } - - foreach (TEntry entry in tempEntries) - { - if (!entry.WriteSetUpdateToJson( - service, - ewsObject, - propertyDefinition, - updates)) - { - JsonObject jsonUpdate = new JsonObject(); - - jsonUpdate.AddTypeParameter(ewsObject.GetSetFieldXmlElementName()); - - JsonObject jsonUri = new JsonObject(); - - jsonUri.AddTypeParameter(JsonNames.PathToIndexedFieldType); - jsonUri.Add(XmlAttributeNames.FieldURI, this.GetFieldURI()); - jsonUri.Add(XmlAttributeNames.FieldIndex, entry.Key.ToString()); - - jsonUpdate.Add(JsonNames.Path, jsonUri); - - object jsonProperty = entry.InternalToJson(service); - - JsonObject jsonServiceObject = new JsonObject(); - jsonServiceObject.AddTypeParameter(ewsObject.GetXmlElementName()); - jsonServiceObject.Add(propertyDefinition.XmlElementName, new object[] { jsonProperty }); - - jsonUpdate.Add(PropertyBag.GetPropertyUpdateItemName(ewsObject), jsonServiceObject); - - updates.Add(jsonUpdate); - } - } - - foreach (TEntry entry in this.removedEntries.Values) - { - if (!entry.WriteDeleteUpdateToJson(service, ewsObject, updates)) - { - JsonObject jsonUpdate = new JsonObject(); - - jsonUpdate.AddTypeParameter(ewsObject.GetDeleteFieldXmlElementName()); - - JsonObject jsonUri = new JsonObject(); - - jsonUri.AddTypeParameter(JsonNames.PathToIndexedFieldType); - jsonUri.Add(XmlAttributeNames.FieldURI, this.GetFieldURI()); - jsonUri.Add(XmlAttributeNames.FieldIndex, entry.Key.ToString()); - - jsonUpdate.Add(JsonNames.Path, jsonUri); - - updates.Add(jsonUpdate); - } - } - - return true; - } - /// /// Writes deletion update to XML. /// @@ -495,18 +366,6 @@ bool ICustomUpdateSerializer.WriteDeleteUpdateToXml(EwsServiceXmlWriter writer, return false; } - /// - /// Writes the delete update to json. - /// - /// The service. - /// The ews object. - /// The updates. - /// - bool ICustomUpdateSerializer.WriteDeleteUpdateToJson(ExchangeService service, ServiceObject ewsObject, List updates) - { - return false; - } - #endregion } -} +} \ No newline at end of file diff --git a/ComplexProperties/EmailAddress.cs b/ComplexProperties/EmailAddress.cs index 89987e0b..1554fdc0 100644 --- a/ComplexProperties/EmailAddress.cs +++ b/ComplexProperties/EmailAddress.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the EmailAddress class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -266,39 +281,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.Name: - this.name = jsonProperty.ReadAsString(key); - break; - case XmlElementNames.EmailAddress: - this.address = jsonProperty.ReadAsString(key); - break; - case XmlElementNames.RoutingType: - this.routingType = jsonProperty.ReadAsString(key); - break; - case XmlElementNames.MailboxType: - this.mailboxType = jsonProperty.ReadEnumValue(key); - break; - case XmlElementNames.ItemId: - this.id = new ItemId(); - this.id.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service); - break; - default: - break; - } - } - } - /// /// Writes elements to XML. /// @@ -316,30 +298,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) } } - /// - /// Serializes the property to a Json value. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonProperty = new JsonObject(); - - jsonProperty.Add(XmlElementNames.Name, this.Name); - jsonProperty.Add(XmlElementNames.EmailAddress, this.Address); - jsonProperty.Add(XmlElementNames.RoutingType, this.RoutingType); - jsonProperty.Add(XmlElementNames.MailboxType, this.MailboxType); - - if (this.Id != null) - { - jsonProperty.Add(XmlElementNames.ItemId, this.Id.InternalToJson(service)); - } - - return jsonProperty; - } - #region ISearchStringProvider methods /// /// Get a string representation for using this instance in a search filter. @@ -387,4 +345,4 @@ public override string ToString() } #endregion } -} +} \ No newline at end of file diff --git a/ComplexProperties/EmailAddressCollection.cs b/ComplexProperties/EmailAddressCollection.cs index 4ee8d29f..986cf204 100644 --- a/ComplexProperties/EmailAddressCollection.cs +++ b/ComplexProperties/EmailAddressCollection.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Implements an e-mail address collection. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -157,15 +172,6 @@ internal override EmailAddress CreateComplexProperty(string xmlElementName) } } - /// - /// Creates the default complex property. - /// - /// - internal override EmailAddress CreateDefaultComplexProperty() - { - return new EmailAddress(); - } - /// /// Retrieves the XML element name corresponding to the provided EmailAddress object. /// @@ -185,4 +191,4 @@ internal override bool ShouldWriteToRequest() return true; } } -} +} \ No newline at end of file diff --git a/ComplexProperties/EmailAddressDictionary.cs b/ComplexProperties/EmailAddressDictionary.cs index f75e4a9f..00232388 100644 --- a/ComplexProperties/EmailAddressDictionary.cs +++ b/ComplexProperties/EmailAddressDictionary.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the EmailAddressDictionary class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/ComplexProperties/EmailAddressEntity.cs b/ComplexProperties/EmailAddressEntity.cs index 6d384bc3..f16fdbdc 100644 --- a/ComplexProperties/EmailAddressEntity.cs +++ b/ComplexProperties/EmailAddressEntity.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the EmailAddressEntity class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -49,4 +64,4 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/EmailAddressEntityCollection.cs b/ComplexProperties/EmailAddressEntityCollection.cs index e6d7df4d..20a78f8c 100644 --- a/ComplexProperties/EmailAddressEntityCollection.cs +++ b/ComplexProperties/EmailAddressEntityCollection.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the EmailAddressEntityCollection class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -50,15 +65,6 @@ internal override EmailAddressEntity CreateComplexProperty(string xmlElementName return new EmailAddressEntity(); } - /// - /// Creates the default complex property. - /// - /// EmailAddressEntity. - internal override EmailAddressEntity CreateDefaultComplexProperty() - { - return new EmailAddressEntity(); - } - /// /// Gets the name of the collection item XML element. /// @@ -69,4 +75,4 @@ internal override string GetCollectionItemXmlElementName(EmailAddressEntity comp return XmlElementNames.NlgEmailAddress; } } -} +} \ No newline at end of file diff --git a/ComplexProperties/EmailAddressEntry.cs b/ComplexProperties/EmailAddressEntry.cs index 0705e837..358ab0f2 100644 --- a/ComplexProperties/EmailAddressEntry.cs +++ b/ComplexProperties/EmailAddressEntry.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the EmailAddressEntry class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -80,36 +95,6 @@ internal override void ReadTextValueFromXml(EwsServiceXmlReader reader) this.EmailAddress.Address = reader.ReadValue(); } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlAttributeNames.Key: - this.Key = jsonProperty.ReadEnumValue(key); - break; - case XmlAttributeNames.Name: - this.EmailAddress.Name = jsonProperty.ReadAsString(key); - break; - case XmlAttributeNames.RoutingType: - this.EmailAddress.RoutingType = jsonProperty.ReadAsString(key); - break; - case XmlAttributeNames.MailboxType: - this.EmailAddress.MailboxType = jsonProperty.ReadEnumValue(key); - break; - case XmlElementNames.EmailAddress: - this.EmailAddress.Address = jsonProperty.ReadAsString(key); - break; - } - } - } - /// /// Writes the attributes to XML. /// @@ -138,31 +123,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) writer.WriteValue(this.EmailAddress.Address, XmlElementNames.EmailAddress); } - /// - /// Serializes the property to a Json value. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonProperty = new JsonObject(); - - jsonProperty.Add(XmlAttributeNames.Key, this.Key); - jsonProperty.Add(XmlAttributeNames.Name, this.EmailAddress.Name); - jsonProperty.Add(XmlAttributeNames.RoutingType, this.EmailAddress.RoutingType); - - if (this.EmailAddress.MailboxType.HasValue) - { - jsonProperty.Add(XmlAttributeNames.MailboxType, this.EmailAddress.MailboxType.Value); - } - - jsonProperty.Add(XmlElementNames.EmailAddress, this.EmailAddress.Address); - - return jsonProperty; - } - /// /// Gets or sets the e-mail address of the entry. /// diff --git a/ComplexProperties/EmailUserEntity.cs b/ComplexProperties/EmailUserEntity.cs index 1337cbb4..baacf2ed 100644 --- a/ComplexProperties/EmailUserEntity.cs +++ b/ComplexProperties/EmailUserEntity.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the EmailUserEntity class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -59,4 +74,4 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/EmailUserEntityCollection.cs b/ComplexProperties/EmailUserEntityCollection.cs index e97b7ee3..5c0cc2cf 100644 --- a/ComplexProperties/EmailUserEntityCollection.cs +++ b/ComplexProperties/EmailUserEntityCollection.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the EmailUserEntityCollection class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -50,15 +65,6 @@ internal override EmailUserEntity CreateComplexProperty(string xmlElementName) return new EmailUserEntity(); } - /// - /// Creates the default complex property. - /// - /// EmailUserEntity. - internal override EmailUserEntity CreateDefaultComplexProperty() - { - return new EmailUserEntity(); - } - /// /// Gets the name of the collection item XML element. /// @@ -69,4 +75,4 @@ internal override string GetCollectionItemXmlElementName(EmailUserEntity complex return XmlElementNames.NlgEmailUser; } } -} +} \ No newline at end of file diff --git a/ComplexProperties/EnhancedLocation.cs b/ComplexProperties/EnhancedLocation.cs index a6477893..0f22e488 100644 --- a/ComplexProperties/EnhancedLocation.cs +++ b/ComplexProperties/EnhancedLocation.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the EnhancedLocation class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -90,34 +105,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json. - /// - /// The json property. - /// - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.LocationDisplayName: - this.displayName = jsonProperty.ReadAsString(key); - break; - case XmlElementNames.LocationAnnotation: - this.annotation = jsonProperty.ReadAsString(key); - break; - case XmlElementNames.PersonaPostalAddress: - this.personaPostalAddress = new PersonaPostalAddress(); - this.personaPostalAddress.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service); - this.personaPostalAddress.OnChange += new ComplexPropertyChangedDelegate(PersonaPostalAddress_OnChange); - break; - default: - break; - } - } - } - /// /// Gets or sets the Location DisplayName. /// @@ -169,27 +156,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) this.personaPostalAddress.WriteToXml(writer); } - /// - /// Serializes the property to a Json value. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonProperty = new JsonObject(); - - jsonProperty.Add(XmlElementNames.LocationDisplayName, this.displayName); - jsonProperty.Add(XmlElementNames.LocationAnnotation, this.annotation); - if (this.personaPostalAddress != null) - { - jsonProperty.Add(XmlElementNames.PersonaPostalAddress, this.personaPostalAddress.InternalToJson(service)); - } - - return jsonProperty; - } - /// /// Validates this instance. /// @@ -210,4 +176,4 @@ private void PersonaPostalAddress_OnChange(ComplexProperty complexProperty) this.Changed(); } } -} +} \ No newline at end of file diff --git a/ComplexProperties/EntityExtractionResult.cs b/ComplexProperties/EntityExtractionResult.cs index 419c322b..1c7b3052 100644 --- a/ComplexProperties/EntityExtractionResult.cs +++ b/ComplexProperties/EntityExtractionResult.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the EntityExtractionResult class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -111,4 +126,4 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/ExtendedProperty.cs b/ComplexProperties/ExtendedProperty.cs index 872366d7..adeec1c2 100644 --- a/ComplexProperties/ExtendedProperty.cs +++ b/ComplexProperties/ExtendedProperty.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ExtendedProperty class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -78,46 +93,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.ExtendedFieldURI: - this.propertyDefinition = new ExtendedPropertyDefinition(); - this.propertyDefinition.LoadFromJson(jsonProperty.ReadAsJsonObject(key)); - break; - case XmlElementNames.Value: - EwsUtilities.Assert( - this.PropertyDefinition != null, - "ExtendedProperty.TryReadElementFromXml", - "PropertyDefintion is missing"); - - string stringValue = jsonProperty.ReadAsString(key); - this.value = MapiTypeConverter.ConvertToValue(this.PropertyDefinition.MapiType, stringValue); - break; - case XmlElementNames.Values: - EwsUtilities.Assert( - this.PropertyDefinition != null, - "ExtendedProperty.TryReadElementFromXml", - "PropertyDefintion is missing"); - - StringList stringList = new StringList(XmlElementNames.Value); - ((IJsonCollectionDeserializer)stringList).CreateFromJsonCollection(jsonProperty.ReadAsArray(key), service); - this.value = MapiTypeConverter.ConvertToValue(this.PropertyDefinition.MapiType, stringList); - break; - default: - break; - } - } - } - /// /// Writes elements to XML. /// @@ -148,43 +123,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) } } - /// - /// Serializes the property to a Json value. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonExtendedProp = new JsonObject(); - - JsonObject jsonExtendedFieldUri = new JsonObject(); - this.PropertyDefinition.AddJsonProperties(jsonExtendedFieldUri, service); - - jsonExtendedProp.Add(XmlElementNames.ExtendedFieldURI, jsonExtendedFieldUri); - - if (MapiTypeConverter.IsArrayType(this.PropertyDefinition.MapiType)) - { - List values = new List(); - - foreach (object value in this.Value as Array) - { - values.Add(MapiTypeConverter.ConvertToString(this.PropertyDefinition.MapiType, value)); - } - - jsonExtendedProp.Add(XmlElementNames.Values, values.ToArray()); - } - else - { - jsonExtendedProp.Add( - XmlElementNames.Value, - MapiTypeConverter.ConvertToString(this.PropertyDefinition.MapiType, this.Value)); - } - - return jsonExtendedProp; - } - /// /// Gets the definition of the extended property. /// @@ -282,4 +220,4 @@ public override int GetHashCode() this.GetStringValue()).GetHashCode(); } } -} +} \ No newline at end of file diff --git a/ComplexProperties/ExtendedPropertyCollection.cs b/ComplexProperties/ExtendedPropertyCollection.cs index 9bd5995c..066dc87f 100644 --- a/ComplexProperties/ExtendedPropertyCollection.cs +++ b/ComplexProperties/ExtendedPropertyCollection.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ExtendedPropertyCollection class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -30,15 +45,6 @@ internal override ExtendedProperty CreateComplexProperty(string xmlElementName) return new ExtendedProperty(); } - /// - /// Creates the default complex property. - /// - /// - internal override ExtendedProperty CreateDefaultComplexProperty() - { - return new ExtendedProperty(); - } - /// /// Gets the name of the collection item XML element. /// @@ -76,23 +82,6 @@ internal override void WriteToXml(EwsServiceXmlWriter writer, string xmlElementN } } - /// - /// Internals to json. - /// - /// The service. - /// - internal override object InternalToJson(ExchangeService service) - { - List values = new List(); - - foreach (ExtendedProperty extendedProperty in this) - { - values.Add(extendedProperty.InternalToJson(service)); - } - - return values.ToArray(); - } - /// /// Gets existing or adds new extended property. /// @@ -227,42 +216,6 @@ bool ICustomUpdateSerializer.WriteSetUpdateToXml( return true; } - /// - /// Writes the set update to json. - /// - /// The service. - /// The ews object. - /// The property definition. - /// The updates. - /// - bool ICustomUpdateSerializer.WriteSetUpdateToJson( - ExchangeService service, - ServiceObject ewsObject, - PropertyDefinition propertyDefinition, - List updates) - { - List propertiesToSet = new List(); - - propertiesToSet.AddRange(this.AddedItems); - propertiesToSet.AddRange(this.ModifiedItems); - - foreach (ExtendedProperty extendedProperty in propertiesToSet) - { - updates.Add( - PropertyBag.CreateJsonSetUpdate( - extendedProperty, - service, - ewsObject)); - } - - foreach (ExtendedProperty extendedProperty in this.RemovedItems) - { - updates.Add(PropertyBag.CreateJsonDeleteUpdate(extendedProperty.PropertyDefinition, service, ewsObject)); - } - - return true; - } - /// /// Writes the deletion update to XML. /// @@ -283,23 +236,6 @@ bool ICustomUpdateSerializer.WriteDeleteUpdateToXml(EwsServiceXmlWriter writer, return true; } - /// - /// Writes the delete update to json. - /// - /// The service. - /// The ews object. - /// The updates. - /// - bool ICustomUpdateSerializer.WriteDeleteUpdateToJson(ExchangeService service, ServiceObject ewsObject, List updates) - { - foreach (ExtendedProperty extendedProperty in this.Items) - { - updates.Add(PropertyBag.CreateJsonDeleteUpdate(extendedProperty.PropertyDefinition, service, ewsObject)); - } - - return true; - } - #endregion } -} +} \ No newline at end of file diff --git a/ComplexProperties/ExtractedEntity.cs b/ComplexProperties/ExtractedEntity.cs index 05d189c5..977c65a2 100644 --- a/ComplexProperties/ExtractedEntity.cs +++ b/ComplexProperties/ExtractedEntity.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ExtractedEntity class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -55,4 +70,4 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/FileAttachment.cs b/ComplexProperties/FileAttachment.cs index a0a02a2e..f9611145 100644 --- a/ComplexProperties/FileAttachment.cs +++ b/ComplexProperties/FileAttachment.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the FileAttachment class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -127,57 +142,6 @@ internal override bool TryReadElementFromXmlToPatch(EwsServiceXmlReader reader) return base.TryReadElementFromXml(reader); } - /// - /// Loads from json. - /// - /// The json property. - /// - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - base.LoadFromJson(jsonProperty, service); - - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.IsContactPhoto: - this.isContactPhoto = jsonProperty.ReadAsBool(key); - break; - case XmlElementNames.Content: - if (this.loadToStream != null) - { - jsonProperty.ReadAsBase64Content(key, this.loadToStream); - } - else - { - // If there's a file attachment content handler, use it. Otherwise - // load the content into a byte array. - // TODO: Should we mark the attachment to indicate that content is stored elsewhere? - if (service.FileAttachmentContentHandler != null) - { - Stream outputStream = service.FileAttachmentContentHandler.GetOutputStream(this.Id); - - if (outputStream != null) - { - jsonProperty.ReadAsBase64Content(key, outputStream); - } - else - { - this.content = jsonProperty.ReadAsBase64Content(key); - } - } - else - { - this.content = jsonProperty.ReadAsBase64Content(key); - } - } - break; - default: - break; - } - } - } - /// /// Writes elements and content to XML. /// @@ -219,48 +183,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) writer.WriteEndElement(); } - /// - /// Serializes the property to a Json value. - /// - /// - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonAttachment = base.InternalToJson(service) as JsonObject; - - if (service.RequestedServerVersion > ExchangeVersion.Exchange2007_SP1) - { - jsonAttachment.Add(XmlElementNames.IsContactPhoto, this.isContactPhoto); - } - - if (!string.IsNullOrEmpty(this.FileName)) - { - using (FileStream fileStream = new FileStream(this.FileName, FileMode.Open, FileAccess.Read)) - { - jsonAttachment.AddBase64(XmlElementNames.Content, fileStream); - } - } - else if (this.ContentStream != null) - { - jsonAttachment.AddBase64(XmlElementNames.Content, this.ContentStream); - } - else if (this.Content != null) - { - jsonAttachment.AddBase64(XmlElementNames.Content, this.Content); - } - else - { - EwsUtilities.Assert( - false, - "FileAttachment.WriteElementsToXml", - "The attachment's content is not set."); - } - - return jsonAttachment; - } - /// /// Loads the content of the file attachment into the specified stream. Calling this method results in a call to EWS. /// @@ -385,4 +307,4 @@ public bool IsContactPhoto } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/Flag.cs b/ComplexProperties/Flag.cs index 36a54961..90dbcaed 100644 --- a/ComplexProperties/Flag.cs +++ b/ComplexProperties/Flag.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the Flag class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -55,35 +70,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.FlagStatus: - this.flagStatus = jsonProperty.ReadEnumValue(key); - break; - case XmlElementNames.StartDate: - this.startDate = service.ConvertUniversalDateTimeStringToLocalDateTime(jsonProperty.ReadAsString(key)).Value; - break; - case XmlElementNames.DueDate: - this.dueDate = service.ConvertUniversalDateTimeStringToLocalDateTime(jsonProperty.ReadAsString(key)).Value; - break; - case XmlElementNames.CompleteDate: - this.completeDate = service.ConvertUniversalDateTimeStringToLocalDateTime(jsonProperty.ReadAsString(key)).Value; - break; - default: - break; - } - } - } - /// /// Writes elements to XML. /// @@ -92,42 +78,17 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) { writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.FlagStatus, this.FlagStatus); - if (this.FlagStatus == ItemFlagStatus.Flagged && this.StartDate != null && this.DueDate != null) + if (this.FlagStatus == ItemFlagStatus.Flagged) { writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.StartDate, this.StartDate); writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.DueDate, this.DueDate); } - else if (this.FlagStatus == ItemFlagStatus.Complete && this.CompleteDate != null) + else if (this.FlagStatus == ItemFlagStatus.Complete) { writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.CompleteDate, this.CompleteDate); } } - /// - /// Serializes the property to a Json value. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonObject = new JsonObject(); - - jsonObject.Add(XmlElementNames.FlagStatus, this.FlagStatus); - if (this.FlagStatus == ItemFlagStatus.Flagged && this.StartDate != null && this.DueDate != null) - { - jsonObject.Add(XmlElementNames.StartDate, this.StartDate); - jsonObject.Add(XmlElementNames.DueDate, this.DueDate); - } - else if (this.FlagStatus == ItemFlagStatus.Complete && this.CompleteDate != null) - { - jsonObject.Add(XmlElementNames.CompleteDate, this.CompleteDate); - } - - return jsonObject; - } - /// /// Validates this instance. /// @@ -200,4 +161,4 @@ public DateTime CompleteDate } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/FolderId.cs b/ComplexProperties/FolderId.cs index b1c00c9b..f2793fb6 100644 --- a/ComplexProperties/FolderId.cs +++ b/ComplexProperties/FolderId.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the FolderId class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -92,35 +107,6 @@ internal override void WriteAttributesToXml(EwsServiceXmlWriter writer) } } - /// - /// Serializes the property to a Json value. - /// - /// - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - if (this.FolderName.HasValue) - { - JsonObject jsonProperty = new JsonObject(); - - jsonProperty.AddTypeParameter(this.GetXmlElementName()); - jsonProperty.Add(XmlAttributeNames.Id, this.FolderName.Value.ToString().ToLowerInvariant()); - - if (this.Mailbox != null) - { - jsonProperty.Add(XmlElementNames.Mailbox, this.Mailbox.InternalToJson(service)); - } - - return jsonProperty; - } - else - { - return base.InternalToJson(service); - } - } - /// /// Validates FolderId against a specified request version. /// @@ -294,4 +280,4 @@ public override string ToString() } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/FolderIdCollection.cs b/ComplexProperties/FolderIdCollection.cs index 4d164d7f..680e9f39 100644 --- a/ComplexProperties/FolderIdCollection.cs +++ b/ComplexProperties/FolderIdCollection.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the FolderIdCollection class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -50,15 +65,6 @@ internal override FolderId CreateComplexProperty(string xmlElementName) return new FolderId(); } - /// - /// Creates the default complex property. - /// - /// FolderId. - internal override FolderId CreateDefaultComplexProperty() - { - return new FolderId(); - } - /// /// Gets the name of the collection item XML element. /// @@ -148,4 +154,4 @@ public bool Remove(WellKnownFolderName folderName) return this.InternalRemove(folderName); } } -} +} \ No newline at end of file diff --git a/ComplexProperties/FolderPermission.cs b/ComplexProperties/FolderPermission.cs index 13830bf0..cbbec60f 100644 --- a/ComplexProperties/FolderPermission.cs +++ b/ComplexProperties/FolderPermission.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the FolderPermission class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -639,57 +654,6 @@ internal override void LoadFromXml( this.AdjustPermissionLevel(); } - /// - /// Loads from json. - /// - /// The json property. - /// - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.UserId: - this.UserId = new UserId(); - this.UserId.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service); - break; - case XmlElementNames.CanCreateItems: - this.canCreateItems = jsonProperty.ReadAsBool(key); - break; - case XmlElementNames.CanCreateSubFolders: - this.canCreateSubFolders = jsonProperty.ReadAsBool(key); - break; - case XmlElementNames.IsFolderOwner: - this.isFolderOwner = jsonProperty.ReadAsBool(key); - break; - case XmlElementNames.IsFolderVisible: - this.isFolderVisible = jsonProperty.ReadAsBool(key); - break; - case XmlElementNames.IsFolderContact: - this.isFolderContact = jsonProperty.ReadAsBool(key); - break; - case XmlElementNames.EditItems: - this.editItems = jsonProperty.ReadEnumValue(key); - break; - case XmlElementNames.DeleteItems: - this.deleteItems = jsonProperty.ReadEnumValue(key); - break; - case XmlElementNames.ReadItems: - this.readItems = jsonProperty.ReadEnumValue(key); - break; - case XmlElementNames.PermissionLevel: - case XmlElementNames.CalendarPermissionLevel: - this.permissionLevel = jsonProperty.ReadEnumValue(key); - break; - default: - break; - } - } - - this.AdjustPermissionLevel(); - } - /// /// Writes elements to XML. /// @@ -767,64 +731,5 @@ internal void WriteToXml( this.WriteElementsToXml(writer, isCalendarFolder); writer.WriteEndElement(); } - - /// - /// Serializes the property to a Json value. - /// - /// The service. - /// if set to true [is calendar folder]. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal object InternalToJson(ExchangeService service, bool isCalendarFolder) - { - JsonObject jsonPermission = new JsonObject(); - - jsonPermission.Add(XmlElementNames.UserId, this.UserId.InternalToJson(service)); - - if (this.PermissionLevel == FolderPermissionLevel.Custom) - { - jsonPermission.Add( - XmlElementNames.CanCreateItems, - this.CanCreateItems); - - jsonPermission.Add( - XmlElementNames.CanCreateSubFolders, - this.CanCreateSubFolders); - - jsonPermission.Add( - XmlElementNames.IsFolderOwner, - this.IsFolderOwner); - - jsonPermission.Add( - XmlElementNames.IsFolderVisible, - this.IsFolderVisible); - - jsonPermission.Add( - XmlElementNames.IsFolderContact, - this.IsFolderContact); - - jsonPermission.Add( - XmlElementNames.EditItems, - this.EditItems); - - jsonPermission.Add( - XmlElementNames.DeleteItems, - this.DeleteItems); - - jsonPermission.Add( - XmlElementNames.ReadItems, - this.ReadItems); - } - - jsonPermission.Add( - isCalendarFolder ? XmlElementNames.CalendarPermissionLevel : XmlElementNames.PermissionLevel, - this.PermissionLevel); - - jsonPermission.AddTypeParameter( - isCalendarFolder ? XmlElementNames.CalendarPermission : XmlElementNames.Permission); - - return jsonPermission; - } } -} +} \ No newline at end of file diff --git a/ComplexProperties/FolderPermissionCollection.cs b/ComplexProperties/FolderPermissionCollection.cs index 89ca8ca5..8d590624 100644 --- a/ComplexProperties/FolderPermissionCollection.cs +++ b/ComplexProperties/FolderPermissionCollection.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the FolderPermissionCollection class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -92,30 +107,6 @@ internal override void LoadFromXml(EwsServiceXmlReader reader, string localEleme } } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - object[] jsonFolderPermissions = jsonProperty.ReadAsArray(this.InnerCollectionXmlElementName); - - foreach (object jsonFolderPermission in jsonFolderPermissions) - { - FolderPermission permission = new FolderPermission(); - permission.LoadFromJson(jsonFolderPermission as JsonObject, service); - this.InternalAdd(permission); - } - - object[] jsonUnknownEntries = jsonProperty.ReadAsArray(XmlElementNames.UnknownEntries); - - foreach (object jsonUnknownEntry in jsonUnknownEntries) - { - this.unknownEntries.Add(jsonUnknownEntry as string); - } - } - /// /// Validates this instance. /// @@ -145,29 +136,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) writer.WriteEndElement(); // this.InnerCollectionXmlElementName } - /// - /// Serializes the property to a Json value. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonProperty = new JsonObject(); - List permissions = new List(); - - foreach (FolderPermission folderPermission in this) - { - permissions.Add(folderPermission.InternalToJson(service, this.isCalendarFolder)); - } - - jsonProperty.AddTypeParameter(this.InnerCollectionXmlElementName); - jsonProperty.Add(this.InnerCollectionXmlElementName, permissions.ToArray()); - - return jsonProperty; - } - /// /// Creates the complex property. /// @@ -178,15 +146,6 @@ internal override FolderPermission CreateComplexProperty(string xmlElementName) return new FolderPermission(); } - /// - /// Creates the default complex property. - /// - /// FolderPermission instance. - internal override FolderPermission CreateDefaultComplexProperty() - { - return new FolderPermission(); - } - /// /// Adds a permission to the collection. /// @@ -245,4 +204,4 @@ public Collection UnknownEntries get { return this.unknownEntries; } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/GenericItemAttachment.cs b/ComplexProperties/GenericItemAttachment.cs index 14d05235..2663ecf1 100644 --- a/ComplexProperties/GenericItemAttachment.cs +++ b/ComplexProperties/GenericItemAttachment.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GenericItemAttachment enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -39,4 +54,4 @@ internal ItemAttachment(Item owner) internal set { base.Item = value; } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/GroupMember.cs b/ComplexProperties/GroupMember.cs index 87269d7a..5964f765 100644 --- a/ComplexProperties/GroupMember.cs +++ b/ComplexProperties/GroupMember.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GroupMember class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -259,31 +274,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json. - /// - /// The json property. - /// - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.Status: - this.status = jsonProperty.ReadEnumValue(key); - break; - - case XmlElementNames.Mailbox: - this.AddressInformation = new EmailAddress(); - this.AddressInformation.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service); - break; - default: - break; - } - } - } - /// /// Writes the member key attribute to XML. /// @@ -308,23 +298,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) XmlElementNames.Mailbox); } - /// - /// Serializes the property to a Json value. - /// - /// - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonProperty = new JsonObject(); - - jsonProperty.Add(XmlAttributeNames.Key, this.key); - jsonProperty.Add(XmlElementNames.Mailbox, this.AddressInformation.InternalToJson(service)); - - return jsonProperty; - } - /// /// AddressInformation instance is changed. /// @@ -334,4 +307,4 @@ private void AddressInformationChanged(ComplexProperty complexProperty) this.Changed(); } } -} +} \ No newline at end of file diff --git a/ComplexProperties/GroupMemberCollection.cs b/ComplexProperties/GroupMemberCollection.cs index 1bc8dade..d1094a53 100644 --- a/ComplexProperties/GroupMemberCollection.cs +++ b/ComplexProperties/GroupMemberCollection.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GroupMemberCollection class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -281,24 +296,6 @@ bool ICustomUpdateSerializer.WriteSetUpdateToXml( return true; } - /// - /// Writes the set update to json. - /// - /// The service. - /// The ews object. - /// The property definition. - /// The updates. - /// - bool ICustomUpdateSerializer.WriteSetUpdateToJson( - ExchangeService service, - ServiceObject ewsObject, - PropertyDefinition propertyDefinition, - List updates) - { - // TODO: Implement - throw new NotImplementedException(); - } - /// /// Writes the deletion update to XML. /// @@ -310,18 +307,6 @@ bool ICustomUpdateSerializer.WriteDeleteUpdateToXml(EwsServiceXmlWriter writer, return false; } - /// - /// Writes the delete update to json. - /// - /// The service. - /// The ews object. - /// The updates. - /// - bool ICustomUpdateSerializer.WriteDeleteUpdateToJson(ExchangeService service, ServiceObject ewsObject, List updates) - { - return false; - } - /// /// Creates a GroupMember object from an XML element name. /// @@ -332,15 +317,6 @@ internal override GroupMember CreateComplexProperty(string xmlElementName) return new GroupMember(); } - /// - /// Creates the default complex property. - /// - /// An GroupMember object. - internal override GroupMember CreateDefaultComplexProperty() - { - return new GroupMember(); - } - /// /// Clears the change log. /// @@ -440,4 +416,4 @@ internal override void InternalValidate() } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/HighlightTerm.cs b/ComplexProperties/HighlightTerm.cs index 838f8d23..cb4ee8c8 100644 --- a/ComplexProperties/HighlightTerm.cs +++ b/ComplexProperties/HighlightTerm.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the HighlightTerm class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -74,23 +89,5 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) return false; } } - - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - if (jsonProperty.ContainsKey(XmlElementNames.HighlightTermScope)) - { - this.scope = jsonProperty.ReadAsString(XmlElementNames.HighlightTermScope); - } - - if (jsonProperty.ContainsKey(XmlElementNames.HighlightTermValue)) - { - this.value = jsonProperty.ReadAsString(XmlElementNames.HighlightTermValue); - } - } } -} +} \ No newline at end of file diff --git a/ComplexProperties/ImAddressDictionary.cs b/ComplexProperties/ImAddressDictionary.cs index fd2c29f5..d5b7b72b 100644 --- a/ComplexProperties/ImAddressDictionary.cs +++ b/ComplexProperties/ImAddressDictionary.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ImAddressDictionary class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -101,4 +116,4 @@ public bool TryGetValue(ImAddressKey key, out string imAddress) } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/ImAddressEntry.cs b/ComplexProperties/ImAddressEntry.cs index 8c3bbf9e..b3d23722 100644 --- a/ComplexProperties/ImAddressEntry.cs +++ b/ComplexProperties/ImAddressEntry.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ImAddressEntry class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -68,26 +83,5 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) { writer.WriteValue(this.ImAddress, XmlElementNames.ImAddress); } - - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonProperty = new JsonObject(); - - jsonProperty.Add(XmlAttributeNames.Key, this.Key); - jsonProperty.Add(XmlElementNames.ImAddress, this.ImAddress); - - return jsonProperty; - } - - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - this.Key = jsonProperty.ReadEnumValue(XmlAttributeNames.Key); - this.ImAddress = jsonProperty.ReadAsString(XmlElementNames.ImAddress); - } } -} +} \ No newline at end of file diff --git a/ComplexProperties/InternetMessageHeader.cs b/ComplexProperties/InternetMessageHeader.cs index 97075e86..cbcab114 100644 --- a/ComplexProperties/InternetMessageHeader.cs +++ b/ComplexProperties/InternetMessageHeader.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the InternetMessageHeader class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -47,29 +62,6 @@ internal override void ReadTextValueFromXml(EwsServiceXmlReader reader) this.value = reader.ReadValue(); } - /// - /// Loads from json. - /// - /// The json property. - /// - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlAttributeNames.HeaderName: - this.name = jsonProperty.ReadAsString(key); - break; - case JsonObject.JsonValueString: - this.value = jsonProperty.ReadAsString(key); - break; - default: - break; - } - } - } - /// /// Writes the attributes to XML. /// @@ -88,23 +80,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) writer.WriteValue(this.Value, this.Name); } - /// - /// Serializes the property to a Json value. - /// - /// - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonProperty = new JsonObject(); - - jsonProperty.Add(XmlAttributeNames.HeaderName, this.Name); - jsonProperty.Add(JsonObject.JsonValueString, this.Value); - - return jsonProperty; - } - /// /// Obtains a string representation of the header. /// @@ -132,4 +107,4 @@ public string Value set { this.SetFieldValue(ref this.value, value); } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/InternetMessageHeaderCollection.cs b/ComplexProperties/InternetMessageHeaderCollection.cs index 640ea09c..1cbdbd77 100644 --- a/ComplexProperties/InternetMessageHeaderCollection.cs +++ b/ComplexProperties/InternetMessageHeaderCollection.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the InternetMessageHeaderCollection class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -39,15 +54,6 @@ internal override InternetMessageHeader CreateComplexProperty(string xmlElementN return new InternetMessageHeader(); } - /// - /// Creates the default complex property. - /// - /// InternetMessageHeader instance. - internal override InternetMessageHeader CreateDefaultComplexProperty() - { - return new InternetMessageHeader(); - } - /// /// Gets the name of the collection item XML element. /// @@ -76,4 +82,4 @@ public InternetMessageHeader Find(string name) return null; } } -} +} \ No newline at end of file diff --git a/ComplexProperties/ItemAttachment.cs b/ComplexProperties/ItemAttachment.cs index 2c38bbdf..a903e61e 100644 --- a/ComplexProperties/ItemAttachment.cs +++ b/ComplexProperties/ItemAttachment.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ItemAttachment class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -138,32 +153,6 @@ internal override bool TryReadElementFromXmlToPatch(EwsServiceXmlReader reader) return false; } - /// - /// Loads from json. - /// - /// The json property. - /// - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - base.LoadFromJson(jsonProperty, service); - - if (jsonProperty.ContainsKey(XmlElementNames.Item)) - { - JsonObject jsonItem = jsonProperty.ReadAsJsonObject(XmlElementNames.Item); - - // skip this - "Item" : null - if (jsonItem != null) - { - this.item = EwsUtilities.CreateItemFromXmlElementName(this, jsonItem.ReadTypeString()); - - if (this.item != null) - { - this.item.LoadFromJson(jsonItem, service, true /* clearPropertyBag */); - } - } - } - } - /// /// Writes the properties of this object as XML elements. /// @@ -175,22 +164,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) this.Item.WriteToXml(writer); } - /// - /// Serializes the property to a Json value. - /// - /// - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonAttachment = base.InternalToJson(service) as JsonObject; - - jsonAttachment.Add(XmlElementNames.Item, this.item.ToJson(service, false /* isUpdateOperation */) as JsonObject); - - return jsonAttachment; - } - /// /// Validates this instance. /// @@ -252,4 +225,4 @@ public void Load(BodyType bodyType, IEnumerable addition additionalProperties); } } -} +} \ No newline at end of file diff --git a/ComplexProperties/ItemCollection.cs b/ComplexProperties/ItemCollection.cs index 7a3eb154..c3735c1d 100644 --- a/ComplexProperties/ItemCollection.cs +++ b/ComplexProperties/ItemCollection.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ItemCollection class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -21,7 +36,7 @@ namespace Microsoft.Exchange.WebServices.Data /// /// The type of item the collection contains. [EditorBrowsable(EditorBrowsableState.Never)] - public sealed class ItemCollection : ComplexProperty, IEnumerable, IJsonCollectionDeserializer + public sealed class ItemCollection : ComplexProperty, IEnumerable where TItem : Item { private List items = new List(); @@ -70,37 +85,6 @@ internal override void LoadFromXml(EwsServiceXmlReader reader, string localEleme } } - /// - /// Loads from json collection. - /// - /// The json collection. - /// The service. - void IJsonCollectionDeserializer.CreateFromJsonCollection(object[] jsonCollection, ExchangeService service) - { - foreach (object entry in jsonCollection) - { - JsonObject jsonServiceObject = entry as JsonObject; - - TItem item = EwsUtilities.CreateEwsObjectFromXmlElementName( - service, - jsonServiceObject.ReadTypeString()) as TItem; - - item.LoadFromJson(jsonServiceObject, service, true); - - this.items.Add(item); - } - } - - /// - /// Loads from json collection to update the existing collection element. - /// - /// The json collection. - /// The service. - void IJsonCollectionDeserializer.UpdateFromJsonCollection(object[] jsonCollection, ExchangeService service) - { - throw new NotImplementedException(); - } - /// /// Gets the total number of items in the collection. /// @@ -153,4 +137,4 @@ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() #endregion } -} +} \ No newline at end of file diff --git a/ComplexProperties/ItemId.cs b/ComplexProperties/ItemId.cs index 29eb8f5b..94045575 100644 --- a/ComplexProperties/ItemId.cs +++ b/ComplexProperties/ItemId.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ItemId class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -17,7 +32,7 @@ namespace Microsoft.Exchange.WebServices.Data /// /// Represents the Id of an Exchange item. /// - public class ItemId : ServiceId, IJsonSerializable + public class ItemId : ServiceId { /// /// Initializes a new instance of the class. @@ -55,4 +70,4 @@ public ItemId(string uniqueId) { } } -} +} \ No newline at end of file diff --git a/ComplexProperties/ItemIdCollection.cs b/ComplexProperties/ItemIdCollection.cs index 16bb34ef..41109e6c 100644 --- a/ComplexProperties/ItemIdCollection.cs +++ b/ComplexProperties/ItemIdCollection.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ItemIdCollection class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -36,15 +51,6 @@ internal override ItemId CreateComplexProperty(string xmlElementName) return new ItemId(); } - /// - /// Creates the default complex property. - /// - /// ItemId. - internal override ItemId CreateDefaultComplexProperty() - { - return new ItemId(); - } - /// /// Gets the name of the collection item XML element. /// @@ -55,4 +61,4 @@ internal override string GetCollectionItemXmlElementName(ItemId complexProperty) return complexProperty.GetXmlElementName(); } } -} +} \ No newline at end of file diff --git a/ComplexProperties/Mailbox.cs b/ComplexProperties/Mailbox.cs index 0fc5272b..a615aa9d 100644 --- a/ComplexProperties/Mailbox.cs +++ b/ComplexProperties/Mailbox.cs @@ -1,12 +1,28 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ -//----------------------------------------------------------------------- -// Defines the EmailAddress class. -//----------------------------------------------------------------------- namespace Microsoft.Exchange.WebServices.Data { /// @@ -124,46 +140,8 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) #endregion - #region Json Methods - - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - if (jsonProperty.ContainsKey(XmlElementNames.EmailAddress)) - { - this.Address = jsonProperty.ReadAsString(XmlElementNames.EmailAddress); - } - - if (jsonProperty.ContainsKey(XmlElementNames.RoutingType)) - { - this.RoutingType = jsonProperty.ReadAsString(XmlElementNames.RoutingType); - } - } - - /// - /// Serializes the property to a Json value. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonObject = new JsonObject(); - - jsonObject.Add(XmlElementNames.EmailAddress, this.Address); - jsonObject.Add(XmlElementNames.RoutingType, this.RoutingType); - - return jsonObject; - } - - #endregion - #region ISearchStringProvider methods + /// /// Get a string representation for using this instance in a search filter. /// @@ -172,6 +150,7 @@ string ISearchStringProvider.GetSearchString() { return this.Address; } + #endregion /// @@ -269,4 +248,4 @@ public override string ToString() } #endregion } -} +} \ No newline at end of file diff --git a/ComplexProperties/ManagedFolderInformation.cs b/ComplexProperties/ManagedFolderInformation.cs index eae8657e..43bf166b 100644 --- a/ComplexProperties/ManagedFolderInformation.cs +++ b/ComplexProperties/ManagedFolderInformation.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ManagedFolderInformation class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -82,61 +97,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json. - /// - /// The json property. - /// - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.CanDelete: - this.canDelete = jsonProperty.ReadAsBool(key); - break; - case XmlElementNames.CanRenameOrMove: - this.canRenameOrMove = jsonProperty.ReadAsBool(key); - break; - case XmlElementNames.MustDisplayComment: - this.mustDisplayComment = jsonProperty.ReadAsBool(key); - break; - case XmlElementNames.HasQuota: - this.hasQuota = jsonProperty.ReadAsBool(key); - break; - case XmlElementNames.IsManagedFoldersRoot: - this.isManagedFoldersRoot = jsonProperty.ReadAsBool(key); - break; - case XmlElementNames.ManagedFolderId: - this.managedFolderId = jsonProperty.ReadAsString(key); - break; - case XmlElementNames.Comment: - string commentValue = jsonProperty.ReadAsString(key); - if (commentValue != null) - { - this.comment = commentValue; - } - break; - case XmlElementNames.StorageQuota: - this.storageQuota = jsonProperty.ReadAsInt(key); - break; - case XmlElementNames.FolderSize: - this.folderSize = jsonProperty.ReadAsInt(key); - break; - case XmlElementNames.HomePage: - string homePageValue = jsonProperty.ReadAsString(key); - if (homePageValue != null) - { - this.homePage = homePageValue; - } - break; - default: - break; - } - } - } - /// /// Gets a value indicating whether the user can delete objects in the folder. /// @@ -217,4 +177,4 @@ public string HomePage get { return this.homePage; } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/MeetingSuggestion.cs b/ComplexProperties/MeetingSuggestion.cs index e331fbe1..501b22eb 100644 --- a/ComplexProperties/MeetingSuggestion.cs +++ b/ComplexProperties/MeetingSuggestion.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the MeetingSuggestion class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -95,4 +110,4 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/MeetingSuggestionCollection.cs b/ComplexProperties/MeetingSuggestionCollection.cs index 5fd22743..ebefb458 100644 --- a/ComplexProperties/MeetingSuggestionCollection.cs +++ b/ComplexProperties/MeetingSuggestionCollection.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the MeetingSuggestionCollection class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -50,15 +65,6 @@ internal override MeetingSuggestion CreateComplexProperty(string xmlElementName) return new MeetingSuggestion(); } - /// - /// Creates the default complex property. - /// - /// MeetingSuggestion. - internal override MeetingSuggestion CreateDefaultComplexProperty() - { - return new MeetingSuggestion(); - } - /// /// Gets the name of the collection item XML element. /// @@ -69,4 +75,4 @@ internal override string GetCollectionItemXmlElementName(MeetingSuggestion compl return XmlElementNames.NlgMeetingSuggestion; } } -} +} \ No newline at end of file diff --git a/ComplexProperties/MeetingTimeZone.cs b/ComplexProperties/MeetingTimeZone.cs index 024e58df..4e63cfe4 100644 --- a/ComplexProperties/MeetingTimeZone.cs +++ b/ComplexProperties/MeetingTimeZone.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the MeetingTimeZone class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -91,37 +106,6 @@ internal override void ReadAttributesFromXml(EwsServiceXmlReader reader) this.name = reader.ReadAttributeValue(XmlAttributeNames.TimeZoneName); } - /// - /// Loads from json. - /// - /// The json property. - /// - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.BaseOffset: - this.baseOffset = EwsUtilities.XSDurationToTimeSpan(jsonProperty.ReadAsString(key)); - break; - case XmlElementNames.Standard: - this.standard = new TimeChange(); - this.standard.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service); - break; - case XmlElementNames.Daylight: - this.daylight = new TimeChange(); - this.daylight.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service); - break; - case XmlAttributeNames.TimeZoneName: - this.name = jsonProperty.ReadAsString(key); - break; - default: - break; - } - } - } - /// /// Writes the attributes to XML. /// @@ -156,39 +140,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) } } - /// - /// Serializes the property to a Json value. - /// - /// - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonProperty = new JsonObject(); - - if (this.BaseOffset.HasValue) - { - jsonProperty.Add( - XmlElementNames.BaseOffset, - EwsUtilities.TimeSpanToXSDuration(this.BaseOffset.Value)); - } - - if (this.Standard != null) - { - jsonProperty.Add(XmlElementNames.Standard, this.Standard.InternalToJson(service)); - } - - if (this.Daylight != null) - { - jsonProperty.Add(XmlElementNames.Daylight, this.Daylight.InternalToJson(service)); - } - - jsonProperty.Add(XmlAttributeNames.TimeZoneName, this.Name); - - return jsonProperty; - } - /// /// Converts this meeting time zone into a TimeZoneInfo structure. /// diff --git a/ComplexProperties/MessageBody.cs b/ComplexProperties/MessageBody.cs index d29244a0..78b04dd8 100644 --- a/ComplexProperties/MessageBody.cs +++ b/ComplexProperties/MessageBody.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the MessageBody class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -86,29 +101,6 @@ internal override void ReadTextValueFromXml(EwsServiceXmlReader reader) this.text = reader.ReadValue(); } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlAttributeNames.BodyType: - this.bodyType = jsonProperty.ReadEnumValue(key); - break; - case JsonObject.JsonValueString: - this.text = jsonProperty.ReadAsString(key); - break; - default: - break; - } - } - } - /// /// Writes attributes to XML. /// @@ -130,26 +122,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) } } - /// - /// Serializes the property to a Json value. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonProperty = new JsonObject(); - - jsonProperty.Add(XmlAttributeNames.BodyType, this.BodyType); - - if (!string.IsNullOrEmpty(this.Text)) - { - jsonProperty.Add(JsonObject.JsonValueString, this.Text); - } - return jsonProperty; - } - /// /// Gets or sets the type of the message body's text. /// @@ -181,4 +153,4 @@ public override string ToString() } #endregion } -} +} \ No newline at end of file diff --git a/ComplexProperties/MimeContent.cs b/ComplexProperties/MimeContent.cs index 6474bf45..df0f53e5 100644 --- a/ComplexProperties/MimeContent.cs +++ b/ComplexProperties/MimeContent.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the MimeContent class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -71,4 +86,4 @@ public override string ToString() } #endregion } -} +} \ No newline at end of file diff --git a/ComplexProperties/MimeContentBase.cs b/ComplexProperties/MimeContentBase.cs index a2d4d2b1..1d65b9f3 100644 --- a/ComplexProperties/MimeContentBase.cs +++ b/ComplexProperties/MimeContentBase.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the MimeContentBase class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ using System.Security.Cryptography; @@ -49,29 +64,6 @@ internal override void ReadTextValueFromXml(EwsServiceXmlReader reader) this.content = System.Convert.FromBase64String(reader.ReadValue()); } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlAttributeNames.CharacterSet: - this.characterSet = jsonProperty.ReadAsString(key); - break; - case JsonObject.JsonValueString: - this.content = jsonProperty.ReadAsBase64Content(key); - break; - default: - break; - } - } - } - /// /// Writes attributes to XML. /// @@ -93,27 +85,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) } } - /// - /// Serializes the property to a Json value. - /// - /// - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonProperty = new JsonObject(); - - jsonProperty.Add(XmlAttributeNames.ChangeKey, this.CharacterSet); - - if (this.Content != null && this.Content.Length > 0) - { - jsonProperty.AddBase64(JsonObject.JsonValueString, this.Content); - } - - return jsonProperty; - } - /// /// Gets or sets the character set of the content. /// @@ -132,4 +103,4 @@ public byte[] Content set { this.SetFieldValue(ref this.content, value); } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/MimeContentUTF8.cs b/ComplexProperties/MimeContentUTF8.cs index 2be46e08..bfed9c7d 100644 --- a/ComplexProperties/MimeContentUTF8.cs +++ b/ComplexProperties/MimeContentUTF8.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the MimeContentUTF8 class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -67,4 +82,4 @@ public override string ToString() } #endregion } -} +} \ No newline at end of file diff --git a/ComplexProperties/NormalizedBody.cs b/ComplexProperties/NormalizedBody.cs index 4a5310c1..2e3af8aa 100644 --- a/ComplexProperties/NormalizedBody.cs +++ b/ComplexProperties/NormalizedBody.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the NormalizedBody class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -61,32 +76,6 @@ internal override void ReadTextValueFromXml(EwsServiceXmlReader reader) this.text = reader.ReadValue(); } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlAttributeNames.BodyType: - this.bodyType = jsonProperty.ReadEnumValue(key); - break; - case XmlAttributeNames.IsTruncated: - this.isTruncated = jsonProperty.ReadAsBool(key); - break; - case JsonObject.JsonValueString: - this.text = jsonProperty.ReadAsString(key); - break; - default: - break; - } - } - } - /// /// Writes attributes to XML. /// @@ -108,28 +97,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) } } - /// - /// Serializes the property to a Json value. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonProperty = new JsonObject(); - - jsonProperty.Add(XmlAttributeNames.BodyType, this.BodyType); - jsonProperty.Add(XmlAttributeNames.IsTruncated, this.IsTruncated); - - if (!string.IsNullOrEmpty(this.Text)) - { - jsonProperty.Add(JsonObject.JsonValueString, this.Text); - } - - return jsonProperty; - } - /// /// Gets the type of the normalized body's text. /// @@ -191,4 +158,4 @@ public override string ToString() } #endregion } -} +} \ No newline at end of file diff --git a/ComplexProperties/OccurrenceInfo.cs b/ComplexProperties/OccurrenceInfo.cs index 53db4dbd..54b161cf 100644 --- a/ComplexProperties/OccurrenceInfo.cs +++ b/ComplexProperties/OccurrenceInfo.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the OccurrenceInfo class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -56,36 +71,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.ItemId: - this.itemId = new ItemId(); - this.itemId.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service); - break; - case XmlElementNames.Start: - this.start = service.ConvertUniversalDateTimeStringToLocalDateTime(jsonProperty.ReadAsString(key)).Value; - break; - case XmlElementNames.End: - this.end = service.ConvertUniversalDateTimeStringToLocalDateTime(jsonProperty.ReadAsString(key)).Value; - break; - case XmlElementNames.OriginalStart: - this.originalStart = service.ConvertUniversalDateTimeStringToLocalDateTime(jsonProperty.ReadAsString(key)).Value; - break; - default: - break; - } - } - } - /// /// Gets the Id of the occurrence. /// @@ -118,4 +103,4 @@ public DateTime OriginalStart get { return this.originalStart; } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/OccurrenceInfoCollection.cs b/ComplexProperties/OccurrenceInfoCollection.cs index 65493609..42596ba3 100644 --- a/ComplexProperties/OccurrenceInfoCollection.cs +++ b/ComplexProperties/OccurrenceInfoCollection.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the OccurrenceInfoCollection class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -42,15 +57,6 @@ internal override OccurrenceInfo CreateComplexProperty(string xmlElementName) } } - /// - /// Creates the default complex property. - /// - /// OccurenceInfo instance. - internal override OccurrenceInfo CreateDefaultComplexProperty() - { - return new OccurrenceInfo(); - } - /// /// Gets the name of the collection item XML element. /// @@ -61,4 +67,4 @@ internal override string GetCollectionItemXmlElementName(OccurrenceInfo complexP return XmlElementNames.Occurrence; } } -} +} \ No newline at end of file diff --git a/ComplexProperties/OnlineMeetingSettings.cs b/ComplexProperties/OnlineMeetingSettings.cs index f720593b..7171ac7c 100644 --- a/ComplexProperties/OnlineMeetingSettings.cs +++ b/ComplexProperties/OnlineMeetingSettings.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the OnlineMeetingSettings class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -213,4 +228,4 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.Presenters, this.Presenters); } } -} +} \ No newline at end of file diff --git a/ComplexProperties/PeopleInsights/CompanyInsightValue.cs b/ComplexProperties/PeopleInsights/CompanyInsightValue.cs new file mode 100644 index 00000000..8a87f9ed --- /dev/null +++ b/ComplexProperties/PeopleInsights/CompanyInsightValue.cs @@ -0,0 +1,239 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + using System.Collections.Generic; + using System.Xml; + + /// + /// Represents the CompanyInsightValue. + /// + public sealed class CompanyInsightValue : InsightValue + { + private string name; + private string satoriId; + private string description; + private string descriptionAttribution; + private string imageUrl; + private string imageUrlAttribution; + private string yearFound; + private string financeSymbol; + private string websiteUrl; + + /// + /// Gets the Name + /// + public string Name + { + get + { + return this.name; + } + + set + { + this.SetFieldValue(ref this.name, value); + } + } + + /// + /// Gets the SatoriId + /// + public string SatoriId + { + get + { + return this.satoriId; + } + + set + { + this.SetFieldValue(ref this.satoriId, value); + } + } + + /// + /// Gets the Description + /// + public string Description + { + get + { + return this.description; + } + + set + { + this.SetFieldValue(ref this.description, value); + } + } + + /// + /// Gets the DescriptionAttribution + /// + public string DescriptionAttribution + { + get + { + return this.descriptionAttribution; + } + + set + { + this.SetFieldValue(ref this.descriptionAttribution, value); + } + } + + /// + /// Gets the ImageUrl + /// + public string ImageUrl + { + get + { + return this.imageUrl; + } + + set + { + this.SetFieldValue(ref this.imageUrl, value); + } + } + + /// + /// Gets the ImageUrlAttribution + /// + public string ImageUrlAttribution + { + get + { + return this.imageUrlAttribution; + } + + set + { + this.SetFieldValue(ref this.imageUrlAttribution, value); + } + } + + /// + /// Gets the YearFound + /// + public string YearFound + { + get + { + return this.yearFound; + } + + set + { + this.SetFieldValue(ref this.yearFound, value); + } + } + + /// + /// Gets the FinanceSymbol + /// + public string FinanceSymbol + { + get + { + return this.financeSymbol; + } + + set + { + this.SetFieldValue(ref this.financeSymbol, value); + } + } + + /// + /// Gets the WebsiteUrl + /// + public string WebsiteUrl + { + get + { + return this.websiteUrl; + } + + set + { + this.SetFieldValue(ref this.websiteUrl, value); + } + } + + /// + /// Tries to read element from XML. + /// + /// XML reader + /// Whether the element was read + internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) + { + switch (reader.LocalName) + { + case XmlElementNames.InsightSource: + this.InsightSource = reader.ReadElementValue(); + break; + case XmlElementNames.UpdatedUtcTicks: + this.UpdatedUtcTicks = reader.ReadElementValue(); + break; + case XmlElementNames.Name: + this.Name = reader.ReadElementValue(); + break; + case XmlElementNames.SatoriId: + this.SatoriId = reader.ReadElementValue(); + break; + case XmlElementNames.Description: + this.Description = reader.ReadElementValue(); + break; + case XmlElementNames.DescriptionAttribution: + this.DescriptionAttribution = reader.ReadElementValue(); + break; + case XmlElementNames.ImageUrl: + this.ImageUrl = reader.ReadElementValue(); + break; + case XmlElementNames.ImageUrlAttribution: + this.ImageUrlAttribution = reader.ReadElementValue(); + break; + case XmlElementNames.YearFound: + this.YearFound = reader.ReadElementValue(); + break; + case XmlElementNames.FinanceSymbol: + this.FinanceSymbol = reader.ReadElementValue(); + break; + case XmlElementNames.WebsiteUrl: + this.WebsiteUrl = reader.ReadElementValue(); + break; + default: + return false; + } + + return true; + } + } +} \ No newline at end of file diff --git a/ComplexProperties/PeopleInsights/CompanyInsightValueCollection.cs b/ComplexProperties/PeopleInsights/CompanyInsightValueCollection.cs new file mode 100644 index 00000000..0b51ec81 --- /dev/null +++ b/ComplexProperties/PeopleInsights/CompanyInsightValueCollection.cs @@ -0,0 +1,95 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + using System; + using System.Collections.Generic; + + /// + /// Represents the collection of job insights. + /// + public sealed class CompanyInsightValueCollection : ComplexPropertyCollection + { + /// + /// XML element name + /// + private readonly string collectionItemXmlElementName; + + /// + /// Creates a new instance of the class. + /// + internal CompanyInsightValueCollection() + : this(XmlElementNames.CompanyInsightValue) + { + } + + /// + /// Creates a new instance of the class. + /// + /// Name of the collection item XML element. + internal CompanyInsightValueCollection(string collectionItemXmlElementName) + : base() + { + this.collectionItemXmlElementName = collectionItemXmlElementName; + } + + /// + /// Creates a CompanyInsightValue object from an XML element name. + /// + /// The XML element name from which to create the CompanyInsightValue. + /// A CompanyInsightValue object. + internal override CompanyInsightValue CreateComplexProperty(string xmlElementName) + { + if (xmlElementName == this.collectionItemXmlElementName) + { + return new CompanyInsightValue(); + } + else + { + return null; + } + } + + /// + /// Retrieves the XML element name corresponding to the provided PersonInsight object. + /// + /// The CompanyInsightValue object from which to determine the XML element name. + /// The XML element name corresponding to the provided CompanyInsightValue object. + internal override string GetCollectionItemXmlElementName(CompanyInsightValue insight) + { + return this.collectionItemXmlElementName; + } + + /// + /// Determine whether we should write collection to XML or not. + /// + /// Always true, even if the collection is empty. + internal override bool ShouldWriteToRequest() + { + return true; + } + } +} \ No newline at end of file diff --git a/ComplexProperties/PeopleInsights/ComputedInsightValue.cs b/ComplexProperties/PeopleInsights/ComputedInsightValue.cs new file mode 100644 index 00000000..f8433d20 --- /dev/null +++ b/ComplexProperties/PeopleInsights/ComputedInsightValue.cs @@ -0,0 +1,50 @@ +// --------------------------------------------------------------------------- +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// --------------------------------------------------------------------------- + +//----------------------------------------------------------------------- +// Implements the class for company insight value. +//----------------------------------------------------------------------- +namespace Microsoft.Exchange.WebServices.Data +{ + /// + /// Represents the ComputedInsightValue. + /// + public sealed class ComputedInsightValue : InsightValue + { + /// + /// Gets the collection of computed insight + /// value properties. + /// + public ComputedInsightValuePropertyCollection Properties + { + get; + internal set; + } + + /// + /// Tries to read element from XML. + /// + /// XML reader + /// Whether the element was read + internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) + { + switch (reader.LocalName) + { + case XmlElementNames.InsightSource: + this.InsightSource = reader.ReadElementValue(); + break; + case XmlElementNames.Properties: + this.Properties = new ComputedInsightValuePropertyCollection(); + this.Properties.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.Properties); + break; + default: + return base.TryReadElementFromXml(reader); + } + + return true; + } + } +} diff --git a/ComplexProperties/PeopleInsights/ComputedInsightValueProperty.cs b/ComplexProperties/PeopleInsights/ComputedInsightValueProperty.cs new file mode 100644 index 00000000..e7bdeae4 --- /dev/null +++ b/ComplexProperties/PeopleInsights/ComputedInsightValueProperty.cs @@ -0,0 +1,74 @@ +// --------------------------------------------------------------------------- +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// --------------------------------------------------------------------------- + +//----------------------------------------------------------------------- +// Implements the class for computed insight value property. +//----------------------------------------------------------------------- +namespace Microsoft.Exchange.WebServices.Data +{ + /// + /// Represents a computed insight value. + /// + public sealed class ComputedInsightValueProperty : ComplexProperty + { + private string key; + private string value; + + /// + /// Gets or sets the Key + /// + public string Key + { + get + { + return this.key; + } + + set + { + this.SetFieldValue(ref this.key, value); + } + } + + /// + /// Gets or sets the Value + /// + public string Value + { + get + { + return this.value; + } + + set + { + this.SetFieldValue(ref this.value, value); + } + } + + /// + /// Tries to read element from XML. + /// + /// XML reader + /// Whether the element was read + internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) + { + switch (reader.LocalName) + { + case XmlElementNames.Key: + this.Key = reader.ReadElementValue(); + break; + case XmlElementNames.Value: + this.Value = reader.ReadElementValue(); + break; + default: + return false; + } + + return true; + } + } +} diff --git a/ComplexProperties/PeopleInsights/ComputedInsightValuePropertyCollection.cs b/ComplexProperties/PeopleInsights/ComputedInsightValuePropertyCollection.cs new file mode 100644 index 00000000..178b6cab --- /dev/null +++ b/ComplexProperties/PeopleInsights/ComputedInsightValuePropertyCollection.cs @@ -0,0 +1,60 @@ +// --------------------------------------------------------------------------- +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// --------------------------------------------------------------------------- + +//----------------------------------------------------------------------- +// Implements the class for computed insight value property collection. +//----------------------------------------------------------------------- +namespace Microsoft.Exchange.WebServices.Data +{ + using System; + using System.Collections.Generic; + + /// + /// Represents a collection of computed insight values. + /// + public sealed class ComputedInsightValuePropertyCollection : ComplexPropertyCollection + { + /// + /// Initializes a new instance of the class. + /// + internal ComputedInsightValuePropertyCollection() + : base() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// The collection of objects to include. + internal ComputedInsightValuePropertyCollection(IEnumerable collection) + { + if (collection != null) + { + collection.ForEach(this.InternalAdd); + } + } + + /// + /// Creates the complex property. + /// + /// Name of the XML element. + /// ComputedInsightValueProperty. + internal override ComputedInsightValueProperty CreateComplexProperty(string xmlElementName) + { + return new ComputedInsightValueProperty(); + } + + /// + /// Gets the name of the collection item XML element. + /// + /// The complex property. + /// XML element name. + internal override string GetCollectionItemXmlElementName(ComputedInsightValueProperty complexProperty) + { + return XmlElementNames.Property; + } + } +} diff --git a/ComplexProperties/PeopleInsights/DelveDocument.cs b/ComplexProperties/PeopleInsights/DelveDocument.cs new file mode 100644 index 00000000..43ff63de --- /dev/null +++ b/ComplexProperties/PeopleInsights/DelveDocument.cs @@ -0,0 +1,259 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + using System.Collections.Generic; + using System.Xml; + + /// + /// Represents the DelveDocument. + /// + public sealed class DelveDocument : InsightValue + { + private double rank; + private string author; + private string created; + private string lastModifiedTime; + private string defaultEncodingURL; + private string fileType; + private string title; + private string lastEditor; + private string documentId; + private string previewURL; + + /// + /// Gets the Rank + /// + public double Rank + { + get + { + return this.rank; + } + + set + { + this.SetFieldValue(ref this.rank, value); + } + } + + /// + /// Gets the Author + /// + public string Author + { + get + { + return this.author; + } + + set + { + this.SetFieldValue(ref this.author, value); + } + } + + /// + /// Gets the Created + /// + public string Created + { + get + { + return this.created; + } + + set + { + this.SetFieldValue(ref this.created, value); + } + } + + /// + /// Gets the LastModifiedTime + /// + public string LastModifiedTime + { + get + { + return this.lastModifiedTime; + } + + set + { + this.SetFieldValue(ref this.lastModifiedTime, value); + } + } + + /// + /// Gets the DefaultEncodingURL + /// + public string DefaultEncodingURL + { + get + { + return this.defaultEncodingURL; + } + + set + { + this.SetFieldValue(ref this.defaultEncodingURL, value); + } + } + + /// + /// Gets the FileType + /// + public string FileType + { + get + { + return this.fileType; + } + + set + { + this.SetFieldValue(ref this.fileType, value); + } + } + + /// + /// Gets the Title + /// + public string Title + { + get + { + return this.title; + } + + set + { + this.SetFieldValue(ref this.title, value); + } + } + + /// + /// Gets the DocumentId + /// + public string DocumentId + { + get + { + return this.documentId; + } + + set + { + this.SetFieldValue(ref this.documentId, value); + } + } + + /// + /// Gets the PreviewURL + /// + public string PreviewURL + { + get + { + return this.previewURL; + } + + set + { + this.SetFieldValue(ref this.previewURL, value); + } + } + + /// + /// Gets the LastEditor + /// + public string LastEditor + { + get + { + return this.lastEditor; + } + + set + { + this.SetFieldValue(ref this.lastEditor, value); + } + } + + /// + /// Tries to read element from XML. + /// + /// XML reader + /// Whether the element was read + internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) + { + switch (reader.LocalName) + { + case XmlElementNames.InsightSource: + this.InsightSource = reader.ReadElementValue(); + break; + case XmlElementNames.UpdatedUtcTicks: + this.UpdatedUtcTicks = reader.ReadElementValue(); + break; + case XmlElementNames.Rank: + this.Rank = reader.ReadElementValue(); + break; + case XmlElementNames.Author: + this.Author = reader.ReadElementValue(); + break; + case XmlElementNames.Created: + this.Created = reader.ReadElementValue(); + break; + case XmlElementNames.LastModifiedTime: + this.LastModifiedTime = reader.ReadElementValue(); + break; + case XmlElementNames.DefaultEncodingURL: + this.DefaultEncodingURL = reader.ReadElementValue(); + break; + case XmlElementNames.FileType: + this.FileType = reader.ReadElementValue(); + break; + case XmlElementNames.Title: + this.Title = reader.ReadElementValue(); + break; + case XmlElementNames.DocumentId: + this.DocumentId = reader.ReadElementValue(); + break; + case XmlElementNames.PreviewURL: + this.PreviewURL = reader.ReadElementValue(); + break; + case XmlElementNames.LastEditor: + this.LastEditor = reader.ReadElementValue(); + break; + default: + return false; + } + + return true; + } + } +} \ No newline at end of file diff --git a/ComplexProperties/PeopleInsights/EducationInsightValue.cs b/ComplexProperties/PeopleInsights/EducationInsightValue.cs new file mode 100644 index 00000000..2deb11bd --- /dev/null +++ b/ComplexProperties/PeopleInsights/EducationInsightValue.cs @@ -0,0 +1,139 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + using System.Collections.Generic; + using System.Xml; + + /// + /// Represents the EducationInsightValue. + /// + public sealed class EducationInsightValue : InsightValue + { + private string institute; + private string degree; + private long startUtcTicks; + private long endUtcTicks; + + /// + /// Gets the Institute + /// + public string Institute + { + get + { + return this.institute; + } + + set + { + this.SetFieldValue(ref this.institute, value); + } + } + + /// + /// Gets the Degree + /// + public string Degree + { + get + { + return this.degree; + } + + set + { + this.SetFieldValue(ref this.degree, value); + } + } + + /// + /// Gets the StartUtcTicks + /// + public long StartUtcTicks + { + get + { + return this.startUtcTicks; + } + + set + { + this.SetFieldValue(ref this.startUtcTicks, value); + } + } + + /// + /// Gets the EndUtcTicks + /// + public long EndUtcTicks + { + get + { + return this.endUtcTicks; + } + + set + { + this.SetFieldValue(ref this.endUtcTicks, value); + } + } + + /// + /// Tries to read element from XML. + /// + /// XML reader + /// Whether the element was read + internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) + { + switch (reader.LocalName) + { + case XmlElementNames.InsightSource: + this.InsightSource = reader.ReadElementValue(); + break; + case XmlElementNames.UpdatedUtcTicks: + this.UpdatedUtcTicks = reader.ReadElementValue(); + break; + case XmlElementNames.Institute: + this.Institute = reader.ReadElementValue(); + break; + case XmlElementNames.Degree: + this.Degree = reader.ReadElementValue(); + break; + case XmlElementNames.StartUtcTicks: + this.StartUtcTicks = reader.ReadElementValue(); + break; + case XmlElementNames.EndUtcTicks: + this.EndUtcTicks = reader.ReadElementValue(); + break; + default: + return false; + } + + return true; + } + } +} \ No newline at end of file diff --git a/ComplexProperties/PeopleInsights/EmailInsightValue.cs b/ComplexProperties/PeopleInsights/EmailInsightValue.cs new file mode 100644 index 00000000..877c9045 --- /dev/null +++ b/ComplexProperties/PeopleInsights/EmailInsightValue.cs @@ -0,0 +1,143 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + using System.Collections.Generic; + using System.Xml; + + /// + /// Represents the EmailInsightValue. + /// + public sealed class EmailInsightValue : InsightValue + { + /// + /// Gets the Id + /// + public string Id + { + get; + internal set; + } + + /// + /// Gets the ThreadId + /// + public string ThreadId + { + get; + internal set; + } + + /// + /// Gets the Subject + /// + public string Subject + { + get; + internal set; + } + + /// + /// Gets the LastEmailDateUtcTicks + /// + public long LastEmailDateUtcTicks + { + get; + internal set; + } + + /// + /// Gets the Body + /// + public string Body + { + get; + internal set; + } + + /// + /// Gets the LastEmailSender + /// + public ProfileInsightValue LastEmailSender + { + get; + internal set; + } + + /// + /// Gets the EmailsCount + /// + public int EmailsCount + { + get; + internal set; + } + + /// + /// Tries to read element from XML. + /// + /// XML reader + /// Whether the element was read + internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) + { + switch (reader.LocalName) + { + case XmlElementNames.InsightSource: + this.InsightSource = reader.ReadElementValue(); + break; + case XmlElementNames.UpdatedUtcTicks: + this.UpdatedUtcTicks = reader.ReadElementValue(); + break; + case XmlElementNames.Id: + this.Id = reader.ReadElementValue(); + break; + case XmlElementNames.ThreadId: + this.ThreadId = reader.ReadElementValue(); + break; + case XmlElementNames.Subject: + this.Subject = reader.ReadElementValue(); + break; + case XmlElementNames.LastEmailDateUtcTicks: + this.LastEmailDateUtcTicks = reader.ReadElementValue(); + break; + case XmlElementNames.Body: + this.Body = reader.ReadElementValue(); + break; + case XmlElementNames.LastEmailSender: + this.LastEmailSender = new ProfileInsightValue(); + this.LastEmailSender.LoadFromXml(reader, reader.LocalName); + break; + case XmlElementNames.EmailsCount: + this.EmailsCount = reader.ReadElementValue(); + break; + default: + return false; + } + + return true; + } + } +} \ No newline at end of file diff --git a/ComplexProperties/PeopleInsights/InsightValue.cs b/ComplexProperties/PeopleInsights/InsightValue.cs new file mode 100644 index 00000000..ed39610e --- /dev/null +++ b/ComplexProperties/PeopleInsights/InsightValue.cs @@ -0,0 +1,59 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + using System.Collections.Generic; + using System.Xml; + + /// + /// Represents the InsightValue. + /// + public class InsightValue : ComplexProperty + { + private long updatedUtcTicks; + + /// + /// Gets the InsightSource + /// + public string InsightSource { get; set; } + + /// + /// Gets the UpdatedUtcTicks + /// + public long UpdatedUtcTicks + { + get + { + return this.updatedUtcTicks; + } + + set + { + this.SetFieldValue(ref this.updatedUtcTicks, value); + } + } + } +} \ No newline at end of file diff --git a/ComplexProperties/PeopleInsights/InsightValueCollection.cs b/ComplexProperties/PeopleInsights/InsightValueCollection.cs new file mode 100644 index 00000000..3e0a078c --- /dev/null +++ b/ComplexProperties/PeopleInsights/InsightValueCollection.cs @@ -0,0 +1,76 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + using System.Collections.Generic; + using System.Xml; + + /// + /// Represents the collection of InsightValue. + /// + public class InsightValueCollection : ComplexPropertyCollection + { + /// + /// Initializes a new instance of the class. + /// + internal InsightValueCollection() + : base() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// The collection of objects to include. + internal InsightValueCollection(IEnumerable collection) + { + if (collection != null) + { + collection.ForEach(this.InternalAdd); + } + } + + /// + /// Creates the complex property. + /// + /// Name of the XML element. + /// InsightValue. + internal override InsightValue CreateComplexProperty(string xmlElementName) + { + return new InsightValue(); + } + + /// + /// Gets the name of the collection item XML element. + /// + /// The complex property. + /// XML element name. + internal override string GetCollectionItemXmlElementName(InsightValue complexProperty) + { + return XmlElementNames.Item; + } + } +} \ No newline at end of file diff --git a/ComplexProperties/PeopleInsights/JobInsightValue.cs b/ComplexProperties/PeopleInsights/JobInsightValue.cs new file mode 100644 index 00000000..a33bc53e --- /dev/null +++ b/ComplexProperties/PeopleInsights/JobInsightValue.cs @@ -0,0 +1,224 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + using System.Collections.Generic; + using System.Xml; + + /// + /// Represents the JobInsightValue. + /// + public sealed class JobInsightValue : InsightValue + { + private string company; + private string companyDescription; + private string companyTicker; + private string companyLogoUrl; + private string companyWebsiteUrl; + private string companyLinkedInUrl; + private string title; + private long startUtcTicks; + private long endUtcTicks; + + /// + /// Gets the Company + /// + public string Company + { + get + { + return this.company; + } + + set + { + this.SetFieldValue(ref this.company, value); + } + } + + /// + /// Gets the CompanyDescription + /// + public string CompanyDescription + { + get + { + return this.companyDescription; + } + + set + { + this.SetFieldValue(ref this.companyDescription, value); + } + } + + /// + /// Gets the CompanyTicker + /// + public string CompanyTicker + { + get + { + return this.companyTicker; + } + + set + { + this.SetFieldValue(ref this.companyTicker, value); + } + } + + /// + /// Gets the CompanyLogoUrl + /// + public string CompanyLogoUrl + { + get + { + return this.companyLogoUrl; + } + + set + { + this.SetFieldValue(ref this.companyLogoUrl, value); + } + } + + /// + /// Gets the CompanyWebsiteUrl + /// + public string CompanyWebsiteUrl + { + get + { + return this.companyWebsiteUrl; + } + + set + { + this.SetFieldValue(ref this.companyWebsiteUrl, value); + } + } + + /// + /// Gets the CompanyLinkedInUrl + /// + public string CompanyLinkedInUrl + { + get + { + return this.companyLinkedInUrl; + } + + set + { + this.SetFieldValue(ref this.companyLinkedInUrl, value); + } + } + + /// + /// Gets the Title + /// + public string Title + { + get + { + return this.title; + } + + set + { + this.SetFieldValue(ref this.title, value); + } + } + + /// + /// Gets the StartUtcTicks + /// + public long StartUtcTicks + { + get + { + return this.startUtcTicks; + } + + set + { + this.SetFieldValue(ref this.startUtcTicks, value); + } + } + + /// + /// Gets the EndUtcTicks + /// + public long EndUtcTicks + { + get + { + return this.endUtcTicks; + } + + set + { + this.SetFieldValue(ref this.endUtcTicks, value); + } + } + + /// + /// Tries to read element from XML. + /// + /// XML reader + /// Whether the element was read + internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) + { + switch (reader.LocalName) + { + case XmlElementNames.InsightSource: + this.InsightSource = reader.ReadElementValue(); + break; + case XmlElementNames.UpdatedUtcTicks: + this.UpdatedUtcTicks = reader.ReadElementValue(); + break; + case XmlElementNames.Company: + this.Company = reader.ReadElementValue(); + break; + case XmlElementNames.Title: + this.Title = reader.ReadElementValue(); + break; + case XmlElementNames.StartUtcTicks: + this.StartUtcTicks = reader.ReadElementValue(); + break; + case XmlElementNames.EndUtcTicks: + this.EndUtcTicks = reader.ReadElementValue(); + break; + default: + return false; + } + + return true; + } + } +} \ No newline at end of file diff --git a/ComplexProperties/PeopleInsights/JobInsightValueCollection.cs b/ComplexProperties/PeopleInsights/JobInsightValueCollection.cs new file mode 100644 index 00000000..e2b55a3f --- /dev/null +++ b/ComplexProperties/PeopleInsights/JobInsightValueCollection.cs @@ -0,0 +1,95 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + using System; + using System.Collections.Generic; + + /// + /// Represents the collection of job insights. + /// + public sealed class JobInsightValueCollection : ComplexPropertyCollection + { + /// + /// XML element name + /// + private readonly string collectionItemXmlElementName; + + /// + /// Creates a new instance of the class. + /// + internal JobInsightValueCollection() + : this(XmlElementNames.JobInsight) + { + } + + /// + /// Creates a new instance of the class. + /// + /// Name of the collection item XML element. + internal JobInsightValueCollection(string collectionItemXmlElementName) + : base() + { + this.collectionItemXmlElementName = collectionItemXmlElementName; + } + + /// + /// Creates a SkillInsightValue object from an XML element name. + /// + /// The XML element name from which to create the JobInsightValue. + /// A JobInsightValue object. + internal override JobInsightValue CreateComplexProperty(string xmlElementName) + { + if (xmlElementName == this.collectionItemXmlElementName) + { + return new JobInsightValue(); + } + else + { + return null; + } + } + + /// + /// Retrieves the XML element name corresponding to the provided PersonInsight object. + /// + /// The SkillInsightValue object from which to determine the XML element name. + /// The XML element name corresponding to the provided JobInsightValue object. + internal override string GetCollectionItemXmlElementName(JobInsightValue insight) + { + return this.collectionItemXmlElementName; + } + + /// + /// Determine whether we should write collection to XML or not. + /// + /// Always true, even if the collection is empty. + internal override bool ShouldWriteToRequest() + { + return true; + } + } +} \ No newline at end of file diff --git a/ComplexProperties/PeopleInsights/MeetingInsightValue.cs b/ComplexProperties/PeopleInsights/MeetingInsightValue.cs new file mode 100644 index 00000000..f7d6b37e --- /dev/null +++ b/ComplexProperties/PeopleInsights/MeetingInsightValue.cs @@ -0,0 +1,153 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + using System.Collections.Generic; + using System.Xml; + + /// + /// Represents the MeetingInsightValue. + /// + public sealed class MeetingInsightValue : InsightValue + { + /// + /// Initializes a new instance of the class. + /// + public MeetingInsightValue() + : base() + { + this.Attendees = new ProfileInsightValueCollection(); + } + + /// + /// Gets the Id + /// + public string Id + { + get; + internal set; + } + + /// + /// Gets the Subject + /// + public string Subject + { + get; + internal set; + } + + /// + /// Gets the StartUtcTicks + /// + public long StartUtcTicks + { + get; + internal set; + } + + /// + /// Gets the EndUtcTicks + /// + public long EndUtcTicks + { + get; + internal set; + } + + /// + /// Gets the Location + /// + public string Location + { + get; + internal set; + } + + /// + /// Gets the Organizer + /// + public ProfileInsightValue Organizer + { + get; + internal set; + } + + /// + /// Gets the Attendees + /// + public ProfileInsightValueCollection Attendees + { + get; + internal set; + } + + /// + /// Tries to read element from XML. + /// + /// XML reader + /// Whether the element was read + internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) + { + switch (reader.LocalName) + { + case XmlElementNames.InsightSource: + this.InsightSource = reader.ReadElementValue(); + break; + case XmlElementNames.UpdatedUtcTicks: + this.UpdatedUtcTicks = reader.ReadElementValue(); + break; + case XmlElementNames.Id: + this.Id = reader.ReadElementValue(); + break; + case XmlElementNames.Subject: + this.Subject = reader.ReadElementValue(); + break; + case XmlElementNames.StartUtcTicks: + this.StartUtcTicks = reader.ReadElementValue(); + break; + case XmlElementNames.EndUtcTicks: + this.EndUtcTicks = reader.ReadElementValue(); + break; + case XmlElementNames.Location: + this.Location = reader.ReadElementValue(); + break; + case XmlElementNames.Organizer: + this.Organizer = new ProfileInsightValue(); + this.Organizer.LoadFromXml(reader, reader.LocalName); + break; + case XmlElementNames.Attendees: + this.Attendees = new ProfileInsightValueCollection(XmlElementNames.Item); + this.Attendees.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.Attendees); + break; + default: + return false; + } + + return true; + } + } +} \ No newline at end of file diff --git a/ComplexProperties/PeopleInsights/MultiValueInsightContent.cs b/ComplexProperties/PeopleInsights/MultiValueInsightContent.cs new file mode 100644 index 00000000..eda3d246 --- /dev/null +++ b/ComplexProperties/PeopleInsights/MultiValueInsightContent.cs @@ -0,0 +1,129 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + using System.Collections.Generic; + using System.Xml; + + /// + /// Represents the MultiValueInsightContent. + /// + public sealed class MultiValueInsightContent : ComplexProperty + { + /// + /// Gets the ItemList + /// + public InsightValueCollection ItemList { get; internal set; } + + /// + /// Initializes a new instance of the class. + /// + public MultiValueInsightContent() + : base() + { + this.ItemList = new InsightValueCollection(); + } + + /// + /// Tries to read element from XML. + /// + /// The reader. + /// True if element was read. + internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) + { + do + { + reader.Read(); + InsightValue item = null; + + if (reader.NodeType == XmlNodeType.Element && reader.LocalName == XmlElementNames.Item) + { + switch (reader.ReadAttributeValue("xsi:type")) + { + case XmlElementNames.StringInsightValue: + item = new StringInsightValue(); + item.LoadFromXml(reader, reader.LocalName); + this.ItemList.InternalAdd(item); + break; + case XmlElementNames.ProfileInsightValue: + item = new ProfileInsightValue(); + item.LoadFromXml(reader, reader.LocalName); + this.ItemList.InternalAdd(item); + break; + case XmlElementNames.JobInsightValue: + item = new JobInsightValue(); + item.LoadFromXml(reader, reader.LocalName); + this.ItemList.InternalAdd(item); + break; + case XmlElementNames.UserProfilePicture: + item = new UserProfilePicture(); + item.LoadFromXml(reader, reader.LocalName); + this.ItemList.InternalAdd(item); + break; + case XmlElementNames.EducationInsightValue: + item = new EducationInsightValue(); + item.LoadFromXml(reader, reader.LocalName); + this.ItemList.InternalAdd(item); + break; + case XmlElementNames.SkillInsightValue: + item = new SkillInsightValue(); + item.LoadFromXml(reader, reader.LocalName); + this.ItemList.InternalAdd(item); + break; + case XmlElementNames.ComputedInsightValue: + item = new ComputedInsightValue(); + item.LoadFromXml(reader, reader.LocalName); + this.ItemList.InternalAdd(item); + break; + case XmlElementNames.MeetingInsightValue: + item = new MeetingInsightValue(); + item.LoadFromXml(reader, reader.LocalName); + this.ItemList.InternalAdd(item); + break; + case XmlElementNames.EmailInsightValue: + item = new EmailInsightValue(); + item.LoadFromXml(reader, reader.LocalName); + this.ItemList.InternalAdd(item); + break; + case XmlElementNames.DelveDocument: + item = new DelveDocument(); + item.LoadFromXml(reader, reader.LocalName); + this.ItemList.InternalAdd(item); + break; + default: + return false; + } + } + else + { + return false; + } + } while (!reader.IsEndElement(XmlNamespace.Messages, XmlElementNames.ItemList)); + + return true; + } + } +} \ No newline at end of file diff --git a/ComplexProperties/PeopleInsights/OutOfOfficeInsightValue.cs b/ComplexProperties/PeopleInsights/OutOfOfficeInsightValue.cs new file mode 100644 index 00000000..61f23591 --- /dev/null +++ b/ComplexProperties/PeopleInsights/OutOfOfficeInsightValue.cs @@ -0,0 +1,118 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + using System; + using System.Collections.Generic; + using System.Globalization; + using System.Xml; + + /// + /// Represents the OutOfOfficeInsightValue. + /// + public sealed class OutOfOfficeInsightValue : InsightValue + { + private DateTime startTime; + private DateTime endTime; + private string culture = CultureInfo.CurrentCulture.Name; + private string message; + + /// + /// Get the start date and time. + /// + public DateTime StartTime + { + get + { + return this.startTime; + } + } + + /// + /// Get the end date and time. + /// + public DateTime EndTime + { + get + { + return this.endTime; + } + } + + /// + /// Get the culture of the reply. + /// + public string Culture + { + get + { + return this.culture; + } + } + + /// + /// Get the reply message. + /// + public string Message + { + get + { + return this.message; + } + } + + /// + /// Tries to read element from XML. + /// + /// XML reader + /// Whether the element was read + internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) + { + switch (reader.LocalName) + { + case XmlElementNames.InsightSource: + this.InsightSource = reader.ReadElementValue(); + break; + case XmlElementNames.StartTime: + this.startTime = reader.ReadElementValueAsDateTime(XmlNamespace.Types, XmlElementNames.StartTime).Value; + break; + case XmlElementNames.EndTime: + this.endTime = reader.ReadElementValueAsDateTime(XmlNamespace.Types, XmlElementNames.EndTime).Value; + break; + case XmlElementNames.Culture: + this.culture = reader.ReadElementValue(); + break; + case XmlElementNames.Message: + this.message = reader.ReadElementValue(); + break; + default: + return false; + } + + return true; + } + } +} diff --git a/ComplexProperties/PeopleInsights/Person.cs b/ComplexProperties/PeopleInsights/Person.cs new file mode 100644 index 00000000..412b476a --- /dev/null +++ b/ComplexProperties/PeopleInsights/Person.cs @@ -0,0 +1,415 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + /// + /// Represents the Person. + /// + public class Person : ComplexProperty + { + /// + /// Initializes a local instance of + /// + public Person() + : base() + { + } + + /// + /// Gets the EmailAddress. + /// + public string EmailAddress + { + get; + internal set; + } + + /// + /// Gets the collection of insights. + /// + public PersonInsightCollection Insights + { + get; + internal set; + } + + /// + /// Gets the display name. + /// + public string FullName + { + get; + internal set; + } + + /// + /// Gets the display name. + /// + public string DisplayName + { + get; + internal set; + } + + /// + /// Gets the given name. + /// + public string GivenName + { + get; + internal set; + } + + /// + /// Gets the surname. + /// + public string Surname + { + get; + internal set; + } + + /// + /// Gets the phone number. + /// + public string PhoneNumber + { + get; + internal set; + } + + /// + /// Gets the sms number. + /// + public string SMSNumber + { + get; + internal set; + } + + /// + /// Gets the facebook profile link. + /// + public string FacebookProfileLink + { + get; + internal set; + } + + /// + /// Gets the linkedin profile link. + /// + public string LinkedInProfileLink + { + get; + internal set; + } + + /// + /// Gets the list of skills. + /// + public SkillInsightValueCollection Skills + { + get; + internal set; + } + + /// + /// Gets the professional biography. + /// + public string ProfessionalBiography + { + get; + internal set; + } + + /// + /// Gets the management chain. + /// + public ProfileInsightValueCollection ManagementChain + { + get; + internal set; + } + + /// + /// Gets the list of direct reports. + /// + public ProfileInsightValueCollection DirectReports + { + get; + internal set; + } + + /// + /// Gets the list of peers. + /// + public ProfileInsightValueCollection Peers + { + get; + internal set; + } + + /// + /// Gets the team size. + /// + public string TeamSize + { + get; + internal set; + } + + /// + /// Gets the current job. + /// + public JobInsightValueCollection CurrentJob + { + get; + internal set; + } + + /// + /// Gets the birthday. + /// + public string Birthday + { + get; + internal set; + } + + /// + /// Gets the hometown. + /// + public string Hometown + { + get; + internal set; + } + + /// + /// Gets the current location. + /// + public string CurrentLocation + { + get; + internal set; + } + + /// + /// Gets the company profile. + /// + public CompanyInsightValueCollection CompanyProfile + { + get; + internal set; + } + + /// + /// Gets the office. + /// + public string Office + { + get; + internal set; + } + + /// + /// Gets the headline. + /// + public string Headline + { + get; + internal set; + } + + /// + /// Gets the list of mutual connections. + /// + public ProfileInsightValueCollection MutualConnections + { + get; + internal set; + } + + /// + /// Gets the title. + /// + public string Title + { + get; + internal set; + } + + /// + /// Gets the mutual manager. + /// + public ProfileInsightValue MutualManager + { + get; + internal set; + } + + /// + /// Gets the alias. + /// + public string Alias + { + get; + internal set; + } + + /// + /// Gets the Department. + /// + public string Department + { + get; + internal set; + } + + /// + /// Gets the user profile picture. + /// + public UserProfilePicture UserProfilePicture + { + get; + internal set; + } + + /// + /// Tries to read element from XML. + /// + /// The reader. + /// True if element was read. + internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) + { + switch (reader.LocalName) + { + case XmlElementNames.EmailAddress: + this.EmailAddress = reader.ReadElementValue(); + break; + case XmlElementNames.FullName: + this.FullName = reader.ReadElementValue(); + break; + case XmlElementNames.DisplayName: + this.DisplayName = reader.ReadElementValue(); + break; + case XmlElementNames.GivenName: + this.GivenName = reader.ReadElementValue(); + break; + case XmlElementNames.Surname: + this.Surname = reader.ReadElementValue(); + break; + case XmlElementNames.PhoneNumber: + this.PhoneNumber = reader.ReadElementValue(); + break; + case XmlElementNames.SMSNumber: + this.SMSNumber = reader.ReadElementValue(); + break; + case XmlElementNames.FacebookProfileLink: + this.FacebookProfileLink = reader.ReadElementValue(); + break; + case XmlElementNames.LinkedInProfileLink: + this.LinkedInProfileLink = reader.ReadElementValue(); + break; + case XmlElementNames.ProfessionalBiography: + this.ProfessionalBiography = reader.ReadElementValue(); + break; + case XmlElementNames.TeamSize: + this.TeamSize = reader.ReadElementValue(); + break; + case XmlElementNames.Birthday: + this.Birthday = reader.ReadElementValue(); + break; + case XmlElementNames.Hometown: + this.Hometown = reader.ReadElementValue(); + break; + case XmlElementNames.CurrentLocation: + this.CurrentLocation = reader.ReadElementValue(); + break; + case XmlElementNames.Office: + this.Office = reader.ReadElementValue(); + break; + case XmlElementNames.Headline: + this.Headline = reader.ReadElementValue(); + break; + case XmlElementNames.Title: + this.Title = reader.ReadElementValue(); + break; + case XmlElementNames.Alias: + this.Alias = reader.ReadElementValue(); + break; + case XmlElementNames.Department: + this.Department = reader.ReadElementValue(); + break; + case XmlElementNames.MutualManager: + this.MutualManager = new ProfileInsightValue(); + this.MutualManager.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.MutualManager); + break; + case XmlElementNames.ManagementChain: + this.ManagementChain = new ProfileInsightValueCollection(XmlElementNames.Item); + this.ManagementChain.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.ManagementChain); + break; + case XmlElementNames.DirectReports: + this.DirectReports = new ProfileInsightValueCollection(XmlElementNames.Item); + this.DirectReports.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.DirectReports); + break; + case XmlElementNames.Peers: + this.Peers = new ProfileInsightValueCollection(XmlElementNames.Item); + this.Peers.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.Peers); + break; + case XmlElementNames.MutualConnections: + this.MutualConnections = new ProfileInsightValueCollection(XmlElementNames.Item); + this.MutualConnections.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.MutualConnections); + break; + case XmlElementNames.Skills: + this.Skills = new SkillInsightValueCollection(XmlElementNames.Item); + this.Skills.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.Skills); + break; + case XmlElementNames.CurrentJob: + this.CurrentJob = new JobInsightValueCollection(XmlElementNames.Item); + this.CurrentJob.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.CurrentJob); + break; + case XmlElementNames.CompanyProfile: + this.CompanyProfile = new CompanyInsightValueCollection(XmlElementNames.Item); + this.CompanyProfile.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.CompanyProfile); + break; + case XmlElementNames.Insights: + this.Insights = new PersonInsightCollection(); + this.Insights.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.Insights); + break; + case XmlElementNames.UserProfilePicture: + this.UserProfilePicture = new UserProfilePicture(); + this.UserProfilePicture.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.UserProfilePicture); + break; + default: + return base.TryReadElementFromXml(reader); + } + + return true; + } + } +} \ No newline at end of file diff --git a/ComplexProperties/PeopleInsights/PersonInsight.cs b/ComplexProperties/PeopleInsights/PersonInsight.cs new file mode 100644 index 00000000..9d0fd688 --- /dev/null +++ b/ComplexProperties/PeopleInsights/PersonInsight.cs @@ -0,0 +1,189 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + using System.Collections.Generic; + using System.Xml; + + /// + /// Represents the PersonInsight. + /// + public sealed class PersonInsight : ComplexProperty + { + /// + /// Initializes a new instance of the class. + /// + public PersonInsight() : base() + { + this.ItemList = new InsightValueCollection(); + } + + /// + /// Gets the string + /// + public string InsightType { get; internal set; } + + /// + /// Gets the Rank + /// + public double Rank { get; internal set; } + + /// + /// Gets the Content + /// + public ComplexProperty Content { get; internal set; } + + /// + /// Gets the ItemList + /// + public InsightValueCollection ItemList { get; internal set; } + + /// + /// Tries to read element from XML. + /// + /// The reader. + /// True if element was read. + internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) + { + while (true) + { + switch (reader.LocalName) + { + case XmlElementNames.InsightType: + this.InsightType = reader.ReadElementValue(); + break; + case XmlElementNames.Rank: + this.Rank = reader.ReadElementValue(); + break; + case XmlElementNames.Content: + var type = reader.ReadAttributeValue("xsi:type"); + switch (type) + { + case XmlElementNames.SingleValueInsightContent: + this.Content = new SingleValueInsightContent(); + ((SingleValueInsightContent)this.Content).LoadFromXml(reader, reader.LocalName); + break; + case XmlElementNames.MultiValueInsightContent: + this.Content = new MultiValueInsightContent(); + ((MultiValueInsightContent)this.Content).LoadFromXml(reader, reader.LocalName); + break; + default: + return false; + } + break; + case XmlElementNames.ItemList: + this.ReadItemList(reader); + break; + default: + return false; + } + + return true; + } + } + + /// + /// Reads ItemList from XML + /// + /// The reader. + private void ReadItemList(EwsServiceXmlReader reader) + { + do + { + reader.Read(); + InsightValue item = null; + + if (reader.NodeType == XmlNodeType.Element && reader.LocalName == XmlElementNames.Item) + { + switch (reader.ReadAttributeValue("xsi:type")) + { + case XmlElementNames.StringInsightValue: + item = new StringInsightValue(); + item.LoadFromXml(reader, reader.LocalName); + this.ItemList.InternalAdd(item); + break; + case XmlElementNames.ProfileInsightValue: + item = new ProfileInsightValue(); + item.LoadFromXml(reader, reader.LocalName); + this.ItemList.InternalAdd(item); + break; + case XmlElementNames.JobInsightValue: + item = new JobInsightValue(); + item.LoadFromXml(reader, reader.LocalName); + this.ItemList.InternalAdd(item); + break; + case XmlElementNames.UserProfilePicture: + item = new UserProfilePicture(); + item.LoadFromXml(reader, reader.LocalName); + this.ItemList.InternalAdd(item); + break; + case XmlElementNames.EducationInsightValue: + item = new EducationInsightValue(); + item.LoadFromXml(reader, reader.LocalName); + this.ItemList.InternalAdd(item); + break; + case XmlElementNames.SkillInsightValue: + item = new SkillInsightValue(); + item.LoadFromXml(reader, reader.LocalName); + this.ItemList.InternalAdd(item); + break; + case XmlElementNames.ComputedInsightValue: + item = new ComputedInsightValue(); + item.LoadFromXml(reader, reader.LocalName); + this.ItemList.InternalAdd(item); + break; + case XmlElementNames.MeetingInsightValue: + item = new MeetingInsightValue(); + item.LoadFromXml(reader, reader.LocalName); + this.ItemList.InternalAdd(item); + break; + case XmlElementNames.EmailInsightValue: + item = new EmailInsightValue(); + item.LoadFromXml(reader, reader.LocalName); + this.ItemList.InternalAdd(item); + break; + case XmlElementNames.DelveDocument: + item = new DelveDocument(); + item.LoadFromXml(reader, reader.LocalName); + this.ItemList.InternalAdd(item); + break; + case XmlElementNames.CompanyInsightValue: + item = new CompanyInsightValue(); + item.LoadFromXml(reader, reader.LocalName); + this.ItemList.InternalAdd(item); + break; + case XmlElementNames.OutOfOfficeInsightValue: + item = new OutOfOfficeInsightValue(); + item.LoadFromXml(reader, reader.LocalName); + this.ItemList.InternalAdd(item); + break; + } + } + } + while (!reader.IsEndElement(XmlNamespace.Types, XmlElementNames.ItemList)); + } + } +} \ No newline at end of file diff --git a/ComplexProperties/PeopleInsights/PersonInsightCollection.cs b/ComplexProperties/PeopleInsights/PersonInsightCollection.cs new file mode 100644 index 00000000..6c2b1d1e --- /dev/null +++ b/ComplexProperties/PeopleInsights/PersonInsightCollection.cs @@ -0,0 +1,153 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + using System; + using System.Collections.Generic; + + /// + /// Represents the collection of person insights. + /// + public sealed class PersonInsightCollection : ComplexPropertyCollection + { + /// + /// XML element name + /// + private readonly string collectionItemXmlElementName; + + /// + /// Creates a new instance of the class. + /// + internal PersonInsightCollection() + : this(XmlElementNames.Insight) + { + } + + /// + /// Creates a new instance of the class. + /// + /// Name of the collection item XML element. + internal PersonInsightCollection(string collectionItemXmlElementName) + : base() + { + this.collectionItemXmlElementName = collectionItemXmlElementName; + } + + /// + /// Adds an insight to the collection. + /// + /// The insight to add. + public void Add(PersonInsight insight) + { + this.InternalAdd(insight); + } + + /// + /// Adds multiple person insights to the collection. + /// + /// The collection of person insights to add. + public void AddRange(IEnumerable insights) + { + if (insights != null) + { + foreach (PersonInsight insight in insights) + { + this.Add(insight); + } + } + } + + /// + /// Clears the collection. + /// + public void Clear() + { + this.InternalClear(); + } + + /// + /// Removes a person insight from the collection. + /// + /// The index of the person insight to remove. + public void RemoveAt(int index) + { + if (index < 0 || index >= this.Count) + { + throw new ArgumentOutOfRangeException("index", Strings.IndexIsOutOfRange); + } + + this.InternalRemoveAt(index); + } + + /// + /// Removes a person insight from the collection. + /// + /// The person sight to remove. + /// Whether removed from the collection + public bool Remove(PersonInsight insight) + { + EwsUtilities.ValidateParam(insight, "insight"); + + return this.InternalRemove(insight); + } + + /// + /// Creates a PersonInsight object from an XML element name. + /// + /// The XML element name from which to create the PersonInsight. + /// A PersonInsight object. + internal override PersonInsight CreateComplexProperty(string xmlElementName) + { + if (xmlElementName == this.collectionItemXmlElementName) + { + return new PersonInsight(); + } + else + { + return null; + } + } + + /// + /// Retrieves the XML element name corresponding to the provided PersonInsight object. + /// + /// The PersonInsight object from which to determine the XML element name. + /// The XML element name corresponding to the provided PersonInsight object. + internal override string GetCollectionItemXmlElementName(PersonInsight insight) + { + return this.collectionItemXmlElementName; + } + + /// + /// Determine whether we should write collection to XML or not. + /// + /// Always true, even if the collection is empty. + internal override bool ShouldWriteToRequest() + { + return true; + } + } +} \ No newline at end of file diff --git a/ComplexProperties/PeopleInsights/ProfileInsightValue.cs b/ComplexProperties/PeopleInsights/ProfileInsightValue.cs new file mode 100644 index 00000000..2f29aec7 --- /dev/null +++ b/ComplexProperties/PeopleInsights/ProfileInsightValue.cs @@ -0,0 +1,181 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + using System.Collections.Generic; + using System.Xml; + + /// + /// Represents the ProfileInsightValue. + /// + public sealed class ProfileInsightValue : InsightValue + { + private string fullName; + private string firstName; + private string lastName; + private string emailAddress; + private string avatar; + private long joinedUtcTicks; + private UserProfilePicture profilePicture; + private string title; + + /// + /// Gets the FullName + /// + public string FullName + { + get + { + return this.fullName; + } + } + + /// + /// Gets the FirstName + /// + public string FirstName + { + get + { + return this.firstName; + } + } + + /// + /// Gets the LastName + /// + public string LastName + { + get + { + return this.lastName; + } + } + + /// + /// Gets the EmailAddress + /// + public string EmailAddress + { + get + { + return this.emailAddress; + } + } + + /// + /// Gets the Avatar + /// + public string Avatar + { + get + { + return this.avatar; + } + } + + /// + /// Gets the JoinedUtcTicks + /// + public long JoinedUtcTicks + { + get + { + return this.joinedUtcTicks; + } + } + + /// + /// Gets the ProfilePicture + /// + public UserProfilePicture ProfilePicture + { + get + { + return this.profilePicture; + } + } + + /// + /// Gets the Title + /// + public string Title + { + get + { + return this.title; + } + } + + /// + /// Tries to read element from XML. + /// + /// XML reader + /// Whether the element was read + internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) + { + switch (reader.LocalName) + { + case XmlElementNames.InsightSource: + this.InsightSource = reader.ReadElementValue(); + break; + case XmlElementNames.UpdatedUtcTicks: + this.UpdatedUtcTicks = reader.ReadElementValue(); + break; + case XmlElementNames.FullName: + this.fullName = reader.ReadElementValue(); + break; + case XmlElementNames.FirstName: + this.firstName = reader.ReadElementValue(); + break; + case XmlElementNames.LastName: + this.lastName = reader.ReadElementValue(); + break; + case XmlElementNames.EmailAddress: + this.emailAddress = reader.ReadElementValue(); + break; + case XmlElementNames.Avatar: + this.avatar = reader.ReadElementValue(); + break; + case XmlElementNames.JoinedUtcTicks: + this.joinedUtcTicks = reader.ReadElementValue(); + break; + case XmlElementNames.ProfilePicture: + var picture = new UserProfilePicture(); + picture.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.UserProfilePicture); + this.profilePicture = new UserProfilePicture(); + break; + case XmlElementNames.Title: + this.title = reader.ReadElementValue(); + break; + default: + return false; + } + + return true; + } + } +} \ No newline at end of file diff --git a/ComplexProperties/PeopleInsights/ProfileInsightValueCollection.cs b/ComplexProperties/PeopleInsights/ProfileInsightValueCollection.cs new file mode 100644 index 00000000..96a1f325 --- /dev/null +++ b/ComplexProperties/PeopleInsights/ProfileInsightValueCollection.cs @@ -0,0 +1,95 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + using System; + using System.Collections.Generic; + + /// + /// Represents the collection of profile insight values. + /// + public sealed class ProfileInsightValueCollection : ComplexPropertyCollection + { + /// + /// XML element name + /// + private readonly string collectionItemXmlElementName; + + /// + /// Creates a new instance of the class. + /// + internal ProfileInsightValueCollection() + : this(XmlElementNames.ProfileInsightValue) + { + } + + /// + /// Creates a new instance of the class. + /// + /// Name of the collection item XML element. + internal ProfileInsightValueCollection(string collectionItemXmlElementName) + : base() + { + this.collectionItemXmlElementName = collectionItemXmlElementName; + } + + /// + /// Creates a ProfileInsightValue object from an XML element name. + /// + /// The XML element name from which to create the ProfileInsightValue. + /// A ProfileInsightValue object. + internal override ProfileInsightValue CreateComplexProperty(string xmlElementName) + { + if (xmlElementName == this.collectionItemXmlElementName) + { + return new ProfileInsightValue(); + } + else + { + return null; + } + } + + /// + /// Retrieves the XML element name corresponding to the provided PersonInsight object. + /// + /// The ProfileInsightValue object from which to determine the XML element name. + /// The XML element name corresponding to the provided ProfileInsightValue object. + internal override string GetCollectionItemXmlElementName(ProfileInsightValue insight) + { + return this.collectionItemXmlElementName; + } + + /// + /// Determine whether we should write collection to XML or not. + /// + /// Always true, even if the collection is empty. + internal override bool ShouldWriteToRequest() + { + return true; + } + } +} \ No newline at end of file diff --git a/ComplexProperties/PeopleInsights/SingleValueInsightContent.cs b/ComplexProperties/PeopleInsights/SingleValueInsightContent.cs new file mode 100644 index 00000000..5068670c --- /dev/null +++ b/ComplexProperties/PeopleInsights/SingleValueInsightContent.cs @@ -0,0 +1,97 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + using System.Collections.Generic; + using System.Xml; + + /// + /// Represents the SingleValueInsightContent. + /// + public sealed class SingleValueInsightContent : ComplexProperty + { + /// + /// Gets the Item + /// + public InsightValue Item { get; internal set; } + + /// + /// Tries to read element from XML. + /// + /// The reader. + /// True if element was read. + internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) + { + switch (reader.ReadAttributeValue("xsi:type")) + { + case XmlElementNames.StringInsightValue: + this.Item = new StringInsightValue(); + this.Item.LoadFromXml(reader, reader.LocalName); + break; + case XmlElementNames.ProfileInsightValue: + this.Item = new ProfileInsightValue(); + this.Item.LoadFromXml(reader, reader.LocalName); + break; + case XmlElementNames.JobInsightValue: + this.Item = new JobInsightValue(); + this.Item.LoadFromXml(reader, reader.LocalName); + break; + case XmlElementNames.UserProfilePicture: + this.Item = new UserProfilePicture(); + this.Item.LoadFromXml(reader, reader.LocalName); + break; + case XmlElementNames.EducationInsightValue: + this.Item = new EducationInsightValue(); + this.Item.LoadFromXml(reader, reader.LocalName); + break; + case XmlElementNames.SkillInsightValue: + this.Item = new SkillInsightValue(); + this.Item.LoadFromXml(reader, reader.LocalName); + break; + case XmlElementNames.DelveDocument: + this.Item = new DelveDocument(); + this.Item.LoadFromXml(reader, reader.LocalName); + break; + case XmlElementNames.CompanyInsightValue: + this.Item = new CompanyInsightValue(); + this.Item.LoadFromXml(reader, reader.LocalName); + break; + case XmlElementNames.ComputedInsightValue: + this.Item = new ComputedInsightValue(); + this.Item.LoadFromXml(reader, reader.LocalName); + break; + case XmlElementNames.OutOfOfficeInsightValue: + this.Item = new OutOfOfficeInsightValue(); + this.Item.LoadFromXml(reader, reader.LocalName); + break; + default: + return false; + } + + return true; + } + } +} \ No newline at end of file diff --git a/ComplexProperties/PeopleInsights/SkillInsightValue.cs b/ComplexProperties/PeopleInsights/SkillInsightValue.cs new file mode 100644 index 00000000..5cd99d3d --- /dev/null +++ b/ComplexProperties/PeopleInsights/SkillInsightValue.cs @@ -0,0 +1,99 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + using System.Collections.Generic; + using System.Xml; + + /// + /// Represents the SkillInsightValue. + /// + public sealed class SkillInsightValue : InsightValue + { + private string name; + private string strength; + + /// + /// Gets the Name + /// + public string Name + { + get + { + return this.name; + } + + set + { + this.SetFieldValue(ref this.name, value); + } + } + + /// + /// Gets the Strength + /// + public string Strength + { + get + { + return this.strength; + } + + set + { + this.SetFieldValue(ref this.strength, value); + } + } + + /// + /// Tries to read element from XML. + /// + /// XML reader + /// Whether the element was read + internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) + { + switch (reader.LocalName) + { + case XmlElementNames.InsightSource: + this.InsightSource = reader.ReadElementValue(); + break; + case XmlElementNames.UpdatedUtcTicks: + this.UpdatedUtcTicks = reader.ReadElementValue(); + break; + case XmlElementNames.Name: + this.Name = reader.ReadElementValue(); + break; + case XmlElementNames.Strength: + this.Strength = reader.ReadElementValue(); + break; + default: + return false; + } + + return true; + } + } +} \ No newline at end of file diff --git a/ComplexProperties/PeopleInsights/SkillInsightValueCollection.cs b/ComplexProperties/PeopleInsights/SkillInsightValueCollection.cs new file mode 100644 index 00000000..8375992a --- /dev/null +++ b/ComplexProperties/PeopleInsights/SkillInsightValueCollection.cs @@ -0,0 +1,95 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + using System; + using System.Collections.Generic; + + /// + /// Represents the collection of person insights. + /// + public sealed class SkillInsightValueCollection : ComplexPropertyCollection + { + /// + /// XML element name + /// + private readonly string collectionItemXmlElementName; + + /// + /// Creates a new instance of the class. + /// + internal SkillInsightValueCollection() + : this(XmlElementNames.SkillInsightValue) + { + } + + /// + /// Creates a new instance of the class. + /// + /// Name of the collection item XML element. + internal SkillInsightValueCollection(string collectionItemXmlElementName) + : base() + { + this.collectionItemXmlElementName = collectionItemXmlElementName; + } + + /// + /// Creates a SkillInsightValue object from an XML element name. + /// + /// The XML element name from which to create the SkillInsightValue. + /// A SkillInsightValue object. + internal override SkillInsightValue CreateComplexProperty(string xmlElementName) + { + if (xmlElementName == this.collectionItemXmlElementName) + { + return new SkillInsightValue(); + } + else + { + return null; + } + } + + /// + /// Retrieves the XML element name corresponding to the provided PersonInsight object. + /// + /// The SkillInsightValue object from which to determine the XML element name. + /// The XML element name corresponding to the provided SkillInsightValue object. + internal override string GetCollectionItemXmlElementName(SkillInsightValue insight) + { + return this.collectionItemXmlElementName; + } + + /// + /// Determine whether we should write collection to XML or not. + /// + /// Always true, even if the collection is empty. + internal override bool ShouldWriteToRequest() + { + return true; + } + } +} \ No newline at end of file diff --git a/ComplexProperties/PeopleInsights/StringInsightValue.cs b/ComplexProperties/PeopleInsights/StringInsightValue.cs new file mode 100644 index 00000000..baf44311 --- /dev/null +++ b/ComplexProperties/PeopleInsights/StringInsightValue.cs @@ -0,0 +1,79 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + using System.Collections.Generic; + using System.Xml; + + /// + /// Represents the StringInsightValue. + /// + public sealed class StringInsightValue : InsightValue + { + private string data; + + /// + /// Gets the Data + /// + public string Data + { + get + { + return this.data; + } + + set + { + this.SetFieldValue(ref this.data, value); + } + } + + /// + /// Tries to read element from XML. + /// + /// XML reader + /// Whether the element was read + internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) + { + switch (reader.LocalName) + { + case XmlElementNames.InsightSource: + this.InsightSource = reader.ReadElementValue(); + break; + case XmlElementNames.UpdatedUtcTicks: + this.UpdatedUtcTicks = reader.ReadElementValue(); + break; + case XmlElementNames.Data: + this.Data = reader.ReadElementValue(); + break; + default: + return false; + } + + return true; + } + } +} \ No newline at end of file diff --git a/ComplexProperties/PeopleInsights/UserProfilePicture.cs b/ComplexProperties/PeopleInsights/UserProfilePicture.cs new file mode 100644 index 00000000..2146da6d --- /dev/null +++ b/ComplexProperties/PeopleInsights/UserProfilePicture.cs @@ -0,0 +1,139 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + using System.Collections.Generic; + using System.Xml; + + /// + /// Represents the UserProfilePicture. + /// + public sealed class UserProfilePicture : InsightValue + { + private string blob; + private string photoSize; + private string url; + private string imageType; + + /// + /// Gets the Blob + /// + public string Blob + { + get + { + return this.blob; + } + + set + { + this.SetFieldValue(ref this.blob, value); + } + } + + /// + /// Gets the PhotoSize + /// + public string PhotoSize + { + get + { + return this.photoSize; + } + + set + { + this.SetFieldValue(ref this.photoSize, value); + } + } + + /// + /// Gets the Url + /// + public string Url + { + get + { + return this.url; + } + + set + { + this.SetFieldValue(ref this.url, value); + } + } + + /// + /// Gets the ImageType + /// + public string ImageType + { + get + { + return this.imageType; + } + + set + { + this.SetFieldValue(ref this.imageType, value); + } + } + + /// + /// Tries to read element from XML. + /// + /// XML reader + /// Whether the element was read + internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) + { + switch (reader.LocalName) + { + case XmlElementNames.InsightSource: + this.InsightSource = reader.ReadElementValue(); + break; + case XmlElementNames.UpdatedUtcTicks: + this.UpdatedUtcTicks = reader.ReadElementValue(); + break; + case XmlElementNames.Blob: + this.Blob = reader.ReadElementValue(); + break; + case XmlElementNames.PhotoSize: + this.PhotoSize = reader.ReadElementValue(); + break; + case XmlElementNames.Url: + this.Url = reader.ReadElementValue(); + break; + case XmlElementNames.ImageType: + this.ImageType = reader.ReadElementValue(); + break; + default: + return false; + } + + return true; + } + } +} \ No newline at end of file diff --git a/ComplexProperties/PersonaEmailAddress.cs b/ComplexProperties/PersonaEmailAddress.cs new file mode 100644 index 00000000..28ec63e5 --- /dev/null +++ b/ComplexProperties/PersonaEmailAddress.cs @@ -0,0 +1,282 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + /// + /// Represents an e-mail address. + /// + public sealed class PersonaEmailAddress : ComplexProperty, ISearchStringProvider + { + /// + /// Creates a new instance of the class. + /// + public PersonaEmailAddress() + : base() + { + _emailAddress = new EmailAddress(); + } + + /// + /// Creates a new instance of the class. + /// + /// The SMTP address used to initialize the PersonaEmailAddress. + public PersonaEmailAddress(string smtpAddress) + : this() + { + EwsUtilities.ValidateParam(smtpAddress, "smtpAddress"); + this.Address = smtpAddress; + } + + /// + /// Creates a new instance of the class. + /// + /// The name used to initialize the PersonaEmailAddress. + /// The SMTP address used to initialize the PersonaEmailAddress. + public PersonaEmailAddress(string name, string smtpAddress) + : this(smtpAddress) + { + EwsUtilities.ValidateParam(name, "name"); + this.Name = name; + } + + /// + /// Name accessors + /// + public string Name + { + get + { + return _emailAddress.Name; + } + + set + { + _emailAddress.Name = value; + } + } + + /// + /// Email address accessors. The type of the Address property must match the specified routing type. + /// If RoutingType is not set, Address is assumed to be an SMTP address. + /// + public string Address + { + get + { + return _emailAddress.Address; + } + + set + { + _emailAddress.Address = value; + } + } + + /// + /// Routing type accessors. If RoutingType is not set, Address is assumed to be an SMTP address. + /// + public string RoutingType + { + get + { + return _emailAddress.RoutingType; + } + + set + { + _emailAddress.RoutingType = value; + } + } + + /// + /// Mailbox type accessors + /// + public MailboxType? MailboxType + { + get + { + return _emailAddress.MailboxType; + } + + set + { + _emailAddress.MailboxType = value; + } + } + + /// + /// PersonaEmailAddress Id accessors + /// + public ItemId Id + { + get + { + return _emailAddress.Id; + } + + set + { + _emailAddress.Id = value; + } + } + + /// + /// Original display name accessors + /// + public string OriginalDisplayName { get; set; } + + /// + /// Email address details + /// + private EmailAddress _emailAddress; + + /// + /// Defines an implicit conversion from a string representing an SMTP address to PeronaEmailAddress. + /// + /// The SMTP address to convert to EmailAddress. + /// An EmailAddress initialized with the specified SMTP address. + public static implicit operator PersonaEmailAddress(string smtpAddress) + { + return new PersonaEmailAddress(smtpAddress); + } + + /// + /// Tries to read element from XML. + /// + /// XML reader + /// Whether the element was read + internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) + { + while (true) + { + switch (reader.LocalName) + { + case XmlElementNames.Name: + this.Name = reader.ReadElementValue(); + break; + case XmlElementNames.EmailAddress: + this.Address = reader.ReadElementValue(); + + // Process the next node before returning. Otherwise, the current node + // makes ComplexProperty.InternalLoadFromXml think that this ends the outer + // node, causing the remaining children of the outer EmailAddress node to be skipped. + reader.Read(); + if (reader.NodeType == System.Xml.XmlNodeType.Element) + { + continue; + } + break; + case XmlElementNames.RoutingType: + this.RoutingType = reader.ReadElementValue(); + break; + case XmlElementNames.MailboxType: + this.MailboxType = reader.ReadElementValue(); + break; + case XmlElementNames.ItemId: + this.Id = new ItemId(); + this.Id.LoadFromXml(reader, reader.LocalName); + break; + case XmlElementNames.OriginalDisplayName: + this.OriginalDisplayName = reader.ReadElementValue(); + break; + default: + return false; + } + + return true; + } + } + + /// + /// Writes elements to XML. + /// + /// XML writer + internal override void WriteElementsToXml(EwsServiceXmlWriter writer) + { + writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.Name, this.Name); + writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.EmailAddress, this.Address); + writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.RoutingType, this.RoutingType); + writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.MailboxType, this.MailboxType); + + if (!string.IsNullOrEmpty(this.OriginalDisplayName)) + { + writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.OriginalDisplayName, this.OriginalDisplayName); + } + + if (this.Id != null) + { + this.Id.WriteToXml(writer, XmlElementNames.ItemId); + } + } + + #region ISearchStringProvider methods + /// + /// Get a string representation for using this instance in a search filter. + /// + /// String representation of instance. + string ISearchStringProvider.GetSearchString() + { + return this.Address; + } + #endregion + + #region Object method overrides + /// + /// Returns a that represents the current . + /// + /// + /// A that represents the current . + /// + public override string ToString() + { + string addressPart; + + if (string.IsNullOrEmpty(this.Address)) + { + return string.Empty; + } + + if (!string.IsNullOrEmpty(this.RoutingType)) + { + addressPart = this.RoutingType + ":" + this.Address; + } + else + { + addressPart = this.Address; + } + + if (!string.IsNullOrEmpty(this.Name)) + { + return this.Name + " <" + addressPart + ">"; + } + else + { + return addressPart; + } + } + #endregion + } +} \ No newline at end of file diff --git a/ComplexProperties/PersonaEmailAddressCollection.cs b/ComplexProperties/PersonaEmailAddressCollection.cs new file mode 100644 index 00000000..0a2acf12 --- /dev/null +++ b/ComplexProperties/PersonaEmailAddressCollection.cs @@ -0,0 +1,200 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + using System; + using System.Collections.Generic; + + /// + /// Represents a collection of persona e-mail addresses. + /// + public sealed class PersonaEmailAddressCollection : ComplexPropertyCollection + { + /// + /// XML element name + /// + private readonly string collectionItemXmlElementName; + + /// + /// Creates a new instance of the class. + /// + /// + /// MSDN example incorrectly shows root element as EmailAddress. In fact, it is Address. + /// + internal PersonaEmailAddressCollection() + : this(XmlElementNames.Address) + { + } + + /// + /// Creates a new instance of the class. + /// + /// Name of the collection item XML element. + internal PersonaEmailAddressCollection(string collectionItemXmlElementName) + : base() + { + this.collectionItemXmlElementName = collectionItemXmlElementName; + } + + /// + /// Adds a persona e-mail address to the collection. + /// + /// The persona e-mail address to add. + public void Add(PersonaEmailAddress emailAddress) + { + this.InternalAdd(emailAddress); + } + + /// + /// Adds multiple persona e-mail addresses to the collection. + /// + /// The collection of persona e-mail addresses to add. + public void AddRange(IEnumerable emailAddresses) + { + if (emailAddresses != null) + { + foreach (PersonaEmailAddress emailAddress in emailAddresses) + { + this.Add(emailAddress); + } + } + } + + /// + /// Adds a persona e-mail address to the collection. + /// + /// The SMTP address used to initialize the persona e-mail address. + /// An PersonaEmailAddress object initialized with the provided SMTP address. + public PersonaEmailAddress Add(string smtpAddress) + { + PersonaEmailAddress emailAddress = new PersonaEmailAddress(smtpAddress); + + this.Add(emailAddress); + + return emailAddress; + } + + /// + /// Adds multiple e-mail addresses to the collection. + /// + /// The SMTP addresses to be added as persona email addresses + public void AddRange(IEnumerable smtpAddresses) + { + if (smtpAddresses != null) + { + foreach (string smtpAddress in smtpAddresses) + { + this.Add(smtpAddress); + } + } + } + + /// + /// Adds an e-mail address to the collection. + /// + /// The name used to initialize the persona e-mail address. + /// The SMTP address used to initialize the persona e-mail address. + /// An PersonaEmailAddress object initialized with the provided SMTP address. + public PersonaEmailAddress Add(string name, string smtpAddress) + { + PersonaEmailAddress emailAddress = new PersonaEmailAddress(name, smtpAddress); + + this.Add(emailAddress); + + return emailAddress; + } + + /// + /// Clears the collection. + /// + public void Clear() + { + this.InternalClear(); + } + + /// + /// Removes a persona e-mail address from the collection. + /// + /// The index of the e-mail address to remove. + public void RemoveAt(int index) + { + if (index < 0 || index >= this.Count) + { + throw new ArgumentOutOfRangeException("index", Strings.IndexIsOutOfRange); + } + + this.InternalRemoveAt(index); + } + + /// + /// Removes a persona e-mail address from the collection. + /// + /// The e-mail address to remove. + /// Whether removed from the collection + public bool Remove(PersonaEmailAddress personaEmailAddress) + { + EwsUtilities.ValidateParam(personaEmailAddress, "personaEmailAddress"); + + return this.InternalRemove(personaEmailAddress); + } + + /// + /// Creates a PersonaEmailAddress object from an XML element name. + /// + /// The XML element name from which to create the persona e-mail address. + /// A PersonaEmailAddress object. + internal override PersonaEmailAddress CreateComplexProperty(string xmlElementName) + { + if (xmlElementName == this.collectionItemXmlElementName) + { + return new PersonaEmailAddress(); + } + else + { + return null; + } + } + + /// + /// Retrieves the XML element name corresponding to the provided PersonaEmailAddress object. + /// + /// The PersonaEmailAddress object from which to determine the XML element name. + /// The XML element name corresponding to the provided PersonaEmailAddress object. + internal override string GetCollectionItemXmlElementName(PersonaEmailAddress personaEmailAddress) + { + return this.collectionItemXmlElementName; + } + + /// + /// Determine whether we should write collection to XML or not. + /// + /// Always true, even if the collection is empty. + internal override bool ShouldWriteToRequest() + { + return true; + } + } +} \ No newline at end of file diff --git a/ComplexProperties/PersonaId.cs b/ComplexProperties/PersonaId.cs new file mode 100644 index 00000000..be821478 --- /dev/null +++ b/ComplexProperties/PersonaId.cs @@ -0,0 +1,104 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + using System; + + /// + /// Represents the Id of a Persona. + /// + public sealed class PersonaId : ServiceId + { + /// + /// Creates a new instance of the class. + /// + internal PersonaId() + : base() + { + } + + /// + /// Defines an implicit conversion from Id string to PersonaId. + /// + /// The unique Id to convert to PersonaId. + /// A PersonaId initialized with the specified unique Id. + public static implicit operator PersonaId(string uniqueId) + { + return new PersonaId(uniqueId); + } + + /// + /// Defines an implicit conversion from PersonaId to a Id string. + /// + /// The PersonaId to be converted + /// A PersonaId initialized with the specified unique Id. + public static implicit operator String(PersonaId PersonaId) + { + if (PersonaId == null) + { + throw new ArgumentNullException("PersonaId"); + } + + if (String.IsNullOrEmpty(PersonaId.UniqueId)) + { + return string.Empty; + } + else + { + // Ignoring the change key info + return PersonaId.UniqueId; + } + } + + /// + /// Gets the name of the XML element. + /// + /// XML element name. + internal override string GetXmlElementName() + { + return XmlElementNames.PersonaId; + } + + /// + /// Creates a new instance of PersonaId. + /// + /// The unique Id used to initialize the . + public PersonaId(string uniqueId) + : base(uniqueId) + { + } + + /// + /// Gets a string representation of the Persona Id. + /// + /// The string representation of the Persona id. + public override string ToString() + { + // We have ignored the change key portion + return this.UniqueId; + } + } +} \ No newline at end of file diff --git a/ComplexProperties/PersonaPostalAddress.cs b/ComplexProperties/PersonaPostalAddress.cs index 0acf1d5d..d857b0fb 100644 --- a/ComplexProperties/PersonaPostalAddress.cs +++ b/ComplexProperties/PersonaPostalAddress.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the PersonaPostalAddress class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -168,65 +183,6 @@ internal void LoadFromXml(EwsServiceXmlReader reader) while (!reader.IsEndElement(XmlNamespace.Types, XmlElementNames.PersonaPostalAddress)); } - /// - /// Loads from json. - /// - /// The json property. - /// - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.Street: - this.street = jsonProperty.ReadAsString(key); - break; - case XmlElementNames.City: - this.city = jsonProperty.ReadAsString(key); - break; - case XmlElementNames.Country: - this.country = jsonProperty.ReadAsString(key); - break; - case XmlElementNames.PostalCode: - this.postalCode = jsonProperty.ReadAsString(key); - break; - case XmlElementNames.PostOfficeBox: - this.postOfficeBox = jsonProperty.ReadAsString(key); - break; - case XmlElementNames.PostalAddressType: - this.type = jsonProperty.ReadAsString(key); - break; - case XmlElementNames.Latitude: - this.latitude = jsonProperty.ReadAsDouble(key); - break; - case XmlElementNames.Longitude: - this.longitude = jsonProperty.ReadAsDouble(key); - break; - case XmlElementNames.Accuracy: - this.accuracy = jsonProperty.ReadAsDouble(key); - break; - case XmlElementNames.Altitude: - this.altitude = jsonProperty.ReadAsDouble(key); - break; - case XmlElementNames.AltitudeAccuracy: - this.altitudeAccuracy = jsonProperty.ReadAsDouble(key); - break; - case XmlElementNames.FormattedAddress: - this.formattedAddress = jsonProperty.ReadAsString(key); - break; - case XmlElementNames.LocationUri: - this.uri = jsonProperty.ReadAsString(key); - break; - case XmlElementNames.LocationSource: - this.source = jsonProperty.ReadEnumValue(key); - break; - default: - break; - } - } - } - /// /// Gets or sets the street. /// @@ -385,35 +341,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.LocationSource, this.source); } - /// - /// Serializes the property to a Json value. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonProperty = new JsonObject(); - - jsonProperty.Add(XmlElementNames.Street, this.street); - jsonProperty.Add(XmlElementNames.City, this.city); - jsonProperty.Add(XmlElementNames.Country, this.country); - jsonProperty.Add(XmlElementNames.PostalCode, this.postalCode); - jsonProperty.Add(XmlElementNames.PostOfficeBox, this.postOfficeBox); - jsonProperty.Add(XmlElementNames.PostalAddressType, this.type); - jsonProperty.Add(XmlElementNames.Latitude, this.latitude); - jsonProperty.Add(XmlElementNames.Longitude, this.longitude); - jsonProperty.Add(XmlElementNames.Accuracy, this.accuracy); - jsonProperty.Add(XmlElementNames.Altitude, this.altitude); - jsonProperty.Add(XmlElementNames.AltitudeAccuracy, this.altitudeAccuracy); - jsonProperty.Add(XmlElementNames.FormattedAddress, this.formattedAddress); - jsonProperty.Add(XmlElementNames.LocationUri, this.uri); - jsonProperty.Add(XmlElementNames.LocationSource, this.source); - - return jsonProperty; - } - /// /// Writes to XML. /// @@ -427,4 +354,4 @@ internal void WriteToXml(EwsServiceXmlWriter writer) writer.WriteEndElement(); // xmlElementName } } -} +} \ No newline at end of file diff --git a/ComplexProperties/PhoneEntity.cs b/ComplexProperties/PhoneEntity.cs index dba111e2..41a7db8a 100644 --- a/ComplexProperties/PhoneEntity.cs +++ b/ComplexProperties/PhoneEntity.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the PhoneEntity class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -67,4 +82,4 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/PhoneEntityCollection.cs b/ComplexProperties/PhoneEntityCollection.cs index 59a58b23..4e1a7852 100644 --- a/ComplexProperties/PhoneEntityCollection.cs +++ b/ComplexProperties/PhoneEntityCollection.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the PhoneEntityCollection class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -50,15 +65,6 @@ internal override PhoneEntity CreateComplexProperty(string xmlElementName) return new PhoneEntity(); } - /// - /// Creates the default complex property. - /// - /// PhoneEntity. - internal override PhoneEntity CreateDefaultComplexProperty() - { - return new PhoneEntity(); - } - /// /// Gets the name of the collection item XML element. /// @@ -69,4 +75,4 @@ internal override string GetCollectionItemXmlElementName(PhoneEntity complexProp return XmlElementNames.NlgPhone; } } -} +} \ No newline at end of file diff --git a/ComplexProperties/PhoneNumberDictionary.cs b/ComplexProperties/PhoneNumberDictionary.cs index ea27a549..ad16e065 100644 --- a/ComplexProperties/PhoneNumberDictionary.cs +++ b/ComplexProperties/PhoneNumberDictionary.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the PhoneNumberDictionary class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -101,4 +116,4 @@ public bool TryGetValue(PhoneNumberKey key, out string phoneNumber) } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/PhoneNumberEntry.cs b/ComplexProperties/PhoneNumberEntry.cs index 35f93376..e21e340b 100644 --- a/ComplexProperties/PhoneNumberEntry.cs +++ b/ComplexProperties/PhoneNumberEntry.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the PhoneNumberEntry class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -60,34 +75,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) writer.WriteValue(this.PhoneNumber, XmlElementNames.PhoneNumber); } - /// - /// Serializes the property to a Json value. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonProperty = new JsonObject(); - - jsonProperty.Add(XmlAttributeNames.Key, this.Key); - jsonProperty.Add(XmlElementNames.PhoneNumber, this.PhoneNumber); - - return jsonProperty; - } - - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - this.Key = jsonProperty.ReadEnumValue(XmlAttributeNames.Key); - this.PhoneNumber = jsonProperty.ReadAsString(XmlElementNames.PhoneNumber); - } - /// /// Gets or sets the phone number of the entry. /// @@ -97,4 +84,4 @@ public string PhoneNumber set { this.SetFieldValue(ref this.phoneNumber, value); } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/PhysicalAddressDictionary.cs b/ComplexProperties/PhysicalAddressDictionary.cs index f6facc58..8b08ba89 100644 --- a/ComplexProperties/PhysicalAddressDictionary.cs +++ b/ComplexProperties/PhysicalAddressDictionary.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the PhysicalAddressDictionary class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -69,4 +84,4 @@ public bool TryGetValue(PhysicalAddressKey key, out PhysicalAddressEntry physica return this.Entries.TryGetValue(key, out physicalAddress); } } -} +} \ No newline at end of file diff --git a/ComplexProperties/PhysicalAddressEntry.cs b/ComplexProperties/PhysicalAddressEntry.cs index 151c7c7e..c123017e 100644 --- a/ComplexProperties/PhysicalAddressEntry.cs +++ b/ComplexProperties/PhysicalAddressEntry.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Implements the representation of a physical address. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -191,59 +206,6 @@ internal override bool WriteSetUpdateToXml( return true; } - /// - /// Writes the set update to json. - /// - /// The service. - /// The ews object. - /// The property definition. - /// The updates. - /// - internal override bool WriteSetUpdateToJson(ExchangeService service, ServiceObject ewsObject, PropertyDefinition propertyDefinition, List updates) - { - List propertiesToSet = new List(); - - propertiesToSet.AddRange(this.propertyBag.AddedItems); - propertiesToSet.AddRange(this.propertyBag.ModifiedItems); - - foreach (string propertyName in propertiesToSet) - { - JsonObject jsonUpdate = new JsonObject(); - - jsonUpdate.AddTypeParameter(ewsObject.GetSetFieldXmlElementName()); - - JsonObject jsonUri = new JsonObject(); - - jsonUri.AddTypeParameter(JsonNames.PathToIndexedFieldType); - jsonUri.Add(XmlAttributeNames.FieldURI, GetFieldUri(propertyName)); - jsonUri.Add(XmlAttributeNames.FieldIndex, this.Key.ToString()); - - jsonUpdate.Add(JsonNames.Path, jsonUri); - - JsonObject jsonProperty = new JsonObject(); - jsonProperty.Add(XmlAttributeNames.Key, this.Key); - jsonProperty.Add(propertyName, this.propertyBag[propertyName]); - - JsonObject jsonServiceObject = new JsonObject(); - jsonServiceObject.AddTypeParameter(ewsObject.GetXmlElementName()); - jsonServiceObject.Add(propertyDefinition.XmlElementName, new JsonObject[] { jsonProperty }); - - jsonUpdate.Add(PropertyBag.GetPropertyUpdateItemName(ewsObject), jsonServiceObject); - - updates.Add(jsonUpdate); - } - - foreach (string propertyName in this.propertyBag.RemovedItems) - { - this.InternalWriteDeleteUpdateToJson( - ewsObject, - propertyName, - updates); - } - - return true; - } - /// /// Writes the delete update to XML. /// @@ -263,86 +225,6 @@ internal override bool WriteDeleteUpdateToXml(EwsServiceXmlWriter writer, Servic return true; } - /// - /// Writes field deletion to json. - /// - /// The service. - /// The ews object. - /// The updates. - /// - internal override bool WriteDeleteUpdateToJson(ExchangeService service, ServiceObject ewsObject, List updates) - { - foreach (string propertyName in PhysicalAddressSchema.XmlElementNames) - { - this.InternalWriteDeleteUpdateToJson( - ewsObject, - propertyName, - updates); - } - - return true; - } - - /// - /// Internal the write delete update to json. - /// - /// The ews object. - /// Name of the property. - /// The updates. - internal void InternalWriteDeleteUpdateToJson(ServiceObject ewsObject, string propertyName, List updates) - { - JsonObject jsonUpdate = new JsonObject(); - - jsonUpdate.AddTypeParameter(ewsObject.GetDeleteFieldXmlElementName()); - - JsonObject jsonUri = new JsonObject(); - - jsonUri.AddTypeParameter(JsonNames.PathToIndexedFieldType); - jsonUri.Add(XmlAttributeNames.FieldURI, GetFieldUri(propertyName)); - jsonUri.Add(XmlAttributeNames.FieldIndex, this.Key.ToString()); - - jsonUpdate.Add(JsonNames.Path, jsonUri); - - updates.Add(jsonUpdate); - } - - /// - /// Serializes the property to a Json value. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonProperty = new JsonObject(); - - jsonProperty.Add(XmlAttributeNames.Key, this.Key); - jsonProperty.Add(XmlElementNames.Street, this.Street); - jsonProperty.Add(XmlElementNames.City, this.City); - jsonProperty.Add(XmlElementNames.State, this.State); - jsonProperty.Add(XmlElementNames.CountryOrRegion, this.CountryOrRegion); - jsonProperty.Add(XmlElementNames.PostalCode, this.PostalCode); - - return jsonProperty; - } - - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - this.Key = jsonProperty.ReadEnumValue(XmlAttributeNames.Key); - this.Street = jsonProperty.ReadAsString(XmlElementNames.Street); - this.City = jsonProperty.ReadAsString(XmlElementNames.City); - this.State = jsonProperty.ReadAsString(XmlElementNames.State); - this.Street = jsonProperty.ReadAsString(XmlElementNames.Street); - this.CountryOrRegion = jsonProperty.ReadAsString(XmlElementNames.CountryOrRegion); - this.PostalCode = jsonProperty.ReadAsString(XmlElementNames.PostalCode); - } - #endregion #region Private methods @@ -426,4 +308,4 @@ public static List XmlElementNames #endregion } -} +} \ No newline at end of file diff --git a/ComplexProperties/PolicyTag.cs b/ComplexProperties/PolicyTag.cs index 3b0d629b..09f89efb 100644 --- a/ComplexProperties/PolicyTag.cs +++ b/ComplexProperties/PolicyTag.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the PolicyTag class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -37,4 +52,4 @@ public PolicyTag(bool isExplicit, Guid retentionId) this.RetentionId = retentionId; } } -} +} \ No newline at end of file diff --git a/ComplexProperties/Recurrence/DayOfTheWeekCollection.cs b/ComplexProperties/Recurrence/DayOfTheWeekCollection.cs index 808a4d91..fc32ccfb 100644 --- a/ComplexProperties/Recurrence/DayOfTheWeekCollection.cs +++ b/ComplexProperties/Recurrence/DayOfTheWeekCollection.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the DayOfTheWeekCollection enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -32,7 +47,7 @@ internal DayOfTheWeekCollection() /// /// The separator. /// String representation of collection. - private string ToString(string separator) + internal string ToString(string separator) { if (this.Count == 0) { @@ -66,29 +81,6 @@ internal override void LoadFromXml(EwsServiceXmlReader reader, string xmlElement ' '); } - /// - /// Loads from json. - /// - /// The json property. - /// - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - // DayOfTheWeekCollection is implemented as a Json primitive, rather than as a Json object. - throw new InvalidOperationException(); - } - - /// - /// Loads from json value. - /// - /// The json value. - internal void LoadFromJsonValue(string jsonValue) - { - EwsUtilities.ParseEnumValueList( - this.items, - jsonValue, - ' '); - } - /// /// Writes to XML. /// @@ -107,18 +99,6 @@ internal override void WriteToXml(EwsServiceXmlWriter writer, string xmlElementN } } - /// - /// Serializes the property to a Json value. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - return this.ToString(" "); - } - /// /// Builds string representation of the collection. /// @@ -244,4 +224,4 @@ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() #endregion } -} +} \ No newline at end of file diff --git a/ComplexProperties/Recurrence/Patterns/Recurrence.DailyPattern.cs b/ComplexProperties/Recurrence/Patterns/Recurrence.DailyPattern.cs index c1a0a607..8ae46d60 100644 --- a/ComplexProperties/Recurrence/Patterns/Recurrence.DailyPattern.cs +++ b/ComplexProperties/Recurrence/Patterns/Recurrence.DailyPattern.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the Recurrence.DailyPattern class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/ComplexProperties/Recurrence/Patterns/Recurrence.DailyRegenerationPattern.cs b/ComplexProperties/Recurrence/Patterns/Recurrence.DailyRegenerationPattern.cs index b2cb11e8..08a16eea 100644 --- a/ComplexProperties/Recurrence/Patterns/Recurrence.DailyRegenerationPattern.cs +++ b/ComplexProperties/Recurrence/Patterns/Recurrence.DailyRegenerationPattern.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the Recurrence.DailyRegenerationPattern class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/ComplexProperties/Recurrence/Patterns/Recurrence.IntervalPattern.cs b/ComplexProperties/Recurrence/Patterns/Recurrence.IntervalPattern.cs index 0e36ece8..2e687d38 100644 --- a/ComplexProperties/Recurrence/Patterns/Recurrence.IntervalPattern.cs +++ b/ComplexProperties/Recurrence/Patterns/Recurrence.IntervalPattern.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the IntervalPattern class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -65,21 +80,6 @@ internal override void InternalWritePropertiesToXml(EwsServiceXmlWriter writer) this.Interval); } - /// - /// Patterns to json. - /// - /// The service. - /// - internal override JsonObject PatternToJson(ExchangeService service) - { - JsonObject jsonPattern = new JsonObject(); - - jsonPattern.AddTypeParameter(this.XmlElementName); - jsonPattern.Add(XmlElementNames.Interval, this.Interval); - - return jsonPattern; - } - /// /// Tries to read element from XML. /// @@ -104,28 +104,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - base.LoadFromJson(jsonProperty, service); - - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.Interval: - this.interval = jsonProperty.ReadAsInt(key); - break; - default: - break; - } - } - } - /// /// Gets or sets the interval between occurrences. /// @@ -146,6 +124,16 @@ public int Interval this.SetFieldValue(ref this.interval, value); } } + + /// + /// Checks if two recurrence objects are identical. + /// + /// The recurrence to compare this one to. + /// true if the two recurrences are identical, false otherwise. + public override bool IsSame(Recurrence otherRecurrence) + { + return base.IsSame(otherRecurrence) && this.interval == ((IntervalPattern)otherRecurrence).interval; + } } } } \ No newline at end of file diff --git a/ComplexProperties/Recurrence/Patterns/Recurrence.MonthlyPattern.cs b/ComplexProperties/Recurrence/Patterns/Recurrence.MonthlyPattern.cs index e46ff38f..86f3ef7c 100644 --- a/ComplexProperties/Recurrence/Patterns/Recurrence.MonthlyPattern.cs +++ b/ComplexProperties/Recurrence/Patterns/Recurrence.MonthlyPattern.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the Recurrence.MonthlyPattern class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -73,20 +88,6 @@ internal override void InternalWritePropertiesToXml(EwsServiceXmlWriter writer) this.DayOfMonth); } - /// - /// Patterns to json. - /// - /// The service. - /// - internal override JsonObject PatternToJson(ExchangeService service) - { - JsonObject jsonPattern = base.PatternToJson(service); - - jsonPattern.Add(XmlElementNames.DayOfMonth, this.DayOfMonth); - - return jsonPattern; - } - /// /// Tries to read element from XML. /// @@ -111,28 +112,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - base.LoadFromJson(jsonProperty, service); - - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.DayOfMonth: - this.dayOfMonth = jsonProperty.ReadAsInt(key); - break; - default: - break; - } - } - } - /// /// Validates this instance. /// @@ -166,6 +145,16 @@ public int DayOfMonth this.SetFieldValue(ref this.dayOfMonth, value); } } + + /// + /// Checks if two recurrence objects are identical. + /// + /// The recurrence to compare this one to. + /// true if the two recurrences are identical, false otherwise. + public override bool IsSame(Recurrence otherRecurrence) + { + return base.IsSame(otherRecurrence) && this.dayOfMonth == ((MonthlyPattern)otherRecurrence).dayOfMonth; + } } } } \ No newline at end of file diff --git a/ComplexProperties/Recurrence/Patterns/Recurrence.MonthlyRegenerationPattern.cs b/ComplexProperties/Recurrence/Patterns/Recurrence.MonthlyRegenerationPattern.cs index d4d7d6ab..ff8b9a39 100644 --- a/ComplexProperties/Recurrence/Patterns/Recurrence.MonthlyRegenerationPattern.cs +++ b/ComplexProperties/Recurrence/Patterns/Recurrence.MonthlyRegenerationPattern.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the Recurrence.MonthlyRegenerationPattern class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/ComplexProperties/Recurrence/Patterns/Recurrence.RelativeMonthlyPattern.cs b/ComplexProperties/Recurrence/Patterns/Recurrence.RelativeMonthlyPattern.cs index 64748693..fe90ae81 100644 --- a/ComplexProperties/Recurrence/Patterns/Recurrence.RelativeMonthlyPattern.cs +++ b/ComplexProperties/Recurrence/Patterns/Recurrence.RelativeMonthlyPattern.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the Recurrence.RelativeMonthlyPattern class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -82,21 +97,6 @@ internal override void InternalWritePropertiesToXml(EwsServiceXmlWriter writer) this.DayOfTheWeekIndex); } - /// - /// Patterns to json. - /// - /// The service. - /// - internal override JsonObject PatternToJson(ExchangeService service) - { - JsonObject jsonPattern = base.PatternToJson(service); - - jsonPattern.Add(XmlElementNames.DaysOfWeek, this.DayOfTheWeek); - jsonPattern.Add(XmlElementNames.DayOfWeekIndex, this.DayOfTheWeekIndex); - - return jsonPattern; - } - /// /// Tries to read element from XML. /// @@ -124,31 +124,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - base.LoadFromJson(jsonProperty, service); - - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.DaysOfWeek: - this.dayOfTheWeek = jsonProperty.ReadEnumValue(key); - break; - case XmlElementNames.DayOfWeekIndex: - this.dayOfTheWeekIndex = jsonProperty.ReadEnumValue(key); - break; - default: - break; - } - } - } - /// /// Validates this instance. /// @@ -167,6 +142,20 @@ internal override void InternalValidate() } } + /// + /// Checks if two recurrence objects are identical. + /// + /// The recurrence to compare this one to. + /// true if the two recurrences are identical, false otherwise. + public override bool IsSame(Recurrence otherRecurrence) + { + RelativeMonthlyPattern otherRelativeMonthlyPattern = (RelativeMonthlyPattern)otherRecurrence; + + return base.IsSame(otherRecurrence) && + this.dayOfTheWeek == otherRelativeMonthlyPattern.dayOfTheWeek && + this.dayOfTheWeekIndex == otherRelativeMonthlyPattern.dayOfTheWeekIndex; + } + /// /// Gets or sets the relative position of the day specified in DayOfTheWeek within the month. /// diff --git a/ComplexProperties/Recurrence/Patterns/Recurrence.RelativeYearlyPattern.cs b/ComplexProperties/Recurrence/Patterns/Recurrence.RelativeYearlyPattern.cs index 39b335fc..ea7d61b3 100644 --- a/ComplexProperties/Recurrence/Patterns/Recurrence.RelativeYearlyPattern.cs +++ b/ComplexProperties/Recurrence/Patterns/Recurrence.RelativeYearlyPattern.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the Recurrence.RelativeYearlyPattern class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -61,24 +76,6 @@ internal override void InternalWritePropertiesToXml(EwsServiceXmlWriter writer) this.Month); } - /// - /// Patterns to json. - /// - /// The service. - /// - internal override JsonObject PatternToJson(ExchangeService service) - { - JsonObject jsonPattern = new JsonObject(); - - jsonPattern.AddTypeParameter(this.XmlElementName); - - jsonPattern.Add(XmlElementNames.DaysOfWeek, this.DayOfTheWeek); - jsonPattern.Add(XmlElementNames.DayOfWeekIndex, this.DayOfTheWeekIndex); - jsonPattern.Add(XmlElementNames.Month, this.Month); - - return jsonPattern; - } - /// /// Tries to read element from XML. /// @@ -109,34 +106,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - base.LoadFromJson(jsonProperty, service); - - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.DaysOfWeek: - this.dayOfTheWeek = jsonProperty.ReadEnumValue(key); - break; - case XmlElementNames.DayOfWeekIndex: - this.dayOfTheWeekIndex = jsonProperty.ReadEnumValue(key); - break; - case XmlElementNames.Month: - this.month = jsonProperty.ReadEnumValue(key); - break; - default: - break; - } - } - } - /// /// Initializes a new instance of the class. /// @@ -187,6 +156,21 @@ internal override void InternalValidate() } } + /// + /// Checks if two recurrence objects are identical. + /// + /// The recurrence to compare this one to. + /// true if the two recurrences are identical, false otherwise. + public override bool IsSame(Recurrence otherRecurrence) + { + RelativeYearlyPattern otherYearlyPattern = (RelativeYearlyPattern)otherRecurrence; + + return base.IsSame(otherRecurrence) && + this.dayOfTheWeek == otherYearlyPattern.dayOfTheWeek && + this.dayOfTheWeekIndex == otherYearlyPattern.dayOfTheWeekIndex && + this.month == otherYearlyPattern.month; + } + /// /// Gets or sets the relative position of the day specified in DayOfTheWeek within the month. /// diff --git a/ComplexProperties/Recurrence/Patterns/Recurrence.WeeklyPattern.cs b/ComplexProperties/Recurrence/Patterns/Recurrence.WeeklyPattern.cs index 21ffbeb9..05cb123e 100644 --- a/ComplexProperties/Recurrence/Patterns/Recurrence.WeeklyPattern.cs +++ b/ComplexProperties/Recurrence/Patterns/Recurrence.WeeklyPattern.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the Recurrence.WeeklyPattern class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -96,35 +111,6 @@ internal override void InternalWritePropertiesToXml(EwsServiceXmlWriter writer) } } - /// - /// Patterns to json. - /// - /// The service. - /// - internal override JsonObject PatternToJson(ExchangeService service) - { - JsonObject jsonPattern = base.PatternToJson(service); - - jsonPattern.Add(XmlElementNames.DayOfWeek, this.DaysOfTheWeek.InternalToJson(service)); - - if (this.firstDayOfWeek.HasValue) - { - // We only allow the "FirstDayOfWeek" parameter for the Exchange2010_SP1 schema - // version. - // - EwsUtilities.ValidatePropertyVersion( - service, - ExchangeVersion.Exchange2010_SP1, - "FirstDayOfWeek"); - - jsonPattern.Add( - XmlElementNames.FirstDayOfWeek, - this.firstDayOfWeek.Value); - } - - return jsonPattern; - } - /// /// Tries to read element from XML. /// @@ -155,41 +141,30 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } /// - /// Loads from json. + /// Validates this instance. /// - /// The json property. - /// - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) + internal override void InternalValidate() { - base.LoadFromJson(jsonProperty, service); + base.InternalValidate(); - foreach (string key in jsonProperty.Keys) + if (this.DaysOfTheWeek.Count == 0) { - switch (key) - { - case XmlElementNames.DaysOfWeek: - this.DaysOfTheWeek.LoadFromJsonValue(jsonProperty.ReadAsString(key)); - break; - case XmlElementNames.FirstDayOfWeek: - this.FirstDayOfWeek = jsonProperty.ReadEnumValue(key); - break; - default: - break; - } + throw new ServiceValidationException(Strings.DaysOfTheWeekNotSpecified); } } /// - /// Validates this instance. + /// Checks if two recurrence objects are identical. /// - internal override void InternalValidate() + /// The recurrence to compare this one to. + /// true if the two recurrences are identical, false otherwise. + public override bool IsSame(Recurrence otherRecurrence) { - base.InternalValidate(); + WeeklyPattern otherWeeklyPattern = (WeeklyPattern)otherRecurrence; - if (this.DaysOfTheWeek.Count == 0) - { - throw new ServiceValidationException(Strings.DaysOfTheWeekNotSpecified); - } + return base.IsSame(otherRecurrence) && + this.daysOfTheWeek.ToString(",") == otherWeeklyPattern.daysOfTheWeek.ToString(",") && + this.firstDayOfWeek == otherWeeklyPattern.firstDayOfWeek; } /// diff --git a/ComplexProperties/Recurrence/Patterns/Recurrence.WeeklyRegenerationPattern.cs b/ComplexProperties/Recurrence/Patterns/Recurrence.WeeklyRegenerationPattern.cs index 4cbf6d8c..afe2d281 100644 --- a/ComplexProperties/Recurrence/Patterns/Recurrence.WeeklyRegenerationPattern.cs +++ b/ComplexProperties/Recurrence/Patterns/Recurrence.WeeklyRegenerationPattern.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the Recurrence.WeeklyRegenerationPattern class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/ComplexProperties/Recurrence/Patterns/Recurrence.YearlyPattern.cs b/ComplexProperties/Recurrence/Patterns/Recurrence.YearlyPattern.cs index 431fc923..9aa1e84d 100644 --- a/ComplexProperties/Recurrence/Patterns/Recurrence.YearlyPattern.cs +++ b/ComplexProperties/Recurrence/Patterns/Recurrence.YearlyPattern.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the Recurrence.YearlyPattern class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -79,22 +94,6 @@ internal override void InternalWritePropertiesToXml(EwsServiceXmlWriter writer) this.Month); } - /// - /// Patterns to json. - /// - /// The service. - /// - internal override JsonObject PatternToJson(ExchangeService service) - { - JsonObject jsonPattern = new JsonObject(); - - jsonPattern.AddTypeParameter(this.XmlElementName); - jsonPattern.Add(XmlElementNames.DayOfMonth, this.DayOfMonth); - jsonPattern.Add(XmlElementNames.Month, this.Month); - - return jsonPattern; - } - /// /// Tries to read element from XML. /// @@ -122,31 +121,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - base.LoadFromJson(jsonProperty, service); - - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.DayOfMonth: - this.dayOfMonth = jsonProperty.ReadAsInt(key); - break; - case XmlElementNames.Month: - this.month = jsonProperty.ReadEnumValue(key); - break; - default: - break; - } - } - } - /// /// Validates this instance. /// @@ -165,6 +139,20 @@ internal override void InternalValidate() } } + /// + /// Checks if two recurrence objects are identical. + /// + /// The recurrence to compare this one to. + /// true if the two recurrences are identical, false otherwise. + public override bool IsSame(Recurrence otherRecurrence) + { + YearlyPattern otherYearlyPattern = (YearlyPattern)otherRecurrence; + + return base.IsSame(otherRecurrence) && + this.month == otherYearlyPattern.month && + this.dayOfMonth == otherYearlyPattern.dayOfMonth; + } + /// /// Gets or sets the month of the year when each occurrence happens. /// diff --git a/ComplexProperties/Recurrence/Patterns/Recurrence.YearlyRegenerationPattern.cs b/ComplexProperties/Recurrence/Patterns/Recurrence.YearlyRegenerationPattern.cs index 169f1dc5..ea39ebe7 100644 --- a/ComplexProperties/Recurrence/Patterns/Recurrence.YearlyRegenerationPattern.cs +++ b/ComplexProperties/Recurrence/Patterns/Recurrence.YearlyRegenerationPattern.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the Recurrence.YearlyRegenerationPatternclass. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/ComplexProperties/Recurrence/Patterns/Recurrence.cs b/ComplexProperties/Recurrence/Patterns/Recurrence.cs index f5f74128..a2c2162b 100644 --- a/ComplexProperties/Recurrence/Patterns/Recurrence.cs +++ b/ComplexProperties/Recurrence/Patterns/Recurrence.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the Recurrence class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -96,65 +111,6 @@ internal override sealed void WriteElementsToXml(EwsServiceXmlWriter writer) range.WriteToXml(writer, range.XmlElementName); } - /// - /// Serializes the property to a Json value. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonProperty = new JsonObject(); - - jsonProperty.Add(JsonNames.RecurrencePattern, this.PatternToJson(service)); - jsonProperty.Add(JsonNames.RecurrenceRange, this.RangeToJson(service)); - - return jsonProperty; - } - - /// - /// Ranges to json. - /// - /// The service. - /// - private object RangeToJson(ExchangeService service) - { - RecurrenceRange range; - - if (!this.HasEnd) - { - range = new NoEndRecurrenceRange(this.StartDate); - } - else if (this.NumberOfOccurrences.HasValue) - { - range = new NumberedRecurrenceRange(this.StartDate, this.NumberOfOccurrences); - } - else - { - range = new EndDateRecurrenceRange(this.StartDate, this.EndDate.Value); - } - - return range.InternalToJson(service); - } - - /// - /// Patterns to json. - /// - /// The service. - /// - internal abstract JsonObject PatternToJson(ExchangeService service); - - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - base.LoadFromJson(jsonProperty, service); - } - /// /// Gets a property value or throw if null. /// @@ -253,42 +209,23 @@ public DateTime? EndDate this.numberOfOccurrences = null; } } - + /// - /// Compares two objects by converting them to JSON and comparing their string values + /// Checks if two recurrence objects are identical. /// - /// object to compare to - /// true if the objects serialize to the same string - public bool IsSame(Recurrence otherRecurrence) + /// The recurrence to compare this one to. + /// true if the two recurrences are identical, false otherwise. + public virtual bool IsSame(Recurrence otherRecurrence) { if (otherRecurrence == null) { return false; } - string jsonString; - using (MemoryStream memoryStream = new MemoryStream()) - { - ((JsonObject)this.InternalToJson(null)).SerializeToJson(memoryStream); - memoryStream.Position = 0; - using (StreamReader reader = new StreamReader(memoryStream)) - { - jsonString = reader.ReadToEnd(); - } - } - - string otherJsonString; - using (MemoryStream memoryStream = new MemoryStream()) - { - ((JsonObject)otherRecurrence.InternalToJson(null)).SerializeToJson(memoryStream); - memoryStream.Position = 0; - using (StreamReader reader = new StreamReader(memoryStream)) - { - otherJsonString = reader.ReadToEnd(); - } - } - - return String.Equals(jsonString, otherJsonString, StringComparison.Ordinal); + return (this.GetType() == otherRecurrence.GetType() && + this.numberOfOccurrences == otherRecurrence.numberOfOccurrences && + this.endDate == otherRecurrence.endDate && + this.startDate == otherRecurrence.startDate); } } -} +} \ No newline at end of file diff --git a/ComplexProperties/Recurrence/Ranges/EndDateRecurrenceRange.cs b/ComplexProperties/Recurrence/Ranges/EndDateRecurrenceRange.cs index 367300d0..44090bdd 100644 --- a/ComplexProperties/Recurrence/Ranges/EndDateRecurrenceRange.cs +++ b/ComplexProperties/Recurrence/Ranges/EndDateRecurrenceRange.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the EndDateRecurrenceRange class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -74,18 +89,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) EwsUtilities.DateTimeToXSDate(this.EndDate)); } - /// - /// Adds the properties to json. - /// - /// The json property. - /// The service. - internal override void AddPropertiesToJson(JsonObject jsonProperty, ExchangeService service) - { - base.AddPropertiesToJson(jsonProperty, service); - - jsonProperty.Add(XmlElementNames.EndDate, EwsUtilities.DateTimeToXSDate(this.EndDate)); - } - /// /// Tries to read element from XML. /// @@ -110,28 +113,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - base.LoadFromJson(jsonProperty, service); - - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.EndDate: - this.endDate = service.ConvertStartDateToUnspecifiedDateTime(jsonProperty.ReadAsString(key)).Value; - break; - default: - break; - } - } - } - /// /// Gets or sets the end date. /// @@ -142,4 +123,4 @@ public DateTime EndDate set { this.SetFieldValue(ref this.endDate, value); } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/Recurrence/Ranges/NoEndRecurrenceRange.cs b/ComplexProperties/Recurrence/Ranges/NoEndRecurrenceRange.cs index 377dd198..61d9d34b 100644 --- a/ComplexProperties/Recurrence/Ranges/NoEndRecurrenceRange.cs +++ b/ComplexProperties/Recurrence/Ranges/NoEndRecurrenceRange.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the NoEndRecurrenceRange class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -56,4 +71,4 @@ internal override void SetupRecurrence(Recurrence recurrence) recurrence.NeverEnds(); } } -} +} \ No newline at end of file diff --git a/ComplexProperties/Recurrence/Ranges/NumberedRecurrenceRange.cs b/ComplexProperties/Recurrence/Ranges/NumberedRecurrenceRange.cs index ff37c7e4..439100a5 100644 --- a/ComplexProperties/Recurrence/Ranges/NumberedRecurrenceRange.cs +++ b/ComplexProperties/Recurrence/Ranges/NumberedRecurrenceRange.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the NumberedRecurrenceRange class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -74,18 +89,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) } } - /// - /// Adds the properties to json. - /// - /// The json property. - /// The service. - internal override void AddPropertiesToJson(JsonObject jsonProperty, ExchangeService service) - { - base.AddPropertiesToJson(jsonProperty, service); - - jsonProperty.Add(XmlElementNames.NumberOfOccurrences, this.NumberOfOccurrences); - } - /// /// Tries to read element from XML. /// @@ -110,28 +113,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - base.LoadFromJson(jsonProperty, service); - - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.NumberOfOccurrences: - this.numberOfOccurrences = jsonProperty.ReadAsInt(key); - break; - default: - break; - } - } - } - /// /// Gets or sets the number of occurrences. /// @@ -149,4 +130,4 @@ public int? NumberOfOccurrences } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/Recurrence/Ranges/RecurrenceRange.cs b/ComplexProperties/Recurrence/Ranges/RecurrenceRange.cs index c180f830..1798c2c8 100644 --- a/ComplexProperties/Recurrence/Ranges/RecurrenceRange.cs +++ b/ComplexProperties/Recurrence/Ranges/RecurrenceRange.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the RecurrenceRange class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -72,33 +87,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) EwsUtilities.DateTimeToXSDate(this.StartDate)); } - /// - /// Serializes the property to a Json value. - /// - /// - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonProperty = new JsonObject(); - - this.AddPropertiesToJson(jsonProperty, service); - - return jsonProperty; - } - - /// - /// Adds the properties to json. - /// - /// The json property. - /// The service. - internal virtual void AddPropertiesToJson(JsonObject jsonProperty, ExchangeService service) - { - jsonProperty.AddTypeParameter(this.XmlElementName); - jsonProperty.Add(XmlElementNames.StartDate, EwsUtilities.DateTimeToXSDate(this.StartDate)); - } - /// /// Tries to read element from XML. /// @@ -124,33 +112,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - base.LoadFromJson(jsonProperty, service); - - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.StartDate: - - DateTime? startDate = service.ConvertStartDateToUnspecifiedDateTime(jsonProperty.ReadAsString(key)); - if (startDate.HasValue) - { - this.startDate = startDate.Value; - } - break; - default: - break; - } - } - } - /// /// Gets the name of the XML element. /// @@ -177,4 +138,4 @@ internal DateTime StartDate set { this.SetFieldValue(ref this.startDate, value); } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/RecurringAppointmentMasterId.cs b/ComplexProperties/RecurringAppointmentMasterId.cs index d809d2f3..e8aae298 100644 --- a/ComplexProperties/RecurringAppointmentMasterId.cs +++ b/ComplexProperties/RecurringAppointmentMasterId.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the RecurringAppointmentMasterId class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -42,23 +57,5 @@ internal override void WriteAttributesToXml(EwsServiceXmlWriter writer) writer.WriteAttributeValue(XmlAttributeNames.OccurrenceId, this.UniqueId); writer.WriteAttributeValue(XmlAttributeNames.ChangeKey, this.ChangeKey); } - - /// - /// Serializes the property to a Json value. - /// - /// - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonProperty = new JsonObject(); - - jsonProperty.AddTypeParameter(this.GetXmlElementName()); - jsonProperty.Add(XmlAttributeNames.OccurrenceId, this.UniqueId); - jsonProperty.Add(XmlAttributeNames.ChangeKey, this.ChangeKey); - - return jsonProperty; - } } -} +} \ No newline at end of file diff --git a/ComplexProperties/ReferenceAttachment.cs b/ComplexProperties/ReferenceAttachment.cs new file mode 100644 index 00000000..212c520e --- /dev/null +++ b/ComplexProperties/ReferenceAttachment.cs @@ -0,0 +1,242 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Text; + + /// + /// Represents an attachment by reference. + /// + public sealed class ReferenceAttachment : Attachment + { + /// + /// The AttachLongPathName of the attachment. + /// + private string attachLongPathName; + + /// + /// The ProviderType of the attachment. + /// + private string providerType; + + /// + /// The ProviderEndpointUrl of the attachment. + /// + private string providerEndpointUrl; + + /// + /// The AttachmentThumbnailUrl of the attachment. + /// + private string attachmentThumbnailUrl; + + /// + /// The AttachmentPreviewUrl of the attachment. + /// + private string attachmentPreviewUrl; + + /// + /// The PermissionType of the attachment. + /// + private int permissionType; + + /// + /// The AttachmentIsFolder of the attachment. + /// + private bool attachmentIsFolder; + + /// + /// Initializes a new instance of the class. + /// + /// The owner. + internal ReferenceAttachment(Item owner) + : base(owner) + { + EwsUtilities.ValidateClassVersion( + this.Owner.Service, + ExchangeVersion.Exchange2015, + this.GetType().Name); + } + + /// + /// Gets the name of the XML element. + /// + /// XML element name. + internal override string GetXmlElementName() + { + return XmlElementNames.ReferenceAttachment; + } + + /// + /// Tries to read element from XML. + /// + /// The reader. + /// True if element was read. + internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) + { + bool result = base.TryReadElementFromXml(reader); + + if (!result) + { + if (reader.LocalName == XmlElementNames.AttachLongPathName) + { + this.attachLongPathName = reader.ReadElementValue(); + return true; + } + + if (reader.LocalName == XmlElementNames.ProviderType) + { + this.providerType = reader.ReadElementValue(); + return true; + } + + if (reader.LocalName == XmlElementNames.ProviderEndpointUrl) + { + this.providerEndpointUrl = reader.ReadElementValue(); + return true; + } + + if (reader.LocalName == XmlElementNames.AttachmentThumbnailUrl) + { + this.attachmentThumbnailUrl = reader.ReadElementValue(); + return true; + } + + if (reader.LocalName == XmlElementNames.AttachmentPreviewUrl) + { + this.attachmentPreviewUrl = reader.ReadElementValue(); + return true; + } + + if (reader.LocalName == XmlElementNames.PermissionType) + { + this.permissionType = reader.ReadElementValue(); + return true; + } + + if (reader.LocalName == XmlElementNames.AttachmentIsFolder) + { + this.attachmentIsFolder = reader.ReadElementValue(); + return true; + } + } + + return result; + } + + /// + /// For ReferenceAttachment, the only thing need to patch is the AttachmentId. + /// + /// The reader. + /// True if element was read. + internal override bool TryReadElementFromXmlToPatch(EwsServiceXmlReader reader) + { + return base.TryReadElementFromXml(reader); + } + + /// + /// Writes elements and content to XML. + /// + /// The writer. + internal override void WriteElementsToXml(EwsServiceXmlWriter writer) + { + base.WriteElementsToXml(writer); + + writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.AttachLongPathName, this.AttachLongPathName); + writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.ProviderType, this.ProviderType); + writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.ProviderEndpointUrl, this.ProviderEndpointUrl); + writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.AttachmentThumbnailUrl, this.AttachmentThumbnailUrl); + writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.AttachmentPreviewUrl, this.AttachmentPreviewUrl); + writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.PermissionType, this.PermissionType); + writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.AttachmentIsFolder, this.AttachmentIsFolder); + } + + /// + /// Gets or sets a fully-qualified path identifying the attachment. + /// + public string AttachLongPathName + { + get { return this.attachLongPathName; } + set { this.SetFieldValue(ref this.attachLongPathName, value); } + } + + /// + /// Gets or sets the type of the attachment provider. + /// + public string ProviderType + { + get { return this.providerType; } + set { this.SetFieldValue(ref this.providerType, value); } + } + + /// + /// Gets or sets the URL of the attachment provider. + /// + public string ProviderEndpointUrl + { + get { return this.providerEndpointUrl; } + set { this.SetFieldValue(ref this.providerEndpointUrl, value); } + } + + /// + /// Gets or sets the URL of the attachment thumbnail. + /// + public string AttachmentThumbnailUrl + { + get { return this.attachmentThumbnailUrl; } + set { this.SetFieldValue(ref this.attachmentThumbnailUrl, value); } + } + + /// + /// Gets or sets the URL of the attachment preview. + /// + public string AttachmentPreviewUrl + { + get { return this.attachmentPreviewUrl; } + set { this.SetFieldValue(ref this.attachmentPreviewUrl, value); } + } + + /// + /// Gets or sets the permission of the attachment. + /// + public int PermissionType + { + get { return this.permissionType; } + set { this.SetFieldValue(ref this.permissionType, value); } + } + + /// + /// Gets or sets a value indicating whether the attachment points to a folder. + /// + public bool AttachmentIsFolder + { + get { return this.attachmentIsFolder; } + set { this.SetFieldValue(ref this.attachmentIsFolder, value); } + } + } +} diff --git a/ComplexProperties/RetentionTagBase.cs b/ComplexProperties/RetentionTagBase.cs index a46d6075..b4bb93f6 100644 --- a/ComplexProperties/RetentionTagBase.cs +++ b/ComplexProperties/RetentionTagBase.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the RetentionTagBase class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -78,29 +93,6 @@ internal override void ReadTextValueFromXml(EwsServiceXmlReader reader) this.retentionId = new Guid(reader.ReadValue()); } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlAttributeNames.IsExplicit: - this.isExplicit = jsonProperty.ReadAsBool(key); - break; - case JsonObject.JsonValueString: - this.retentionId = new Guid(jsonProperty.ReadAsString(key)); - break; - default: - break; - } - } - } - /// /// Writes attributes to XML. /// @@ -116,33 +108,12 @@ internal override void WriteAttributesToXml(EwsServiceXmlWriter writer) /// The writer. internal override void WriteElementsToXml(EwsServiceXmlWriter writer) { - if (this.retentionId != null && this.retentionId != Guid.Empty) + if (this.retentionId != Guid.Empty) { writer.WriteValue(this.retentionId.ToString(), this.xmlElementName); } } - /// - /// Serializes the property to a Json value. - /// - /// - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonProperty = new JsonObject(); - - jsonProperty.Add(XmlAttributeNames.IsExplicit, this.isExplicit); - - if (this.retentionId != null && this.retentionId != Guid.Empty) - { - jsonProperty.Add(JsonObject.JsonValueString, this.retentionId); - } - - return jsonProperty; - } - #region Object method overrides /// @@ -153,7 +124,7 @@ internal override object InternalToJson(ExchangeService service) /// public override string ToString() { - if (this.retentionId == null || this.retentionId == Guid.Empty) + if (this.retentionId == Guid.Empty) { return string.Empty; } @@ -165,4 +136,4 @@ public override string ToString() #endregion } -} +} \ No newline at end of file diff --git a/ComplexProperties/Rule.cs b/ComplexProperties/Rule.cs index 74c71d8a..3b69333d 100644 --- a/ComplexProperties/Rule.cs +++ b/ComplexProperties/Rule.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the Rule class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -247,50 +262,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.DisplayName: - this.displayName = jsonProperty.ReadAsString(key); - break; - case XmlElementNames.RuleId: - this.ruleId = jsonProperty.ReadAsString(key); - break; - case XmlElementNames.Priority: - this.priority = jsonProperty.ReadAsInt(key); - break; - case XmlElementNames.IsEnabled: - this.isEnabled = jsonProperty.ReadAsBool(key); - break; - case XmlElementNames.IsNotSupported: - this.isNotSupported = jsonProperty.ReadAsBool(key); - break; - case XmlElementNames.IsInError: - this.isInError = jsonProperty.ReadAsBool(key); - break; - case XmlElementNames.Conditions: - this.conditions.LoadFromJson(jsonProperty, service); - break; - case XmlElementNames.Actions: - this.actions.LoadFromJson(jsonProperty, service); - break; - case XmlElementNames.Exceptions: - this.exceptions.LoadFromJson(jsonProperty, service); - break; - default: - break; - } - } - } - /// /// Writes elements to XML. /// @@ -326,34 +297,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) this.Actions.WriteToXml(writer, XmlElementNames.Actions); } - /// - /// Serializes the property to a Json value. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonProperty = new JsonObject(); - - if (!string.IsNullOrEmpty(this.Id)) - { - jsonProperty.Add(XmlElementNames.RuleId, this.Id); - } - - jsonProperty.Add(XmlElementNames.DisplayName, this.DisplayName); - jsonProperty.Add(XmlElementNames.Priority, this.Priority); - jsonProperty.Add(XmlElementNames.IsEnabled, this.IsEnabled); - jsonProperty.Add(XmlElementNames.IsInError, this.IsInError); - - jsonProperty.Add(XmlElementNames.Conditions, this.Conditions.InternalToJson(service)); - jsonProperty.Add(XmlElementNames.Exceptions, this.Exceptions.InternalToJson(service)); - jsonProperty.Add(XmlElementNames.Actions, this.Actions.InternalToJson(service)); - - return jsonProperty; - } - /// /// Validates this instance. /// @@ -366,4 +309,4 @@ internal override void InternalValidate() EwsUtilities.ValidateParam(this.actions, "Actions"); } } -} +} \ No newline at end of file diff --git a/ComplexProperties/RuleActions.cs b/ComplexProperties/RuleActions.cs index b311882b..5a2b6a7a 100644 --- a/ComplexProperties/RuleActions.cs +++ b/ComplexProperties/RuleActions.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the RuleActions class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -368,71 +383,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.AssignCategories: - this.assignCategories.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service); - break; - case XmlElementNames.CopyToFolder: - this.copyToFolder = new FolderId(); - this.copyToFolder.LoadFromJson( - jsonProperty.ReadAsJsonObject(key), - service); - break; - case XmlElementNames.Delete: - this.delete = jsonProperty.ReadAsBool(key); - break; - case XmlElementNames.ForwardAsAttachmentToRecipients: - this.forwardAsAttachmentToRecipients.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service); - break; - case XmlElementNames.ForwardToRecipients: - this.forwardToRecipients.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service); - break; - case XmlElementNames.MarkImportance: - this.markImportance = jsonProperty.ReadEnumValue(key); - break; - case XmlElementNames.MarkAsRead: - this.markAsRead = jsonProperty.ReadAsBool(key); - break; - case XmlElementNames.MoveToFolder: - this.moveToFolder = new FolderId(); - this.moveToFolder.LoadFromJson( - jsonProperty.ReadAsJsonObject(key), - service); - break; - case XmlElementNames.PermanentDelete: - this.permanentDelete = jsonProperty.ReadAsBool(key); - break; - case XmlElementNames.RedirectToRecipients: - this.redirectToRecipients.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service); - break; - case XmlElementNames.SendSMSAlertToRecipients: - EmailAddressCollection smsRecipientCollection = new EmailAddressCollection(XmlElementNames.Address); - smsRecipientCollection.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service); - this.sendSMSAlertToRecipients = ConvertSMSRecipientsFromEmailAddressCollectionToMobilePhoneCollection(smsRecipientCollection); - break; - case XmlElementNames.ServerReplyWithMessage: - this.serverReplyWithMessage = new ItemId(); - this.serverReplyWithMessage.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service); - break; - case XmlElementNames.StopProcessingRules: - this.stopProcessingRules = jsonProperty.ReadAsBool(key); - break; - default: - break; - } - } - } - /// /// Writes elements to XML. /// @@ -525,86 +475,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) } } - /// - /// Serializes the property to a Json value. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonProperty = new JsonObject(); - - if (this.AssignCategories.Count > 0) - { - jsonProperty.Add(XmlElementNames.AssignCategories, this.AssignCategories.InternalToJson(service)); - } - - if (this.CopyToFolder != null) - { - jsonProperty.Add(XmlElementNames.CopyToFolder, this.CopyToFolder.InternalToJson(service)); - } - - if (this.Delete != false) - { - jsonProperty.Add(XmlElementNames.Delete, this.Delete); - } - - if (this.ForwardAsAttachmentToRecipients.Count > 0) - { - jsonProperty.Add(XmlElementNames.ForwardAsAttachmentToRecipients, this.ForwardAsAttachmentToRecipients.InternalToJson(service)); - } - - if (this.ForwardToRecipients.Count > 0) - { - jsonProperty.Add(XmlElementNames.ForwardToRecipients, this.ForwardToRecipients.InternalToJson(service)); - } - - if (this.MarkImportance.HasValue) - { - jsonProperty.Add(XmlElementNames.MarkImportance, this.MarkImportance.Value); - } - - if (this.MarkAsRead != false) - { - jsonProperty.Add(XmlElementNames.MarkAsRead, this.MarkAsRead); - } - - if (this.MoveToFolder != null) - { - jsonProperty.Add(XmlElementNames.MoveToFolder, this.MoveToFolder.InternalToJson(service)); - } - - if (this.PermanentDelete != false) - { - jsonProperty.Add(XmlElementNames.PermanentDelete, this.PermanentDelete); - } - - if (this.RedirectToRecipients.Count > 0) - { - jsonProperty.Add(XmlElementNames.RedirectToRecipients, this.RedirectToRecipients.InternalToJson(service)); - } - - if (this.SendSMSAlertToRecipients.Count > 0) - { - EmailAddressCollection emailCollection = ConvertSMSRecipientsFromMobilePhoneCollectionToEmailAddressCollection(this.SendSMSAlertToRecipients); - jsonProperty.Add(XmlElementNames.SendSMSAlertToRecipients, emailCollection.InternalToJson(service)); - } - - if (this.ServerReplyWithMessage != null) - { - jsonProperty.Add(XmlElementNames.ServerReplyWithMessage, this.ServerReplyWithMessage.InternalToJson(service)); - } - - if (this.StopProcessingRules != false) - { - jsonProperty.Add(XmlElementNames.StopProcessingRules, this.StopProcessingRules); - } - - return jsonProperty; - } - /// /// Validates this instance. /// @@ -656,4 +526,4 @@ private static EmailAddressCollection ConvertSMSRecipientsFromMobilePhoneCollect return emailCollection; } } -} +} \ No newline at end of file diff --git a/ComplexProperties/RuleCollection.cs b/ComplexProperties/RuleCollection.cs index f3bda1e9..c69cbd1f 100644 --- a/ComplexProperties/RuleCollection.cs +++ b/ComplexProperties/RuleCollection.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Implements a rule collection. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -18,7 +33,7 @@ namespace Microsoft.Exchange.WebServices.Data /// /// Represents a collection of rules. /// - public sealed class RuleCollection : ComplexProperty, IEnumerable, IJsonCollectionDeserializer + public sealed class RuleCollection : ComplexProperty, IEnumerable { /// /// The OutlookRuleBlobExists flag. @@ -106,35 +121,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json collection. - /// - /// The json collection. - /// The service. - void IJsonCollectionDeserializer.CreateFromJsonCollection(object[] jsonCollection, ExchangeService service) - { - foreach (object entry in jsonCollection) - { - JsonObject jsonEntry = entry as JsonObject; - if (jsonEntry != null) - { - Rule rule = new Rule(); - rule.LoadFromJson(jsonEntry, service); - this.rules.Add(rule); - } - } - } - - /// - /// Loads from json collection to update the existing collection element. - /// - /// The json collection. - /// The service. - void IJsonCollectionDeserializer.UpdateFromJsonCollection(object[] jsonCollection, ExchangeService service) - { - throw new NotImplementedException(); - } - #region IEnumerable Interface /// /// Get an enumerator for the collection @@ -155,4 +141,4 @@ public IEnumerator GetEnumerator() } #endregion } -} +} \ No newline at end of file diff --git a/ComplexProperties/RuleError.cs b/ComplexProperties/RuleError.cs index 9a771a4d..2c2d52ca 100644 --- a/ComplexProperties/RuleError.cs +++ b/ComplexProperties/RuleError.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the RuleError class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -112,33 +127,5 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) return false; } } - - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - if (jsonProperty.ContainsKey(XmlElementNames.FieldURI)) - { - this.ruleProperty = jsonProperty.ReadEnumValue(XmlElementNames.FieldURI); - } - - if (jsonProperty.ContainsKey(XmlElementNames.ErrorCode)) - { - this.errorCode = jsonProperty.ReadEnumValue(XmlElementNames.ErrorCode); - } - - if (jsonProperty.ContainsKey(XmlElementNames.ErrorMessage)) - { - this.errorMessage = jsonProperty.ReadAsString(XmlElementNames.ErrorMessage); - } - - if (jsonProperty.ContainsKey(XmlElementNames.FieldValue)) - { - this.value = jsonProperty.ReadAsString(XmlElementNames.FieldValue); - } - } } -} +} \ No newline at end of file diff --git a/ComplexProperties/RuleErrorCollection.cs b/ComplexProperties/RuleErrorCollection.cs index 239f3e69..76d3d304 100644 --- a/ComplexProperties/RuleErrorCollection.cs +++ b/ComplexProperties/RuleErrorCollection.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Implements a RuleErrorCollection collection. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -40,15 +55,6 @@ internal override RuleError CreateComplexProperty(string xmlElementName) } } - /// - /// Creates the default complex property. - /// - /// A RuleError object. - internal override RuleError CreateDefaultComplexProperty() - { - return new RuleError(); - } - /// /// Retrieves the XML element name corresponding to the provided RuleError object. /// @@ -59,4 +65,4 @@ internal override string GetCollectionItemXmlElementName(RuleError ruleValidatio return XmlElementNames.Error; } } -} +} \ No newline at end of file diff --git a/ComplexProperties/RuleOperation.cs b/ComplexProperties/RuleOperation.cs index 82cb1d09..72eadaca 100644 --- a/ComplexProperties/RuleOperation.cs +++ b/ComplexProperties/RuleOperation.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the RuleOperation class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -31,4 +46,4 @@ internal abstract string XmlElementName get; } } -} +} \ No newline at end of file diff --git a/ComplexProperties/RuleOperationError.cs b/ComplexProperties/RuleOperationError.cs index 362f77dc..6cebe226 100644 --- a/ComplexProperties/RuleOperationError.cs +++ b/ComplexProperties/RuleOperationError.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the RuleOperationError class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -96,25 +111,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - if (jsonProperty.ContainsKey(XmlElementNames.OperationIndex)) - { - this.operationIndex = jsonProperty.ReadAsInt(XmlElementNames.OperationIndex); - } - - if (jsonProperty.ContainsKey(XmlElementNames.ValidationErrors)) - { - this.ruleErrors = new RuleErrorCollection(); - (this.ruleErrors as IJsonCollectionDeserializer).CreateFromJsonCollection(jsonProperty.ReadAsArray(XmlElementNames.ValidationErrors), service); - } - } - /// /// Set operation property by the index of a given opeation enumerator. /// @@ -155,4 +151,4 @@ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() #endregion } -} +} \ No newline at end of file diff --git a/ComplexProperties/RuleOperationErrorCollection.cs b/ComplexProperties/RuleOperationErrorCollection.cs index 004b9011..fc9b3dcd 100644 --- a/ComplexProperties/RuleOperationErrorCollection.cs +++ b/ComplexProperties/RuleOperationErrorCollection.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Implements a RuleOperationErrorCollection collection. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -40,15 +55,6 @@ internal override RuleOperationError CreateComplexProperty(string xmlElementName } } - /// - /// Creates the default complex property. - /// - /// A RuleOperationError object. - internal override RuleOperationError CreateDefaultComplexProperty() - { - return new RuleOperationError(); - } - /// /// Retrieves the XML element name corresponding to the provided RuleOperationError object. /// @@ -59,4 +65,4 @@ internal override string GetCollectionItemXmlElementName(RuleOperationError oper return XmlElementNames.RuleOperationError; } } -} +} \ No newline at end of file diff --git a/ComplexProperties/RulePredicateDateRange.cs b/ComplexProperties/RulePredicateDateRange.cs index ca462ed7..778c9e18 100644 --- a/ComplexProperties/RulePredicateDateRange.cs +++ b/ComplexProperties/RulePredicateDateRange.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the RulePredicateDateRange class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -89,29 +104,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.StartDateTime: - this.start = service.ConvertUniversalDateTimeStringToLocalDateTime(jsonProperty.ReadAsString(key)); - break; - case XmlElementNames.EndDateTime: - this.end = service.ConvertUniversalDateTimeStringToLocalDateTime(jsonProperty.ReadAsString(key)); - break; - default: - break; - } - } - } - /// /// Writes elements to XML. /// @@ -128,29 +120,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) } } - /// - /// Serializes the property to a Json value. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonProperty = new JsonObject(); - - if (this.Start.HasValue) - { - jsonProperty.Add(XmlElementNames.StartDateTime, service.ConvertDateTimeToUniversalDateTimeString(this.Start.Value)); - } - if (this.End.HasValue) - { - jsonProperty.Add(XmlElementNames.EndDateTime, service.ConvertDateTimeToUniversalDateTimeString(this.End.Value)); - } - - return jsonProperty; - } - /// /// Validates this instance. /// @@ -165,4 +134,4 @@ internal override void InternalValidate() } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/RulePredicateSizeRange.cs b/ComplexProperties/RulePredicateSizeRange.cs index b36e83a0..f6399b4e 100644 --- a/ComplexProperties/RulePredicateSizeRange.cs +++ b/ComplexProperties/RulePredicateSizeRange.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the RulePredicateSizeRange class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -87,29 +102,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.MinimumSize: - this.minimumSize = jsonProperty.ReadAsInt(key); - break; - case XmlElementNames.MaximumSize: - this.maximumSize = jsonProperty.ReadAsInt(key); - break; - default: - break; - } - } - } - /// /// Writes elements to XML. /// @@ -126,29 +118,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) } } - /// - /// Serializes the property to a Json value. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonProperty = new JsonObject(); - - if (this.MinimumSize.HasValue) - { - jsonProperty.Add(XmlElementNames.MinimumSize, this.MinimumSize.Value); - } - if (this.MaximumSize.HasValue) - { - jsonProperty.Add(XmlElementNames.MaximumSize, this.MaximumSize.Value); - } - - return jsonProperty; - } - /// /// Validates this instance. /// @@ -163,4 +132,4 @@ internal override void InternalValidate() } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/RulePredicates.cs b/ComplexProperties/RulePredicates.cs index 2eb5cd3d..c4825697 100644 --- a/ComplexProperties/RulePredicates.cs +++ b/ComplexProperties/RulePredicates.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the RulePredicates class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -1101,4 +1116,4 @@ internal override void InternalValidate() EwsUtilities.ValidateParam(this.withinSizeRange, "WithinSizeRange"); } } -} +} \ No newline at end of file diff --git a/ComplexProperties/SearchFolderParameters.cs b/ComplexProperties/SearchFolderParameters.cs index 76478587..0af93cbe 100644 --- a/ComplexProperties/SearchFolderParameters.cs +++ b/ComplexProperties/SearchFolderParameters.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SearchFolderParameters class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -68,34 +83,6 @@ internal override void ReadAttributesFromXml(EwsServiceXmlReader reader) this.Traversal = reader.ReadAttributeValue(XmlAttributeNames.Traversal); } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.BaseFolderIds: - this.RootFolderIds.InternalClear(); - ((IJsonCollectionDeserializer)this.RootFolderIds).CreateFromJsonCollection(jsonProperty.ReadAsArray(key), service); - break; - case XmlElementNames.Restriction: - JsonObject restriction = jsonProperty.ReadAsJsonObject(key); - this.searchFilter = SearchFilter.LoadSearchFilterFromJson(restriction.ReadAsJsonObject(XmlElementNames.Item), service); - break; - case XmlAttributeNames.Traversal: - this.Traversal = jsonProperty.ReadEnumValue(key); - break; - default: - break; - } - } - } - /// /// Writes the attributes to XML. /// @@ -121,30 +108,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) this.RootFolderIds.WriteToXml(writer, XmlElementNames.BaseFolderIds); } - /// - /// Serializes the property to a Json value. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonProperty = new JsonObject(); - - jsonProperty.Add(XmlAttributeNames.Traversal, this.Traversal); - jsonProperty.Add(XmlElementNames.BaseFolderIds, this.RootFolderIds.InternalToJson(service)); - - if (this.SearchFilter != null) - { - JsonObject restriction = new JsonObject(); - restriction.Add(XmlElementNames.Item, this.SearchFilter.InternalToJson(service)); - jsonProperty.Add(XmlElementNames.Restriction, restriction); - } - - return jsonProperty; - } - /// /// Validates this instance. /// @@ -207,4 +170,4 @@ public SearchFilter SearchFilter } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/ServiceId.cs b/ComplexProperties/ServiceId.cs index 90d259c0..ee3db44c 100644 --- a/ComplexProperties/ServiceId.cs +++ b/ComplexProperties/ServiceId.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ServiceId class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -50,29 +65,6 @@ internal override void ReadAttributesFromXml(EwsServiceXmlReader reader) this.changeKey = reader.ReadAttributeValue(XmlAttributeNames.ChangeKey); } - /// - /// Loads from json. - /// - /// The json property. - /// - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlAttributeNames.Id: - this.uniqueId = jsonProperty.ReadAsString(key); - break; - case XmlAttributeNames.ChangeKey: - this.changeKey = jsonProperty.ReadAsString(key); - break; - default: - break; - } - } - } - /// /// Writes attributes to XML. /// @@ -83,39 +75,12 @@ internal override void WriteAttributesToXml(EwsServiceXmlWriter writer) writer.WriteAttributeValue(XmlAttributeNames.ChangeKey, this.ChangeKey); } - /// - /// Serializes the property to a Json value. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonProperty = new JsonObject(); - - jsonProperty.AddTypeParameter(this.GetJsonTypeName()); - jsonProperty.Add(XmlAttributeNames.Id, this.UniqueId); - jsonProperty.Add(XmlAttributeNames.ChangeKey, this.ChangeKey); - - return jsonProperty; - } - /// /// Gets the name of the XML element. /// /// XML element name. internal abstract string GetXmlElementName(); - /// - /// Gets the name of the json type. - /// - /// - internal virtual string GetJsonTypeName() - { - return this.GetXmlElementName(); - } - /// /// Writes to XML. /// @@ -242,4 +207,4 @@ public override string ToString() } #endregion } -} +} \ No newline at end of file diff --git a/ComplexProperties/SetClientExtensionAction.cs b/ComplexProperties/SetClientExtensionAction.cs index df07a87f..aab56d1a 100644 --- a/ComplexProperties/SetClientExtensionAction.cs +++ b/ComplexProperties/SetClientExtensionAction.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SetClientExtensionAction class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -65,4 +80,4 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/SetRuleOperation.cs b/ComplexProperties/SetRuleOperation.cs index ee09c02c..18ab7c06 100644 --- a/ComplexProperties/SetRuleOperation.cs +++ b/ComplexProperties/SetRuleOperation.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SetRuleOperation class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -72,27 +87,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.Rule: - this.rule = new Rule(); - this.rule.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service); - break; - default: - break; - } - } - } - /// /// Writes elements to XML. /// @@ -102,22 +96,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) this.Rule.WriteToXml(writer, XmlElementNames.Rule); } - /// - /// Serializes the property to a Json value. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonProperty = new JsonObject(); - - jsonProperty.Add(XmlElementNames.Rule, this.Rule.InternalToJson(service)); - - return jsonProperty; - } - /// /// Validates this instance. /// @@ -137,4 +115,4 @@ internal override string XmlElementName } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/StringList.cs b/ComplexProperties/StringList.cs index ef3f7fd4..f1f2c40a 100644 --- a/ComplexProperties/StringList.cs +++ b/ComplexProperties/StringList.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the StringList class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -17,7 +32,7 @@ namespace Microsoft.Exchange.WebServices.Data /// /// Represents a list of strings. /// - public sealed class StringList : ComplexProperty, IEnumerable, IJsonCollectionDeserializer + public sealed class StringList : ComplexProperty, IEnumerable { private List items = new List(); private string itemXmlElementName = XmlElementNames.String; @@ -66,29 +81,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json collection. - /// - /// The json collection. - /// The service. - void IJsonCollectionDeserializer.CreateFromJsonCollection(object[] jsonCollection, ExchangeService service) - { - foreach (object element in jsonCollection) - { - this.Add(element as string); - } - } - - /// - /// Loads from json collection to update the existing collection element. - /// - /// The json collection. - /// The service. - void IJsonCollectionDeserializer.UpdateFromJsonCollection(object[] jsonCollection, ExchangeService service) - { - throw new NotImplementedException(); - } - /// /// Writes elements to XML. /// @@ -103,18 +95,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) } } - /// - /// Serializes the property to a Json value. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - return new List(this).ToArray(); - } - /// /// Adds a string to the list. /// @@ -307,4 +287,4 @@ public override int GetHashCode() return this.ToString().GetHashCode(); } } -} +} \ No newline at end of file diff --git a/ComplexProperties/TaskSuggestion.cs b/ComplexProperties/TaskSuggestion.cs index 9b2302b7..fc95f7d9 100644 --- a/ComplexProperties/TaskSuggestion.cs +++ b/ComplexProperties/TaskSuggestion.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the TaskSuggestion class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -59,4 +74,4 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/TaskSuggestionCollection.cs b/ComplexProperties/TaskSuggestionCollection.cs index 43fac02b..b109eb8b 100644 --- a/ComplexProperties/TaskSuggestionCollection.cs +++ b/ComplexProperties/TaskSuggestionCollection.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the TaskSuggestionCollection class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -50,15 +65,6 @@ internal override TaskSuggestion CreateComplexProperty(string xmlElementName) return new TaskSuggestion(); } - /// - /// Creates the default complex property. - /// - /// TaskSuggestion. - internal override TaskSuggestion CreateDefaultComplexProperty() - { - return new TaskSuggestion(); - } - /// /// Gets the name of the collection item XML element. /// @@ -69,4 +75,4 @@ internal override string GetCollectionItemXmlElementName(TaskSuggestion complexP return XmlElementNames.NlgTaskSuggestion; } } -} +} \ No newline at end of file diff --git a/ComplexProperties/TextBody.cs b/ComplexProperties/TextBody.cs index bf6e5173..7f5d8879 100644 --- a/ComplexProperties/TextBody.cs +++ b/ComplexProperties/TextBody.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the TextBody class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -41,4 +56,4 @@ public static implicit operator TextBody(string textBody) return new TextBody(textBody); } } -} +} \ No newline at end of file diff --git a/ComplexProperties/TimeChange.cs b/ComplexProperties/TimeChange.cs index 79971dd1..516a8274 100644 --- a/ComplexProperties/TimeChange.cs +++ b/ComplexProperties/TimeChange.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the TimeChange class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/ComplexProperties/TimeChangeRecurrence.cs b/ComplexProperties/TimeChangeRecurrence.cs index e1b91d47..7c73d760 100644 --- a/ComplexProperties/TimeChangeRecurrence.cs +++ b/ComplexProperties/TimeChangeRecurrence.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the TimeChangeRecurrence class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/ComplexProperties/TimeZones/AbsoluteDateTransition.cs b/ComplexProperties/TimeZones/AbsoluteDateTransition.cs index be12b7a5..9d7d6c11 100644 --- a/ComplexProperties/TimeZones/AbsoluteDateTransition.cs +++ b/ComplexProperties/TimeZones/AbsoluteDateTransition.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the AbsoluteDateTransition class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -104,4 +119,4 @@ internal DateTime DateTime set { this.dateTime = value; } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/TimeZones/AbsoluteDayOfMonthTransition.cs b/ComplexProperties/TimeZones/AbsoluteDayOfMonthTransition.cs index 98894f6f..fe13b573 100644 --- a/ComplexProperties/TimeZones/AbsoluteDayOfMonthTransition.cs +++ b/ComplexProperties/TimeZones/AbsoluteDayOfMonthTransition.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the AbsoluteDayOfMonthTransition class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -125,4 +140,4 @@ internal int DayOfMonth get { return this.dayOfMonth; } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/TimeZones/AbsoluteMonthTransition.cs b/ComplexProperties/TimeZones/AbsoluteMonthTransition.cs index 92c2eede..4411997a 100644 --- a/ComplexProperties/TimeZones/AbsoluteMonthTransition.cs +++ b/ComplexProperties/TimeZones/AbsoluteMonthTransition.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the AbsoluteMonthTransition class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -121,4 +136,4 @@ internal int Month get { return this.month; } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/TimeZones/RelativeDayOfMonthTransition.cs b/ComplexProperties/TimeZones/RelativeDayOfMonthTransition.cs index 5fe2e3af..fd7e912b 100644 --- a/ComplexProperties/TimeZones/RelativeDayOfMonthTransition.cs +++ b/ComplexProperties/TimeZones/RelativeDayOfMonthTransition.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the RelativeDayOfMonthTransition class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -140,4 +155,4 @@ internal int WeekIndex get { return this.weekIndex; } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/TimeZones/TimeZoneDefinition.cs b/ComplexProperties/TimeZones/TimeZoneDefinition.cs index 84923ebd..cd1491e2 100644 --- a/ComplexProperties/TimeZones/TimeZoneDefinition.cs +++ b/ComplexProperties/TimeZones/TimeZoneDefinition.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the TimeZoneDefinition class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -84,15 +99,15 @@ internal TimeZoneDefinition(TimeZoneInfo timeZoneInfo) standardPeriod.Id = TimeZonePeriod.StandardPeriodId; standardPeriod.Name = TimeZonePeriod.StandardPeriodName; standardPeriod.Bias = -timeZoneInfo.BaseUtcOffset; - - this.periods.Add(standardPeriod.Id, standardPeriod); - + TimeZoneInfo.AdjustmentRule[] adjustmentRules = timeZoneInfo.GetAdjustmentRules(); TimeZoneTransition transitionToStandardPeriod = new TimeZoneTransition(this, standardPeriod); if (adjustmentRules.Length == 0) { + this.periods.Add(standardPeriod.Id, standardPeriod); + // If the time zone info doesn't support Daylight Saving Time, we just need to // create one transition to one group with one transition to the standard period. TimeZoneTransitionGroup transitionGroup = new TimeZoneTransitionGroup(this, "0"); @@ -132,6 +147,7 @@ internal TimeZoneDefinition(TimeZoneInfo timeZoneInfo) absoluteDateTransition.DateTime = adjustmentRules[i].DateStart; transition = absoluteDateTransition; + this.periods.Add(standardPeriod.Id, standardPeriod); } else { @@ -235,7 +251,24 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) TimeZonePeriod period = new TimeZonePeriod(); period.LoadFromXml(reader); - this.periods.Add(period.Id, period); + // OM:1648848 Bad timezone data from clients can include duplicate rules + // for one year, with duplicate ID. In that case, let the first one win. + if (!this.periods.ContainsKey(period.Id)) + { + this.periods.Add(period.Id, period); + } + else + { + reader.Service.TraceMessage( + TraceFlags.EwsTimeZones, + string.Format( + "An entry with the same key (Id) '{0}' already exists in Periods. Cannot add another one. Existing entry: [Name='{1}', Bias='{2}']. Entry to skip: [Name='{3}', Bias='{4}'].", + period.Id, + this.Periods[period.Id].Name, + this.Periods[period.Id].Bias, + period.Name, + period.Bias)); + } } } while (!reader.IsEndElement(XmlNamespace.Types, XmlElementNames.Periods)); @@ -291,76 +324,6 @@ internal void LoadFromXml(EwsServiceXmlReader reader) this.transitions.Sort(this.CompareTransitions); } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - base.LoadFromJson(jsonProperty, service); - - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlAttributeNames.Name: - this.name = jsonProperty.ReadAsString(key); - break; - case XmlAttributeNames.Id: - this.id = jsonProperty.ReadAsString(key); - break; - case XmlElementNames.Periods: - foreach (object jsonPeriod in jsonProperty.ReadAsArray(key)) - { - TimeZonePeriod period = new TimeZonePeriod(); - period.LoadFromJson(jsonPeriod as JsonObject, service); - - this.periods.Add(period.Id, period); - } - - break; - - case XmlElementNames.TransitionsGroups: - foreach (object arrayOfTransitionsTypeInstance in jsonProperty.ReadAsArray(key)) - { - TimeZoneTransitionGroup transitionGroup = new TimeZoneTransitionGroup(this); - transitionGroup.LoadFromJson(arrayOfTransitionsTypeInstance as JsonObject, service); - - this.transitionGroups.Add(transitionGroup.Id, transitionGroup); - } - - break; - - case XmlElementNames.Transitions: - JsonObject arrayOfTransitionsType = jsonProperty.ReadAsJsonObject(key); - - foreach (object uncastJsonTransition in arrayOfTransitionsType.ReadAsArray(XmlElementNames.Transition)) - { - JsonObject jsonTransition = uncastJsonTransition as JsonObject; - TimeZoneTransition transition = TimeZoneTransition.Create(this, jsonTransition.ReadTypeString()); - - transition.LoadFromJson(jsonTransition, service); - - this.transitions.Add(transition); - } - - break; - default: - break; - } - } - - // EWS can return a TimeZone definition with no Id. Generate a new Id in this case. - if (string.IsNullOrEmpty(this.id)) - { - string nameValue = string.IsNullOrEmpty(this.Name) ? string.Empty : this.Name; - this.Id = NoIdPrefix + Math.Abs(nameValue.GetHashCode()).ToString(); - } - - this.transitions.Sort(this.CompareTransitions); - } - /// /// Writes elements to XML. /// @@ -408,67 +371,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) } } - /// - /// Serializes the property to a Json value. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonTimeZoneDefinition = new JsonObject(); - - jsonTimeZoneDefinition.Add(XmlAttributeNames.Id, this.id); - - // We only emit the full time zone definition against Exchange 2010 servers and above. - if (service.RequestedServerVersion != ExchangeVersion.Exchange2007_SP1) - { - jsonTimeZoneDefinition.Add(XmlAttributeNames.Name, this.name); - - if (this.periods.Count > 0) - { - List jsonPeriods = new List(); - - foreach (KeyValuePair keyValuePair in this.periods) - { - jsonPeriods.Add(keyValuePair.Value.InternalToJson(service)); - } - - jsonTimeZoneDefinition.Add(XmlElementNames.Periods, jsonPeriods.ToArray()); - } - - if (this.transitionGroups.Count > 0) - { - List jsonTransitionGroups = new List(); - - foreach (KeyValuePair keyValuePair in this.transitionGroups) - { - jsonTransitionGroups.Add(keyValuePair.Value.InternalToJson(service)); - } - - jsonTimeZoneDefinition.Add(XmlElementNames.TransitionsGroups, jsonTransitionGroups.ToArray()); - } - - if (this.transitions.Count > 0) - { - JsonObject transisitionsJsonObject = new JsonObject(); - - List jsonTransitions = new List(); - - foreach (TimeZoneTransition transition in this.transitions) - { - jsonTransitions.Add(transition.InternalToJson(service)); - } - - transisitionsJsonObject.Add(XmlElementNames.Transition, jsonTransitions.ToArray()); - jsonTimeZoneDefinition.Add(XmlElementNames.Transitions, transisitionsJsonObject); - } - } - - return jsonTimeZoneDefinition; - } - /// /// Writes to XML. /// @@ -524,8 +426,9 @@ internal void Validate() /// /// Converts this time zone definition into a TimeZoneInfo structure. /// + /// The service. /// A TimeZoneInfo representing the same time zone as this definition. - internal TimeZoneInfo ToTimeZoneInfo() + internal TimeZoneInfo ToTimeZoneInfo(ExchangeService service) { this.Validate(); @@ -556,14 +459,28 @@ internal TimeZoneInfo ToTimeZoneInfo() effectiveEndDate = endDate; } - TimeZoneInfo.AdjustmentRule adjustmentRule = this.transitions[i].TargetGroup.CreateAdjustmentRule(startDate, effectiveEndDate); + // OM:1648848 Due to bad timezone data from clients the + // startDate may not always come before the effectiveEndDate + if (startDate < effectiveEndDate) + { + TimeZoneInfo.AdjustmentRule adjustmentRule = this.transitions[i].TargetGroup.CreateAdjustmentRule(startDate, effectiveEndDate); - if (adjustmentRule != null) + if (adjustmentRule != null) + { + adjustmentRules.Add(adjustmentRule); + } + + startDate = endDate; + } + else { - adjustmentRules.Add(adjustmentRule); + service.TraceMessage( + TraceFlags.EwsTimeZones, + string.Format( + "The startDate '{0}' is not before the effectiveEndDate '{1}'. Will skip creating adjustment rule.", + startDate, + effectiveEndDate)); } - - startDate = endDate; } if (adjustmentRules.Count == 0) @@ -624,4 +541,4 @@ internal Dictionary TransitionGroups get { return this.transitionGroups; } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/TimeZones/TimeZonePeriod.cs b/ComplexProperties/TimeZones/TimeZonePeriod.cs index 470d6fc8..57cee0e3 100644 --- a/ComplexProperties/TimeZones/TimeZonePeriod.cs +++ b/ComplexProperties/TimeZones/TimeZonePeriod.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the TimeZonePeriod class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -50,24 +65,6 @@ internal override void WriteAttributesToXml(EwsServiceXmlWriter writer) writer.WriteAttributeValue(XmlAttributeNames.Id, this.id); } - /// - /// Serializes the property to a Json value. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonTimeZonePeriod = new JsonObject(); - - jsonTimeZonePeriod.Add(XmlAttributeNames.Bias, EwsUtilities.TimeSpanToXSDuration(this.bias)); - jsonTimeZonePeriod.Add(XmlAttributeNames.Name, this.name); - jsonTimeZonePeriod.Add(XmlAttributeNames.Id, this.id); - - return jsonTimeZonePeriod; - } - /// /// Loads from XML. /// @@ -77,32 +74,6 @@ internal void LoadFromXml(EwsServiceXmlReader reader) this.LoadFromXml(reader, XmlElementNames.Period); } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - base.LoadFromJson(jsonProperty, service); - - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlAttributeNames.Id: - this.id = jsonProperty.ReadAsString(key); - break; - case XmlAttributeNames.Name: - this.name = jsonProperty.ReadAsString(key); - break; - case XmlAttributeNames.Bias: - this.bias = EwsUtilities.XSDurationToTimeSpan(jsonProperty.ReadAsString(key)); - break; - } - } - } - /// /// Writes to XML. /// @@ -164,4 +135,4 @@ internal string Id set { this.id = value; } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/TimeZones/TimeZoneTransition.cs b/ComplexProperties/TimeZones/TimeZoneTransition.cs index 3b0e640c..c3d07cd2 100644 --- a/ComplexProperties/TimeZones/TimeZoneTransition.cs +++ b/ComplexProperties/TimeZones/TimeZoneTransition.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the TimeZoneTransition class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -151,81 +166,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - base.LoadFromJson(jsonProperty, service); - - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.To: - string targetKind = jsonProperty.ReadAsJsonObject(key).ReadAsString(XmlAttributeNames.Kind); - string targetId = jsonProperty.ReadAsJsonObject(key).ReadAsString(XmlElementNames.Value); - - switch (targetKind) - { - case TimeZoneTransition.PeriodTarget: - if (!this.timeZoneDefinition.Periods.TryGetValue(targetId, out this.targetPeriod)) - { - throw new ServiceLocalException( - string.Format( - Strings.PeriodNotFound, - targetId)); - } - - break; - case TimeZoneTransition.GroupTarget: - if (!this.timeZoneDefinition.TransitionGroups.TryGetValue(targetId, out this.targetGroup)) - { - throw new ServiceLocalException( - string.Format( - Strings.TransitionGroupNotFound, - targetId)); - } - - break; - default: - throw new ServiceLocalException(Strings.UnsupportedTimeZonePeriodTransitionTarget); - } - break; - } - } - } - - /// - /// Serializes the property to a Json value. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonTimeZoneTransition = new JsonObject(); - JsonObject jsonToElement = new JsonObject(); - - jsonTimeZoneTransition.Add(XmlElementNames.To, jsonToElement); - - if (this.targetPeriod != null) - { - jsonToElement.Add(XmlAttributeNames.Kind, PeriodTarget); - jsonToElement.Add(XmlElementNames.Value, this.targetPeriod.Id); - } - else - { - jsonToElement.Add(XmlAttributeNames.Kind, GroupTarget); - jsonToElement.Add(XmlElementNames.Value, this.targetGroup.Id); - } - - return jsonTimeZoneTransition; - } - /// /// Writes elements to XML. /// @@ -314,4 +254,4 @@ internal TimeZoneTransitionGroup TargetGroup get { return this.targetGroup; } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/TimeZones/TimeZoneTransitionGroup.cs b/ComplexProperties/TimeZones/TimeZoneTransitionGroup.cs index 2a68bae6..c9f4f9e7 100644 --- a/ComplexProperties/TimeZones/TimeZoneTransitionGroup.cs +++ b/ComplexProperties/TimeZones/TimeZoneTransitionGroup.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the TimeZoneTransitionGroup class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -52,39 +67,6 @@ internal override void ReadAttributesFromXml(EwsServiceXmlReader reader) this.id = reader.ReadAttributeValue(XmlAttributeNames.Id); } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - base.LoadFromJson(jsonProperty, service); - - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlAttributeNames.Id: - this.id = jsonProperty.ReadAsString(key); - break; - - case XmlElementNames.Transition: - - foreach (object uncastJsonTransition in jsonProperty.ReadAsArray(key)) - { - JsonObject jsonTransition = uncastJsonTransition as JsonObject; - TimeZoneTransition transition = TimeZoneTransition.Create(this.timeZoneDefinition, jsonTransition.ReadTypeString()); - - transition.LoadFromJson(jsonTransition, service); - - this.transitions.Add(transition); - } - break; - } - } - } - /// /// Writes the attributes to XML. /// @@ -129,30 +111,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) } } - /// - /// Serializes the property to a Json value. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonTimeZoneTransitionGroup = new JsonObject(); - - jsonTimeZoneTransitionGroup.Add(XmlAttributeNames.Id, this.id); - - List jsonTransitions = new List(); - foreach (TimeZoneTransition transition in this.transitions) - { - jsonTransitions.Add(transition.InternalToJson(service)); - } - - jsonTimeZoneTransitionGroup.Add(XmlElementNames.Transitions, jsonTransitions.ToArray()); - - return jsonTimeZoneTransitionGroup; - } - /// /// Initializes this transition group based on the specified asjustment rule. /// @@ -177,9 +135,18 @@ internal virtual void InitializeFromAdjustmentRule(TimeZoneInfo.AdjustmentRule a daylightPeriod, adjustmentRule.DaylightTransitionStart); + TimeZonePeriod standardPeriodToSet = new TimeZonePeriod(); + standardPeriodToSet.Id = string.Format( + "{0}/{1}", + standardPeriod.Id, + adjustmentRule.DateStart.Year); + standardPeriodToSet.Name = standardPeriod.Name; + standardPeriodToSet.Bias = standardPeriod.Bias; + this.timeZoneDefinition.Periods.Add(standardPeriodToSet.Id, standardPeriodToSet); + this.transitionToStandard = TimeZoneTransition.CreateTimeZoneTransition( this.timeZoneDefinition, - standardPeriod, + standardPeriodToSet, adjustmentRule.DaylightTransitionEnd); this.transitions.Add(this.transitionToDaylight); @@ -446,4 +413,4 @@ internal List Transitions get { return this.transitions; } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/UniqueBody.cs b/ComplexProperties/UniqueBody.cs index b54fae39..33286b2f 100644 --- a/ComplexProperties/UniqueBody.cs +++ b/ComplexProperties/UniqueBody.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the UniqueBody class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -61,32 +76,6 @@ internal override void ReadTextValueFromXml(EwsServiceXmlReader reader) this.text = reader.ReadValue(); } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlAttributeNames.BodyType: - this.bodyType = jsonProperty.ReadEnumValue(key); - break; - case XmlAttributeNames.IsTruncated: - this.isTruncated = jsonProperty.ReadAsBool(key); - break; - case JsonObject.JsonValueString: - this.text = jsonProperty.ReadAsString(key); - break; - default: - break; - } - } - } - /// /// Writes attributes to XML. /// @@ -108,28 +97,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) } } - /// - /// Serializes the property to a Json value. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonProperty = new JsonObject(); - - jsonProperty.Add(XmlAttributeNames.BodyType, this.BodyType); - jsonProperty.Add(XmlAttributeNames.IsTruncated, this.IsTruncated); - - if (!string.IsNullOrEmpty(this.Text)) - { - jsonProperty.Add(JsonObject.JsonValueString, this.Text); - } - - return jsonProperty; - } - /// /// Gets the type of the unique body's text. /// @@ -176,4 +143,4 @@ public override string ToString() } #endregion } -} +} \ No newline at end of file diff --git a/ComplexProperties/UrlEntity.cs b/ComplexProperties/UrlEntity.cs index 637f43a8..8316594c 100644 --- a/ComplexProperties/UrlEntity.cs +++ b/ComplexProperties/UrlEntity.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the UrlEntity class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -49,4 +64,4 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/UrlEntityCollection.cs b/ComplexProperties/UrlEntityCollection.cs index f4002950..766b0b81 100644 --- a/ComplexProperties/UrlEntityCollection.cs +++ b/ComplexProperties/UrlEntityCollection.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the UrlEntityCollection class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -50,15 +65,6 @@ internal override UrlEntity CreateComplexProperty(string xmlElementName) return new UrlEntity(); } - /// - /// Creates the default complex property. - /// - /// UrlEntity. - internal override UrlEntity CreateDefaultComplexProperty() - { - return new UrlEntity(); - } - /// /// Gets the name of the collection item XML element. /// @@ -69,4 +75,4 @@ internal override string GetCollectionItemXmlElementName(UrlEntity complexProper return XmlElementNames.NlgUrl; } } -} +} \ No newline at end of file diff --git a/ComplexProperties/UserConfigurationDictionary.cs b/ComplexProperties/UserConfigurationDictionary.cs index 788a08f5..8bbbc557 100644 --- a/ComplexProperties/UserConfigurationDictionary.cs +++ b/ComplexProperties/UserConfigurationDictionary.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Implements a UserConfiguration's Dictionary property. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -23,7 +38,7 @@ namespace Microsoft.Exchange.WebServices.Data /// Represents a user configuration's Dictionary property. /// [EditorBrowsable(EditorBrowsableState.Never)] - public sealed class UserConfigurationDictionary : ComplexProperty, IEnumerable, IJsonCollectionDeserializer + public sealed class UserConfigurationDictionary : ComplexProperty, IEnumerable { // TODO: Consider implementing IsDirty mechanism in ComplexProperty. private Dictionary dictionary; @@ -204,30 +219,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) } } - /// - /// Serializes the property to a Json value. - /// - /// - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - List jsonArray = new List(); - - foreach (KeyValuePair dictionaryEntry in this.dictionary) - { - JsonObject jsonDictionaryEntry = new JsonObject(); - - jsonDictionaryEntry.Add(XmlElementNames.DictionaryKey, this.GetJsonObject(dictionaryEntry.Key, service)); - jsonDictionaryEntry.Add(XmlElementNames.DictionaryValue, this.GetJsonObject(dictionaryEntry.Value, service)); - - jsonArray.Add(jsonDictionaryEntry); - } - - return jsonArray.ToArray(); - } - /// /// Gets the type code. /// @@ -291,46 +282,6 @@ private static UserConfigurationDictionaryObjectType GetObjectType(string type) return (UserConfigurationDictionaryObjectType)Enum.Parse(typeof(UserConfigurationDictionaryObjectType), type, false); } - /// - /// Gets the json object. - /// - /// The dictionary object. - /// The service. - /// - private JsonObject GetJsonObject(object dictionaryObject, ExchangeService service) - { - UserConfigurationDictionaryObjectType dictionaryObjectType = UserConfigurationDictionaryObjectType.String; - string[] valueAsStringArray = null; - - if (dictionaryObject == null) - { - return null; - } - - if (dictionaryObject is string[]) - { - dictionaryObjectType = UserConfigurationDictionaryObjectType.StringArray; - valueAsStringArray = dictionaryObject as string[]; - } - else if (dictionaryObject is byte[]) - { - dictionaryObjectType = UserConfigurationDictionaryObjectType.ByteArray; - valueAsStringArray = new string[] { Convert.ToBase64String(dictionaryObject as byte[]) }; - } - else - { - valueAsStringArray = new string[1]; - GetTypeCode(service, dictionaryObject, ref dictionaryObjectType, ref valueAsStringArray[0]); - } - - JsonObject jsonDictionaryObject = new JsonObject(); - - jsonDictionaryObject.Add(XmlElementNames.Type, dictionaryObjectType); - jsonDictionaryObject.Add(XmlElementNames.Value, valueAsStringArray); - - return jsonDictionaryObject; - } - /// /// Writes a dictionary object (key or value) to Xml. /// @@ -528,54 +479,6 @@ private void LoadEntry(EwsServiceXmlReader reader) this.dictionary.Add(key, value); } - /// - /// Loads from json collection. - /// - /// The json collection. - /// The service. - public void CreateFromJsonCollection(object[] jsonCollection, ExchangeService service) - { - foreach (object element in jsonCollection) - { - JsonObject jsonEntry = element as JsonObject; - - object parsedKey = this.GetDictionaryObject(jsonEntry.ReadAsJsonObject(XmlElementNames.DictionaryKey), service); - object parsedValue = this.GetDictionaryObject(jsonEntry.ReadAsJsonObject(XmlElementNames.DictionaryValue), service); - - this.dictionary.Add(parsedKey, parsedValue); - } - } - - /// - /// Loads from json collection to update. - /// - /// The json collection. - /// The service. - public void UpdateFromJsonCollection(object[] jsonCollection, ExchangeService service) - { - throw new NotImplementedException(); - } - - /// - /// Gets the dictionary object. - /// - /// The json object. - /// The service. - /// - private object GetDictionaryObject(JsonObject jsonObject, ExchangeService service) - { - if (jsonObject == null) - { - return null; - } - - UserConfigurationDictionaryObjectType type = GetObjectType(jsonObject.ReadAsString(XmlElementNames.Type)); - - List values = this.GetObjectValue(jsonObject.ReadAsArray(XmlElementNames.Value)); - - return this.ConstructObject(type, values, service); - } - /// /// Gets the object value. /// @@ -872,4 +775,4 @@ private void ValidateObjectType(Type type) } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/UserId.cs b/ComplexProperties/UserId.cs index 97c94306..f1f452da 100644 --- a/ComplexProperties/UserId.cs +++ b/ComplexProperties/UserId.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the UserId class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -144,35 +159,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.SID: - this.sID = jsonProperty.ReadAsString(key); - break; - case XmlElementNames.PrimarySmtpAddress: - this.primarySmtpAddress = jsonProperty.ReadAsString(key); - break; - case XmlElementNames.DisplayName: - this.displayName = jsonProperty.ReadAsString(key); - break; - case XmlElementNames.DistinguishedUser: - this.standardUser = jsonProperty.ReadEnumValue(key); - break; - default: - break; - } - } - } - /// /// Writes elements to XML. /// @@ -199,28 +185,5 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) XmlElementNames.DistinguishedUser, this.StandardUser); } - - /// - /// Serializes the property to a Json value. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal override object InternalToJson(ExchangeService service) - { - JsonObject jsonProperty = new JsonObject(); - - jsonProperty.Add(XmlElementNames.SID, this.SID); - jsonProperty.Add(XmlElementNames.PrimarySmtpAddress, this.PrimarySmtpAddress); - jsonProperty.Add(XmlElementNames.DisplayName, this.DisplayName); - - if (this.StandardUser.HasValue) - { - jsonProperty.Add(XmlElementNames.DistinguishedUser, this.StandardUser.Value); - } - - return jsonProperty; - } } -} +} \ No newline at end of file diff --git a/ComplexProperties/VotingInformation.cs b/ComplexProperties/VotingInformation.cs index e1a9131b..68ee49ce 100644 --- a/ComplexProperties/VotingInformation.cs +++ b/ComplexProperties/VotingInformation.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the VotingInformation class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -62,40 +77,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.UserOptions: - Object[] votingOptionObjects = jsonProperty.ReadAsArray(XmlElementNames.UserOptions); - if (votingOptionObjects != null) - { - foreach (object votingOptionObject in votingOptionObjects) - { - JsonObject jsonObject = votingOptionObject as JsonObject; - VotingOptionData option = new VotingOptionData(); - - option.LoadFromJson(jsonObject, service); - this.userOptions.Add(option); - } - } - break; - case XmlElementNames.VotingResponse: - this.votingResponse = jsonProperty.ReadAsString(key); - break; - default: - break; - } - } - } - /// /// Gets the list of user options. /// @@ -112,4 +93,4 @@ public string VotingResponse get { return this.votingResponse; } } } -} +} \ No newline at end of file diff --git a/ComplexProperties/VotingOptionData.cs b/ComplexProperties/VotingOptionData.cs index 30d82c49..252dbb20 100644 --- a/ComplexProperties/VotingOptionData.cs +++ b/ComplexProperties/VotingOptionData.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the VotingOptionData class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -47,29 +62,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) } } - /// - /// Loads from json. - /// - /// The json property. - /// The service. - internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service) - { - foreach (string key in jsonProperty.Keys) - { - switch (key) - { - case XmlElementNames.VotingOptionDisplayName: - this.displayName = jsonProperty.ReadAsString(key); - break; - case XmlElementNames.SendPrompt: - this.sendPrompt = jsonProperty.ReadEnumValue(key); - break; - default: - break; - } - } - } - /// /// Gets the display name for the voting option. /// @@ -86,4 +78,4 @@ public SendPrompt SendPrompt get { return this.sendPrompt; } } } -} +} \ No newline at end of file diff --git a/Core/EwsHttpWebRequest.cs b/Core/EwsHttpWebRequest.cs index 0d56e589..dc5705b4 100644 --- a/Core/EwsHttpWebRequest.cs +++ b/Core/EwsHttpWebRequest.cs @@ -1,15 +1,34 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Defines the EwsHttpWebRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { using System; using System.IO; using System.Net; + using System.Net.Security; using System.Security.Cryptography.X509Certificates; /// @@ -276,4 +295,4 @@ public string ConnectionGroupName #endregion } -} +} \ No newline at end of file diff --git a/Core/EwsHttpWebRequestFactory.cs b/Core/EwsHttpWebRequestFactory.cs index 830c68d2..9d80dda9 100644 --- a/Core/EwsHttpWebRequestFactory.cs +++ b/Core/EwsHttpWebRequestFactory.cs @@ -1,9 +1,27 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Defines the EwsHttpWebRequestFactory class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -45,4 +63,4 @@ IEwsHttpWebResponse IEwsHttpWebRequestFactory.CreateExceptionResponse(WebExcepti } #endregion } -} +} \ No newline at end of file diff --git a/Core/EwsHttpWebResponse.cs b/Core/EwsHttpWebResponse.cs index a08d045d..b4a4c6dc 100644 --- a/Core/EwsHttpWebResponse.cs +++ b/Core/EwsHttpWebResponse.cs @@ -1,9 +1,27 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Defines the EwsHttpWebResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -128,4 +146,4 @@ void IDisposable.Dispose() #endregion } -} +} \ No newline at end of file diff --git a/Core/EwsServiceJsonReader.cs b/Core/EwsServiceJsonReader.cs deleted file mode 100644 index 28b6545e..00000000 --- a/Core/EwsServiceJsonReader.cs +++ /dev/null @@ -1,94 +0,0 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the EwsServiceJsonReader class. -//----------------------------------------------------------------------- - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Microsoft.Exchange.WebServices.Data -{ - /// - /// JSON reader. - /// - internal class EwsServiceJsonReader - { - /// - /// Initializes a new instance of the class. - /// - /// The service. - internal EwsServiceJsonReader(ExchangeService service) - { - this.Service = service; - } - - /// - /// Reads the service objects collection from JSON. - /// - /// The type of the service object. - /// The json response. - /// Name of the collection XML element. - /// The get object instance delegate. - /// if set to true [clear property bag]. - /// The requested property set. - /// if set to true [summary properties only]. - /// List of service objects. - internal List ReadServiceObjectsCollectionFromJson( - JsonObject jsonResponse, - string collectionJsonElementName, - GetObjectInstanceDelegate getObjectInstanceDelegate, - bool clearPropertyBag, - PropertySet requestedPropertySet, - bool summaryPropertiesOnly) where TServiceObject : ServiceObject - { - List serviceObjects = new List(); - TServiceObject serviceObject = null; - - object[] jsonServiceObjects = jsonResponse.ReadAsArray(collectionJsonElementName); - foreach (object arrayEntry in jsonServiceObjects) - { - JsonObject jsonServiceObject = arrayEntry as JsonObject; - - if (jsonServiceObject != null) - { - serviceObject = getObjectInstanceDelegate(this.Service, jsonServiceObject.ReadTypeString()); - - if (serviceObject != null) - { - if (string.Compare(jsonServiceObject.ReadTypeString(), serviceObject.GetXmlElementName(), StringComparison.Ordinal) != 0) - { - throw new ServiceLocalException( - string.Format( - "The type of the object in the store ({0}) does not match that of the local object ({1}).", - jsonServiceObject.ReadTypeString(), - serviceObject.GetXmlElementName())); - } - - serviceObject.LoadFromJson( - jsonServiceObject, - this.Service, - clearPropertyBag, - requestedPropertySet, - summaryPropertiesOnly); - - serviceObjects.Add(serviceObject); - } - } - } - - return serviceObjects; - } - - /// - /// Gets or sets the service. - /// - internal ExchangeService Service { get; set; } - } -} diff --git a/Core/EwsServiceMultiResponseXmlReader.cs b/Core/EwsServiceMultiResponseXmlReader.cs index 18ebeb16..344a8d55 100644 --- a/Core/EwsServiceMultiResponseXmlReader.cs +++ b/Core/EwsServiceMultiResponseXmlReader.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the EwsServiceXmlReader class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -91,4 +106,4 @@ protected override XmlReader InitializeXmlReader(Stream stream) return CreateXmlReader(stream); } } -} +} \ No newline at end of file diff --git a/Core/EwsServiceXmlReader.cs b/Core/EwsServiceXmlReader.cs index 6019def5..b8d04a7b 100644 --- a/Core/EwsServiceXmlReader.cs +++ b/Core/EwsServiceXmlReader.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the EwsServiceXmlReader class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Core/EwsServiceXmlWriter.cs b/Core/EwsServiceXmlWriter.cs index 71472f9a..45613bd4 100644 --- a/Core/EwsServiceXmlWriter.cs +++ b/Core/EwsServiceXmlWriter.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the EwsServiceXmlWriter class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Core/EwsUtilities.cs b/Core/EwsUtilities.cs index b5c93c4a..2076f36b 100644 --- a/Core/EwsUtilities.cs +++ b/Core/EwsUtilities.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the EwsUtilities class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -46,15 +61,24 @@ internal static class EwsUtilities private static LazyMember buildVersion = new LazyMember( delegate() { - FileVersionInfo fileInfo = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location); - return fileInfo.FileVersion; + try + { + FileVersionInfo fileInfo = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location); + return fileInfo.FileVersion; + } + catch + { + // OM:2026839 When run in an environment with partial trust, fetching the build version blows up. + // Just return a hardcoded value on failure. + return "0.0"; + } }); /// /// Dictionary of enum type to ExchangeVersion maps. /// private static LazyMember>> enumVersionDictionaries = new LazyMember>>( - () => new Dictionary>() + () => new Dictionary>() { { typeof(WellKnownFolderName), BuildEnumDict(typeof(WellKnownFolderName)) }, { typeof(ItemTraversal), BuildEnumDict(typeof(ItemTraversal)) }, @@ -69,7 +93,7 @@ internal static class EwsUtilities /// Dictionary of enum type to schema-name-to-enum-value maps. /// private static LazyMember>> schemaToEnumDictionaries = new LazyMember>>( - () => new Dictionary> + () => new Dictionary> { { typeof(EventType), BuildSchemaToEnumDict(typeof(EventType)) }, { typeof(MailboxType), BuildSchemaToEnumDict(typeof(MailboxType)) }, @@ -82,7 +106,7 @@ internal static class EwsUtilities /// Dictionary of enum type to enum-value-to-schema-name maps. /// private static LazyMember>> enumToSchemaDictionaries = new LazyMember>>( - () => new Dictionary> + () => new Dictionary> { { typeof(EventType), BuildEnumToSchemaDict(typeof(EventType)) }, { typeof(MailboxType), BuildEnumToSchemaDict(typeof(MailboxType)) }, @@ -95,7 +119,7 @@ internal static class EwsUtilities /// Dictionary to map from special CLR type names to their "short" names. /// private static LazyMember> typeNameToShortNameMap = new LazyMember>( - () => new Dictionary + () => new Dictionary { { "Boolean", "bool" }, { "Int16", "short" }, @@ -637,6 +661,11 @@ internal static void ParseEnumValueList( "EwsUtilities.ParseEnumValueList", "T is not an enum type."); + if (string.IsNullOrEmpty(value)) + { + return; + } + string[] enumValues = value.Split(separators); foreach (string enumValue in enumValues) @@ -696,6 +725,30 @@ internal static T Parse(string value) } } + /// + /// Tries to parses the specified value to the specified type. + /// + /// The type into which to cast the provided value. + /// The value to parse. + /// The value cast to the specified type, if TryParse succeeds. Otherwise, the value of result is indeterminate. + /// True if value could be parsed; otherwise, false. + internal static bool TryParse(string value, out T result) + { + try + { + result = EwsUtilities.Parse(value); + + return true; + } + //// Catch all exceptions here, we're not interested in the reason why TryParse failed. + catch (Exception) + { + result = default(T); + + return false; + } + } + /// /// Converts the specified date and time from one time zone to another. /// diff --git a/Core/EwsXmlReader.cs b/Core/EwsXmlReader.cs index bb1baa93..0078c31a 100644 --- a/Core/EwsXmlReader.cs +++ b/Core/EwsXmlReader.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the EwsXmlReader class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -806,4 +821,4 @@ public XmlNodeType PrevNodeType get { return this.prevNodeType; } } } -} +} \ No newline at end of file diff --git a/Core/ExchangeServerInfo.cs b/Core/ExchangeServerInfo.cs index 6b6aeb56..8baac559 100644 --- a/Core/ExchangeServerInfo.cs +++ b/Core/ExchangeServerInfo.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ExchangeServerInfo class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -51,22 +66,6 @@ internal static ExchangeServerInfo Parse(EwsServiceXmlReader reader) return info; } - /// - /// Parses the specified json object. - /// - /// The json object. - /// - internal static ExchangeServerInfo Parse(JsonObject jsonObject) - { - ExchangeServerInfo info = new ExchangeServerInfo(); - info.MajorVersion = jsonObject.ReadAsInt("MajorVersion"); - info.MinorVersion = jsonObject.ReadAsInt("MinorVersion"); - info.MajorBuildNumber = jsonObject.ReadAsInt("MajorBuildNumber"); - info.MinorBuildNumber = jsonObject.ReadAsInt("MinorBuildNumber"); - info.VersionString = jsonObject.ReadAsString("Version"); - return info; - } - /// /// Gets the Major Exchange server version number /// @@ -130,4 +129,4 @@ public override string ToString() this.MinorBuildNumber); } } -} +} \ No newline at end of file diff --git a/Core/ExchangeService.cs b/Core/ExchangeService.cs index 75f2374b..cdc22cd3 100644 --- a/Core/ExchangeService.cs +++ b/Core/ExchangeService.cs @@ -1,12 +1,27 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//----------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ExchangeService class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -19,6 +34,8 @@ namespace Microsoft.Exchange.WebServices.Data using System.Net; using System.Xml; using Microsoft.Exchange.WebServices.Autodiscover; + using Microsoft.Exchange.WebServices.Data.Enumerations; + using Microsoft.Exchange.WebServices.Data.Groups; /// /// Represents a binding to the Exchange Web Services. @@ -42,7 +59,6 @@ public sealed class ExchangeService : ExchangeServiceBase private IFileAttachmentContentHandler fileAttachmentContentHandler; private UnifiedMessaging unifiedMessaging; private bool enableScpLookup = true; - private ExchangeService.RenderingMode renderingMode = RenderingMode.Xml; private bool traceEnablePrettyPrinting = true; private string targetServerVersion = null; @@ -272,12 +288,11 @@ internal Folder BindToFolder(FolderId folderId, PropertySet propertySet) EwsUtilities.ValidateParam(folderId, "folderId"); EwsUtilities.ValidateParam(propertySet, "propertySet"); - GetFolderRequest request = new GetFolderRequest(this, ServiceErrorHandling.ThrowOnError); - - request.FolderIds.Add(folderId); - request.PropertySet = propertySet; - - ServiceResponseCollection responses = request.Execute(); + ServiceResponseCollection responses = this.InternalBindToFolders( + new[] { folderId }, + propertySet, + ServiceErrorHandling.ThrowOnError + ); return responses[0].Folder; } @@ -308,6 +323,46 @@ internal TFolder BindToFolder(FolderId folderId, PropertySet propertySe } } + /// + /// Binds to multiple folders in a single call to EWS. + /// + /// The Ids of the folders to bind to. + /// The set of properties to load. + /// A ServiceResponseCollection providing results for each of the specified folder Ids. + public ServiceResponseCollection BindToFolders( + IEnumerable folderIds, + PropertySet propertySet) + { + EwsUtilities.ValidateParamCollection(folderIds, "folderIds"); + EwsUtilities.ValidateParam(propertySet, "propertySet"); + + return this.InternalBindToFolders( + folderIds, + propertySet, + ServiceErrorHandling.ReturnErrors + ); + } + + /// + /// Binds to multiple folders in a single call to EWS. + /// + /// The Ids of the folders to bind to. + /// The set of properties to load. + /// Type of error handling to perform. + /// A ServiceResponseCollection providing results for each of the specified folder Ids. + private ServiceResponseCollection InternalBindToFolders( + IEnumerable folderIds, + PropertySet propertySet, + ServiceErrorHandling errorHandling) + { + GetFolderRequest request = new GetFolderRequest(this, errorHandling); + + request.FolderIds.AddRange(folderIds); + request.PropertySet = propertySet; + + return request.Execute(); + } + /// /// Deletes a folder. Calling this method results in a call to EWS. /// @@ -1235,17 +1290,20 @@ internal ServiceResponseCollection InternalLoadPropertiesForIte /// /// The Ids of the items to bind to. /// The set of properties to load. + /// The SmtpAddress of mailbox that hosts all items we need to bind to /// Type of error handling to perform. /// A ServiceResponseCollection providing results for each of the specified item Ids. private ServiceResponseCollection InternalBindToItems( IEnumerable itemIds, PropertySet propertySet, + string anchorMailbox, ServiceErrorHandling errorHandling) { GetItemRequest request = new GetItemRequest(this, errorHandling); request.ItemIds.AddRange(itemIds); request.PropertySet = propertySet; + request.AnchorMailbox = anchorMailbox; return request.Execute(); } @@ -1264,6 +1322,34 @@ public ServiceResponseCollection BindToItems(IEnumerable + /// Binds to multiple items in a single call to EWS. + /// + /// The Ids of the items to bind to. + /// The set of properties to load. + /// The SmtpAddress of mailbox that hosts all items we need to bind to + /// A ServiceResponseCollection providing results for each of the specified item Ids. + /// + /// This API designed to be used primarily in groups scenarios where we want to set the + /// anchor mailbox header so that request is routed directly to the group mailbox backend server. + /// + public ServiceResponseCollection BindToGroupItems( + IEnumerable itemIds, + PropertySet propertySet, + string anchorMailbox) + { + EwsUtilities.ValidateParamCollection(itemIds, "itemIds"); + EwsUtilities.ValidateParam(propertySet, "propertySet"); + EwsUtilities.ValidateParam(propertySet, "anchorMailbox"); + + return this.InternalBindToItems( + itemIds, + propertySet, + anchorMailbox, ServiceErrorHandling.ReturnErrors); } @@ -1281,6 +1367,7 @@ internal Item BindToItem(ItemId itemId, PropertySet propertySet) ServiceResponseCollection responses = this.InternalBindToItems( new ItemId[] { itemId }, propertySet, + null, /* anchorMailbox */ ServiceErrorHandling.ThrowOnError); return responses[0].Item; @@ -1445,6 +1532,255 @@ public ServiceResponseCollection MarkAsJunk(IEnumerable + /// This method is for search scenarios. Retrieves a set of personas satisfying the specified search conditions. + /// + /// Id of the folder being searched + /// The search filter. Available search filter classes + /// include SearchFilter.IsEqualTo, SearchFilter.ContainsSubstring and + /// SearchFilter.SearchFilterCollection + /// The view which defines the number of persona being returned + /// The query string for which the search is being performed + /// A collection of personas matching the search conditions + public ICollection FindPeople(FolderId folderId, SearchFilter searchFilter, ViewBase view, string queryString) + { + EwsUtilities.ValidateParamAllowNull(folderId, "folderId"); + EwsUtilities.ValidateParamAllowNull(searchFilter, "searchFilter"); + EwsUtilities.ValidateParam(view, "view"); + EwsUtilities.ValidateParam(queryString, "queryString"); + EwsUtilities.ValidateMethodVersion(this, ExchangeVersion.Exchange2013_SP1, "FindPeople"); + + FindPeopleRequest request = new FindPeopleRequest(this); + + request.FolderId = folderId; + request.SearchFilter = searchFilter; + request.View = view; + request.QueryString = queryString; + + return request.Execute().Personas; + } + + /// + /// This method is for search scenarios. Retrieves a set of personas satisfying the specified search conditions. + /// + /// Name of the folder being searched + /// The search filter. Available search filter classes + /// include SearchFilter.IsEqualTo, SearchFilter.ContainsSubstring and + /// SearchFilter.SearchFilterCollection + /// The view which defines the number of persona being returned + /// The query string for which the search is being performed + /// A collection of personas matching the search conditions + public ICollection FindPeople(WellKnownFolderName folderName, SearchFilter searchFilter, ViewBase view, string queryString) + { + return this.FindPeople(new FolderId(folderName), searchFilter, view, queryString); + } + + /// + /// This method is for browse scenarios. Retrieves a set of personas satisfying the specified browse conditions. + /// Browse scenariosdon't require query string. + /// + /// Id of the folder being browsed + /// Search filter + /// The view which defines paging and the number of persona being returned + /// A result object containing resultset for browsing + public FindPeopleResults FindPeople(FolderId folderId, SearchFilter searchFilter, ViewBase view) + { + EwsUtilities.ValidateParamAllowNull(folderId, "folderId"); + EwsUtilities.ValidateParamAllowNull(searchFilter, "searchFilter"); + EwsUtilities.ValidateParamAllowNull(view, "view"); + EwsUtilities.ValidateMethodVersion(this, ExchangeVersion.Exchange2013_SP1, "FindPeople"); + + FindPeopleRequest request = new FindPeopleRequest(this); + + request.FolderId = folderId; + request.SearchFilter = searchFilter; + request.View = view; + + return request.Execute().Results; + } + + /// + /// This method is for browse scenarios. Retrieves a set of personas satisfying the specified browse conditions. + /// Browse scenarios don't require query string. + /// + /// Name of the folder being browsed + /// Search filter + /// The view which defines paging and the number of personas being returned + /// A result object containing resultset for browsing + public FindPeopleResults FindPeople(WellKnownFolderName folderName, SearchFilter searchFilter, ViewBase view) + { + return this.FindPeople(new FolderId(folderName), searchFilter, view); + } + + /// + /// Retrieves all people who are relevant to the user + /// + /// The view which defines the number of personas being returned + /// A collection of personas matching the query string + public PeopleQueryResults BrowsePeople(ViewBase view) + { + return this.BrowsePeople(view, null); + } + + /// + /// Retrieves all people who are relevant to the user + /// + /// The view which defines the number of personas being returned + /// The context for this query. See PeopleQueryContextKeys for keys + /// A collection of personas matching the query string + public PeopleQueryResults BrowsePeople(ViewBase view, Dictionary context) + { + return this.PerformPeopleQuery(view, string.Empty, context, null); + } + + /// + /// Searches for people who are relevant to the user, automatically determining + /// the best sources to use. + /// + /// The view which defines the number of personas being returned + /// The query string for which the search is being performed + /// A collection of personas matching the query string + public PeopleQueryResults SearchPeople(ViewBase view, string queryString) + { + return this.SearchPeople(view, queryString, null, null); + } + + /// + /// Searches for people who are relevant to the user + /// + /// The view which defines the number of personas being returned + /// The query string for which the search is being performed + /// The context for this query. See PeopleQueryContextKeys for keys + /// The scope of the query. + /// A collection of personas matching the query string + public PeopleQueryResults SearchPeople(ViewBase view, string queryString, Dictionary context, PeopleQueryMode queryMode) + { + EwsUtilities.ValidateParam(queryString, "queryString"); + + return this.PerformPeopleQuery(view, queryString, context, queryMode); + } + + /// + /// Performs a People Query FindPeople call + /// + /// The view which defines the number of personas being returned + /// The query string for which the search is being performed + /// The context for this query + /// The scope of the query. + /// + private PeopleQueryResults PerformPeopleQuery(ViewBase view, string queryString, Dictionary context, PeopleQueryMode queryMode) + { + EwsUtilities.ValidateParam(view, "view"); + EwsUtilities.ValidateMethodVersion(this, ExchangeVersion.Exchange2015, "FindPeople"); + + if (context == null) + { + context = new Dictionary(); + } + + if (queryMode == null) + { + queryMode = PeopleQueryMode.Auto; + } + + FindPeopleRequest request = new FindPeopleRequest(this); + request.View = view; + request.QueryString = queryString; + request.SearchPeopleSuggestionIndex = true; + request.Context = context; + request.QueryMode = queryMode; + + FindPeopleResponse response = request.Execute(); + + PeopleQueryResults results = new PeopleQueryResults(); + results.Personas = response.Personas.ToList(); + results.TransactionId = response.TransactionId; + + return results; + } + + /// + /// Get a user's photo. + /// + /// The user's email address + /// The desired size of the returned photo. Valid photo sizes are in UserPhotoSize + /// A photo's cache ID which will allow the caller to ensure their cached photo is up to date + /// A result object containing the photo state + public GetUserPhotoResults GetUserPhoto(string emailAddress, string userPhotoSize, string entityTag) + { + EwsUtilities.ValidateParam(emailAddress, "emailAddress"); + EwsUtilities.ValidateParam(userPhotoSize, "userPhotoSize"); + EwsUtilities.ValidateParamAllowNull(entityTag, "entityTag"); + + GetUserPhotoRequest request = new GetUserPhotoRequest(this); + + request.EmailAddress = emailAddress; + request.UserPhotoSize = userPhotoSize; + request.EntityTag = entityTag; + + return request.Execute().Results; + } + + /// + /// Begins an async request for a user photo + /// + /// An AsyncCallback delegate + /// An object that contains state information for this request + /// The user's email address + /// The desired size of the returned photo. Valid photo sizes are in UserPhotoSize + /// A photo's cache ID which will allow the caller to ensure their cached photo is up to date + /// An IAsyncResult that references the asynchronous request. + public IAsyncResult BeginGetUserPhoto( + AsyncCallback callback, + object state, + string emailAddress, + string userPhotoSize, + string entityTag) + { + EwsUtilities.ValidateParam(emailAddress, "emailAddress"); + EwsUtilities.ValidateParam(userPhotoSize, "userPhotoSize"); + EwsUtilities.ValidateParamAllowNull(entityTag, "entityTag"); + + GetUserPhotoRequest request = new GetUserPhotoRequest(this); + + request.EmailAddress = emailAddress; + request.UserPhotoSize = userPhotoSize; + request.EntityTag = entityTag; + + return request.BeginExecute(callback, state); + } + + /// + /// Ends an async request for a user's photo + /// + /// An IAsyncResult that references the asynchronous request. + /// A result object containing the photo state + public GetUserPhotoResults EndGetUserPhoto(IAsyncResult asyncResult) + { + GetUserPhotoRequest request = AsyncRequestResult.ExtractServiceRequest(this, asyncResult); + return request.EndExecute(asyncResult).Results; + } + + #endregion + + #region PeopleInsights operations + + /// + /// This method is for retreiving people insight for given email addresses + /// + /// Specified eamiladdresses to retrieve + /// The collection of Person objects containing the insight info + public Collection GetPeopleInsights(IEnumerable emailAddresses) + { + GetPeopleInsightsRequest request = new GetPeopleInsightsRequest(this); + request.Emailaddresses.AddRange(emailAddresses); + + return request.Execute().People; + } + + #endregion #region Attachment operations /// @@ -2052,6 +2388,7 @@ public PushSubscription SubscribeToPushNotifications( frequency, watermark, null, + null, // AnchorMailbox eventTypes).Execute()[0].Subscription; } @@ -2083,6 +2420,7 @@ public IAsyncResult BeginSubscribeToPushNotifications( frequency, watermark, null, + null, // AnchorMailbox eventTypes).BeginExecute(callback, state); } @@ -2111,6 +2449,7 @@ public PushSubscription SubscribeToPushNotificationsOnAllFolders( frequency, watermark, null, + null, // AnchorMailbox eventTypes).Execute()[0].Subscription; } @@ -2143,6 +2482,7 @@ public IAsyncResult BeginSubscribeToPushNotificationsOnAllFolders( frequency, watermark, null, + null, // AnchorMailbox eventTypes).BeginExecute(callback, state); } @@ -2172,6 +2512,7 @@ public PushSubscription SubscribeToPushNotifications( frequency, watermark, callerData, + null, // AnchorMailbox eventTypes).Execute()[0].Subscription; } @@ -2205,6 +2546,69 @@ public IAsyncResult BeginSubscribeToPushNotifications( frequency, watermark, callerData, + null, // AnchorMailbox + eventTypes).BeginExecute(callback, state); + } + + /// + /// Subscribes to push notifications on a group mailbox. Calling this method results in a call to EWS. + /// + /// The smtpaddress of the group mailbox to subscribe to. + /// The URL of the Web Service endpoint the Exchange server should push events to. + /// The frequency, in minutes, at which the Exchange server should contact the Web Service endpoint. Frequency must be between 1 and 1440. + /// An optional watermark representing a previously opened subscription. + /// Optional caller data that will be returned the call back. + /// The event types to subscribe to. + /// A PushSubscription representing the new subscription. + public PushSubscription SubscribeToGroupPushNotifications( + string groupMailboxSmtp, + Uri url, + int frequency, + string watermark, + string callerData, + params EventType[] eventTypes) + { + var folderIds = new FolderId[] { new FolderId(WellKnownFolderName.Inbox, new Mailbox(groupMailboxSmtp)) }; + return this.BuildSubscribeToPushNotificationsRequest( + folderIds, + url, + frequency, + watermark, + callerData, + groupMailboxSmtp, // AnchorMailbox + eventTypes).Execute()[0].Subscription; + } + + /// + /// Begins an asynchronous request to subscribe to push notifications. Calling this method results in a call to EWS. + /// + /// The AsyncCallback delegate. + /// An object that contains state information for this request. + /// The smtpaddress of the group mailbox to subscribe to. + /// The URL of the Web Service endpoint the Exchange server should push events to. + /// The frequency, in minutes, at which the Exchange server should contact the Web Service endpoint. Frequency must be between 1 and 1440. + /// An optional watermark representing a previously opened subscription. + /// Optional caller data that will be returned the call back. + /// The event types to subscribe to. + /// An IAsyncResult that references the asynchronous request. + public IAsyncResult BeginSubscribeToGroupPushNotifications( + AsyncCallback callback, + object state, + string groupMailboxSmtp, + Uri url, + int frequency, + string watermark, + string callerData, + params EventType[] eventTypes) + { + var folderIds = new FolderId[] { new FolderId(WellKnownFolderName.Inbox, new Mailbox(groupMailboxSmtp)) }; + return this.BuildSubscribeToPushNotificationsRequest( + folderIds, + url, + frequency, + watermark, + callerData, + groupMailboxSmtp, // AnchorMailbox eventTypes).BeginExecute(callback, state); } @@ -2235,6 +2639,7 @@ public PushSubscription SubscribeToPushNotificationsOnAllFolders( frequency, watermark, callerData, + null, // AnchorMailbox eventTypes).Execute()[0].Subscription; } @@ -2269,6 +2674,7 @@ public IAsyncResult BeginSubscribeToPushNotificationsOnAllFolders( frequency, watermark, callerData, + null, // AnchorMailbox eventTypes).BeginExecute(callback, state); } @@ -2284,6 +2690,18 @@ public PushSubscription EndSubscribeToPushNotifications(IAsyncResult asyncResult return request.EndExecute(asyncResult)[0].Subscription; } + /// + /// Ends an asynchronous request to subscribe to push notifications in a group mailbox. + /// + /// An IAsyncResult that references the asynchronous request. + /// A PushSubscription representing the new subscription. + public PushSubscription EndSubscribeToGroupPushNotifications(IAsyncResult asyncResult) + { + var request = AsyncRequestResult.ExtractServiceRequest(this, asyncResult); + + return request.EndExecute(asyncResult)[0].Subscription; + } + /// /// Set a TeamMailbox /// @@ -2333,6 +2751,7 @@ public void UnpinTeamMailbox(EmailAddress emailAddress) /// The frequency, in minutes, at which the Exchange server should contact the Web Service endpoint. Frequency must be between 1 and 1440. /// An optional watermark representing a previously opened subscription. /// Optional caller data that will be returned the call back. + /// The smtpaddress of the mailbox to subscribe to. /// The event types to subscribe to. /// A request to request to subscribe to push notifications in the authenticated user's mailbox. private SubscribeToPushNotificationsRequest BuildSubscribeToPushNotificationsRequest( @@ -2341,6 +2760,7 @@ private SubscribeToPushNotificationsRequest BuildSubscribeToPushNotificationsReq int frequency, string watermark, string callerData, + string anchorMailbox, EventType[] eventTypes) { EwsUtilities.ValidateParam(url, "url"); @@ -2353,6 +2773,7 @@ private SubscribeToPushNotificationsRequest BuildSubscribeToPushNotificationsReq EwsUtilities.ValidateParamCollection(eventTypes, "eventTypes"); SubscribeToPushNotificationsRequest request = new SubscribeToPushNotificationsRequest(this); + request.AnchorMailbox = anchorMailbox; if (folderIds != null) { @@ -2927,6 +3348,39 @@ public ICollection FindConversation(ViewBase view, FolderId folder return request.Execute().Conversations; } + /// + /// Retrieves a collection of all Conversations in the specified Folder. + /// + /// The view controlling the number of conversations returned. + /// The Id of the folder in which to search for conversations. + /// The anchorMailbox Smtp address to route the request directly to group mailbox. + /// Collection of conversations. + /// + /// This API designed to be used primarily in groups scenarios where we want to set the + /// anchor mailbox header so that request is routed directly to the group mailbox backend server. + /// + public Collection FindGroupConversation( + ViewBase view, + FolderId folderId, + string anchorMailbox) + { + EwsUtilities.ValidateParam(view, "view"); + EwsUtilities.ValidateParam(folderId, "folderId"); + EwsUtilities.ValidateParam(anchorMailbox, "anchorMailbox"); + EwsUtilities.ValidateMethodVersion( + this, + ExchangeVersion.Exchange2015, + "FindConversation"); + + FindConversationRequest request = new FindConversationRequest(this); + + request.View = view; + request.FolderId = new FolderIdWrapper(folderId); + request.AnchorMailbox = anchorMailbox; + + return request.Execute().Conversations; + } + /// /// Retrieves a collection of all Conversations in the specified Folder. /// @@ -3024,6 +3478,7 @@ public FindConversationResults FindConversation(ViewBase view, FolderId folderId /// The folders to ignore. /// Sort order of conversation tree nodes. /// The mailbox scope to reference. + /// The smtpaddress of the mailbox that hosts the conversations /// Maximum number of items to return. /// What type of error handling should be performed. /// GetConversationItems response. @@ -3034,6 +3489,7 @@ internal ServiceResponseCollection InternalGetConv ConversationSortOrder? sortOrder, MailboxSearchLocation? mailboxScope, int? maxItemsToReturn, + string anchorMailbox, ServiceErrorHandling errorHandling) { EwsUtilities.ValidateParam(conversations, "conversations"); @@ -3050,6 +3506,7 @@ internal ServiceResponseCollection InternalGetConv request.SortOrder = sortOrder; request.MailboxScope = mailboxScope; request.MaxItemsToReturn = maxItemsToReturn; + request.AnchorMailbox = anchorMailbox; request.Conversations = conversations.ToList(); return request.Execute(); @@ -3076,6 +3533,7 @@ public ServiceResponseCollection GetConversationIt null, /* sortOrder */ null, /* mailboxScope */ null, /* maxItemsToReturn*/ + null, /* anchorMailbox */ ServiceErrorHandling.ReturnErrors); } @@ -3105,6 +3563,45 @@ public ConversationResponse GetConversationItems( sortOrder, null, /* mailboxScope */ null, /* maxItemsToReturn */ + null, /* anchorMailbox */ + ServiceErrorHandling.ThrowOnError)[0].Conversation; + } + + /// + /// Gets the items for a conversation. + /// + /// The conversation id. + /// The set of properties to load. + /// The optional sync state representing the point in time when to start the synchronization. + /// The folders to ignore. + /// Conversation item sort order. + /// The smtp address of the mailbox hosting the conversations + /// ConversationResponseType response. + /// + /// This API designed to be used primarily in groups scenarios where we want to set the + /// anchor mailbox header so that request is routed directly to the group mailbox backend server. + /// + public ConversationResponse GetGroupConversationItems( + ConversationId conversationId, + PropertySet propertySet, + string syncState, + IEnumerable foldersToIgnore, + ConversationSortOrder? sortOrder, + string anchorMailbox) + { + EwsUtilities.ValidateParam(anchorMailbox, "anchorMailbox"); + + List conversations = new List(); + conversations.Add(new ConversationRequest(conversationId, syncState)); + + return this.InternalGetConversationItems( + conversations, + propertySet, + foldersToIgnore, + sortOrder, + null, /* mailboxScope */ + null, /* maxItemsToReturn */ + anchorMailbox, /* anchorMailbox */ ServiceErrorHandling.ThrowOnError)[0].Conversation; } @@ -3131,6 +3628,7 @@ public ServiceResponseCollection GetConversationIt null, /* sortOrder */ mailboxScope, null, /* maxItemsToReturn*/ + null, /* anchorMailbox */ ServiceErrorHandling.ReturnErrors); } @@ -4696,6 +5194,22 @@ public void DisableApp(string id, DisableReasonType disableReason) request.Execute(); } + /// + /// Sets the consent state of an extension. + /// + /// Extension id. + /// Sets the consent state of an extension. + /// Exception will be thrown for errors. + public void RegisterConsent(string id, ConsentState state) + { + EwsUtilities.ValidateParam(id, "id"); + EwsUtilities.ValidateParam(state, "state"); + + RegisterConsentRequest request = new RegisterConsentRequest(this, id, state); + + request.Execute(); + } + /// /// Get App Marketplace Url. /// @@ -4790,6 +5304,28 @@ public void SetEncryptionConfiguration(string imageBase64, string emailText, str request.Execute(); } + /// + /// Get the OME (i.e. Office Message Encryption) configuration data. This method is used in server-to-server calls to retrieve OME configuration + /// + /// OME Configuration response object + public GetOMEConfigurationResponse GetOMEConfiguration() + { + GetOMEConfigurationRequest request = new GetOMEConfigurationRequest(this); + + return request.Execute(); + } + + /// + /// Set the OME (i.e. Office Message Encryption) configuration data. This method is used in server-to-server calls to set encryption configuration + /// + /// The xml + public void SetOMEConfiguration(string xml) + { + SetOMEConfigurationRequest request = new SetOMEConfigurationRequest(this, xml); + + request.Execute(); + } + /// /// Set the client extension data. This method is used in server-to-server calls to install/uninstall/configure ORG /// extensions to support admin's management of ORG extensions via powershell/UMC. @@ -4804,6 +5340,93 @@ public void SetClientExtension(List actions) #endregion + #region Groups + /// + /// Gets the list of unified groups associated with the user + /// + /// The Requested Unified Groups Sets + /// The smtp address of accessing user. + /// UserUnified groups. + public Collection GetUserUnifiedGroups( + IEnumerable requestedUnifiedGroupsSets, + string userSmtpAddress) + { + EwsUtilities.ValidateParam(requestedUnifiedGroupsSets, "requestedUnifiedGroupsSets"); + EwsUtilities.ValidateParam(userSmtpAddress, "userSmtpAddress"); + + return this.GetUserUnifiedGroupsInternal(requestedUnifiedGroupsSets, userSmtpAddress); + } + + /// + /// Gets the list of unified groups associated with the user + /// + /// The Requested Unified Groups Sets + /// UserUnified groups. + public Collection GetUserUnifiedGroups(IEnumerable requestedUnifiedGroupsSets) + { + EwsUtilities.ValidateParam(requestedUnifiedGroupsSets, "requestedUnifiedGroupsSets"); + return this.GetUserUnifiedGroupsInternal(requestedUnifiedGroupsSets, null); + } + + /// + /// Gets the list of unified groups associated with the user + /// + /// The Requested Unified Groups Sets + /// The smtp address of accessing user. + /// UserUnified groups. + private Collection GetUserUnifiedGroupsInternal( + IEnumerable requestedUnifiedGroupsSets, + string userSmtpAddress) + { + GetUserUnifiedGroupsRequest request = new GetUserUnifiedGroupsRequest(this); + + if (!string.IsNullOrEmpty(userSmtpAddress)) + { + request.UserSmtpAddress = userSmtpAddress; + } + + if (requestedUnifiedGroupsSets != null) + { + request.RequestedUnifiedGroupsSets = requestedUnifiedGroupsSets; + } + + return request.Execute().GroupsSets; + } + + /// + /// Gets the UnifiedGroupsUnseenCount for the group specfied + /// + /// The smtpaddress of group for which unseendata is desired + /// The LastVisitedTimeUtc of group for which unseendata is desired + /// UnifiedGroupsUnseenCount + public int GetUnifiedGroupUnseenCount(string groupMailboxSmtpAddress, DateTime lastVisitedTimeUtc) + { + EwsUtilities.ValidateParam(groupMailboxSmtpAddress, "groupMailboxSmtpAddress"); + + GetUnifiedGroupUnseenCountRequest request = new GetUnifiedGroupUnseenCountRequest( + this, lastVisitedTimeUtc, UnifiedGroupIdentityType.SmtpAddress, groupMailboxSmtpAddress); + + request.AnchorMailbox = groupMailboxSmtpAddress; + + return request.Execute().UnseenCount; + } + + /// + /// Sets the LastVisitedTime for the group specfied + /// + /// The smtpaddress of group for which unseendata is desired + /// The LastVisitedTimeUtc of group for which unseendata is desired + public void SetUnifiedGroupLastVisitedTime(string groupMailboxSmtpAddress, DateTime lastVisitedTimeUtc) + { + EwsUtilities.ValidateParam(groupMailboxSmtpAddress, "groupMailboxSmtpAddress"); + + SetUnifiedGroupLastVisitedTimeRequest request = new SetUnifiedGroupLastVisitedTimeRequest(this, lastVisitedTimeUtc, UnifiedGroupIdentityType.SmtpAddress, groupMailboxSmtpAddress); + + request.Execute(); + } + + #endregion + #region Diagnostic Method -- Only used by test /// @@ -5033,16 +5656,7 @@ internal IEwsHttpWebRequest PrepareHttpWebRequest(string methodName) Uri endpoint = this.Url; this.RegisterCustomBasicAuthModule(); - if (this.RenderingMethod == RenderingMode.JSON) - { - endpoint = new Uri( - endpoint, - String.Format("{0}/{1}{2}", endpoint.AbsolutePath, methodName, endpoint.Query)); - } - else - { - endpoint = this.AdjustServiceUriFromCredentials(endpoint); - } + endpoint = this.AdjustServiceUriFromCredentials(endpoint); IEwsHttpWebRequest request = this.PrepareHttpWebRequestForUrl( endpoint, @@ -5063,20 +5677,8 @@ internal IEwsHttpWebRequest PrepareHttpWebRequest(string methodName) /// The request. internal override void SetContentType(IEwsHttpWebRequest request) { - if (this.renderingMode == RenderingMode.Xml) - { - request.ContentType = "text/xml; charset=utf-8"; - request.Accept = "text/xml"; - } - else if (this.renderingMode == RenderingMode.JSON) - { - request.ContentType = "application/json; charset=utf-8"; - request.Accept = "application/json"; - } - else - { - base.SetContentType(request); - } + request.ContentType = "text/xml; charset=utf-8"; + request.Accept = "text/xml"; } /// @@ -5213,15 +5815,6 @@ internal bool Exchange2007CompatibilityMode set { this.exchange2007CompatibilityMode = value; } } - /// - /// Gets or sets the method by which the service will serialize the request. - /// - internal ExchangeService.RenderingMode RenderingMethod - { - get { return this.renderingMode; } - set { this.renderingMode = value; } - } - /// /// Gets or sets a value indicating whether trace output is pretty printed. /// @@ -5249,23 +5842,5 @@ internal string TargetServerVersion } #endregion - - #region Private enums - /// - /// The rendering method. - /// - public enum RenderingMode - { - /// - /// XML - /// - Xml, - - /// - /// Javascript Object Notation - /// - JSON - } - #endregion } -} +} \ No newline at end of file diff --git a/Core/ExchangeServiceBase.cs b/Core/ExchangeServiceBase.cs index b93e902e..2d133f55 100644 --- a/Core/ExchangeServiceBase.cs +++ b/Core/ExchangeServiceBase.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ExchangeServiceBase class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -328,16 +343,20 @@ private void TraceHttpResponseHeaders(TraceFlags traceType, IEwsHttpWebResponse /// The response headers private void SaveHttpResponseHeaders(WebHeaderCollection headers) { - EwsUtilities.Assert( - this.httpResponseHeaders.Count == 0, - "ExchangeServiceBase.SaveHttpResponseHeaders", - "expect no headers in the dictionary yet."); - this.httpResponseHeaders.Clear(); foreach (string key in headers.AllKeys) { - this.httpResponseHeaders.Add(key, headers[key]); + string existingValue; + + if (this.httpResponseHeaders.TryGetValue(key, out existingValue)) + { + this.httpResponseHeaders[key] = existingValue + "," + headers[key]; + } + else + { + this.httpResponseHeaders.Add(key, headers[key]); + } } if (this.OnResponseHeadersCaptured != null) @@ -905,4 +924,4 @@ internal IEwsHttpWebRequestFactory HttpWebRequestFactory #endregion } -} +} \ No newline at end of file diff --git a/Core/JsonNames.cs b/Core/JsonNames.cs deleted file mode 100644 index d3d72273..00000000 --- a/Core/JsonNames.cs +++ /dev/null @@ -1,29 +0,0 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the XmlElementNames class. -//----------------------------------------------------------------------- - -namespace Microsoft.Exchange.WebServices.Data -{ - /// - /// JSON names not shared with the XmlElementNames or XmlAttributeNames classes. - /// - internal static class JsonNames - { - public const string Events = "Events"; - public const string NotificationType = "NotificationType"; - public const string OldFolderId = "OldFolderId"; - public const string OldItemId = "OldItemId"; - public const string PathToExtendedFieldType = "ExtendedPropertyUri"; - public const string PathToIndexedFieldType = "DictionaryPropertyUri"; - public const string PathToUnindexedFieldType = "PropertyUri"; - public const string Path = "Path"; - public const string RecurrencePattern = "RecurrencePattern"; - public const string RecurrenceRange = "RecurrenceRange"; - } -} diff --git a/Core/JsonObject.cs b/Core/JsonObject.cs deleted file mode 100644 index 000d262e..00000000 --- a/Core/JsonObject.cs +++ /dev/null @@ -1,559 +0,0 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -using System; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Text; - -namespace Microsoft.Exchange.WebServices.Data -{ - /// - /// Represents a JSON construction of an object. - /// Used for serialization and deserialization. - /// - internal class JsonObject : Dictionary - { - /// - /// Special property name used by EWS JSON endpoint to indicate the object type. - /// - private const string TypeAttribute = "__type"; - - /// - /// Namespace for Exchange JSON types. - /// - private const string JsonTypeNamespace = "Exchange"; - - /// - /// Used for existing XmlElements that have attributes and a text value. - /// Eg., "Hello, World!]]>" - /// This property is the key for the value of the text element in such an XML Element. - /// - internal const string JsonValueString = "Value"; - - /// - /// Validates the object. - /// - /// The entry. - private static void ValidateObject(object entry) - { - if (!(entry == null || - entry is JsonObject || - entry is Enum || - entry is bool || - entry is string || - entry is int || - entry is float || - entry is double || - entry is long || - entry is DateTime || - entry.GetType().IsArray)) - { - throw new InvalidOperationException(String.Format("Object [{0}] in the array is not serializable to JSON", entry)); - } - } - - /// - /// Initializes a new instance of the class. - /// - internal JsonObject() - { - } - - /// - /// Adds the specified name. - /// - /// The name. - /// The value. - internal void Add(string name, JsonObject value) - { - this.InternalAdd(name, value); - } - - /// - /// Adds the specified name. - /// - /// The name. - /// The value. - internal void Add(string name, string value) - { - if (value != null) - { - this.InternalAdd(name, value); - } - } - - /// - /// Adds the specified name. - /// - /// The name. - /// The value. - internal void Add(string name, Enum value) - { - if (value != null) - { - this.InternalAdd(name, value.ToString()); - } - } - - /// - /// Adds the specified name. - /// - /// The name. - /// The value. - internal void Add(string name, bool value) - { - this.InternalAdd(name, value); - } - - /// - /// Adds the specified name. - /// - /// The name. - /// The value. - internal void Add(string name, int value) - { - this.InternalAdd(name, value); - } - - /// - /// Adds the specified name. - /// - /// The name. - /// The value. - internal void Add(string name, float value) - { - this.InternalAdd(name, value); - } - - /// - /// Adds the specified name. - /// - /// The name. - /// The value. - internal void Add(string name, double value) - { - this.InternalAdd(name, value); - } - - /// - /// Adds the specified name. - /// - /// The name. - /// The value. - internal void Add(string name, long value) - { - this.InternalAdd(name, value); - } - - /// - /// Adds the specified name. - /// - /// The name. - /// The value. - public new void Add(string name, object value) - { - ValidateObject(value); - this.InternalAdd(name, value); - } - - private void InternalAdd(string name, object value) - { - base.Add(name, value); - } - - /// - /// Adds the type parameter. - /// - /// Name of the type. - internal void AddTypeParameter(string typeName) - { - this.InternalAdd( - JsonObject.TypeAttribute, - String.Format("{0}:#{1}", typeName, JsonObject.JsonTypeNamespace)); - } - - /// - /// Adds the specified name. - /// - /// The name. - /// The value. - internal void Add(string name, IEnumerable value) - { - object[] valueArray = value.ToArray(); - - foreach (object entry in valueArray) - { - ValidateObject(entry); - } - - this.InternalAdd(name, valueArray); - } - - /// - /// Adds the base64. - /// - /// The key. - /// The stream. - internal void AddBase64(string key, Stream stream) - { - // We use a memory stream here because we don't know that a generic Stream can tell us how long it is. - using (MemoryStream buffer = new MemoryStream()) - { - byte[] byteBuffer = new byte[4096]; - int bytesRead = 0; - - while ((bytesRead = stream.Read(byteBuffer, 0, byteBuffer.Length)) != 0) - { - buffer.Write(byteBuffer, 0, bytesRead); - } - - this.AddBase64(key, buffer.GetBuffer(), 0, (int)buffer.Length); - } - } - - /// - /// Adds the base64. - /// - /// The key. - /// The buffer. - internal void AddBase64(string key, byte[] buffer) - { - this.AddBase64(key, buffer, 0, buffer.Length); - } - - /// - /// Adds the base64. - /// - /// The key. - /// The buffer. - /// The offset. - /// The count. - internal void AddBase64(string key, byte[] buffer, int offset, int count) - { - this.InternalAdd(key, Convert.ToBase64String(buffer, offset, count)); - } - - /// - /// Serializes to JSON. - /// - /// The stream. - internal void SerializeToJson(Stream stream) - { - this.SerializeToJson(stream, false); - } - - /// - /// Serializes to JSON. - /// - /// The stream. - /// if true, pretty-print the results. - internal void SerializeToJson(Stream stream, bool prettyPrint) - { - using (JsonWriter writer = new JsonWriter(stream, prettyPrint)) - { - this.WriteValue(writer, this); - - writer.Flush(); - } - } - - /// - /// Writes key value pair. - /// - /// The writer. - /// The key. - /// The value. - private void WriteKeyValuePair(JsonWriter writer, string key, object value) - { - writer.WriteKey(key); - this.WriteValue(writer, value); - } - - /// - /// Writes the value. - /// - /// The writer. - /// The value. - private void WriteValue(JsonWriter writer, object value) - { - if (value == null) - { - writer.WriteNullValue(); - } - else if (value is string) - { - writer.WriteValue((string)value); - } - else if (value.GetType().IsEnum) - { - writer.WriteValue((Enum)value); - } - else if (value is int) - { - writer.WriteValue((int)value); - } - else if (value is long) - { - writer.WriteValue((long)value); - } - else if (value is float) - { - writer.WriteValue((float)value); - } - else if (value is double) - { - writer.WriteValue((double)value); - } - else if (value is bool) - { - writer.WriteValue((bool)value); - } - else if (value is DateTime) - { - writer.WriteValue((DateTime)value); - } - else if (value is JsonObject) - { - writer.PushObjectClosure(); - - JsonObject jsObject = value as JsonObject; - - // Wcf JSON deserializer requires the __type attribute to be first. - // - if (jsObject.ContainsKey(JsonObject.TypeAttribute)) - { - this.WriteKeyValuePair(writer, JsonObject.TypeAttribute, jsObject[JsonObject.TypeAttribute]); - } - - foreach (KeyValuePair kvPair in jsObject) - { - if (kvPair.Key != JsonObject.TypeAttribute) - { - this.WriteKeyValuePair(writer, kvPair.Key, kvPair.Value); - } - } - - writer.PopClosure(); - } - else if (value.GetType().IsArray) - { - writer.PushArrayClosure(); - - foreach (var arrayEntry in (Array)value) - { - this.WriteValue(writer, arrayEntry); - } - - writer.PopClosure(); - } - else - { - throw new InvalidOperationException(String.Format("Object [{0}] is not JSON serializable", value)); - } - } - - /// - /// Reads the value for the selected key as an int. - /// - /// The key. - /// - internal int ReadAsInt(string key) - { - if (!this.ContainsKey(key)) - { - throw new ServiceJsonDeserializationException(); - } - - object value = this[key]; - - if (!(value is long)) - { - throw new ServiceJsonDeserializationException(); - } - - return (int)(long)value; - } - - /// - /// Reads the value for the selected key as an double. - /// - /// The key. - /// - internal double ReadAsDouble(string key) - { - if (!this.ContainsKey(key)) - { - throw new ServiceJsonDeserializationException(); - } - - object value = this[key]; - - if (!(value is long)) - { - throw new ServiceJsonDeserializationException(); - } - - return (double)(long)value; - } - - /// - /// Reads the value for the selected key as a string. - /// - /// The key. - /// - internal string ReadAsString(string key) - { - if (!this.ContainsKey(key)) - { - throw new ServiceJsonDeserializationException(); - } - - object value = this[key]; - - if (value != null && - !(value is string)) - { - throw new ServiceJsonDeserializationException(); - } - - return value as string; - } - - /// - /// Reads the value for the selected key as a JSON object. - /// - /// The key. - /// - internal JsonObject ReadAsJsonObject(string key) - { - if (!this.ContainsKey(key)) - { - throw new ServiceJsonDeserializationException(); - } - - object value = this[key]; - - if (value != null && - !(value is JsonObject)) - { - throw new ServiceJsonDeserializationException(); - } - - return value as JsonObject; - } - - /// - /// Reads the value for the selected key as a JSON object. - /// - /// The key. - /// - internal object[] ReadAsArray(string key) - { - if (!this.ContainsKey(key)) - { - return new object[0]; - } - - object value = this[key]; - - if (value != null && - !(value is object[])) - { - throw new ServiceJsonDeserializationException(); - } - - return value as object[]; - } - - /// - /// Determines whether object has type property. - /// - /// Returns true if JsonObject has a type property. - internal bool HasTypeProperty() - { - return this.ContainsKey(JsonObject.TypeAttribute); - } - - /// - /// Reads the type string. - /// - /// - internal string ReadTypeString() - { - if (!this.HasTypeProperty()) - { - throw new ServiceJsonDeserializationException(); - } - - string typeAttribute = this.ReadAsString(JsonObject.TypeAttribute); - - return typeAttribute.Substring( - 0, - typeAttribute.IndexOf(String.Format(":#{0}", JsonObject.JsonTypeNamespace))); - } - - /// - /// Reads the enum value. - /// - /// An enum type - /// The key. - /// - internal T ReadEnumValue(string key) - { - return EwsUtilities.Parse(this.ReadAsString(key)); - } - - /// - /// Reads as bool. - /// - /// The key. - /// - internal bool ReadAsBool(string key) - { - if (!this.ContainsKey(key)) - { - throw new ServiceJsonDeserializationException(); - } - - object value = this[key]; - - if (!(value is bool)) - { - throw new ServiceJsonDeserializationException(); - } - - return (bool)value; - } - - /// - /// Reads the content as base64. - /// - /// The key. - /// The stream. - internal void ReadAsBase64Content(string key, System.IO.Stream stream) - { - byte[] buffer = ReadAsBase64Content(key); - - stream.Write(buffer, 0, buffer.Length); - } - - /// - /// Reads the content of as base64. - /// - /// The key. - /// - internal byte[] ReadAsBase64Content(string key) - { - string base64Content = this.ReadAsString(key); - - byte[] buffer = Convert.FromBase64String(base64Content); - return buffer; - } - } -} diff --git a/Core/JsonParser.cs b/Core/JsonParser.cs deleted file mode 100644 index 646605e7..00000000 --- a/Core/JsonParser.cs +++ /dev/null @@ -1,260 +0,0 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Text; -using System.Text.RegularExpressions; - -namespace Microsoft.Exchange.WebServices.Data -{ - /// - /// Class to parse a JSON stream into an instance of a JSON object. - /// - /// See http://www.ietf.org/rfc/rfc4627.txt - internal class JsonParser - { - private JsonTokenizer tokenizer; - - /// - /// Initializes a new instance of the class. - /// - /// The input stream. - internal JsonParser(Stream inputStream) - { - this.tokenizer = new JsonTokenizer(inputStream); - } - - internal JsonObject Parse() - { - return this.ParseObject(); - } - - /// - /// Parses the object. - /// - /// - private JsonObject ParseObject() - { - JsonObject jsonObject = new JsonObject(); - - string token; - - this.ReadAndValidateToken(out token, JsonTokenType.ObjectOpen); - - while (this.tokenizer.Peek() != JsonTokenType.ObjectClose) - { - this.ParseKeyValuePair(jsonObject); - - if (this.tokenizer.Peek() != JsonTokenType.Comma) - { - break; - } - else - { - this.ReadAndValidateToken(out token, JsonTokenType.Comma); - } - } - - this.ReadAndValidateToken(out token, JsonTokenType.ObjectClose); - - return jsonObject; - } - - /// - /// Parses the key value pair. - /// - /// The json object. - private void ParseKeyValuePair(JsonObject jsonObject) - { - string name; - string colon; - - this.ReadAndValidateToken(out name, JsonTokenType.String); - this.ReadAndValidateToken(out colon, JsonTokenType.Colon); - - name = this.UnescapeString(name); - - jsonObject.Add(name, this.ParseValue()); - } - - /// - /// Parses the value. - /// - /// - private object ParseValue() - { - string valueToken; - - switch (this.tokenizer.Peek()) - { - case JsonTokenType.ArrayOpen: - object[] jsonArray = this.ParseArray(); - return jsonArray; - - case JsonTokenType.ObjectOpen: - JsonObject jsonChildObject = this.ParseObject(); - return jsonChildObject; - - case JsonTokenType.String: - this.ReadAndValidateToken(out valueToken, JsonTokenType.String); - return this.UnescapeString(valueToken); - - case JsonTokenType.Null: - this.ReadAndValidateToken(out valueToken, JsonTokenType.Null); - return null; - - case JsonTokenType.Boolean: - this.ReadAndValidateToken(out valueToken, JsonTokenType.Boolean); - return bool.Parse(valueToken); - - case JsonTokenType.Number: - this.ReadAndValidateToken(out valueToken, JsonTokenType.Number); - return this.ParseNumber(valueToken); - - default: - // TODO: Add a message to better locate the error? - throw new ServiceJsonDeserializationException(); - } - } - - /// - /// Parses the number. - /// - /// The value token. - /// - private object ParseNumber(string valueToken) - { - if (Regex.IsMatch(valueToken, @"^-?\d+$")) - { - return long.Parse(valueToken, CultureInfo.InvariantCulture); - } - else - { - return double.Parse(valueToken, CultureInfo.InvariantCulture); - } - } - - /// - /// Parses the array. - /// - /// - private object[] ParseArray() - { - List objects = new List(); - string token; - - this.ReadAndValidateToken(out token, JsonTokenType.ArrayOpen); - - while (this.tokenizer.Peek() != JsonTokenType.ArrayClose) - { - objects.Add(this.ParseValue()); - - if (this.tokenizer.Peek() != JsonTokenType.Comma) - { - break; - } - else - { - this.ReadAndValidateToken(out token, JsonTokenType.Comma); - } - } - - this.ReadAndValidateToken(out token, JsonTokenType.ArrayClose); - - return objects.ToArray(); - } - - /// - /// Unescapes the string. - /// - /// The value. - /// - private string UnescapeString(string value) - { - // Trim the quotes off the ends - string result = value.Substring(1, value.Length - 2); - - // See if we nee to bother decoding the string - if (result.Contains('\\')) - { - if (result.Contains(@"\\")) - { - result = result.Replace(@"\\", @"\"); - } - if (result.Contains(@"\""")) - { - result = result.Replace(@"\""", @""""); - } - if (result.Contains(@"\/")) - { - result = result.Replace(@"\/", @"/"); - } - if (result.Contains(@"\b")) - { - result = result.Replace(@"\b", "\b"); - } - if (result.Contains(@"\f")) - { - result = result.Replace(@"\f", "\f"); - } - if (result.Contains(@"\n")) - { - result = result.Replace(@"\n", "\n"); - } - if (result.Contains(@"\r")) - { - result = result.Replace(@"\r", "\r"); - } - if (result.Contains(@"\t")) - { - result = result.Replace(@"\t", "\t"); - } - if (result.Contains(@"\u")) - { - MatchCollection unicodeMatches = Regex.Matches(result, @"\\u([\da-fA-F]{4})"); - - foreach (Match currentMatch in unicodeMatches) - { - if (currentMatch.Success) - { - int hexCode = int.Parse(currentMatch.Value.Substring(2), NumberStyles.HexNumber); - string charToReplace = char.ConvertFromUtf32(hexCode); - - result = result.Replace(currentMatch.Value, charToReplace); - } - } - } - } - - return result; - } - - /// - /// Reads the and validate token. - /// - /// The token. - /// The expected token types. - /// - private JsonTokenType ReadAndValidateToken(out string token, params JsonTokenType[] expectedTokenTypes) - { - JsonTokenType tokenType = this.tokenizer.NextToken(out token); - - foreach (JsonTokenType expectedToken in expectedTokenTypes) - { - if (tokenType == expectedToken) - { - return tokenType; - } - } - - // TODO: Add a message to better locate the error? - throw new ServiceJsonDeserializationException(); - } - } -} diff --git a/Core/JsonTokenizer.cs b/Core/JsonTokenizer.cs deleted file mode 100644 index e8800aac..00000000 --- a/Core/JsonTokenizer.cs +++ /dev/null @@ -1,264 +0,0 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Text.RegularExpressions; - -namespace Microsoft.Exchange.WebServices.Data -{ - /// - /// The various tokens this tokenizer recognizes - /// - internal enum JsonTokenType - { - /// - /// "chars" or "" - /// - String, - - /// - /// digits with optional negative sign, fractional component, and/or exponent - /// - Number, - - /// - /// true or false - /// - Boolean, - - /// - /// null - /// - Null, - - /// - /// { - /// - ObjectOpen, - - /// - /// } - /// - ObjectClose, - - /// - /// [ - /// - ArrayOpen, - - /// - /// ] - /// - ArrayClose, - - /// - /// : - /// - Colon, - - /// - /// , - /// - Comma, - - /// - /// EOF - /// - EndOfFile, - } - - /// - /// Class to break a JSON stream into its component tokens to be consumed by a JSON parser. - /// - internal class JsonTokenizer - { - /// - /// Matches: - /// "" - /// or - /// "chars" - /// where 'chars' includes any unicode character except \ or ", plus the escaped characters below. - /// - private const string JsonStringRegExCode = @"""([^\\""]|\\""|\\\\|\\/|\\b|\\f|\\n|\\r|\\t|\\u[\da-fA-F]{4})*"""; - - /// - /// Matches numbers with an optional leading negative, optional decimal, and optional exponent. - /// - private const string JsonNumberRegExCode = @"-?\d+(.\d+)?([eE][+-]?\d+)?"; - - /// - /// Matches true or false; - /// - private const string JsonBooleanRegExCode = @"(true|false)"; - - /// - /// Matches null - /// - private const string JsonNullRegExCode = @"null"; - - /// - /// Matches { - /// - private const string JsonOpenObjectRegExCode = @"\{"; - - /// - /// Matches } - /// - private const string JsonCloseObjectRegExCode = @"\}"; - - /// - /// Matches [ - /// - private const string JsonOpenArrayRegExCode = @"\["; - - /// - /// Matches ] - /// - private const string JsonCloseArrayRegExCode = @"\]"; - - /// - /// Matches : - /// - private const string JsonColonRegExCode = @"\:"; - - /// - /// Matches , - /// - private const string JsonCommaRegExCode = @"\,"; - - private static Regex jsonStringRegEx; - private static Regex jsonNumberRegEx; - private static Regex jsonBooleanRegEx; - private static Regex jsonNullRegEx; - private static Regex jsonOpenObjectRegEx; - private static Regex jsonCloseObjectRegEx; - private static Regex jsonOpenArrayRegEx; - private static Regex jsonCloseArrayRegEx; - private static Regex jsonColonRegEx; - private static Regex jsonCommaRegEx; - private static Regex whitespaceRegEx; - - private static Dictionary tokenDictionary; - private static Regex fullTokenizerRegex; - - static JsonTokenizer() - { - jsonStringRegEx = new Regex(JsonStringRegExCode, RegexOptions.Compiled); - jsonNumberRegEx = new Regex(JsonNumberRegExCode, RegexOptions.Compiled); - jsonBooleanRegEx = new Regex(JsonBooleanRegExCode, RegexOptions.Compiled); - jsonNullRegEx = new Regex(JsonNullRegExCode, RegexOptions.Compiled); - jsonOpenObjectRegEx = new Regex(JsonOpenObjectRegExCode, RegexOptions.Compiled); - jsonCloseObjectRegEx = new Regex(JsonCloseObjectRegExCode, RegexOptions.Compiled); - jsonOpenArrayRegEx = new Regex(JsonOpenArrayRegExCode, RegexOptions.Compiled); - jsonCloseArrayRegEx = new Regex(JsonCloseArrayRegExCode, RegexOptions.Compiled); - jsonColonRegEx = new Regex(JsonColonRegExCode, RegexOptions.Compiled); - jsonCommaRegEx = new Regex(JsonCommaRegExCode, RegexOptions.Compiled); - - whitespaceRegEx = new Regex("\\s"); - - tokenDictionary = new Dictionary(); - tokenDictionary.Add(JsonTokenType.Number, jsonNumberRegEx); - tokenDictionary.Add(JsonTokenType.Boolean, jsonBooleanRegEx); - tokenDictionary.Add(JsonTokenType.Null, jsonNullRegEx); - tokenDictionary.Add(JsonTokenType.ObjectOpen, jsonOpenObjectRegEx); - tokenDictionary.Add(JsonTokenType.ObjectClose, jsonCloseObjectRegEx); - tokenDictionary.Add(JsonTokenType.ArrayOpen, jsonOpenArrayRegEx); - tokenDictionary.Add(JsonTokenType.ArrayClose, jsonCloseArrayRegEx); - tokenDictionary.Add(JsonTokenType.Colon, jsonColonRegEx); - tokenDictionary.Add(JsonTokenType.Comma, jsonCommaRegEx); - tokenDictionary.Add(JsonTokenType.String, jsonStringRegEx); - - StringBuilder tokenizerRegExCode = new StringBuilder(); - bool firstEntry = true; - - foreach (Regex regEx in tokenDictionary.Values) - { - if (firstEntry) - { - firstEntry = false; - } - else - { - tokenizerRegExCode.Append("|"); - } - - tokenizerRegExCode.Append("("); - tokenizerRegExCode.Append(regEx.ToString()); - tokenizerRegExCode.Append(")"); - } - - fullTokenizerRegex = new Regex(tokenizerRegExCode.ToString(), RegexOptions.Compiled); - } - - private Match currentMatch; - - private JsonTokenType nextTokenType; - private string nextToken; - private bool nextTokenPeeked = false; - - internal JsonTokenizer(Stream input) - { - StreamReader reader = new StreamReader(input); - string response = reader.ReadToEnd(); - currentMatch = fullTokenizerRegex.Match(response); - } - - internal JsonTokenType Peek() - { - if (!this.nextTokenPeeked) - { - this.nextTokenType = this.NextToken(out this.nextToken); - this.nextTokenPeeked = true; - } - - return this.nextTokenType; - } - - internal JsonTokenType NextToken(out string token) - { - if (this.nextTokenPeeked) - { - token = this.nextToken; - this.nextTokenPeeked = false; - - return this.nextTokenType; - } - else - { - token = this.currentMatch.Value; - - while (token.Trim().Length == 0) - { - // skip through whitespace and null tokens - this.AdvanceRegExMatch(); - token = this.currentMatch.Value; - } - - foreach (KeyValuePair tokenRegexPair in tokenDictionary) - { - Match regexMatch = tokenRegexPair.Value.Match(token); - if (regexMatch.Success - && regexMatch.Index == 0 - && regexMatch.Length == token.Length) - { - this.AdvanceRegExMatch(); - return tokenRegexPair.Key; - } - } - - throw new ServiceJsonDeserializationException(); - } - } - - private void AdvanceRegExMatch() - { - this.currentMatch = this.currentMatch.NextMatch(); - } - } -} diff --git a/Core/JsonWriter.cs b/Core/JsonWriter.cs deleted file mode 100644 index 4600e6b8..00000000 --- a/Core/JsonWriter.cs +++ /dev/null @@ -1,435 +0,0 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -namespace Microsoft.Exchange.WebServices.Data -{ - using System; - using System.Collections.Generic; - using System.Diagnostics; - using System.IO; - using System.Text; - - /// - /// JSON text writer - /// - internal class JsonWriter : TextWriter - { - private const string Indentation = " "; - - #region Member variables - - private Stream outStream; - private bool shouldCloseStream; - private bool prettyPrint; - private bool writingStringValue = false; - private byte[] smallBuffer = new byte[20]; - private char[] charBuffer = new char[4]; - private Queue surrogateCharBuffer = new Queue(4); - - private Stack closures = new Stack(); - private Stack closureHasMembers = new Stack(); - - #endregion - - #region Constructors - /// - /// Initializes a new instance of the class. - /// - /// The out stream. - /// if set to true [pretty print]. - public JsonWriter(Stream outStream, bool prettyPrint) - { - this.outStream = outStream; - this.prettyPrint = prettyPrint; - this.shouldCloseStream = false; - } - #endregion - - #region Dispose methods - - /// - /// Releases the unmanaged resources used by the and optionally releases the managed resources. - /// - /// true to release both managed and unmanaged resources; false to release only unmanaged resources. - protected override void Dispose(bool disposing) - { - if (this.shouldCloseStream) - { - this.outStream.Flush(); - this.outStream.Dispose(); - } - - base.Dispose(disposing); - } - #endregion - - #region Public methods - /// - /// Writes a character to the text stream. - /// - /// The character to write to the text stream. - /// - /// The is closed. - /// - /// - /// An I/O error occurs. - /// - public override void Write(char value) - { - if (this.writingStringValue) - { - // Handle Surrogates and Supplementary Characters - // Refer to: http://msdn.microsoft.com/en-us/library/windows/desktop/dd374069(v=vs.85).aspx - if (char.IsHighSurrogate(value)) - { - this.surrogateCharBuffer.Enqueue(value); - - if (this.surrogateCharBuffer.Count == 4) - { - Debug.Assert(false, "The number of surrogate characters for a single real character should be less than 4."); - - // Still write characters out - this.WriteSurrogateChar(); - } - } - else if (char.IsLowSurrogate(value)) - { - this.surrogateCharBuffer.Enqueue(value); - this.WriteSurrogateChar(); - } - else - { - // Non surrogate characters - if (this.surrogateCharBuffer.Count > 0) - { - Debug.Assert(false, "A low surrogate character is expected."); - this.WriteSurrogateChar(); - } - - if (value == '\r') - { - this.WriteInternal(@"\r"); - } - else if (value == '\n') - { - this.WriteInternal(@"\n"); - } - else if (value == '\t') - { - this.WriteInternal(@"\t"); - } - else - { - this.WritePrintableChar(value); - } - } - } - else - { - this.WritePrintableChar(value); - } - } - - /// - /// Pushes object closure. - /// - public void PushObjectClosure() - { - this.AddingValue(); - this.closures.Push('}'); - this.closureHasMembers.Push(false); - this.WriteInternal('{'); - this.WriteIndentation(); - } - - /// - /// Pushes array closure. - /// - public void PushArrayClosure() - { - this.AddingValue(); - this.closures.Push(']'); - this.closureHasMembers.Push(false); - this.WriteInternal('['); - this.WriteIndentation(); - } - - /// - /// Pops closure. - /// - public void PopClosure() - { - var popChar = this.closures.Pop(); - this.closureHasMembers.Pop(); - this.WriteIndentation(); - this.WriteInternal(popChar); - } - - /// - /// Writes quote. - /// - public void WriteQuote() - { - this.WriteInternal('"'); - } - - /// - /// Writes key. - /// - /// The key. - public void WriteKey(string key) - { - if (this.closureHasMembers.Peek()) - { - this.WriteInternal(','); - this.WriteIndentation(); - } - - this.WriteQuote(); - this.Write(key); - this.WriteQuote(); - - if (this.prettyPrint) - { - this.Write(" : "); - } - else - { - this.WriteInternal(':'); - } - } - - /// - /// Writes value. - /// - /// The value. - public void WriteValue(string value) - { - this.AddingValue(); - this.WriteQuote(); - this.writingStringValue = true; - this.Write(value); - this.writingStringValue = false; - this.WriteQuote(); - } - - /// - /// Writes bool value. - /// - /// if set to true [value]. - public void WriteValue(bool value) - { - this.AddingValue(); - this.Write(value.ToString().ToLowerInvariant()); - } - - /// - /// Writes long value. - /// - /// The value. - public void WriteValue(long value) - { - this.AddingValue(); - this.Write(value); - } - - /// - /// Writes int value. - /// - /// The value. - public void WriteValue(int value) - { - this.AddingValue(); - this.Write(value); - } - - /// - /// Writes an enum value. - /// - /// The value. - public void WriteValue(Enum value) - { - this.WriteValue(EwsUtilities.SerializeEnum(value)); - } - - /// - /// Writes DateTime value. - /// - /// The value. - public void WriteValue(DateTime value) - { - this.WriteValue(EwsUtilities.DateTimeToXSDateTime(value)); - } - - /// - /// Writes float value. - /// - /// The value. - public void WriteValue(float value) - { - this.AddingValue(); - this.Write(value); - } - - /// - /// Writes double value. - /// - /// The value. - public void WriteValue(double value) - { - this.AddingValue(); - this.Write(value); - } - - /// - /// Writes null value. - /// - public void WriteNullValue() - { - this.AddingValue(); - this.Write("null"); - } - #endregion - - #region Private methods - - /// - /// Write printable char. - /// - /// The value. - private void WritePrintableChar(char value) - { - if (value == '"' || value == '\\') - { - this.WriteInternal('\\'); - } - - this.WriteInternal(value); - } - - /// - /// Internal writer. - /// - /// The value. - private void WriteInternal(char value) - { - this.charBuffer[0] = value; - int bytesLength = this.Encoding.GetBytes( - this.charBuffer, - 0, - 1, - this.smallBuffer, - 0); - - this.outStream.Write(smallBuffer, 0, bytesLength); - } - - /// - /// Internal writer. - /// - /// The value. - private void WriteInternal(string value) - { - value.CopyTo(0, this.charBuffer, 0, value.Length); - int bytesLength = this.Encoding.GetBytes( - this.charBuffer, - 0, - value.Length, - this.smallBuffer, - 0); - - this.outStream.Write(smallBuffer, 0, bytesLength); - } - - /// - /// Surrogate character writer. - /// - private void WriteSurrogateChar() - { - this.surrogateCharBuffer.CopyTo(this.charBuffer, 0); - int bytesLength = this.Encoding.GetBytes( - this.charBuffer, - 0, - this.surrogateCharBuffer.Count, - this.smallBuffer, - 0); - - this.outStream.Write(smallBuffer, 0, bytesLength); - this.surrogateCharBuffer.Clear(); - } - - /// - /// Writes indentation. - /// - private void WriteIndentation() - { - if (this.prettyPrint) - { - this.WriteInternal('\r'); - this.WriteInternal('\n'); - - for (int i = this.closures.Count - 1; i >= 0; i--) - { - this.Write(JsonWriter.Indentation); - } - } - } - - /// - /// Adding a value. - /// - private void AddingValue() - { - if (this.closures.Count > 0) - { - if (this.closures.Peek() == ']' && - this.closureHasMembers.Peek()) - { - this.WriteInternal(','); - this.WriteIndentation(); - } - - if (!this.closureHasMembers.Peek()) - { - this.closureHasMembers.Pop(); - this.closureHasMembers.Push(true); - } - } - } - #endregion - - #region Public properties - - /// - /// When overridden in a derived class, returns the in which the output is written. - /// - /// - /// - /// The Encoding in which the output is written. - /// - public override Encoding Encoding - { - get { return Encoding.UTF8; } - } - - /// - /// Gets or sets a value indicating whether input stream should be closed when reader is closed. - /// - public bool ShouldCloseStream - { - get - { - return this.shouldCloseStream; - } - - set - { - this.shouldCloseStream = value; - } - } - #endregion - } -} diff --git a/Core/LazyMember.cs b/Core/LazyMember.cs index 11315897..7ca6cc55 100644 --- a/Core/LazyMember.cs +++ b/Core/LazyMember.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the LazyMember class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -67,4 +82,4 @@ public T Member } } } -} +} \ No newline at end of file diff --git a/Core/PropertyBag.cs b/Core/PropertyBag.cs index 31358b85..fe3c89df 100644 --- a/Core/PropertyBag.cs +++ b/Core/PropertyBag.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Implements a property bag. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -86,70 +101,6 @@ internal static void AddToChangeList(PropertyDefinition propertyDefinition, List } } - /// - /// Creates the json set update. - /// - /// The property definition. - /// The service. - /// The service object. - /// The property bag. - /// - internal static JsonObject CreateJsonSetUpdate(PropertyDefinition propertyDefinition, ExchangeService service, ServiceObject serviceObject, PropertyBag propertyBag) - { - JsonObject jsonUpdate = new JsonObject(); - - jsonUpdate.AddTypeParameter(serviceObject.GetSetFieldXmlElementName()); - - jsonUpdate.Add(JsonNames.Path, (propertyDefinition as IJsonSerializable).ToJson(service)); - - JsonObject jsonServiceObject = new JsonObject(); - jsonServiceObject.AddTypeParameter(serviceObject.GetXmlElementName()); - propertyDefinition.WriteJsonValue(jsonServiceObject, propertyBag, service, true); - - jsonUpdate.Add(GetPropertyUpdateItemName(serviceObject), jsonServiceObject); - return jsonUpdate; - } - - /// - /// Creates the json set update. - /// - /// The value. - /// The service. - /// The service object. - /// - internal static JsonObject CreateJsonSetUpdate(ExtendedProperty value, ExchangeService service, ServiceObject serviceObject) - { - JsonObject jsonUpdate = new JsonObject(); - - jsonUpdate.AddTypeParameter(serviceObject.GetSetFieldXmlElementName()); - - jsonUpdate.Add(JsonNames.Path, (value.PropertyDefinition as IJsonSerializable).ToJson(service)); - - JsonObject jsonServiceObject = new JsonObject(); - jsonServiceObject.AddTypeParameter(serviceObject.GetXmlElementName()); - jsonServiceObject.Add(XmlElementNames.ExtendedProperty, new object[] { value.InternalToJson(service) }); - - jsonUpdate.Add(GetPropertyUpdateItemName(serviceObject), jsonServiceObject); - return jsonUpdate; - } - - /// - /// Creates the json delete update. - /// - /// The property definition. - /// The service. - /// The service object. - /// - internal static JsonObject CreateJsonDeleteUpdate(PropertyDefinitionBase propertyDefinition, ExchangeService service, ServiceObject serviceObject) - { - JsonObject jsonUpdate = new JsonObject(); - - jsonUpdate.AddTypeParameter(serviceObject.GetDeleteFieldXmlElementName()); - - jsonUpdate.Add("PropertyPath", (propertyDefinition as IJsonSerializable).ToJson(service)); - return jsonUpdate; - } - /// /// Gets the name of the property update item. /// @@ -628,55 +579,6 @@ internal void LoadFromXml( } } - /// - /// Loads from json. - /// - /// The json service object. - /// The service. - /// Indicates whether the bag should be cleared before properties are loaded. - /// The requested property set. - /// Indicates whether summary or full properties were requested. - internal void LoadFromJson( - JsonObject jsonServiceObject, - ExchangeService service, - bool clear, - PropertySet requestedPropertySet, - bool onlySummaryPropertiesRequested) - { - if (clear) - { - this.Clear(); - } - - // Put the property bag in "loading" mode. When in loading mode, no checking is done - // when setting property values. - this.loading = true; - - this.requestedPropertySet = requestedPropertySet; - this.onlySummaryPropertiesRequested = onlySummaryPropertiesRequested; - - try - { - foreach (string propertyName in jsonServiceObject.Keys) - { - PropertyDefinition propertyDefinition; - - if (this.Owner.Schema.TryGetPropertyDefinition(propertyName, out propertyDefinition)) - { - propertyDefinition.LoadPropertyValueFromJson(jsonServiceObject[propertyName], service, this); - - this.loadedProperties.Add(propertyDefinition); - } - } - - this.ClearChangeLog(); - } - finally - { - this.loading = false; - } - } - /// /// Writes the bag's properties to XML. /// @@ -701,88 +603,6 @@ internal void WriteToXml(EwsServiceXmlWriter writer) writer.WriteEndElement(); } - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// if set to true [is update operation]. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal object ToJson(ExchangeService service, bool isUpdateOperation) - { - JsonObject jsonObject = new JsonObject(); - - if (!isUpdateOperation) - { - this.ToJsonForCreate(service, jsonObject); - } - else - { - this.ToJsonForUpdate(service, jsonObject); - } - - return jsonObject; - } - - /// - /// Creates the json for update. - /// - /// The service. - /// The json object. - private void ToJsonForUpdate(ExchangeService service, JsonObject jsonObject) - { - jsonObject.AddTypeParameter(this.Owner.GetChangeXmlElementName()); - - jsonObject.Add(this.Owner.GetId().GetJsonTypeName(), this.Owner.GetId().InternalToJson(service)); - - List jsonUpdates = new List(); - - foreach (PropertyDefinition propertyDefinition in this.addedProperties) - { - this.WriteSetUpdateToJson(jsonUpdates, propertyDefinition, service); - } - - foreach (PropertyDefinition propertyDefinition in this.modifiedProperties) - { - this.WriteSetUpdateToJson(jsonUpdates, propertyDefinition, service); - } - - foreach (KeyValuePair property in this.deletedProperties) - { - this.WriteDeleteUpdateToJson( - jsonUpdates, - property.Key, - property.Value, - service); - } - - jsonObject.Add(XmlElementNames.Updates, jsonUpdates.ToArray()); - } - - /// - /// Creates the json for create. - /// - /// The service. - /// The json object. - private void ToJsonForCreate(ExchangeService service, JsonObject jsonObject) - { - jsonObject.AddTypeParameter(this.Owner.GetXmlElementName()); - - foreach (PropertyDefinition propertyDefinition in this.Owner.Schema) - { - // The following test should not be necessary since the property bag prevents - // properties to be set if they don't have the CanSet flag, but it doesn't hurt... - if (propertyDefinition.HasFlag(PropertyDefinitionFlags.CanSet, service.RequestedServerVersion)) - { - if (this.Contains(propertyDefinition)) - { - propertyDefinition.WriteJsonValue(jsonObject, this, service, false); - } - } - } - } - /// /// Writes the EWS update operations corresponding to the changes that occurred in the bag to XML. /// @@ -901,42 +721,6 @@ private void WriteSetUpdateToXml(EwsServiceXmlWriter writer, PropertyDefinition } } - /// - /// Writes the set update to json. - /// - /// The json updates. - /// The property definition. - /// The service. - private void WriteSetUpdateToJson(List jsonUpdates, PropertyDefinition propertyDefinition, ExchangeService service) - { - // The following test should not be necessary since the property bag prevents - // properties to be updated if they don't have the CanUpdate flag, but it - // doesn't hurt... - if (propertyDefinition.HasFlag(PropertyDefinitionFlags.CanUpdate)) - { - object propertyValue = this[propertyDefinition]; - - bool handled = false; - ICustomUpdateSerializer updateSerializer = propertyValue as ICustomUpdateSerializer; - - if (updateSerializer != null) - { - handled = updateSerializer.WriteSetUpdateToJson( - service, - this.Owner, - propertyDefinition, - jsonUpdates); - } - - if (!handled) - { - JsonObject jsonUpdate = CreateJsonSetUpdate(propertyDefinition, service, this.Owner, this); - - jsonUpdates.Add(jsonUpdate); - } - } - } - /// /// Writes an EWS DeleteUpdate opeartion for the specified property. /// @@ -970,37 +754,6 @@ private void WriteDeleteUpdateToXml( } } - /// - /// Writes the delete update to json. - /// - /// The json updates. - /// The property definition. - /// The property value. - /// The service. - private void WriteDeleteUpdateToJson(List jsonUpdates, PropertyDefinition propertyDefinition, object propertyValue, ExchangeService service) - { - // The following test should not be necessary since the property bag prevents - // properties to be deleted (set to null) if they don't have the CanDelete flag, - // but it doesn't hurt... - if (propertyDefinition.HasFlag(PropertyDefinitionFlags.CanDelete)) - { - bool handled = false; - ICustomUpdateSerializer updateSerializer = propertyValue as ICustomUpdateSerializer; - - if (updateSerializer != null) - { - handled = updateSerializer.WriteDeleteUpdateToJson(service, this.Owner, jsonUpdates); - } - - if (!handled) - { - JsonObject jsonUpdate = CreateJsonDeleteUpdate(propertyDefinition, service, this.Owner); - - jsonUpdates.Add(jsonUpdate); - } - } - } - /// /// Validate property bag instance. /// diff --git a/Core/PropertySet.cs b/Core/PropertySet.cs index 4c9abb98..b280f0c9 100644 --- a/Core/PropertySet.cs +++ b/Core/PropertySet.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the PropertySet class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -241,6 +256,8 @@ private static string GetShapeName(ServiceObjectType serviceObjectType) return XmlElementNames.FolderShape; case ServiceObjectType.Conversation: return XmlElementNames.ConversationShape; + case ServiceObjectType.Persona: + return XmlElementNames.PersonaShape; default: EwsUtilities.Assert( false, @@ -472,24 +489,6 @@ internal static void WriteAdditionalPropertiesToXml( writer.WriteEndElement(); } - /// - /// Writes the additional properties to json. - /// - /// The json attachment shape. - /// The service. - /// The property definitions. - internal static void WriteAdditionalPropertiesToJson(JsonObject jsonItemShape, ExchangeService service, IEnumerable propertyDefinitions) - { - List additionalProperties = new List(); - - foreach (PropertyDefinitionBase propertyDefinition in propertyDefinitions) - { - additionalProperties.Add(((IJsonSerializable)propertyDefinition).ToJson(service)); - } - - jsonItemShape.Add(XmlElementNames.AdditionalProperties, additionalProperties.ToArray()); - } - /// /// Validates this property set. /// @@ -715,71 +714,6 @@ internal void WriteToXml(EwsServiceXmlWriter writer, ServiceObjectType serviceOb writer.WriteEndElement(); // Item/FolderShape } - /// - /// Writes the get shape to json. - /// - /// The json request. - /// The service. - /// Type of the service object. - internal void WriteGetShapeToJson(JsonObject jsonRequest, ExchangeService service, ServiceObjectType serviceObjectType) - { - string shapeName = GetShapeName(serviceObjectType); - - JsonObject jsonShape = new JsonObject(); - - jsonShape.Add(XmlElementNames.BaseShape, defaultPropertySetMap.Member[this.BasePropertySet]); - - if (serviceObjectType == ServiceObjectType.Item) - { - if (this.RequestedBodyType.HasValue) - { - jsonShape.Add(XmlElementNames.BodyType, this.RequestedBodyType.Value); - } - - if (this.FilterHtmlContent.HasValue) - { - jsonShape.Add(XmlElementNames.FilterHtmlContent, this.FilterHtmlContent.Value); - } - - if (this.ConvertHtmlCodePageToUTF8.HasValue && - service.RequestedServerVersion >= ExchangeVersion.Exchange2010_SP1) - { - jsonShape.Add(XmlElementNames.ConvertHtmlCodePageToUTF8, this.ConvertHtmlCodePageToUTF8.Value); - } - - if (!string.IsNullOrEmpty(this.InlineImageUrlTemplate) && - service.RequestedServerVersion >= ExchangeVersion.Exchange2013) - { - jsonShape.Add(XmlElementNames.InlineImageUrlTemplate, this.InlineImageUrlTemplate); - } - - if (this.BlockExternalImages.HasValue && - service.RequestedServerVersion >= ExchangeVersion.Exchange2013) - { - jsonShape.Add(XmlElementNames.BlockExternalImages, this.BlockExternalImages.Value); - } - - if (this.AddBlankTargetToLinks.HasValue && - service.RequestedServerVersion >= ExchangeVersion.Exchange2013) - { - jsonShape.Add(XmlElementNames.AddBlankTargetToLinks, this.AddBlankTargetToLinks.Value); - } - - if (this.MaximumBodySize.HasValue && - service.RequestedServerVersion >= ExchangeVersion.Exchange2013) - { - jsonShape.Add(XmlElementNames.MaximumBodySize, this.MaximumBodySize.Value); - } - } - - if (this.additionalProperties.Count > 0) - { - WriteAdditionalPropertiesToJson(jsonShape, service, this.additionalProperties); - } - - jsonRequest.Add(shapeName, jsonShape); - } - #region IEnumerable Members /// diff --git a/Core/Requests/AddDelegateRequest.cs b/Core/Requests/AddDelegateRequest.cs index 58f674af..14cd6299 100644 --- a/Core/Requests/AddDelegateRequest.cs +++ b/Core/Requests/AddDelegateRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the AddDelegateRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -129,4 +144,4 @@ public List DelegateUsers get { return this.delegateUsers; } } } -} +} \ No newline at end of file diff --git a/Core/Requests/ApplyConversationActionRequest.cs b/Core/Requests/ApplyConversationActionRequest.cs index c4dc49bd..90f05b37 100644 --- a/Core/Requests/ApplyConversationActionRequest.cs +++ b/Core/Requests/ApplyConversationActionRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ApplyConversationActionRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -17,7 +32,7 @@ namespace Microsoft.Exchange.WebServices.Data /// /// Represents a request to a Apply Conversation Action operation /// - internal sealed class ApplyConversationActionRequest : MultiResponseServiceRequest, IJsonSerializable + internal sealed class ApplyConversationActionRequest : MultiResponseServiceRequest { private List conversationActions = new List(); @@ -85,28 +100,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) writer.WriteEndElement(); } - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object IJsonSerializable.ToJson(ExchangeService service) - { - JsonObject jsonRequest = new JsonObject(); - List actions = new List(); - - foreach (ConversationAction action in this.conversationActions) - { - actions.Add(((IJsonSerializable)action).ToJson(service)); - } - - jsonRequest.Add(XmlElementNames.ConversationActions, actions.ToArray()); - - return jsonRequest; - } - /// /// Gets the name of the XML element. /// @@ -143,4 +136,4 @@ internal override ExchangeVersion GetMinimumRequiredServerVersion() return ExchangeVersion.Exchange2010_SP1; } } -} +} \ No newline at end of file diff --git a/Core/Requests/ArchiveItemRequest.cs b/Core/Requests/ArchiveItemRequest.cs index e26f1686..97ae6e5d 100644 --- a/Core/Requests/ArchiveItemRequest.cs +++ b/Core/Requests/ArchiveItemRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ArchiveItemRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -17,7 +32,7 @@ namespace Microsoft.Exchange.WebServices.Data /// /// Represents a ArchiveItem request. /// - internal class ArchiveItemRequest : MultiResponseServiceRequest, IJsonSerializable + internal class ArchiveItemRequest : MultiResponseServiceRequest { /// /// Source folder id @@ -147,33 +162,5 @@ internal void WriteIdsToXml(EwsServiceXmlWriter writer) XmlNamespace.Messages, XmlElementNames.ItemIds); } - - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object IJsonSerializable.ToJson(ExchangeService service) - { - JsonObject jsonObject = new JsonObject(); - - jsonObject.Add(XmlElementNames.ArchiveSourceFolderId, this.SourceFolderId.InternalToJson(service)); - - this.AddIdsToJson(jsonObject, service); - - return jsonObject; - } - - /// - /// Adds the ids to json. - /// - /// The json object. - /// The service. - internal void AddIdsToJson(JsonObject jsonObject, ExchangeService service) - { - jsonObject.Add(XmlElementNames.ItemIds, this.Ids.InternalToJson(service)); - } } } \ No newline at end of file diff --git a/Core/Requests/AsyncRequestResult.cs b/Core/Requests/AsyncRequestResult.cs index d8231530..4ce1b618 100644 --- a/Core/Requests/AsyncRequestResult.cs +++ b/Core/Requests/AsyncRequestResult.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the AsyncRequestResult class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -217,4 +232,4 @@ public AsyncCallback AsyncCallback private set; } } -} +} \ No newline at end of file diff --git a/Core/Requests/ConvertIdRequest.cs b/Core/Requests/ConvertIdRequest.cs index 9a86cd79..1671aaae 100644 --- a/Core/Requests/ConvertIdRequest.cs +++ b/Core/Requests/ConvertIdRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ConvertIdRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -17,7 +32,7 @@ namespace Microsoft.Exchange.WebServices.Data /// /// Represents a ConvertId request. /// - internal sealed class ConvertIdRequest : MultiResponseServiceRequest, IJsonSerializable + internal sealed class ConvertIdRequest : MultiResponseServiceRequest { private IdFormat destinationFormat = IdFormat.EwsId; private List ids = new List(); @@ -133,28 +148,5 @@ public List Ids { get { return this.ids; } } - - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object IJsonSerializable.ToJson(ExchangeService service) - { - JsonObject jsonObject = new JsonObject(); - - jsonObject.Add(XmlAttributeNames.DestinationFormat, this.DestinationFormat); - - List sourceIds = new List(); - foreach (AlternateIdBase id in this.Ids) - { - sourceIds.Add(((IJsonSerializable)id).ToJson(service)); - } - jsonObject.Add(XmlElementNames.SourceIds, sourceIds.ToArray()); - - return jsonObject; - } } -} +} \ No newline at end of file diff --git a/Core/Requests/CopyFolderRequest.cs b/Core/Requests/CopyFolderRequest.cs index 4d3a7872..7025a84b 100644 --- a/Core/Requests/CopyFolderRequest.cs +++ b/Core/Requests/CopyFolderRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the CopyFolderRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -76,4 +91,4 @@ internal override ExchangeVersion GetMinimumRequiredServerVersion() return ExchangeVersion.Exchange2007_SP1; } } -} +} \ No newline at end of file diff --git a/Core/Requests/CopyItemRequest.cs b/Core/Requests/CopyItemRequest.cs index 22708c3d..bf1cbf69 100644 --- a/Core/Requests/CopyItemRequest.cs +++ b/Core/Requests/CopyItemRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the CopyItemRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -76,4 +91,4 @@ internal override ExchangeVersion GetMinimumRequiredServerVersion() return ExchangeVersion.Exchange2007_SP1; } } -} +} \ No newline at end of file diff --git a/Core/Requests/CreateAttachmentRequest.cs b/Core/Requests/CreateAttachmentRequest.cs index 509c6974..283e8d6f 100644 --- a/Core/Requests/CreateAttachmentRequest.cs +++ b/Core/Requests/CreateAttachmentRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the CreateAttachmentRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -18,7 +33,7 @@ namespace Microsoft.Exchange.WebServices.Data /// /// Represents a CreateAttachment request. /// - internal sealed class CreateAttachmentRequest : MultiResponseServiceRequest, IJsonSerializable + internal sealed class CreateAttachmentRequest : MultiResponseServiceRequest { private string parentItemId; private List attachments = new List(); @@ -107,30 +122,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) writer.WriteEndElement(); } - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object IJsonSerializable.ToJson(ExchangeService service) - { - JsonObject jsonRequest = new JsonObject(); - - jsonRequest.Add(XmlElementNames.ParentItemId, new ItemId(this.ParentItemId).InternalToJson(service)); - - List attachmentArray = new List(); - foreach (Attachment attachment in this.Attachments) - { - attachmentArray.Add(attachment.InternalToJson(service)); - } - - jsonRequest.Add(XmlElementNames.Attachments, attachmentArray.ToArray()); - - return jsonRequest; - } - /// /// Gets the request version. /// @@ -178,4 +169,4 @@ public string ParentItemId set { this.parentItemId = value; } } } -} +} \ No newline at end of file diff --git a/Core/Requests/CreateFolderRequest.cs b/Core/Requests/CreateFolderRequest.cs index 052dab6e..ecd272d2 100644 --- a/Core/Requests/CreateFolderRequest.cs +++ b/Core/Requests/CreateFolderRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the CreateFolderRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -119,4 +134,4 @@ public IEnumerable Folders set { this.Objects = value; } } } -} +} \ No newline at end of file diff --git a/Core/Requests/CreateItemRequest.cs b/Core/Requests/CreateItemRequest.cs index a32f1fb0..c811c5a6 100644 --- a/Core/Requests/CreateItemRequest.cs +++ b/Core/Requests/CreateItemRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the CreateItemRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -63,4 +78,4 @@ internal override ExchangeVersion GetMinimumRequiredServerVersion() return ExchangeVersion.Exchange2007_SP1; } } -} +} \ No newline at end of file diff --git a/Core/Requests/CreateItemRequestBase.cs b/Core/Requests/CreateItemRequestBase.cs index ec75db9c..81b800ad 100644 --- a/Core/Requests/CreateItemRequestBase.cs +++ b/Core/Requests/CreateItemRequestBase.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the CreateItemRequestBase class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -132,26 +147,6 @@ internal override void WriteAttributesToXml(EwsServiceXmlWriter writer) } } - /// - /// Adds the json properties. - /// - /// The json request. - /// The service. - internal override void AddJsonProperties(JsonObject jsonRequest, ExchangeService service) - { - base.AddJsonProperties(jsonRequest, service); - - if (this.MessageDisposition.HasValue) - { - jsonRequest.Add(XmlAttributeNames.MessageDisposition, this.MessageDisposition.Value); - } - - if (this.SendInvitationsMode.HasValue) - { - jsonRequest.Add(XmlAttributeNames.SendMeetingInvitations, this.SendInvitationsMode.Value); - } - } - /// /// Gets or sets the message disposition. /// diff --git a/Core/Requests/CreateRequest.cs b/Core/Requests/CreateRequest.cs index b91ad1d1..1d0f82f9 100644 --- a/Core/Requests/CreateRequest.cs +++ b/Core/Requests/CreateRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the CreateRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -19,7 +34,7 @@ namespace Microsoft.Exchange.WebServices.Data /// /// The type of the service object. /// The type of the response. - internal abstract class CreateRequest : MultiResponseServiceRequest, IJsonSerializable + internal abstract class CreateRequest : MultiResponseServiceRequest where TServiceObject : ServiceObject where TResponse : ServiceResponse { @@ -90,47 +105,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) writer.WriteEndElement(); } - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object IJsonSerializable.ToJson(ExchangeService service) - { - JsonObject jsonRequest = new JsonObject(); - - if (this.ParentFolderId != null) - { - JsonObject targetFolderId = new JsonObject(); - targetFolderId.Add(XmlElementNames.BaseFolderId, this.ParentFolderId.InternalToJson(service)); - - jsonRequest.Add(this.GetParentFolderXmlElementName(), targetFolderId); - } - - List jsonServiceObjects = new List(); - foreach (ServiceObject obj in this.objects) - { - jsonServiceObjects.Add(obj.ToJson(service, false)); - } - - jsonRequest.Add(this.GetObjectCollectionXmlElementName(), jsonServiceObjects.ToArray()); - - this.AddJsonProperties(jsonRequest, service); - - return jsonRequest; - } - - /// - /// Adds the json properties. - /// - /// The json request. - /// The service. - internal virtual void AddJsonProperties(JsonObject jsonRequest, ExchangeService service) - { - } - /// /// Gets or sets the service objects. /// @@ -151,4 +125,4 @@ public FolderId ParentFolderId set { this.parentFolderId = value; } } } -} +} \ No newline at end of file diff --git a/Core/Requests/CreateResponseObjectRequest.cs b/Core/Requests/CreateResponseObjectRequest.cs index 8fedff4e..2dc8d97a 100644 --- a/Core/Requests/CreateResponseObjectRequest.cs +++ b/Core/Requests/CreateResponseObjectRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the CreateResponseObjectRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -49,4 +64,4 @@ internal override ExchangeVersion GetMinimumRequiredServerVersion() return ExchangeVersion.Exchange2007_SP1; } } -} +} \ No newline at end of file diff --git a/Core/Requests/CreateUserConfigurationRequest.cs b/Core/Requests/CreateUserConfigurationRequest.cs index afb56483..a47ba7f3 100644 --- a/Core/Requests/CreateUserConfigurationRequest.cs +++ b/Core/Requests/CreateUserConfigurationRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the CreateUserConfigurationRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -17,7 +32,7 @@ namespace Microsoft.Exchange.WebServices.Data /// /// Represents a CreateUserConfiguration request. /// - internal class CreateUserConfigurationRequest : MultiResponseServiceRequest, IJsonSerializable + internal class CreateUserConfigurationRequest : MultiResponseServiceRequest { protected UserConfiguration userConfiguration; @@ -92,26 +107,10 @@ internal override string GetResponseMessageXmlElementName() /// The writer. internal override void WriteElementsToXml(EwsServiceXmlWriter writer) { - // Write UserConfiguation element + // Write UserConfiguration element this.userConfiguration.WriteToXml(writer, XmlNamespace.Messages, XmlElementNames.UserConfiguration); } - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object IJsonSerializable.ToJson(ExchangeService service) - { - JsonObject jsonObject = new JsonObject(); - - jsonObject.Add(XmlElementNames.UserConfiguration, ((IJsonSerializable)this.UserConfiguration).ToJson(service)); - - return jsonObject; - } - /// /// Initializes a new instance of the class. /// @@ -131,4 +130,4 @@ public UserConfiguration UserConfiguration set { this.userConfiguration = value; } } } -} +} \ No newline at end of file diff --git a/Core/Requests/DelegateManagementRequestBase.cs b/Core/Requests/DelegateManagementRequestBase.cs index 9593d5d0..5debead6 100644 --- a/Core/Requests/DelegateManagementRequestBase.cs +++ b/Core/Requests/DelegateManagementRequestBase.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the DelegateManagementRequestBase class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -96,4 +111,4 @@ public Mailbox Mailbox set { this.mailbox = value; } } } -} +} \ No newline at end of file diff --git a/Core/Requests/DeleteAttachmentRequest.cs b/Core/Requests/DeleteAttachmentRequest.cs index 890c7884..7457bee4 100644 --- a/Core/Requests/DeleteAttachmentRequest.cs +++ b/Core/Requests/DeleteAttachmentRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the DeleteAttachmentRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -17,7 +32,7 @@ namespace Microsoft.Exchange.WebServices.Data /// /// Represents a DeleteAttachment request. /// - internal sealed class DeleteAttachmentRequest : MultiResponseServiceRequest, IJsonSerializable + internal sealed class DeleteAttachmentRequest : MultiResponseServiceRequest { private List attachments = new List(); @@ -109,32 +124,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) writer.WriteEndElement(); } - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object IJsonSerializable.ToJson(ExchangeService service) - { - JsonObject jsonRequest = new JsonObject(); - List attachmentIds = new List(); - - foreach (Attachment attachment in this.Attachments) - { - JsonObject jsonAttachmentId = new JsonObject(); - jsonAttachmentId.AddTypeParameter("AttachmentId"); - jsonAttachmentId.Add(XmlAttributeNames.Id, attachment.Id); - - attachmentIds.Add(jsonAttachmentId); - } - - jsonRequest.Add(XmlElementNames.AttachmentIds, attachmentIds.ToArray()); - - return jsonRequest; - } - /// /// Gets the request version. /// @@ -153,4 +142,4 @@ public List Attachments get { return this.attachments; } } } -} +} \ No newline at end of file diff --git a/Core/Requests/DeleteFolderRequest.cs b/Core/Requests/DeleteFolderRequest.cs index cb3e5bce..74e4ec92 100644 --- a/Core/Requests/DeleteFolderRequest.cs +++ b/Core/Requests/DeleteFolderRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the DeleteFolderRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -100,15 +115,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) XmlElementNames.FolderIds); } - /// - /// Serializes the property to a Json value. - /// - /// The body. - protected override void InternalToJson(JsonObject body) - { - body.Add(XmlElementNames.FolderIds, this.FolderIds.InternalToJson(this.Service)); - } - /// /// Gets the request version. /// @@ -127,4 +133,4 @@ internal FolderIdWrapperList FolderIds get { return this.folderIds; } } } -} +} \ No newline at end of file diff --git a/Core/Requests/DeleteItemRequest.cs b/Core/Requests/DeleteItemRequest.cs index 4eeb1b89..9e24089a 100644 --- a/Core/Requests/DeleteItemRequest.cs +++ b/Core/Requests/DeleteItemRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the DeleteItemRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -138,37 +153,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) XmlElementNames.ItemIds); } - /// - /// Internals to json. - /// - /// The body. - protected override void InternalToJson(JsonObject body) - { - if (this.AffectedTaskOccurrences.HasValue) - { - body.Add( - XmlAttributeNames.AffectedTaskOccurrences, - this.AffectedTaskOccurrences.Value); - } - - if (this.SendCancellationsMode.HasValue) - { - body.Add( - XmlAttributeNames.SendMeetingCancellations, - this.SendCancellationsMode.Value); - } - - if (this.SuppressReadReceipts) - { - body.Add(XmlAttributeNames.SuppressReadReceipts, true); - } - - if (this.ItemIds.Count > 0) - { - body.Add(XmlElementNames.ItemIds, this.ItemIds.InternalToJson(this.Service)); - } - } - /// /// Gets the request version. /// @@ -217,4 +201,4 @@ public bool SuppressReadReceipts set; } } -} +} \ No newline at end of file diff --git a/Core/Requests/DeleteRequest.cs b/Core/Requests/DeleteRequest.cs index 0e3ca2f7..da2f084f 100644 --- a/Core/Requests/DeleteRequest.cs +++ b/Core/Requests/DeleteRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the DeleteRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -18,7 +33,7 @@ namespace Microsoft.Exchange.WebServices.Data /// Represents an abstract Delete request. /// /// The type of the response. - internal abstract class DeleteRequest : MultiResponseServiceRequest, IJsonSerializable + internal abstract class DeleteRequest : MultiResponseServiceRequest where TResponse : ServiceResponse { /// @@ -47,26 +62,6 @@ internal override void WriteAttributesToXml(EwsServiceXmlWriter writer) writer.WriteAttributeValue(XmlAttributeNames.DeleteType, this.DeleteMode); } - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object IJsonSerializable.ToJson(ExchangeService service) - { - JsonObject body = new JsonObject(); - - body.Add(XmlAttributeNames.DeleteType, this.DeleteMode.ToString()); - - this.InternalToJson(body); - - return body; - } - - protected abstract void InternalToJson(JsonObject body); - /// /// Gets or sets the delete mode. /// @@ -77,4 +72,4 @@ public DeleteMode DeleteMode set { this.deleteMode = value; } } } -} +} \ No newline at end of file diff --git a/Core/Requests/DeleteUserConfigurationRequest.cs b/Core/Requests/DeleteUserConfigurationRequest.cs index 87f3711b..26b2c206 100644 --- a/Core/Requests/DeleteUserConfigurationRequest.cs +++ b/Core/Requests/DeleteUserConfigurationRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the DeleteUserConfigurationRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -17,7 +32,7 @@ namespace Microsoft.Exchange.WebServices.Data /// /// Represents a DeleteUserConfiguration request. /// - internal class DeleteUserConfigurationRequest : MultiResponseServiceRequest, IJsonSerializable + internal class DeleteUserConfigurationRequest : MultiResponseServiceRequest { private string name; private FolderId parentFolderId; @@ -95,7 +110,7 @@ internal override string GetResponseMessageXmlElementName() /// The writer. internal override void WriteElementsToXml(EwsServiceXmlWriter writer) { - // Write UserConfiguationName element + // Write UserConfigurationName element UserConfiguration.WriteUserConfigurationNameToXml( writer, XmlNamespace.Messages, @@ -103,24 +118,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) this.parentFolderId); } - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object IJsonSerializable.ToJson(ExchangeService service) - { - JsonObject jsonObject = new JsonObject(); - - jsonObject.Add( - XmlElementNames.UserConfigurationName, - UserConfiguration.GetJsonUserConfigName(service, this.parentFolderId, this.name)); - - return jsonObject; - } - /// /// Initializes a new instance of the class. /// @@ -150,4 +147,4 @@ internal FolderId ParentFolderId set { this.parentFolderId = value; } } } -} +} \ No newline at end of file diff --git a/Core/Requests/DisableAppRequest.cs b/Core/Requests/DisableAppRequest.cs index ed44657d..e99d6096 100644 --- a/Core/Requests/DisableAppRequest.cs +++ b/Core/Requests/DisableAppRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the DisableAppRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Core/Requests/DisconnectPhoneCallRequest.cs b/Core/Requests/DisconnectPhoneCallRequest.cs index 3ec107c2..8a4cc7ec 100644 --- a/Core/Requests/DisconnectPhoneCallRequest.cs +++ b/Core/Requests/DisconnectPhoneCallRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the DisconnectPhoneCallRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Core/Requests/EmptyFolderRequest.cs b/Core/Requests/EmptyFolderRequest.cs index 4b188500..c0848d34 100644 --- a/Core/Requests/EmptyFolderRequest.cs +++ b/Core/Requests/EmptyFolderRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the EmptyFolderRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -111,16 +126,6 @@ internal override void WriteAttributesToXml(EwsServiceXmlWriter writer) writer.WriteAttributeValue(XmlAttributeNames.DeleteSubFolders, this.DeleteSubFolders); } - /// - /// Serializes the property to a Json value. - /// - /// The body. - protected override void InternalToJson(JsonObject body) - { - body.Add(XmlAttributeNames.DeleteSubFolders, this.DeleteSubFolders); - body.Add(XmlElementNames.FolderIds, this.FolderIds.InternalToJson(this.Service)); - } - /// /// Gets the request version. /// @@ -149,4 +154,4 @@ internal bool DeleteSubFolders set; } } -} +} \ No newline at end of file diff --git a/Core/Requests/ExecuteDiagnosticMethodRequest.cs b/Core/Requests/ExecuteDiagnosticMethodRequest.cs index 55f10e63..075f5ae6 100644 --- a/Core/Requests/ExecuteDiagnosticMethodRequest.cs +++ b/Core/Requests/ExecuteDiagnosticMethodRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ExecuteDiagnosticMethodRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Core/Requests/ExpandGroupRequest.cs b/Core/Requests/ExpandGroupRequest.cs index a63d9367..ec7e6fcd 100644 --- a/Core/Requests/ExpandGroupRequest.cs +++ b/Core/Requests/ExpandGroupRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ExpandGroupRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -116,4 +131,4 @@ public EmailAddress EmailAddress set { this.emailAddress = value; } } } -} +} \ No newline at end of file diff --git a/Core/Requests/FindConversationRequest.cs b/Core/Requests/FindConversationRequest.cs index 5e851c1d..993ae56d 100644 --- a/Core/Requests/FindConversationRequest.cs +++ b/Core/Requests/FindConversationRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the FindConversationRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -17,7 +32,7 @@ namespace Microsoft.Exchange.WebServices.Data /// /// Represents a request to a Find Conversation operation /// - internal sealed class FindConversationRequest : SimpleServiceRequestBase, IJsonSerializable + internal sealed class FindConversationRequest : SimpleServiceRequestBase { private ViewBase view; private FolderIdWrapper folderId; @@ -234,52 +249,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) } } - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object IJsonSerializable.ToJson(ExchangeService service) - { - JsonObject jsonRequest = new JsonObject(); - - jsonRequest.Add("Paging", this.View.WritePagingToJson(service)); - this.View.AddJsonProperties(jsonRequest, service); - - JsonObject jsonTargetFolderId = new JsonObject(); - jsonTargetFolderId.Add(XmlElementNames.BaseFolderId, this.FolderId.InternalToJson(service)); - jsonRequest.Add(XmlElementNames.ParentFolderId, jsonTargetFolderId); - - if (this.MailboxScope.HasValue) - { - jsonRequest.Add(XmlElementNames.MailboxScope, this.MailboxScope.Value); - } - - if (!string.IsNullOrEmpty(this.queryString)) - { - JsonObject jsonQueryString = new JsonObject(); - jsonQueryString.Add(XmlAttributeNames.Value, this.QueryString); - - if (this.ReturnHighlightTerms) - { - jsonQueryString.Add(XmlAttributeNames.ReturnHighlightTerms, this.ReturnHighlightTerms.ToString().ToLowerInvariant()); - } - - jsonRequest.Add(XmlElementNames.QueryString, jsonQueryString); - } - - if (this.Service.RequestedServerVersion >= ExchangeVersion.Exchange2013) - { - if (this.View.PropertySet != null) - { - this.View.PropertySet.WriteGetShapeToJson(jsonRequest, service, ServiceObjectType.Conversation); - } - } - return jsonRequest; - } - /// /// Parses the response. /// @@ -292,18 +261,6 @@ internal override object ParseResponse(EwsServiceXmlReader reader) return response; } - /// - /// Parses the response. - /// - /// The json body. - /// Response object. - internal override object ParseResponse(JsonObject jsonBody) - { - FindConversationResponse serviceResponse = new FindConversationResponse(); - serviceResponse.LoadFromJson(jsonBody, this.Service); - return serviceResponse; - } - /// /// Gets the name of the XML element. /// diff --git a/Core/Requests/FindFolderRequest.cs b/Core/Requests/FindFolderRequest.cs index c14ef1a6..2e21d146 100644 --- a/Core/Requests/FindFolderRequest.cs +++ b/Core/Requests/FindFolderRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the FindFolderRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -76,4 +91,4 @@ internal override ExchangeVersion GetMinimumRequiredServerVersion() return ExchangeVersion.Exchange2007_SP1; } } -} +} \ No newline at end of file diff --git a/Core/Requests/FindItemRequest.cs b/Core/Requests/FindItemRequest.cs index 5b7ac7dc..3f708acc 100644 --- a/Core/Requests/FindItemRequest.cs +++ b/Core/Requests/FindItemRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the FindItemRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Core/Requests/FindPeopleRequest.cs b/Core/Requests/FindPeopleRequest.cs new file mode 100644 index 00000000..3e566a5b --- /dev/null +++ b/Core/Requests/FindPeopleRequest.cs @@ -0,0 +1,233 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + using System; + using System.Collections.Generic; + + /// + /// Represents a request of a find persona operation + /// + internal sealed class FindPeopleRequest : SimpleServiceRequestBase + { + /// + /// Default constructor + /// + /// Exchange web service + internal FindPeopleRequest(ExchangeService service) + : base(service) + { + } + + /// + /// Accessors of the view controlling the number of personas returned. + /// + internal ViewBase View { get; set; } + + /// + /// Folder Id accessors + /// + internal FolderId FolderId { get; set; } + + /// + /// Search filter accessors + /// Available search filter classes include SearchFilter.IsEqualTo, + /// SearchFilter.ContainsSubstring and SearchFilter.SearchFilterCollection. If SearchFilter + /// is null, no search filters are applied. + /// + internal SearchFilter SearchFilter { get; set; } + + /// + /// Query string accessors + /// + internal string QueryString { get; set; } + + /// + /// Whether to search the people suggestion index + /// + internal bool SearchPeopleSuggestionIndex { get; set; } + + /// + /// The context for suggestion index enabled queries + /// + internal Dictionary Context { get; set; } + + /// + /// The query mode for suggestion index enabled queries + /// + internal PeopleQueryMode QueryMode { get; set; } + + /// + /// Validate request. + /// + internal override void Validate() + { + base.Validate(); + this.View.InternalValidate(this); + } + + /// + /// Writes XML attributes. + /// + /// The writer. + internal override void WriteAttributesToXml(EwsServiceXmlWriter writer) + { + base.WriteAttributesToXml(writer); + this.View.WriteAttributesToXml(writer); + } + + /// + /// Writes XML elements. + /// + /// The writer. + internal override void WriteElementsToXml(EwsServiceXmlWriter writer) + { + if (this.SearchFilter != null) + { + // Emit the Restriction element + writer.WriteStartElement(XmlNamespace.Messages, XmlElementNames.Restriction); + this.SearchFilter.WriteToXml(writer); + writer.WriteEndElement(); + } + + // Emit the View element + this.View.WriteToXml(writer, null); + + // Emit the SortOrder + this.View.WriteOrderByToXml(writer); + + // Emit the ParentFolderId element + if (this.FolderId != null) + { + writer.WriteStartElement(XmlNamespace.Messages, XmlElementNames.ParentFolderId); + this.FolderId.WriteToXml(writer); + writer.WriteEndElement(); + } + + if (!string.IsNullOrEmpty(this.QueryString)) + { + // Emit the QueryString element + writer.WriteStartElement(XmlNamespace.Messages, XmlElementNames.QueryString); + writer.WriteValue(this.QueryString, XmlElementNames.QueryString); + writer.WriteEndElement(); + } + + // Emit the SuggestionIndex-enabled elements + if (this.SearchPeopleSuggestionIndex) + { + writer.WriteStartElement(XmlNamespace.Messages, XmlElementNames.SearchPeopleSuggestionIndex); + writer.WriteValue(this.SearchPeopleSuggestionIndex.ToString().ToLowerInvariant(), XmlElementNames.SearchPeopleSuggestionIndex); + writer.WriteEndElement(); + + // Write the Context key value pairs + writer.WriteStartElement(XmlNamespace.Messages, XmlElementNames.SearchPeopleContext); + foreach (KeyValuePair contextItem in this.Context) + { + writer.WriteStartElement(XmlNamespace.Messages, "ContextProperty"); + + writer.WriteStartElement(XmlNamespace.Messages, "Key"); + writer.WriteValue(contextItem.Key, "Key"); + writer.WriteEndElement(); + + writer.WriteStartElement(XmlNamespace.Messages, "Value"); + writer.WriteValue(contextItem.Value, "Value"); + writer.WriteEndElement(); + + writer.WriteEndElement(); + } + writer.WriteEndElement(); + + // Write the Query Mode Sources + writer.WriteStartElement(XmlNamespace.Messages, XmlElementNames.SearchPeopleQuerySources); + foreach (string querySource in this.QueryMode.Sources) + { + writer.WriteStartElement(XmlNamespace.Messages, "Source"); + writer.WriteValue(querySource, "Source"); + writer.WriteEndElement(); + } + writer.WriteEndElement(); + } + + if (this.Service.RequestedServerVersion >= this.GetMinimumRequiredServerVersion()) + { + if (this.View.PropertySet != null) + { + this.View.PropertySet.WriteToXml(writer, ServiceObjectType.Persona); + } + } + } + + /// + /// Parses the response. + /// + /// The reader. + /// Response object. + internal override object ParseResponse(EwsServiceXmlReader reader) + { + FindPeopleResponse response = new FindPeopleResponse(); + response.LoadFromXml(reader, XmlElementNames.FindPeopleResponse); + return response; + } + + /// + /// Gets the name of the XML element. + /// + /// XML element name. + internal override string GetXmlElementName() + { + return XmlElementNames.FindPeople; + } + + /// + /// Gets the name of the response XML element. + /// + /// XML element name. + internal override string GetResponseXmlElementName() + { + return XmlElementNames.FindPeopleResponse; + } + + /// + /// Gets the request version. + /// + /// Earliest Exchange version in which this request is supported. + internal override ExchangeVersion GetMinimumRequiredServerVersion() + { + return ExchangeVersion.Exchange2013_SP1; + } + + /// + /// Executes this request. + /// + /// Service response. + internal FindPeopleResponse Execute() + { + FindPeopleResponse serviceResponse = (FindPeopleResponse)this.InternalExecute(); + serviceResponse.ThrowIfNecessary(); + return serviceResponse; + } + } +} \ No newline at end of file diff --git a/Core/Requests/FindRequest.cs b/Core/Requests/FindRequest.cs index 931f4fe5..f13ca96f 100644 --- a/Core/Requests/FindRequest.cs +++ b/Core/Requests/FindRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the FindRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -18,7 +33,7 @@ namespace Microsoft.Exchange.WebServices.Data /// Represents an abstract Find request. /// /// The type of the response. - internal abstract class FindRequest : MultiResponseServiceRequest, IJsonSerializable + internal abstract class FindRequest : MultiResponseServiceRequest where TResponse : ServiceResponse { private FolderIdWrapperList parentFolderIds = new FolderIdWrapperList(); @@ -156,55 +171,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) } } - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object IJsonSerializable.ToJson(ExchangeService service) - { - JsonObject jsonRequest = new JsonObject(); - - this.View.WriteShapeToJson(jsonRequest, service); - jsonRequest.Add("Paging", this.View.WritePagingToJson(service)); - - object jsonGrouping = this.View.WriteGroupingToJson(service, this.GetGroupBy()); - if (jsonGrouping != null) - { - jsonRequest.Add("Grouping", jsonGrouping); - } - - // Traversal and OrderBy - this.View.AddJsonProperties(jsonRequest, service); - - if (this.SearchFilter != null) - { - JsonObject jsonSearchFilter = new JsonObject(); - jsonSearchFilter.Add(XmlElementNames.Item, this.SearchFilter.InternalToJson(service)); - - jsonRequest.Add(XmlElementNames.Restriction, jsonSearchFilter); - } - - jsonRequest.Add(XmlElementNames.ParentFolderIds, this.ParentFolderIds.InternalToJson(service)); - - if (!string.IsNullOrEmpty(this.queryString)) - { - JsonObject jsonQueryString = new JsonObject(); - jsonQueryString.Add(XmlAttributeNames.Value, this.QueryString); - - if (this.ReturnHighlightTerms) - { - jsonQueryString.Add(XmlAttributeNames.ReturnHighlightTerms, this.ReturnHighlightTerms.ToString().ToLowerInvariant()); - } - - jsonRequest.Add(XmlElementNames.QueryString, jsonQueryString); - } - - return jsonRequest; - } - /// /// Gets the parent folder ids. /// diff --git a/Core/Requests/GetAppManifestsRequest.cs b/Core/Requests/GetAppManifestsRequest.cs index 3f9b8ffd..8a5f4a1c 100644 --- a/Core/Requests/GetAppManifestsRequest.cs +++ b/Core/Requests/GetAppManifestsRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetAppManifestsRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Core/Requests/GetAppMarketplaceUrlRequest.cs b/Core/Requests/GetAppMarketplaceUrlRequest.cs index 215ff6c3..9875f411 100644 --- a/Core/Requests/GetAppMarketplaceUrlRequest.cs +++ b/Core/Requests/GetAppMarketplaceUrlRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetAppMarketplaceUrlRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Core/Requests/GetAttachmentRequest.cs b/Core/Requests/GetAttachmentRequest.cs index 8e689b00..7b7ecafb 100644 --- a/Core/Requests/GetAttachmentRequest.cs +++ b/Core/Requests/GetAttachmentRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetAttachmentRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -16,7 +31,7 @@ namespace Microsoft.Exchange.WebServices.Data /// /// Represents a GetAttachment request. /// - internal sealed class GetAttachmentRequest : MultiResponseServiceRequest, IJsonSerializable + internal sealed class GetAttachmentRequest : MultiResponseServiceRequest { private List attachments = new List(); private List attachmentIds = new List(); @@ -147,51 +162,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) writer.WriteEndElement(); } - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object IJsonSerializable.ToJson(ExchangeService service) - { - JsonObject jsonRequest = new JsonObject(); - - if (this.BodyType.HasValue || this.AdditionalProperties.Count > 0) - { - JsonObject jsonAttachmentShape = new JsonObject(); - - if (this.BodyType.HasValue) - { - jsonAttachmentShape.Add(XmlElementNames.BodyType, this.BodyType.Value); - } - - if (this.AdditionalProperties.Count > 0) - { - PropertySet.WriteAdditionalPropertiesToJson(jsonAttachmentShape, service, this.AdditionalProperties); - } - - jsonRequest.Add(XmlElementNames.AttachmentShape, jsonAttachmentShape); - } - - List attachmentIds = new List(); - - foreach (Attachment attachment in this.Attachments) - { - this.AddJsonAttachmentIdToList(attachmentIds, attachment.Id); - } - - foreach (string attachmentId in this.AttachmentIds) - { - this.AddJsonAttachmentIdToList(attachmentIds, attachmentId); - } - - jsonRequest.Add(XmlElementNames.AttachmentIds, attachmentIds.ToArray()); - - return jsonRequest; - } - /// /// Gets the request version. /// @@ -265,17 +235,5 @@ private void WriteAttachmentIdXml(EwsServiceXmlWriter writer, string attachmentI writer.WriteAttributeValue(XmlAttributeNames.Id, attachmentId); writer.WriteEndElement(); } - - /// - /// Add json attachment id to list - /// - /// The attachment id object list. - /// The attachment id. - private void AddJsonAttachmentIdToList(List attachmentIds, string attachmentId) - { - JsonObject jsonAttachmentId = new JsonObject(); - jsonAttachmentId.Add(XmlAttributeNames.Id, attachmentId); - attachmentIds.Add(jsonAttachmentId); - } } -} +} \ No newline at end of file diff --git a/Core/Requests/GetClientAccessTokenRequest.cs b/Core/Requests/GetClientAccessTokenRequest.cs index a7cb5ef2..3089ff0d 100644 --- a/Core/Requests/GetClientAccessTokenRequest.cs +++ b/Core/Requests/GetClientAccessTokenRequest.cs @@ -1,8 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -13,7 +32,7 @@ namespace Microsoft.Exchange.WebServices.Data /// /// Represents a GetClientAccessToken request. /// - internal sealed class GetClientAccessTokenRequest : MultiResponseServiceRequest, IJsonSerializable + internal sealed class GetClientAccessTokenRequest : MultiResponseServiceRequest { /// /// Initializes a new instance of the class. @@ -98,36 +117,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) writer.WriteEndElement(); } - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object IJsonSerializable.ToJson(ExchangeService service) - { - List jsonArray = new List(); - - foreach (ClientAccessTokenRequest tokenRequestInfo in this.TokenRequests) - { - JsonObject innerRequest = new JsonObject(); - innerRequest.AddTypeParameter(XmlElementNames.TokenRequest); - innerRequest.Add(XmlElementNames.Id, tokenRequestInfo.Id); - innerRequest.Add(XmlElementNames.TokenType, tokenRequestInfo.TokenType); - if (!string.IsNullOrEmpty(tokenRequestInfo.Scope)) - { - innerRequest.Add(XmlElementNames.HighlightTermScope, tokenRequestInfo.Scope); - } - - jsonArray.Add(innerRequest); - } - - JsonObject jsonRequest = new JsonObject(); - jsonRequest.Add(XmlElementNames.TokenRequests, jsonArray.ToArray()); - return jsonRequest; - } - /// /// Validate request. /// diff --git a/Core/Requests/GetClientExtensionRequest.cs b/Core/Requests/GetClientExtensionRequest.cs index 7e7d255d..7b128449 100644 --- a/Core/Requests/GetClientExtensionRequest.cs +++ b/Core/Requests/GetClientExtensionRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetClientExtensionRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Core/Requests/GetConversationItemsRequest.cs b/Core/Requests/GetConversationItemsRequest.cs index 619b320f..151f8bdc 100644 --- a/Core/Requests/GetConversationItemsRequest.cs +++ b/Core/Requests/GetConversationItemsRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetConversationItemsRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -17,7 +32,7 @@ namespace Microsoft.Exchange.WebServices.Data /// /// Represents a request to a GetConversationItems operation /// - internal sealed class GetConversationItemsRequest : MultiResponseServiceRequest, IJsonSerializable + internal sealed class GetConversationItemsRequest : MultiResponseServiceRequest { /// /// Initializes a new instance of the class. @@ -115,48 +130,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) writer.WriteEndElement(); } - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object IJsonSerializable.ToJson(ExchangeService service) - { - JsonObject jsonRequest = new JsonObject(); - - this.ItemProperties.WriteGetShapeToJson(jsonRequest, service, ServiceObjectType.Item); - - if (this.FoldersToIgnore.Count > 0) - { - jsonRequest.Add(XmlElementNames.FoldersToIgnore, this.FoldersToIgnore.InternalToJson(service)); - } - - if (this.MaxItemsToReturn.HasValue) - { - jsonRequest.Add(XmlElementNames.MaxItemsToReturn, this.MaxItemsToReturn.Value); - } - - if (this.SortOrder.HasValue) - { - jsonRequest.Add(XmlElementNames.SortOrder, this.SortOrder.Value); - } - - if (this.MailboxScope.HasValue) - { - jsonRequest.Add(XmlElementNames.MailboxScope, this.MailboxScope.Value); - } - - List jsonPropertyCollection = new List(); - - this.Conversations.ForEach((conversation) => jsonPropertyCollection.Add(conversation.InternalToJson(service))); - - jsonRequest.Add(XmlElementNames.Conversations, jsonPropertyCollection.ToArray()); - - return jsonRequest; - } - /// /// Creates the service response. /// diff --git a/Core/Requests/GetDelegateRequest.cs b/Core/Requests/GetDelegateRequest.cs index 3e273331..6729a899 100644 --- a/Core/Requests/GetDelegateRequest.cs +++ b/Core/Requests/GetDelegateRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetDelegateRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -120,4 +135,4 @@ public bool IncludePermissions set { this.includePermissions = value; } } } -} +} \ No newline at end of file diff --git a/Core/Requests/GetDiscoverySearchConfigurationRequest.cs b/Core/Requests/GetDiscoverySearchConfigurationRequest.cs index 01812588..0ac44fe4 100644 --- a/Core/Requests/GetDiscoverySearchConfigurationRequest.cs +++ b/Core/Requests/GetDiscoverySearchConfigurationRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetDiscoverySearchConfigurationRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -17,7 +32,7 @@ namespace Microsoft.Exchange.WebServices.Data /// /// Represents a GetDiscoverySearchConfigurationRequest. /// - internal sealed class GetDiscoverySearchConfigurationRequest : SimpleServiceRequestBase, IJsonSerializable + internal sealed class GetDiscoverySearchConfigurationRequest : SimpleServiceRequestBase { /// /// Initializes a new instance of the class. @@ -88,20 +103,6 @@ internal GetDiscoverySearchConfigurationResponse Execute() return serviceResponse; } - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object IJsonSerializable.ToJson(ExchangeService service) - { - JsonObject jsonObject = new JsonObject(); - - return jsonObject; - } - /// /// Search Id /// diff --git a/Core/Requests/GetEncryptionConfigurationRequest.cs b/Core/Requests/GetEncryptionConfigurationRequest.cs index 3b6f44d3..68e65ce6 100644 --- a/Core/Requests/GetEncryptionConfigurationRequest.cs +++ b/Core/Requests/GetEncryptionConfigurationRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetEncryptionConfigurationRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Core/Requests/GetEventsRequest.cs b/Core/Requests/GetEventsRequest.cs index 5dd68497..878a63d8 100644 --- a/Core/Requests/GetEventsRequest.cs +++ b/Core/Requests/GetEventsRequest.cs @@ -1,19 +1,34 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetEventsRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { /// /// GetEvents request /// - internal class GetEventsRequest : MultiResponseServiceRequest, IJsonSerializable + internal class GetEventsRequest : MultiResponseServiceRequest { private string subscriptionId; private string watermark; @@ -101,23 +116,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) this.Watermark); } - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object IJsonSerializable.ToJson(ExchangeService service) - { - JsonObject jsonRequest = new JsonObject(); - - jsonRequest.Add(XmlElementNames.SubscriptionId, this.SubscriptionId); - jsonRequest.Add(XmlElementNames.Watermark, this.Watermark); - - return jsonRequest; - } - /// /// Gets the request version. /// @@ -147,4 +145,4 @@ public string Watermark set { this.watermark = value; } } } -} +} \ No newline at end of file diff --git a/Core/Requests/GetFolderRequest.cs b/Core/Requests/GetFolderRequest.cs index ba57fc21..44749102 100644 --- a/Core/Requests/GetFolderRequest.cs +++ b/Core/Requests/GetFolderRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetFolderRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -40,4 +55,4 @@ internal override GetFolderResponse CreateServiceResponse(ExchangeService servic return new GetFolderResponse(this.FolderIds[responseIndex].GetFolder(), this.PropertySet); } } -} +} \ No newline at end of file diff --git a/Core/Requests/GetFolderRequestBase.cs b/Core/Requests/GetFolderRequestBase.cs index db549edf..ee126e45 100644 --- a/Core/Requests/GetFolderRequestBase.cs +++ b/Core/Requests/GetFolderRequestBase.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetFolderRequestBase class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -75,16 +90,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) XmlElementNames.FolderIds); } - /// - /// Adds the ids to request. - /// - /// The json request. - /// The service. - internal override void AddIdsToRequest(JsonObject jsonRequest, ExchangeService service) - { - jsonRequest.Add(XmlElementNames.FolderIds, this.FolderIds.InternalToJson(service)); - } - /// /// Gets the name of the XML element. /// @@ -130,4 +135,4 @@ public FolderIdWrapperList FolderIds get { return this.folderIds; } } } -} +} \ No newline at end of file diff --git a/Core/Requests/GetFolderRequestForLoad.cs b/Core/Requests/GetFolderRequestForLoad.cs index ba09ce77..d706d937 100644 --- a/Core/Requests/GetFolderRequestForLoad.cs +++ b/Core/Requests/GetFolderRequestForLoad.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetFolderRequestForLoad class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -40,4 +55,4 @@ internal override ServiceResponse CreateServiceResponse(ExchangeService service, return new GetFolderResponse(this.FolderIds[responseIndex].GetFolder(), this.PropertySet); } } -} +} \ No newline at end of file diff --git a/Core/Requests/GetHoldOnMailboxesRequest.cs b/Core/Requests/GetHoldOnMailboxesRequest.cs index b305bc55..16a5d6b9 100644 --- a/Core/Requests/GetHoldOnMailboxesRequest.cs +++ b/Core/Requests/GetHoldOnMailboxesRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetHoldOnMailboxesRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -17,7 +32,7 @@ namespace Microsoft.Exchange.WebServices.Data /// /// Represents a GetHoldOnMailboxesRequest request. /// - internal sealed class GetHoldOnMailboxesRequest : SimpleServiceRequestBase, IJsonSerializable + internal sealed class GetHoldOnMailboxesRequest : SimpleServiceRequestBase { /// /// Initializes a new instance of the class. @@ -99,20 +114,6 @@ internal GetHoldOnMailboxesResponse Execute() return serviceResponse; } - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object IJsonSerializable.ToJson(ExchangeService service) - { - JsonObject jsonObject = new JsonObject(); - - return jsonObject; - } - /// /// Hold id /// diff --git a/Core/Requests/GetInboxRulesRequest.cs b/Core/Requests/GetInboxRulesRequest.cs index 07b43dd8..d924dac5 100644 --- a/Core/Requests/GetInboxRulesRequest.cs +++ b/Core/Requests/GetInboxRulesRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetInboxRulesRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Core/Requests/GetItemRequest.cs b/Core/Requests/GetItemRequest.cs index a5f82fbd..fac8a3f7 100644 --- a/Core/Requests/GetItemRequest.cs +++ b/Core/Requests/GetItemRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetItemRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -36,4 +51,4 @@ internal override GetItemResponse CreateServiceResponse(ExchangeService service, return new GetItemResponse(this.ItemIds[responseIndex], this.PropertySet); } } -} +} \ No newline at end of file diff --git a/Core/Requests/GetItemRequestBase.cs b/Core/Requests/GetItemRequestBase.cs index c5498a4d..7209ad79 100644 --- a/Core/Requests/GetItemRequestBase.cs +++ b/Core/Requests/GetItemRequestBase.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetItemRequestBase class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -74,16 +89,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) XmlElementNames.ItemIds); } - /// - /// Adds the ids to request. - /// - /// The json request. - /// The service. - internal override void AddIdsToRequest(JsonObject jsonRequest, ExchangeService service) - { - jsonRequest.Add(XmlElementNames.ItemIds, this.ItemIds.InternalToJson(service)); - } - /// /// Gets the name of the XML element. /// @@ -145,4 +150,4 @@ internal override bool EmitTimeZoneHeader } } } -} +} \ No newline at end of file diff --git a/Core/Requests/GetItemRequestForLoad.cs b/Core/Requests/GetItemRequestForLoad.cs index 0d96f540..4712c3b9 100644 --- a/Core/Requests/GetItemRequestForLoad.cs +++ b/Core/Requests/GetItemRequestForLoad.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetItemRequestForLoad class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -40,4 +55,4 @@ internal override ServiceResponse CreateServiceResponse(ExchangeService service, return new GetItemResponse(this.ItemIds[responseIndex], this.PropertySet); } } -} +} \ No newline at end of file diff --git a/Core/Requests/GetNonIndexableItemDetailsRequest.cs b/Core/Requests/GetNonIndexableItemDetailsRequest.cs index bc0efeee..8910c91c 100644 --- a/Core/Requests/GetNonIndexableItemDetailsRequest.cs +++ b/Core/Requests/GetNonIndexableItemDetailsRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetNonIndexableItemDetailsRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -17,7 +32,7 @@ namespace Microsoft.Exchange.WebServices.Data /// /// Represents a GetNonIndexableItemDetailsRequest request. /// - internal sealed class GetNonIndexableItemDetailsRequest : SimpleServiceRequestBase, IJsonSerializable + internal sealed class GetNonIndexableItemDetailsRequest : SimpleServiceRequestBase { /// /// Initializes a new instance of the class. @@ -122,20 +137,6 @@ internal GetNonIndexableItemDetailsResponse Execute() return serviceResponse; } - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object IJsonSerializable.ToJson(ExchangeService service) - { - JsonObject jsonObject = new JsonObject(); - - return jsonObject; - } - /// /// Mailboxes /// diff --git a/Core/Requests/GetNonIndexableItemStatisticsRequest.cs b/Core/Requests/GetNonIndexableItemStatisticsRequest.cs index cd60a0fa..468cbc47 100644 --- a/Core/Requests/GetNonIndexableItemStatisticsRequest.cs +++ b/Core/Requests/GetNonIndexableItemStatisticsRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetNonIndexableItemStatisticsRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -17,7 +32,7 @@ namespace Microsoft.Exchange.WebServices.Data /// /// Represents a GetNonIndexableItemStatisticsRequest request. /// - internal sealed class GetNonIndexableItemStatisticsRequest : SimpleServiceRequestBase, IJsonSerializable + internal sealed class GetNonIndexableItemStatisticsRequest : SimpleServiceRequestBase { /// /// Initializes a new instance of the class. @@ -107,20 +122,6 @@ internal GetNonIndexableItemStatisticsResponse Execute() return serviceResponse; } - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object IJsonSerializable.ToJson(ExchangeService service) - { - JsonObject jsonObject = new JsonObject(); - - return jsonObject; - } - /// /// Mailboxes /// diff --git a/Core/Requests/GetOMEConfigurationRequest.cs b/Core/Requests/GetOMEConfigurationRequest.cs new file mode 100644 index 00000000..251e2d7c --- /dev/null +++ b/Core/Requests/GetOMEConfigurationRequest.cs @@ -0,0 +1,101 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + /// + /// Represents a GetOMEConfiguration request. + /// + internal sealed class GetOMEConfigurationRequest : SimpleServiceRequestBase + { + /// + /// Initializes a new instance of the class. + /// + /// The service. + internal GetOMEConfigurationRequest(ExchangeService service) + : base(service) + { + } + + /// + /// Gets the name of the XML element. + /// + /// XML element name, + internal override string GetXmlElementName() + { + return XmlElementNames.GetOMEConfigurationRequest; + } + + /// + /// Writes XML elements. + /// + /// The writer. + internal override void WriteElementsToXml(EwsServiceXmlWriter writer) + { + // Don't have parameters in request + } + + /// + /// Gets the name of the response XML element. + /// + /// XML element name, + internal override string GetResponseXmlElementName() + { + return XmlElementNames.GetOMEConfigurationResponse; + } + + /// + /// Parses the response. + /// + /// The reader. + /// Response object. + internal override object ParseResponse(EwsServiceXmlReader reader) + { + GetOMEConfigurationResponse response = new GetOMEConfigurationResponse(); + response.LoadFromXml(reader, XmlElementNames.GetOMEConfigurationResponse); + return response; + } + + /// + /// Gets the request version. + /// + /// Earliest Exchange version in which this request is supported. + internal override ExchangeVersion GetMinimumRequiredServerVersion() + { + return ExchangeVersion.Exchange2013; + } + + /// + /// Executes this request. + /// + /// Service response. + internal GetOMEConfigurationResponse Execute() + { + GetOMEConfigurationResponse serviceResponse = (GetOMEConfigurationResponse)this.InternalExecute(); + serviceResponse.ThrowIfNecessary(); + return serviceResponse; + } + } +} \ No newline at end of file diff --git a/Core/Requests/GetPasswordExpirationDateRequest.cs b/Core/Requests/GetPasswordExpirationDateRequest.cs index fe057765..19c1ce19 100644 --- a/Core/Requests/GetPasswordExpirationDateRequest.cs +++ b/Core/Requests/GetPasswordExpirationDateRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetPasswordExpirationDateRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -16,7 +31,7 @@ namespace Microsoft.Exchange.WebServices.Data /// /// Represents a GetPasswordExpirationDate request. /// - internal sealed class GetPasswordExpirationDateRequest : SimpleServiceRequestBase, IJsonSerializable + internal sealed class GetPasswordExpirationDateRequest : SimpleServiceRequestBase { /// /// Initializes a new instance of the class. @@ -45,21 +60,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) writer.WriteElementValue(XmlNamespace.Messages, XmlElementNames.MailboxSmtpAddress, this.MailboxSmtpAddress); } - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object IJsonSerializable.ToJson(ExchangeService service) - { - JsonObject jsonRequest = new JsonObject(); - - jsonRequest.Add(XmlElementNames.MailboxSmtpAddress, this.MailboxSmtpAddress); - return jsonRequest; - } - /// /// Gets the name of the response XML element. /// @@ -81,18 +81,6 @@ internal override object ParseResponse(EwsServiceXmlReader reader) return response; } - /// - /// Parses the response. - /// - /// The json body. - /// Response object. - internal override object ParseResponse(JsonObject jsonBody) - { - GetPasswordExpirationDateResponse serviceResponse = new GetPasswordExpirationDateResponse(); - serviceResponse.LoadFromJson(jsonBody, this.Service); - return serviceResponse; - } - /// /// Gets the request version. /// diff --git a/Core/Requests/GetPeopleInsightsRequest.cs b/Core/Requests/GetPeopleInsightsRequest.cs new file mode 100644 index 00000000..4f2b0d3a --- /dev/null +++ b/Core/Requests/GetPeopleInsightsRequest.cs @@ -0,0 +1,136 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Text; + + using Microsoft.Exchange.WebServices.Data.Enumerations; + + /// + /// Represents a GetPeopleInsights request. + /// + internal sealed class GetPeopleInsightsRequest : SimpleServiceRequestBase + { + /// + /// Initializes a new instance of the class. + /// + /// The service + internal GetPeopleInsightsRequest(ExchangeService service) + : base(service) + { + this.Emailaddresses = new List(); + } + + /// + /// Gets the collection of Emailaddress. + /// + internal List Emailaddresses + { + get; + set; + } + + /// + /// Validate the request + /// + internal override void Validate() + { + base.Validate(); + + // TODO - Validate each emailaddress + EwsUtilities.ValidateParamCollection(this.Emailaddresses, "EmailAddresses"); + } + + /// + /// Gets the name of the XML element. + /// + /// XML element name. + internal override string GetXmlElementName() + { + return XmlElementNames.GetPeopleInsights; + } + + /// + /// Writes XML elements for GetPeopleInsights request + /// + /// The writer. + internal override void WriteElementsToXml(EwsServiceXmlWriter writer) + { + writer.WriteStartElement(XmlNamespace.Messages, XmlElementNames.EmailAddresses); + + foreach (string emailAddress in this.Emailaddresses) + { + writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.String, emailAddress); + } + + writer.WriteEndElement(); + } + + /// + /// Gets the name of the response XML element. + /// + /// XML element name. + internal override string GetResponseXmlElementName() + { + return XmlElementNames.GetPeopleInsightsResponse; + } + + /// + /// Parses the response. + /// + /// The reader. + /// Response object. + internal override object ParseResponse(EwsServiceXmlReader reader) + { + GetPeopleInsightsResponse response = new GetPeopleInsightsResponse(); + response.LoadFromXml(reader, XmlElementNames.GetPeopleInsightsResponse); + return response; + } + + /// + /// Gets the request version. + /// + /// Earliest Exchange version in which this request is supported. + internal override ExchangeVersion GetMinimumRequiredServerVersion() + { + return ExchangeVersion.Exchange2013_SP1; + } + + /// + /// Executes this request. + /// + /// Service response. + internal GetPeopleInsightsResponse Execute() + { + GetPeopleInsightsResponse serviceResponse = (GetPeopleInsightsResponse)this.InternalExecute(); + serviceResponse.ThrowIfNecessary(); + return serviceResponse; + } + } +} \ No newline at end of file diff --git a/Core/Requests/GetPhoneCallRequest.cs b/Core/Requests/GetPhoneCallRequest.cs index e34321b4..724e9d5f 100644 --- a/Core/Requests/GetPhoneCallRequest.cs +++ b/Core/Requests/GetPhoneCallRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetPhoneCallRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Core/Requests/GetRequest.cs b/Core/Requests/GetRequest.cs index 96c2451a..e747f85a 100644 --- a/Core/Requests/GetRequest.cs +++ b/Core/Requests/GetRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -19,7 +34,7 @@ namespace Microsoft.Exchange.WebServices.Data /// /// The type of the service object. /// The type of the response. - internal abstract class GetRequest : MultiResponseServiceRequest, IJsonSerializable + internal abstract class GetRequest : MultiResponseServiceRequest where TServiceObject : ServiceObject where TResponse : ServiceResponse { @@ -69,24 +84,5 @@ public PropertySet PropertySet get { return this.propertySet; } set { this.propertySet = value; } } - - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object IJsonSerializable.ToJson(ExchangeService service) - { - JsonObject jsonRequest = new JsonObject(); - - this.propertySet.WriteGetShapeToJson(jsonRequest, service, this.GetServiceObjectType()); - this.AddIdsToRequest(jsonRequest, service); - - return jsonRequest; - } - - internal abstract void AddIdsToRequest(JsonObject jsonRequest, ExchangeService service); } -} +} \ No newline at end of file diff --git a/Core/Requests/GetRoomListsRequest.cs b/Core/Requests/GetRoomListsRequest.cs index 8506f199..70932765 100644 --- a/Core/Requests/GetRoomListsRequest.cs +++ b/Core/Requests/GetRoomListsRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetUserAvailabilityRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -87,4 +102,4 @@ internal GetRoomListsResponse Execute() return serviceResponse; } } -} +} \ No newline at end of file diff --git a/Core/Requests/GetRoomsRequest.cs b/Core/Requests/GetRoomsRequest.cs index d296781f..a771a272 100644 --- a/Core/Requests/GetRoomsRequest.cs +++ b/Core/Requests/GetRoomsRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetPhoneCallRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Core/Requests/GetSearchableMailboxesRequest.cs b/Core/Requests/GetSearchableMailboxesRequest.cs index 2c9a502f..33d50324 100644 --- a/Core/Requests/GetSearchableMailboxesRequest.cs +++ b/Core/Requests/GetSearchableMailboxesRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetSearchableMailboxesRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -17,7 +32,7 @@ namespace Microsoft.Exchange.WebServices.Data /// /// Represents a GetSearchableMailboxesRequest request. /// - internal sealed class GetSearchableMailboxesRequest : SimpleServiceRequestBase, IJsonSerializable + internal sealed class GetSearchableMailboxesRequest : SimpleServiceRequestBase { /// /// Initializes a new instance of the class. @@ -87,20 +102,6 @@ internal GetSearchableMailboxesResponse Execute() return serviceResponse; } - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object IJsonSerializable.ToJson(ExchangeService service) - { - JsonObject jsonObject = new JsonObject(); - - return jsonObject; - } - /// /// Search filter /// diff --git a/Core/Requests/GetServerTimeZonesRequest.cs b/Core/Requests/GetServerTimeZonesRequest.cs index 53a81b63..e2c0a47f 100644 --- a/Core/Requests/GetServerTimeZonesRequest.cs +++ b/Core/Requests/GetServerTimeZonesRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetServerTimeZonesRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Core/Requests/GetStreamingEventsRequest.cs b/Core/Requests/GetStreamingEventsRequest.cs index 239e5019..942696ed 100644 --- a/Core/Requests/GetStreamingEventsRequest.cs +++ b/Core/Requests/GetStreamingEventsRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetStreamingEventsRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -122,4 +137,4 @@ internal static int HeartbeatFrequency } #endregion } -} +} \ No newline at end of file diff --git a/Core/Requests/GetUserAvailabilityRequest.cs b/Core/Requests/GetUserAvailabilityRequest.cs index 86c25caf..490da3cf 100644 --- a/Core/Requests/GetUserAvailabilityRequest.cs +++ b/Core/Requests/GetUserAvailabilityRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetUserAvailabilityRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -223,4 +238,4 @@ public AvailabilityOptions Options set { this.options = value; } } } -} +} \ No newline at end of file diff --git a/Core/Requests/GetUserConfigurationRequest.cs b/Core/Requests/GetUserConfigurationRequest.cs index d6a08b4f..8edc6f4d 100644 --- a/Core/Requests/GetUserConfigurationRequest.cs +++ b/Core/Requests/GetUserConfigurationRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetUserConfigurationRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -17,7 +32,7 @@ namespace Microsoft.Exchange.WebServices.Data /// /// Represents a GetUserConfiguration request. /// - internal class GetUserConfigurationRequest : MultiResponseServiceRequest, IJsonSerializable + internal class GetUserConfigurationRequest : MultiResponseServiceRequest { private const string EnumDelimiter = ","; private string name; @@ -121,23 +136,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) this.properties.ToString().Replace(EnumDelimiter, string.Empty)); } - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object IJsonSerializable.ToJson(ExchangeService service) - { - JsonObject jsonObject = new JsonObject(); - - jsonObject.Add(XmlElementNames.UserConfigurationName, UserConfiguration.GetJsonUserConfigName(service, this.parentFolderId, this.name)); - jsonObject.Add(XmlElementNames.UserConfigurationProperties, this.properties.ToString().Replace(EnumDelimiter, string.Empty)); - - return jsonObject; - } - /// /// Initializes a new instance of the class. /// @@ -194,4 +192,4 @@ internal UserConfigurationProperties Properties set { this.properties = value; } } } -} +} \ No newline at end of file diff --git a/Core/Requests/GetUserOofSettingsRequest.cs b/Core/Requests/GetUserOofSettingsRequest.cs index 797787c5..69efd5ea 100644 --- a/Core/Requests/GetUserOofSettingsRequest.cs +++ b/Core/Requests/GetUserOofSettingsRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetUserOofSettingsRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -126,4 +141,4 @@ internal string SmtpAddress set { this.smtpAddress = value; } } } -} +} \ No newline at end of file diff --git a/Core/Requests/GetUserPhotoRequest.cs b/Core/Requests/GetUserPhotoRequest.cs new file mode 100644 index 00000000..340b7a8e --- /dev/null +++ b/Core/Requests/GetUserPhotoRequest.cs @@ -0,0 +1,224 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + using System; + using System.Net; + using Microsoft.Exchange.WebServices.Data; + + /// + /// Represents a request of a get user photo operation + /// + internal sealed class GetUserPhotoRequest : SimpleServiceRequestBase + { + /// + /// Default constructor + /// + /// Exchange web service + internal GetUserPhotoRequest(ExchangeService service) + : base(service) + { + } + + /// + /// email address accessor + /// + internal string EmailAddress { get; set; } + + /// + /// user photo size accessor + /// + internal string UserPhotoSize { get; set; } + + /// + /// EntityTag accessor + /// + internal string EntityTag { get; set; } + + /// + /// Creates a NotFound instance of the result + /// + /// The canonical NotFound result + internal static GetUserPhotoResponse GetNotFoundResponse() + { + GetUserPhotoResponse serviceResponse = new GetUserPhotoResponse(); + serviceResponse.Results.Status = GetUserPhotoStatus.PhotoOrUserNotFound; + + return serviceResponse; + } + + /// + /// Validate request. + /// + internal override void Validate() + { + if (string.IsNullOrEmpty(this.EmailAddress)) + { + throw new ServiceLocalException(Strings.InvalidEmailAddress); + } + + if (string.IsNullOrEmpty(this.UserPhotoSize)) + { + throw new ServiceLocalException(Strings.UserPhotoSizeNotSpecified); + } + + base.Validate(); + } + + /// + /// Writes XML attributes. + /// + /// The writer. + internal override void WriteAttributesToXml(EwsServiceXmlWriter writer) + { + base.WriteAttributesToXml(writer); + } + + /// + /// Writes XML elements. + /// + /// The writer. + internal override void WriteElementsToXml(EwsServiceXmlWriter writer) + { + // Emit the EmailAddress element + writer.WriteStartElement(XmlNamespace.Messages, XmlElementNames.Email); + writer.WriteValue(this.EmailAddress, XmlElementNames.Email); + writer.WriteEndElement(); + + writer.WriteStartElement(XmlNamespace.Messages, XmlElementNames.SizeRequested); + writer.WriteValue(this.UserPhotoSize, XmlElementNames.SizeRequested); + writer.WriteEndElement(); + } + + /// + /// Adds header values to the request + /// + /// The collection of headers to add to + internal override void AddHeaders(WebHeaderCollection webHeaderCollection) + { + // Check if the ETag was specified + if (!string.IsNullOrEmpty(this.EntityTag)) + { + // Ensure the ETag is wrapped in quotes + string quotedETag = this.EntityTag; + if (!this.EntityTag.StartsWith("\"")) + { + quotedETag = "\"" + quotedETag; + } + if (!this.EntityTag.EndsWith("\"")) + { + quotedETag = quotedETag + "\""; + } + + webHeaderCollection[HttpRequestHeader.IfNoneMatch] = quotedETag; + } + } + + /// + /// Parses the response. + /// + /// The reader. + /// The HTTP response headers + /// Response object. + internal override object ParseResponse(EwsServiceXmlReader reader, WebHeaderCollection responseHeaders) + { + GetUserPhotoResponse response = new GetUserPhotoResponse(); + response.LoadFromXml(reader, XmlElementNames.GetUserPhotoResponse); + response.ReadHeader(responseHeaders); + return response; + } + + /// + /// Gets the name of the XML element. + /// + /// XML element name. + internal override string GetXmlElementName() + { + return XmlElementNames.GetUserPhoto; + } + + /// + /// Gets the name of the response XML element. + /// + /// XML element name. + internal override string GetResponseXmlElementName() + { + return XmlElementNames.GetUserPhotoResponse; + } + + /// + /// Gets the request version. + /// + /// Earliest Exchange version in which this request is supported. + internal override ExchangeVersion GetMinimumRequiredServerVersion() + { + return ExchangeVersion.Exchange2013; + } + + /// + /// Executes this request. + /// + /// Service response. + internal GetUserPhotoResponse Execute() + { + return GetUserPhotoRequest.GetResultOrDefault(this.InternalExecute); + } + + /// + /// Ends executing this async request. + /// + /// The async result + /// Service response collection. + internal GetUserPhotoResponse EndExecute(IAsyncResult asyncResult) + { + return GetUserPhotoRequest.GetResultOrDefault(() => this.EndInternalExecute(asyncResult)); + } + + private static GetUserPhotoResponse GetResultOrDefault(Func serviceResponseFactory) + { + try + { + return (GetUserPhotoResponse)serviceResponseFactory(); + } + catch (ServiceRequestException ex) + { + // 404 is a valid return code in the case of GetUserPhoto when the photo is + // not found, so it is necessary to catch this exception here. + WebException webException = ex.InnerException as WebException; + if (webException != null) + { + HttpWebResponse errorResponse = webException.Response as HttpWebResponse; + if (errorResponse != null && errorResponse.StatusCode == HttpStatusCode.NotFound) + { + return GetUserPhotoRequest.GetNotFoundResponse(); + } + } + + throw; + } + } + } +} \ No newline at end of file diff --git a/Core/Requests/GetUserRetentionPolicyTagsRequest.cs b/Core/Requests/GetUserRetentionPolicyTagsRequest.cs index 312a3259..ea31cd61 100644 --- a/Core/Requests/GetUserRetentionPolicyTagsRequest.cs +++ b/Core/Requests/GetUserRetentionPolicyTagsRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetUserRetentionPolicyTagsRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -16,7 +31,7 @@ namespace Microsoft.Exchange.WebServices.Data /// /// Represents a GetUserRetentionPolicyTagsRequest request. /// - internal sealed class GetUserRetentionPolicyTagsRequest : SimpleServiceRequestBase, IJsonSerializable + internal sealed class GetUserRetentionPolicyTagsRequest : SimpleServiceRequestBase { /// /// Initializes a new instance of the class. @@ -84,19 +99,5 @@ internal GetUserRetentionPolicyTagsResponse Execute() GetUserRetentionPolicyTagsResponse serviceResponse = (GetUserRetentionPolicyTagsResponse)this.InternalExecute(); return serviceResponse; } - - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object IJsonSerializable.ToJson(ExchangeService service) - { - JsonObject jsonObject = new JsonObject(); - - return jsonObject; - } } } \ No newline at end of file diff --git a/Core/Requests/HangingServiceRequestBase.cs b/Core/Requests/HangingServiceRequestBase.cs index c68c00da..b53881cf 100644 --- a/Core/Requests/HangingServiceRequestBase.cs +++ b/Core/Requests/HangingServiceRequestBase.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the HangingServiceRequestBase class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -194,7 +209,7 @@ private void ParseResponses(object state) { try { - responseObject = this.ReadResponse(ewsXmlReader); + responseObject = this.ReadResponse(ewsXmlReader, this.response.Headers); } finally { @@ -208,7 +223,7 @@ private void ParseResponses(object state) } else { - responseObject = this.ReadResponse(ewsXmlReader); + responseObject = this.ReadResponse(ewsXmlReader, this.response.Headers); } this.responseHandler(responseObject); diff --git a/Core/Requests/InstallAppRequest.cs b/Core/Requests/InstallAppRequest.cs index 566b9f24..73fb1090 100644 --- a/Core/Requests/InstallAppRequest.cs +++ b/Core/Requests/InstallAppRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the InstallAppRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Core/Requests/MarkAllItemsAsReadRequest.cs b/Core/Requests/MarkAllItemsAsReadRequest.cs index a428c44e..a370beb8 100644 --- a/Core/Requests/MarkAllItemsAsReadRequest.cs +++ b/Core/Requests/MarkAllItemsAsReadRequest.cs @@ -1,19 +1,34 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the MarkAllItemsAsReadRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { /// /// Represents an MarkAllItemsAsRead request. /// - internal sealed class MarkAllItemsAsReadRequest : MultiResponseServiceRequest, IJsonSerializable + internal sealed class MarkAllItemsAsReadRequest : MultiResponseServiceRequest { private FolderIdWrapperList folderIds = new FolderIdWrapperList(); @@ -99,24 +114,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) XmlElementNames.FolderIds); } - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object IJsonSerializable.ToJson(ExchangeService service) - { - JsonObject body = new JsonObject(); - - body.Add(XmlElementNames.ReadFlag, this.ReadFlag); - body.Add(XmlElementNames.SuppressReadReceipts, this.SuppressReadReceipts); - body.Add(XmlElementNames.FolderIds, this.FolderIds.InternalToJson(this.Service)); - - return body; - } - /// /// Gets the request version. /// @@ -152,4 +149,4 @@ internal bool SuppressReadReceipts set; } } -} +} \ No newline at end of file diff --git a/Core/Requests/MarkAsJunkRequest.cs b/Core/Requests/MarkAsJunkRequest.cs index 73ab152c..9f517854 100644 --- a/Core/Requests/MarkAsJunkRequest.cs +++ b/Core/Requests/MarkAsJunkRequest.cs @@ -1,8 +1,27 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -13,7 +32,7 @@ namespace Microsoft.Exchange.WebServices.Data /// /// Definition for MarkAsJunkRequest /// - internal sealed class MarkAsJunkRequest : MultiResponseServiceRequest, IJsonSerializable + internal sealed class MarkAsJunkRequest : MultiResponseServiceRequest { private ItemIdWrapperList itemIds = new ItemIdWrapperList(); @@ -102,20 +121,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) this.itemIds.WriteToXml(writer, XmlNamespace.Messages, XmlElementNames.ItemIds); } - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object IJsonSerializable.ToJson(ExchangeService service) - { - JsonObject jsonRequest = new JsonObject(); - jsonRequest.Add(XmlElementNames.ItemIds, this.ItemIds.InternalToJson(service)); - return jsonRequest; - } - /// /// Gets the request version. /// diff --git a/Core/Requests/MoveCopyFolderRequest.cs b/Core/Requests/MoveCopyFolderRequest.cs index d9fd0959..9c7d194f 100644 --- a/Core/Requests/MoveCopyFolderRequest.cs +++ b/Core/Requests/MoveCopyFolderRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the MoveCopyFolderRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -55,19 +70,6 @@ internal override void WriteIdsToXml(EwsServiceXmlWriter writer) XmlElementNames.FolderIds); } - /// - /// Adds the ids to json. - /// - /// The json object. - /// The service. - internal override void AddIdsToJson(JsonObject jsonObject, ExchangeService service) - { - if (this.folderIds.Count > 0) - { - jsonObject.Add(XmlElementNames.FolderIds, this.folderIds.InternalToJson(service)); - } - } - /// /// Gets the expected response message count. /// @@ -86,4 +88,4 @@ internal FolderIdWrapperList FolderIds get { return this.folderIds; } } } -} +} \ No newline at end of file diff --git a/Core/Requests/MoveCopyItemRequest.cs b/Core/Requests/MoveCopyItemRequest.cs index 402eadc9..e23ab37d 100644 --- a/Core/Requests/MoveCopyItemRequest.cs +++ b/Core/Requests/MoveCopyItemRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the MoveCopyItemRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -62,23 +77,6 @@ internal override void WriteIdsToXml(EwsServiceXmlWriter writer) } } - /// - /// Adds the ids to json. - /// - /// The json object. - /// The service. - internal override void AddIdsToJson(JsonObject jsonObject, ExchangeService service) - { - jsonObject.Add(XmlElementNames.ItemIds, this.ItemIds.InternalToJson(service)); - - if (this.ReturnNewItemIds.HasValue) - { - jsonObject.Add( - XmlElementNames.ReturnNewItemIds, - this.ReturnNewItemIds.Value); - } - } - /// /// Gets the expected response message count. /// @@ -105,4 +103,4 @@ internal bool? ReturnNewItemIds get; set; } } -} +} \ No newline at end of file diff --git a/Core/Requests/MoveCopyRequest.cs b/Core/Requests/MoveCopyRequest.cs index 387aeaa4..fea2ef2d 100644 --- a/Core/Requests/MoveCopyRequest.cs +++ b/Core/Requests/MoveCopyRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the MoveCopyRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -19,7 +34,7 @@ namespace Microsoft.Exchange.WebServices.Data /// /// The type of the service object. /// The type of the response. - internal abstract class MoveCopyRequest : MultiResponseServiceRequest, IJsonSerializable + internal abstract class MoveCopyRequest : MultiResponseServiceRequest where TServiceObject : ServiceObject where TResponse : ServiceResponse { @@ -72,33 +87,5 @@ public FolderId DestinationFolderId get { return this.destinationFolderId; } set { this.destinationFolderId = value; } } - - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object IJsonSerializable.ToJson(ExchangeService service) - { - JsonObject jsonObject = new JsonObject(); - - JsonObject jsonToFolderId = new JsonObject(); - jsonToFolderId.Add(XmlElementNames.BaseFolderId, this.DestinationFolderId.InternalToJson(service)); - - jsonObject.Add(XmlElementNames.ToFolderId, jsonToFolderId); - - this.AddIdsToJson(jsonObject, service); - - return jsonObject; - } - - /// - /// Adds the ids to json. - /// - /// The json object. - /// The service. - internal abstract void AddIdsToJson(JsonObject jsonObject, ExchangeService service); } -} +} \ No newline at end of file diff --git a/Core/Requests/MoveFolderRequest.cs b/Core/Requests/MoveFolderRequest.cs index fa8c5077..3f25a9f4 100644 --- a/Core/Requests/MoveFolderRequest.cs +++ b/Core/Requests/MoveFolderRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the MoveFolderRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -76,4 +91,4 @@ internal override ExchangeVersion GetMinimumRequiredServerVersion() return ExchangeVersion.Exchange2007_SP1; } } -} +} \ No newline at end of file diff --git a/Core/Requests/MoveItemRequest.cs b/Core/Requests/MoveItemRequest.cs index 794c52e6..4a6265c2 100644 --- a/Core/Requests/MoveItemRequest.cs +++ b/Core/Requests/MoveItemRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the MoveItemRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -76,4 +91,4 @@ internal override ExchangeVersion GetMinimumRequiredServerVersion() return ExchangeVersion.Exchange2007_SP1; } } -} +} \ No newline at end of file diff --git a/Core/Requests/MultiResponseServiceRequest.cs b/Core/Requests/MultiResponseServiceRequest.cs index 41149ff4..3853ae3b 100644 --- a/Core/Requests/MultiResponseServiceRequest.cs +++ b/Core/Requests/MultiResponseServiceRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the MultiResponseServiceRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -53,7 +68,7 @@ internal override object ParseResponse(EwsServiceXmlReader reader) // If there's a general error in batch processing, // the server will return a single response message containing the error // (for example, if the SavedItemFolderId is bogus in a batch CreateItem - // call). In this case, throw a ServiceResponsException. Otherwise this + // call). In this case, throw a ServiceResponseException. Otherwise this // is an unexpected server error. if (serviceResponses.Count < this.GetExpectedResponseMessageCount()) { @@ -77,46 +92,6 @@ internal override object ParseResponse(EwsServiceXmlReader reader) return serviceResponses; } - /// - /// Parses the response. - /// - /// The json body. - /// Response object. - internal override object ParseResponse(JsonObject jsonBody) - { - ServiceResponseCollection serviceResponses = new ServiceResponseCollection(); - - object[] jsonResponseMessages = jsonBody.ReadAsJsonObject(XmlElementNames.ResponseMessages).ReadAsArray(XmlElementNames.Items); - - int responseCtr = 0; - foreach (object jsonResponseObject in jsonResponseMessages) - { - TResponse response = this.CreateServiceResponse(this.Service, responseCtr); - - response.LoadFromJson(jsonResponseObject as JsonObject, this.Service); - - // Add the response to the list after it has been deserialized because the response - // list updates an overall result as individual responses are added to it. - serviceResponses.Add(response); - - responseCtr++; - } - - if (serviceResponses.Count < this.GetExpectedResponseMessageCount()) - { - if ((serviceResponses.Count == 1) && (serviceResponses[0].Result == ServiceResult.Error)) - { - throw new ServiceResponseException(serviceResponses[0]); - } - else - { - throw new ServiceJsonDeserializationException(); - } - } - - return serviceResponses; - } - /// /// Creates the service response. /// @@ -199,4 +174,4 @@ internal ServiceErrorHandling ErrorHandlingMode get { return this.errorHandlingMode; } } } -} +} \ No newline at end of file diff --git a/Core/Requests/PlayOnPhoneRequest.cs b/Core/Requests/PlayOnPhoneRequest.cs index 7269af1c..ee6528f4 100644 --- a/Core/Requests/PlayOnPhoneRequest.cs +++ b/Core/Requests/PlayOnPhoneRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the PlayOnPhoneRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -17,7 +32,7 @@ namespace Microsoft.Exchange.WebServices.Data /// /// Represents a PlayOnPhone request. /// - internal sealed class PlayOnPhoneRequest : SimpleServiceRequestBase, IJsonSerializable + internal sealed class PlayOnPhoneRequest : SimpleServiceRequestBase { private ItemId itemId; private string dialString; @@ -50,23 +65,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) writer.WriteElementValue(XmlNamespace.Messages, XmlElementNames.DialString, dialString); } - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object IJsonSerializable.ToJson(ExchangeService service) - { - JsonObject jsonRequest = new JsonObject(); - - jsonRequest.Add(XmlElementNames.ItemId, this.ItemId.InternalToJson(service)); - jsonRequest.Add(XmlElementNames.DialString, this.dialString); - - return jsonRequest; - } - /// /// Gets the name of the response XML element. /// @@ -88,18 +86,6 @@ internal override object ParseResponse(EwsServiceXmlReader reader) return serviceResponse; } - /// - /// Parses the response. - /// - /// The json body. - /// Response object. - internal override object ParseResponse(JsonObject jsonBody) - { - PlayOnPhoneResponse serviceResponse = new PlayOnPhoneResponse(this.Service); - serviceResponse.LoadFromJson(jsonBody, this.Service); - return serviceResponse; - } - /// /// Gets the request version. /// diff --git a/Core/Requests/RegisterConsentRequest.cs b/Core/Requests/RegisterConsentRequest.cs new file mode 100644 index 00000000..4c79a7e3 --- /dev/null +++ b/Core/Requests/RegisterConsentRequest.cs @@ -0,0 +1,131 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Text; + + using Microsoft.Exchange.WebServices.Data.Enumerations; + + /// + /// Represents a RegisterConsent request. + /// + internal sealed class RegisterConsentRequest : SimpleServiceRequestBase + { + /// + /// Initializes a new instance of the class. + /// + /// The service. + /// Extension id. + /// Sets the consent state of an extension. + internal RegisterConsentRequest(ExchangeService service, string id, ConsentState state) + : base(service) + { + this.Id = id; + this.ConsentState = state; + } + + /// + /// Extension id + /// + private string Id + { + get; + set; + } + + /// + /// User decision on the consent state of an extension + /// + private ConsentState ConsentState + { + get; + set; + } + + /// + /// Gets the name of the XML element. + /// + /// XML element name. + internal override string GetXmlElementName() + { + return XmlElementNames.DisableAppRequest; + } + + /// + /// Writes XML elements. + /// + /// The writer. + internal override void WriteElementsToXml(EwsServiceXmlWriter writer) + { + writer.WriteElementValue(XmlNamespace.Messages, XmlElementNames.ID, this.Id); + writer.WriteElementValue(XmlNamespace.Messages, XmlElementNames.AcceptanceState, this.ConsentState); + } + + /// + /// Gets the name of the response XML element. + /// + /// XML element name. + internal override string GetResponseXmlElementName() + { + return XmlElementNames.RegisterConsentResponse; + } + + /// + /// Parses the response. + /// + /// The reader. + /// Response object. + internal override object ParseResponse(EwsServiceXmlReader reader) + { + RegisterConsentResponse response = new RegisterConsentResponse(); + response.LoadFromXml(reader, XmlElementNames.RegisterConsentResponse); + return response; + } + + /// + /// Gets the request version. + /// + /// Earliest Exchange version in which this request is supported. + internal override ExchangeVersion GetMinimumRequiredServerVersion() + { + return ExchangeVersion.Exchange2013_SP1; + } + + /// + /// Executes this request. + /// + /// Service response. + internal RegisterConsentResponse Execute() + { + RegisterConsentResponse serviceResponse = (RegisterConsentResponse)this.InternalExecute(); + serviceResponse.ThrowIfNecessary(); + return serviceResponse; + } + } +} \ No newline at end of file diff --git a/Core/Requests/RemoveDelegateRequest.cs b/Core/Requests/RemoveDelegateRequest.cs index 1479c9f8..b44ac619 100644 --- a/Core/Requests/RemoveDelegateRequest.cs +++ b/Core/Requests/RemoveDelegateRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the RemoveDelegateRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -100,4 +115,4 @@ public List UserIds get { return this.userIds; } } } -} +} \ No newline at end of file diff --git a/Core/Requests/ResolveNamesRequest.cs b/Core/Requests/ResolveNamesRequest.cs index 2c4ade00..186dfd1d 100644 --- a/Core/Requests/ResolveNamesRequest.cs +++ b/Core/Requests/ResolveNamesRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ResolveNamesRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -15,7 +30,7 @@ namespace Microsoft.Exchange.WebServices.Data /// /// Represents a ResolveNames request. /// - internal sealed class ResolveNamesRequest : MultiResponseServiceRequest, IJsonSerializable + internal sealed class ResolveNamesRequest : MultiResponseServiceRequest { private static LazyMember> searchScopeMap = new LazyMember>( delegate @@ -153,50 +168,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) this.NameToResolve); } - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object IJsonSerializable.ToJson(ExchangeService service) - { - JsonObject jsonRequest = new JsonObject(); - - if (this.ParentFolderIds.Count > 0) - { - jsonRequest.Add(XmlElementNames.ParentFolderIds, this.ParentFolderIds.InternalToJson(service)); - } - jsonRequest.Add(XmlElementNames.UnresolvedEntry, this.NameToResolve); - jsonRequest.Add(XmlAttributeNames.ReturnFullContactData, this.ReturnFullContactData); - - string searchScope = null; - - searchScopeMap.Member.TryGetValue(this.SearchLocation, out searchScope); - - EwsUtilities.Assert( - !string.IsNullOrEmpty(searchScope), - "ResolveNameRequest.ToJson", - "The specified search location cannot be mapped to an EWS search scope."); - - string propertySet = null; - if (this.contactDataPropertySet != null) - { - PropertySet.DefaultPropertySetMap.Member.TryGetValue(this.contactDataPropertySet.BasePropertySet, out propertySet); - } - if (!this.Service.Exchange2007CompatibilityMode) - { - jsonRequest.Add(XmlAttributeNames.SearchScope, searchScope); - } - if (!string.IsNullOrEmpty(propertySet)) - { - jsonRequest.Add(XmlAttributeNames.ContactDataShape, propertySet); - } - - return jsonRequest; - } - /// /// Gets the request version. /// @@ -257,4 +228,4 @@ public FolderIdWrapperList ParentFolderIds get { return this.parentFolderIds; } } } -} +} \ No newline at end of file diff --git a/Core/Requests/SearchMailboxesRequest.cs b/Core/Requests/SearchMailboxesRequest.cs index fc9806ce..35275181 100644 --- a/Core/Requests/SearchMailboxesRequest.cs +++ b/Core/Requests/SearchMailboxesRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SearchMailboxesRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -17,7 +32,7 @@ namespace Microsoft.Exchange.WebServices.Data /// /// Represents a SearchMailboxesRequest request. /// - internal sealed class SearchMailboxesRequest : MultiResponseServiceRequest, IJsonSerializable, IDiscoveryVersionable + internal sealed class SearchMailboxesRequest : MultiResponseServiceRequest, IDiscoveryVersionable { private List searchQueries = new List(); private SearchResultType searchResultType = SearchResultType.PreviewOnly; @@ -177,28 +192,6 @@ internal override object ParseResponse(EwsServiceXmlReader reader) return serviceResponses; } - /// - /// Parses the response. - /// See O15:324151 on why we need to override ParseResponse here instead of calling the one in MultiResponseServiceRequest.cs - /// - /// The json body. - /// Response object. - internal override object ParseResponse(JsonObject jsonBody) - { - ServiceResponseCollection serviceResponses = new ServiceResponseCollection(); - - object[] jsonResponseMessages = jsonBody.ReadAsJsonObject(XmlElementNames.ResponseMessages).ReadAsArray(XmlElementNames.Items); - - foreach (object jsonResponseObject in jsonResponseMessages) - { - SearchMailboxesResponse response = new SearchMailboxesResponse(); - response.LoadFromJson(jsonResponseObject as JsonObject, this.Service); - serviceResponses.Add(response); - } - - return serviceResponses; - } - /// /// Writes XML elements. /// @@ -213,7 +206,7 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) writer.WriteStartElement(XmlNamespace.Types, XmlElementNames.MailboxSearchScopes); foreach (MailboxSearchScope mailboxSearchScope in mailboxQuery.MailboxSearchScopes) { - // The checks here silently downgrade the schema based on compatability checks, to recieve errors use the validate method + // The checks here silently downgrade the schema based on compatibility checks, to receive errors use the validate method if (mailboxSearchScope.SearchScopeType == MailboxSearchScopeType.LegacyExchangeDN || DiscoverySchemaChanges.SearchMailboxesAdditionalSearchScopes.IsCompatible(this)) { writer.WriteStartElement(XmlNamespace.Types, XmlElementNames.MailboxSearchScope); @@ -316,20 +309,6 @@ internal override ExchangeVersion GetMinimumRequiredServerVersion() return ExchangeVersion.Exchange2013; } - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object IJsonSerializable.ToJson(ExchangeService service) - { - JsonObject jsonObject = new JsonObject(); - - return jsonObject; - } - /// /// Collection of query + mailboxes /// diff --git a/Core/Requests/SendItemRequest.cs b/Core/Requests/SendItemRequest.cs index 69607f1a..b228afac 100644 --- a/Core/Requests/SendItemRequest.cs +++ b/Core/Requests/SendItemRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SendItemRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -17,7 +32,7 @@ namespace Microsoft.Exchange.WebServices.Data /// /// Represents a SendItem request. /// - internal sealed class SendItemRequest : MultiResponseServiceRequest, IJsonSerializable + internal sealed class SendItemRequest : MultiResponseServiceRequest { private IEnumerable items; private FolderId savedCopyDestinationFolderId; @@ -119,36 +134,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) } } - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object IJsonSerializable.ToJson(ExchangeService service) - { - JsonObject jsonRequest = new JsonObject(); - - jsonRequest.Add(XmlAttributeNames.SaveItemToFolder, this.SavedCopyDestinationFolderId != null); - if (this.SavedCopyDestinationFolderId != null) - { - JsonObject targetFolderId = new JsonObject(); - targetFolderId.Add(XmlElementNames.BaseFolderId, this.SavedCopyDestinationFolderId.InternalToJson(service)); - jsonRequest.Add(XmlElementNames.SavedItemFolderId, targetFolderId); - } - - List idList = new List(); - foreach (Item item in this.Items) - { - idList.Add(item.Id.InternalToJson(service)); - } - - jsonRequest.Add(XmlElementNames.ItemIds, idList.ToArray()); - - return jsonRequest; - } - /// /// Gets the request version. /// @@ -188,4 +173,4 @@ public FolderId SavedCopyDestinationFolderId set { this.savedCopyDestinationFolderId = value; } } } -} +} \ No newline at end of file diff --git a/Core/Requests/ServiceRequestBase.cs b/Core/Requests/ServiceRequestBase.cs index c895f896..55dd008f 100644 --- a/Core/Requests/ServiceRequestBase.cs +++ b/Core/Requests/ServiceRequestBase.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ServiceRequestBase class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -24,7 +39,18 @@ namespace Microsoft.Exchange.WebServices.Data internal abstract class ServiceRequestBase { #region Private Constants - + /// + /// The two contants below are used to set the AnchorMailbox and ExplicitLogonUser values + /// in the request header. + /// + /// + /// Note: Setting this values will route the request directly to the backend hosting the + /// AnchorMailbox. These headers should be used primarily for UnifiedGroup scenario where + /// a request needs to be routed directly to the group mailbox versus the user mailbox. + /// + private const string AnchorMailboxHeaderName = "X-AnchorMailbox"; + private const string ExplicitLogonUserHeaderName = "X-OWA-ExplicitLogonUser"; + private static readonly string[] RequestIdResponseHeaders = new[] { "RequestId", "request-id", }; private const string XMLSchemaNamespace = "http://www.w3.org/2001/XMLSchema"; private const string XMLSchemaInstanceNamespace = "http://www.w3.org/2001/XMLSchema-instance"; @@ -32,6 +58,20 @@ internal abstract class ServiceRequestBase #endregion + /// + /// Gets or sets the anchor mailbox associated with the request + /// + /// + /// Setting this value will add special headers to the request which in turn + /// will route the request directly to the mailbox server against which the request + /// is to be executed. + /// + internal string AnchorMailbox + { + get; + set; + } + /// /// Maintains the collection of client side statistics for requests already completed /// @@ -113,18 +153,21 @@ private static Stream WrapStream(Stream responseStream, string contentEncoding) /// /// The reader. /// Response object. - internal abstract object ParseResponse(EwsServiceXmlReader reader); + internal virtual object ParseResponse(EwsServiceXmlReader reader) + { + throw new NotImplementedException("you must override either this or the 2-parameter version"); + } /// /// Parses the response. /// - /// The json body. + /// The reader. + /// Response headers /// Response object. - internal virtual object ParseResponse(JsonObject jsonBody) + /// If this is overriden instead of the 1-parameter version, you can read response headers + internal virtual object ParseResponse(EwsServiceXmlReader reader, WebHeaderCollection responseHeaders) { - ServiceResponse serviceResponse = new ServiceResponse(); - serviceResponse.LoadFromJson(jsonBody, this.Service); - return serviceResponse; + return this.ParseResponse(reader); } /// @@ -171,12 +214,30 @@ internal virtual void WriteAttributesToXml(EwsServiceXmlWriter writer) { } + /// + /// Allows the subclasses to add their own header information + /// + /// The HTTP request headers + internal virtual void AddHeaders(WebHeaderCollection webHeaderCollection) + { + if (!string.IsNullOrEmpty(this.AnchorMailbox)) + { + webHeaderCollection.Set(AnchorMailboxHeaderName, this.AnchorMailbox); + webHeaderCollection.Set(ExplicitLogonUserHeaderName, this.AnchorMailbox); + } + } + /// /// Initializes a new instance of the class. /// /// The service. internal ServiceRequestBase(ExchangeService service) { + if (service == null) + { + throw new ArgumentNullException("service"); + } + this.service = service; this.ThrowIfNotSupportedByRequestedServerVersion(); } @@ -306,84 +367,6 @@ internal void WriteToXml(EwsServiceXmlWriter writer) writer.WriteEndElement(); // soap:Envelope } - /// - /// Creates the json request. - /// - /// - internal JsonObject CreateJsonRequest() - { - IJsonSerializable serializableRequest = this as IJsonSerializable; - - if (serializableRequest == null) - { - throw new JsonSerializationNotImplementedException(); - } - - JsonObject jsonRequest = new JsonObject(); - - jsonRequest.Add("Header", this.CreateJsonHeaders()); - jsonRequest.Add("Body", serializableRequest.ToJson(service)); - - return jsonRequest; - } - - /// - /// Creates the json headers. - /// - /// - private JsonObject CreateJsonHeaders() - { - JsonObject headers = new JsonObject(); - - headers.Add(XmlElementNames.RequestServerVersion, this.GetRequestedServiceVersionString()); - - // Against Exchange 2007 SP1, we always emit the simplified time zone header. It adds very little to - // the request, so bandwidth consumption is not an issue. Against Exchange 2010 and above, we emit - // the full time zone header but only when the request actually needs it. - // - // The exception to this is if we are in Exchange2007 Compat Mode, in which case we should never emit - // the header. (Note: Exchange2007 Compat Mode is enabled for testability purposes only.) - // - if ((this.Service.RequestedServerVersion == ExchangeVersion.Exchange2007_SP1 || this.EmitTimeZoneHeader) && - (!this.Service.Exchange2007CompatibilityMode)) - { - JsonObject jsonTimeZoneDefinition = new JsonObject(); - jsonTimeZoneDefinition.Add(XmlElementNames.TimeZoneDefinition, this.Service.TimeZoneDefinition.InternalToJson(this.Service)); - headers.Add(XmlElementNames.TimeZoneContext, jsonTimeZoneDefinition); - } - - if (this.Service.PreferredCulture != null) - { - headers.Add(XmlElementNames.MailboxCulture, this.Service.PreferredCulture.Name); - } - - // Emit the DateTimePrecision header - if (this.Service.DateTimePrecision != DateTimePrecision.Default) - { - headers.Add(XmlElementNames.DateTimePrecision, this.Service.DateTimePrecision.ToString()); - } - - // TODO: JSON-ify the ImpersonatedUserId - ////// Emit the ExchangeImpersonation header - ////if (this.Service.ImpersonatedUserId != null) - ////{ - //// this.Service.ImpersonatedUserId.WriteToXml(writer); - ////} - - // TODO: JSON-ify the Credentials - ////if (this.Service.Credentials != null) - ////{ - //// this.Service.Credentials.SerializeExtraSoapHeaders(writer.InternalWriter, this.GetXmlElementName()); - ////} - - if (this.Service.ManagementRoles != null) - { - headers.Add(XmlElementNames.ManagementRole, this.Service.ManagementRoles.ToJsonObject()); - } - - return headers; - } - /// /// Gets string representation of requested server version. /// @@ -410,23 +393,11 @@ private string GetRequestedServiceVersionString() /// The request. private void EmitRequest(IEwsHttpWebRequest request) { - if (this.Service.RenderingMethod == ExchangeService.RenderingMode.Xml) - { - using (Stream requestStream = this.GetWebRequestStream(request)) - { - using (EwsServiceXmlWriter writer = new EwsServiceXmlWriter(this.Service, requestStream)) - { - this.WriteToXml(writer); - } - } - } - else if (this.Service.RenderingMethod == ExchangeService.RenderingMode.JSON) + using (Stream requestStream = this.GetWebRequestStream(request)) { - JsonObject requestObject = this.CreateJsonRequest(); - - using (Stream serviceRequestStream = this.GetWebRequestStream(request)) + using (EwsServiceXmlWriter writer = new EwsServiceXmlWriter(this.Service, requestStream)) { - requestObject.SerializeToJson(serviceRequestStream); + this.WriteToXml(writer); } } } @@ -439,41 +410,27 @@ private void EmitRequest(IEwsHttpWebRequest request) /// private void TraceAndEmitRequest(IEwsHttpWebRequest request, bool needSignature, bool needTrace) { - if (this.service.RenderingMethod == ExchangeService.RenderingMode.Xml) + using (MemoryStream memoryStream = new MemoryStream()) { - using (MemoryStream memoryStream = new MemoryStream()) + using (EwsServiceXmlWriter writer = new EwsServiceXmlWriter(this.Service, memoryStream)) { - using (EwsServiceXmlWriter writer = new EwsServiceXmlWriter(this.Service, memoryStream)) - { - writer.RequireWSSecurityUtilityNamespace = needSignature; - this.WriteToXml(writer); - } - - if (needSignature) - { - this.service.Credentials.Sign(memoryStream); - } - - if (needTrace) - { - this.TraceXmlRequest(memoryStream); - } + writer.RequireWSSecurityUtilityNamespace = needSignature; + this.WriteToXml(writer); + } - using (Stream serviceRequestStream = this.GetWebRequestStream(request)) - { - EwsUtilities.CopyStream(memoryStream, serviceRequestStream); - } + if (needSignature) + { + this.service.Credentials.Sign(memoryStream); } - } - else if (this.service.RenderingMethod == ExchangeService.RenderingMode.JSON) - { - JsonObject requestObject = this.CreateJsonRequest(); - this.TraceJsonRequest(requestObject); + if (needTrace) + { + this.TraceXmlRequest(memoryStream); + } using (Stream serviceRequestStream = this.GetWebRequestStream(request)) { - requestObject.SerializeToJson(serviceRequestStream); + EwsUtilities.CopyStream(memoryStream, serviceRequestStream); } } } @@ -489,7 +446,7 @@ private Stream GetWebRequestStream(IEwsHttpWebRequest request) // there is little perf gain with this approach because of EWS's message nature. // The overall latency of BeginGetRequestStream() is same as GetRequestStream() in this case. // The overhead to implement a two-step async operation includes wait handle synchronization, exception handling and wrapping. - // Therefore, we only leverage BeginGetResponse() and EndGetReponse() to provide the async functionality. + // Therefore, we only leverage BeginGetResponse() and EndGetResponse() to provide the async functionality. // Reference: http://www.wintellect.com/CS/blogs/jeffreyr/archive/2009/02/08/httpwebrequest-its-request-stream-and-sending-data-in-chunks.aspx return request.EndGetRequestStream(request.BeginGetRequestStream(null, null)); } @@ -498,8 +455,9 @@ private Stream GetWebRequestStream(IEwsHttpWebRequest request) /// Reads the response. /// /// The XML reader. + /// HTTP response headers /// Service response. - protected object ReadResponse(EwsServiceXmlReader ewsXmlReader) + protected object ReadResponse(EwsServiceXmlReader ewsXmlReader, WebHeaderCollection responseHeaders) { object serviceResponse; @@ -510,7 +468,14 @@ protected object ReadResponse(EwsServiceXmlReader ewsXmlReader) ewsXmlReader.ReadStartElement(XmlNamespace.Messages, this.GetResponseXmlElementName()); - serviceResponse = this.ParseResponse(ewsXmlReader); + if (responseHeaders != null) + { + serviceResponse = this.ParseResponse(ewsXmlReader, responseHeaders); + } + else + { + serviceResponse = this.ParseResponse(ewsXmlReader); + } ewsXmlReader.ReadEndElementIfNecessary(XmlNamespace.Messages, this.GetResponseXmlElementName()); @@ -519,21 +484,6 @@ protected object ReadResponse(EwsServiceXmlReader ewsXmlReader) return serviceResponse; } - /// - /// Builds the response object from json. - /// - /// The json response. - /// - protected object BuildResponseObjectFromJson(JsonObject jsonResponse) - { - if (jsonResponse.ContainsKey("Header")) - { - this.ReadSoapHeader(jsonResponse.ReadAsJsonObject("Header")); - } - - return this.ParseResponse(jsonResponse.ReadAsJsonObject(XmlElementNames.SOAPBodyElementName)); - } - /// /// Reads any preamble data not part of the core response. /// @@ -565,18 +515,6 @@ private void ReadSoapHeader(EwsServiceXmlReader reader) while (!reader.IsEndElement(XmlNamespace.Soap, XmlElementNames.SOAPHeaderElementName)); } - /// - /// Read SOAP header and extract server version - /// - /// The json header. - private void ReadSoapHeader(JsonObject jsonHeader) - { - if (jsonHeader.ContainsKey(XmlElementNames.ServerVersionInfo)) - { - this.Service.ServerInfo = ExchangeServerInfo.Parse(jsonHeader.ReadAsJsonObject(XmlElementNames.ServerVersionInfo)); - } - } - /// /// Reads the SOAP fault. /// @@ -653,28 +591,6 @@ protected SoapFaultDetails ReadSoapFault(EwsServiceXmlReader reader) return soapFaultDetails; } - /// - /// Reads the SOAP fault. - /// - /// The json SOAP fault. - /// - private SoapFaultDetails ReadSoapFault(JsonObject jsonSoapFault) - { - SoapFaultDetails soapFaultDetails = null; - - if (jsonSoapFault.ContainsKey("Header")) - { - this.ReadSoapHeader(jsonSoapFault.ReadAsJsonObject("Header")); - } - - if (jsonSoapFault.ContainsKey("Body")) - { - soapFaultDetails = SoapFaultDetails.Parse(jsonSoapFault.ReadAsJsonObject("Body")); - } - - return soapFaultDetails; - } - /// /// Validates request parameters, and emits the request to the server. /// @@ -778,6 +694,9 @@ protected IEwsHttpWebRequest BuildEwsHttpWebRequest() bool needSignature = this.Service.Credentials != null && this.Service.Credentials.NeedSignature; bool needTrace = this.Service.IsTraceEnabledFor(TraceFlags.EwsRequest); + // The request might need to add additional headers + this.AddHeaders(request.Headers); + // If tracing is enabled, we generate the request in-memory so that we // can pass it along to the ITraceListener. Then we copy the stream to // the request stream. @@ -897,58 +816,18 @@ private void ProcessWebException(WebException webException) memoryStream.Position = 0; } - if (this.Service.RenderingMethod == ExchangeService.RenderingMode.Xml) - { - this.TraceResponseXml(httpWebResponse, memoryStream); + this.TraceResponseXml(httpWebResponse, memoryStream); - EwsServiceXmlReader reader = new EwsServiceXmlReader(memoryStream, this.Service); - soapFaultDetails = this.ReadSoapFault(reader); - } - else if (this.Service.RenderingMethod == ExchangeService.RenderingMode.JSON) - { - this.TraceResponseJson(httpWebResponse, memoryStream); - - try - { - JsonObject jsonSoapFault = new JsonParser(memoryStream).Parse(); - soapFaultDetails = this.ReadSoapFault(jsonSoapFault); - } - catch (ServiceJsonDeserializationException) - { - // If no valid JSON response was returned, just return null SoapFault details - } - } - else - { - throw new InvalidOperationException(); - } + EwsServiceXmlReader reader = new EwsServiceXmlReader(memoryStream, this.Service); + soapFaultDetails = this.ReadSoapFault(reader); } } else { using (Stream stream = ServiceRequestBase.GetResponseStream(httpWebResponse)) { - if (this.Service.RenderingMethod == ExchangeService.RenderingMode.Xml) - { - EwsServiceXmlReader reader = new EwsServiceXmlReader(stream, this.Service); - soapFaultDetails = this.ReadSoapFault(reader); - } - else if (this.Service.RenderingMethod == ExchangeService.RenderingMode.JSON) - { - try - { - JsonObject jsonSoapFault = new JsonParser(stream).Parse(); - soapFaultDetails = this.ReadSoapFault(jsonSoapFault); - } - catch (ServiceJsonDeserializationException) - { - // If no valid JSON response was returned, just return null SoapFault details - } - } - else - { - throw new InvalidOperationException(); - } + EwsServiceXmlReader reader = new EwsServiceXmlReader(stream, this.Service); + soapFaultDetails = this.ReadSoapFault(reader); } } @@ -1007,26 +886,6 @@ protected void TraceXmlRequest(MemoryStream memoryStream) this.Service.TraceXml(TraceFlags.EwsRequest, memoryStream); } - /// - /// Traces a JSON request. This should only be used for synchronous requests, or synchronous situations - /// (such as a WebException on an asynchrounous request). - /// - /// The JSON request object. - protected void TraceJsonRequest(JsonObject requestObject) - { - using (MemoryStream memoryStream = new MemoryStream()) - { - requestObject.SerializeToJson(memoryStream, this.Service.TraceEnablePrettyPrinting); - - memoryStream.Position = 0; - - using (StreamReader reader = new StreamReader(memoryStream)) - { - this.Service.TraceMessage(TraceFlags.EwsRequest, reader.ReadToEnd()); - } - } - } - /// /// Traces the response. This should only be used for synchronous requests, or synchronous situations /// (such as a WebException on an asynchrounous request). @@ -1047,31 +906,6 @@ protected void TraceResponseXml(IEwsHttpWebResponse response, MemoryStream memor } } - /// - /// Traces the response. This should only be used for synchronous requests, or synchronous situations - /// (such as a WebException on an asynchrounous request). - /// - /// The response. - /// The response content in a MemoryStream. - protected void TraceResponseJson(IEwsHttpWebResponse response, MemoryStream memoryStream) - { - JsonObject jsonResponse = new JsonParser(memoryStream).Parse(); - - using (MemoryStream responseStream = new MemoryStream()) - { - jsonResponse.SerializeToJson(responseStream, this.Service.TraceEnablePrettyPrinting); - - responseStream.Position = 0; - - using (StreamReader responseReader = new StreamReader(responseStream)) - { - this.Service.TraceMessage(TraceFlags.EwsResponse, responseReader.ReadToEnd()); - } - } - - memoryStream.Seek(0, SeekOrigin.Begin); - } - /// /// Try to read the XML declaration. If it's not there, the server didn't return XML. /// @@ -1094,4 +928,4 @@ private void ReadXmlDeclaration(EwsServiceXmlReader reader) #endregion } -} +} \ No newline at end of file diff --git a/Core/Requests/SetClientExtensionRequest.cs b/Core/Requests/SetClientExtensionRequest.cs index 3888668e..2b9911b4 100644 --- a/Core/Requests/SetClientExtensionRequest.cs +++ b/Core/Requests/SetClientExtensionRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SetClientExtensionRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Core/Requests/SetEncryptionConfigurationRequest.cs b/Core/Requests/SetEncryptionConfigurationRequest.cs index 48b547fa..8fd1fb62 100644 --- a/Core/Requests/SetEncryptionConfigurationRequest.cs +++ b/Core/Requests/SetEncryptionConfigurationRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SetEncryptionConfigurationRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -124,9 +139,7 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) writer.WriteElementValue(XmlNamespace.Messages, XmlElementNames.EncryptionConfigurationEmailText, this.EmailText); writer.WriteElementValue(XmlNamespace.Messages, XmlElementNames.EncryptionConfigurationPortalText, this.PortalText); writer.WriteElementValue(XmlNamespace.Messages, XmlElementNames.EncryptionConfigurationDisclaimerText, this.disclaimerText); - - // TODO: Uncomment after server schema change have been deployed to all machines - // writer.WriteElementValue(XmlNamespace.Messages, XmlElementNames.EncryptionConfigurationOTPEnabled, this.otpEnabled); + writer.WriteElementValue(XmlNamespace.Messages, XmlElementNames.EncryptionConfigurationOTPEnabled, this.otpEnabled); } /// diff --git a/Core/Requests/SetHoldOnMailboxesRequest.cs b/Core/Requests/SetHoldOnMailboxesRequest.cs index 87d43ddf..c0465032 100644 --- a/Core/Requests/SetHoldOnMailboxesRequest.cs +++ b/Core/Requests/SetHoldOnMailboxesRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SetHoldOnMailboxesRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -17,7 +32,7 @@ namespace Microsoft.Exchange.WebServices.Data /// /// Represents a SetHoldOnMailboxesRequest request. /// - internal sealed class SetHoldOnMailboxesRequest : SimpleServiceRequestBase, IJsonSerializable + internal sealed class SetHoldOnMailboxesRequest : SimpleServiceRequestBase { /// /// Initializes a new instance of the class. @@ -132,20 +147,6 @@ internal override ExchangeVersion GetMinimumRequiredServerVersion() return ExchangeVersion.Exchange2013; } - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object IJsonSerializable.ToJson(ExchangeService service) - { - JsonObject jsonObject = new JsonObject(); - - return jsonObject; - } - /// /// Action type /// diff --git a/Core/Requests/SetOMEConfigurationRequest.cs b/Core/Requests/SetOMEConfigurationRequest.cs new file mode 100644 index 00000000..3f28735e --- /dev/null +++ b/Core/Requests/SetOMEConfigurationRequest.cs @@ -0,0 +1,115 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + /// + /// Represents a SetOMEConfiguration request. + /// + internal sealed class SetOMEConfigurationRequest : SimpleServiceRequestBase + { + /// + /// The XML representation of EncryptionConfigurationData + /// + private readonly string xml; + + /// + /// The XML representation of EncryptionConfigurationData + /// + public string Xml + { + get { return this.xml; } + } + + /// + /// Initializes a new instance of the class. + /// + /// The service. + /// The XML representation of EncryptionConfigurationData + internal SetOMEConfigurationRequest(ExchangeService service, string xml) : base(service) + { + this.xml = xml; + } + + /// + /// Gets the name of the XML element. + /// + /// XML element name, + internal override string GetXmlElementName() + { + return XmlElementNames.SetOMEConfigurationRequest; + } + + /// + /// Writes XML elements. + /// + /// The writer. + internal override void WriteElementsToXml(EwsServiceXmlWriter writer) + { + writer.WriteElementValue(XmlNamespace.Messages, XmlElementNames.OMEConfigurationXml, this.Xml); + } + + /// + /// Gets the name of the response XML element. + /// + /// XML element name, + internal override string GetResponseXmlElementName() + { + return XmlElementNames.SetOMEConfigurationResponse; + } + + /// + /// Parses the response. + /// + /// The reader. + /// Response object. + internal override object ParseResponse(EwsServiceXmlReader reader) + { + SetOMEConfigurationResponse response = new SetOMEConfigurationResponse(); + response.LoadFromXml(reader, GetResponseXmlElementName()); + return response; + } + + /// + /// Gets the request version. + /// + /// Earliest Exchange version in which this request is supported. + internal override ExchangeVersion GetMinimumRequiredServerVersion() + { + return ExchangeVersion.Exchange2013; + } + + /// + /// Executes this request. + /// + /// Service response. + internal ServiceResponse Execute() + { + SetOMEConfigurationResponse serviceResponse = (SetOMEConfigurationResponse)this.InternalExecute(); + serviceResponse.ThrowIfNecessary(); + return serviceResponse; + } + } +} \ No newline at end of file diff --git a/Core/Requests/SetTeamMailboxRequest.cs b/Core/Requests/SetTeamMailboxRequest.cs index 8ab69881..f41cd26f 100644 --- a/Core/Requests/SetTeamMailboxRequest.cs +++ b/Core/Requests/SetTeamMailboxRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SetTeamMailboxRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Core/Requests/SetUserOofSettingsRequest.cs b/Core/Requests/SetUserOofSettingsRequest.cs index 8a3236cc..4d1fc785 100644 --- a/Core/Requests/SetUserOofSettingsRequest.cs +++ b/Core/Requests/SetUserOofSettingsRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SetUserOofSettingsRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -127,4 +142,4 @@ public OofSettings OofSettings set { this.oofSettings = value; } } } -} +} \ No newline at end of file diff --git a/Core/Requests/SimpleServiceRequestBase.cs b/Core/Requests/SimpleServiceRequestBase.cs index 011f164e..74d1c3f7 100644 --- a/Core/Requests/SimpleServiceRequestBase.cs +++ b/Core/Requests/SimpleServiceRequestBase.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SimpleServiceRequestBase class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -124,40 +139,16 @@ private object ReadResponse(IEwsHttpWebResponse response) memoryStream.Position = 0; } - if (this.Service.RenderingMethod == ExchangeService.RenderingMode.Xml) - { - this.TraceResponseXml(response, memoryStream); - - serviceResponse = this.ReadResponseXml(memoryStream); - } - else if (this.Service.RenderingMethod == ExchangeService.RenderingMode.JSON) - { - this.TraceResponseJson(response, memoryStream); + this.TraceResponseXml(response, memoryStream); - serviceResponse = this.ReadResponseJson(memoryStream); - } - else - { - throw new InvalidOperationException("Unknown RenderingMethod."); - } + serviceResponse = this.ReadResponseXml(memoryStream, response.Headers); } } else { using (Stream responseStream = ServiceRequestBase.GetResponseStream(response)) { - if (this.Service.RenderingMethod == ExchangeService.RenderingMode.Xml) - { - serviceResponse = this.ReadResponseXml(responseStream); - } - else if (this.Service.RenderingMethod == ExchangeService.RenderingMode.JSON) - { - serviceResponse = this.ReadResponseJson(responseStream); - } - else - { - throw new InvalidOperationException("Unknown RenderingMethod."); - } + serviceResponse = this.ReadResponseXml(responseStream, response.Headers); } } } @@ -188,26 +179,26 @@ private object ReadResponse(IEwsHttpWebResponse response) } /// - /// Reads the response json. + /// Reads the response XML. /// /// The response stream. /// - private object ReadResponseJson(Stream responseStream) + private object ReadResponseXml(Stream responseStream) { - JsonObject jsonResponse = new JsonParser(responseStream).Parse(); - return this.BuildResponseObjectFromJson(jsonResponse); + return this.ReadResponseXml(responseStream, null); } /// /// Reads the response XML. /// /// The response stream. + /// The HTTP response headers /// - private object ReadResponseXml(Stream responseStream) + private object ReadResponseXml(Stream responseStream, WebHeaderCollection responseHeaders) { object serviceResponse; EwsServiceXmlReader ewsXmlReader = new EwsServiceXmlReader(responseStream, this.Service); - serviceResponse = this.ReadResponse(ewsXmlReader); + serviceResponse = this.ReadResponse(ewsXmlReader, responseHeaders); return serviceResponse; } } diff --git a/Core/Requests/SubscribeRequest.cs b/Core/Requests/SubscribeRequest.cs index a25fcfed..736413e9 100644 --- a/Core/Requests/SubscribeRequest.cs +++ b/Core/Requests/SubscribeRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SubscribeRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -17,7 +32,7 @@ namespace Microsoft.Exchange.WebServices.Data /// Represents an abstract Subscribe request. /// /// The type of the subscription. - internal abstract class SubscribeRequest : MultiResponseServiceRequest>, IJsonSerializable + internal abstract class SubscribeRequest : MultiResponseServiceRequest> where TSubscription : SubscriptionBase { /// @@ -136,50 +151,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) writer.WriteEndElement(); } - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object IJsonSerializable.ToJson(ExchangeService service) - { - JsonObject jsonRequest = new JsonObject(); - - JsonObject jsonSubscribeRequest = new JsonObject(); - - jsonSubscribeRequest.AddTypeParameter(this.GetSubscriptionXmlElementName()); - jsonSubscribeRequest.Add(XmlElementNames.EventTypes, this.EventTypes.ToArray()); - - if (this.FolderIds.Count > 0) - { - jsonSubscribeRequest.Add(XmlElementNames.FolderIds, this.FolderIds.InternalToJson(service)); - } - else - { - jsonSubscribeRequest.Add(XmlAttributeNames.SubscribeToAllFolders, true); - } - - if (!string.IsNullOrEmpty(this.Watermark)) - { - jsonSubscribeRequest.Add(XmlElementNames.Watermark, this.Watermark); - } - - this.AddJsonProperties(jsonSubscribeRequest, service); - - jsonRequest.Add(XmlElementNames.SubscriptionRequest, jsonSubscribeRequest); - - return jsonRequest; - } - - /// - /// Adds the json properties. - /// - /// The json subscribe request. - /// The service. - internal abstract void AddJsonProperties(JsonObject jsonSubscribeRequest, ExchangeService service); - /// /// Initializes a new instance of the class. /// @@ -215,4 +186,4 @@ public string Watermark get; set; } } -} +} \ No newline at end of file diff --git a/Core/Requests/SubscribeToPullNotificationsRequest.cs b/Core/Requests/SubscribeToPullNotificationsRequest.cs index 43130aac..77b1a316 100644 --- a/Core/Requests/SubscribeToPullNotificationsRequest.cs +++ b/Core/Requests/SubscribeToPullNotificationsRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SubscribeToPullNotificationsRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -74,16 +89,6 @@ internal override void InternalWriteElementsToXml(EwsServiceXmlWriter writer) this.Timeout); } - /// - /// Adds the json properties. - /// - /// The json subscribe request. - /// The service. - internal override void AddJsonProperties(JsonObject jsonSubscribeRequest, ExchangeService service) - { - jsonSubscribeRequest.Add(XmlElementNames.Timeout, this.Timeout); - } - /// /// Gets the request version. /// @@ -103,4 +108,4 @@ public int Timeout set { this.timeout = value; } } } -} +} \ No newline at end of file diff --git a/Core/Requests/SubscribeToPushNotificationsRequest.cs b/Core/Requests/SubscribeToPushNotificationsRequest.cs index e05e90b4..921c2254 100644 --- a/Core/Requests/SubscribeToPushNotificationsRequest.cs +++ b/Core/Requests/SubscribeToPushNotificationsRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SubscribeToPushNotificationsRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -80,17 +95,6 @@ internal override void InternalWriteElementsToXml(EwsServiceXmlWriter writer) } } - /// - /// Adds the json properties. - /// - /// The json subscribe request. - /// The service. - internal override void AddJsonProperties(JsonObject jsonSubscribeRequest, ExchangeService service) - { - jsonSubscribeRequest.Add(XmlElementNames.StatusFrequency, this.Frequency); - jsonSubscribeRequest.Add(XmlElementNames.URL, this.Url.ToString()); - } - /// /// Creates the service response. /// diff --git a/Core/Requests/SubscribeToStreamingNotificationsRequest.cs b/Core/Requests/SubscribeToStreamingNotificationsRequest.cs index 611681c9..28b61e1c 100644 --- a/Core/Requests/SubscribeToStreamingNotificationsRequest.cs +++ b/Core/Requests/SubscribeToStreamingNotificationsRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SubscribeToStreamingNotificationsRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -58,15 +73,6 @@ internal override void InternalWriteElementsToXml(EwsServiceXmlWriter writer) { } - /// - /// Adds the json properties. - /// - /// The json subscribe request. - /// The service. - internal override void AddJsonProperties(JsonObject jsonSubscribeRequest, ExchangeService service) - { - } - /// /// Creates the service response. /// @@ -87,4 +93,4 @@ internal override ExchangeVersion GetMinimumRequiredServerVersion() return ExchangeVersion.Exchange2010_SP1; } } -} +} \ No newline at end of file diff --git a/Core/Requests/SyncFolderHierarchyRequest.cs b/Core/Requests/SyncFolderHierarchyRequest.cs index 34824e67..c079ab5a 100644 --- a/Core/Requests/SyncFolderHierarchyRequest.cs +++ b/Core/Requests/SyncFolderHierarchyRequest.cs @@ -1,19 +1,34 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SyncFolderHierarchyRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { /// /// Represents a SyncFolderHierarchy request. /// - internal class SyncFolderHierarchyRequest : MultiResponseServiceRequest, IJsonSerializable + internal class SyncFolderHierarchyRequest : MultiResponseServiceRequest { private PropertySet propertySet; private FolderId syncFolderId; @@ -111,31 +126,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) this.SyncState); } - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object IJsonSerializable.ToJson(ExchangeService service) - { - JsonObject jsonRequest = new JsonObject(); - - this.propertySet.WriteGetShapeToJson(jsonRequest, service, ServiceObjectType.Folder); - - if (this.SyncFolderId != null) - { - JsonObject jsonSyncFolderId = new JsonObject(); - jsonSyncFolderId.Add(XmlElementNames.BaseFolderId, this.SyncFolderId.InternalToJson(service)); - jsonRequest.Add(XmlElementNames.SyncFolderId, jsonSyncFolderId); - } - - jsonRequest.Add(XmlElementNames.SyncState, this.SyncState); - - return jsonRequest; - } - /// /// Gets the request version. /// @@ -175,4 +165,4 @@ public string SyncState set { this.syncState = value; } } } -} +} \ No newline at end of file diff --git a/Core/Requests/SyncFolderItemsRequest.cs b/Core/Requests/SyncFolderItemsRequest.cs index 361e7ed1..5c895207 100644 --- a/Core/Requests/SyncFolderItemsRequest.cs +++ b/Core/Requests/SyncFolderItemsRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SyncFolderItemsRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -17,7 +32,7 @@ namespace Microsoft.Exchange.WebServices.Data /// /// Represents a SyncFolderItems request. /// - internal class SyncFolderItemsRequest : MultiResponseServiceRequest, IJsonSerializable + internal class SyncFolderItemsRequest : MultiResponseServiceRequest { private PropertySet propertySet; private FolderId syncFolderId; @@ -165,45 +180,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) } } - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object IJsonSerializable.ToJson(ExchangeService service) - { - JsonObject jsonRequest = new JsonObject(); - - this.propertySet.WriteGetShapeToJson(jsonRequest, service, ServiceObjectType.Item); - - JsonObject jsonSyncFolderId = new JsonObject(); - jsonSyncFolderId.Add(XmlElementNames.BaseFolderId, this.SyncFolderId.InternalToJson(service)); - jsonRequest.Add(XmlElementNames.SyncFolderId, jsonSyncFolderId); - - jsonRequest.Add(XmlElementNames.SyncState, this.SyncState); - - if (this.IgnoredItemIds.Count > 0) - { - jsonRequest.Add(XmlElementNames.Ignore, this.IgnoredItemIds.InternalToJson(service)); - } - - jsonRequest.Add(XmlElementNames.MaxChangesReturned, this.MaxChangesReturned); - - if (this.Service.RequestedServerVersion >= ExchangeVersion.Exchange2010) - { - jsonRequest.Add(XmlElementNames.SyncScope, this.SyncScope); - } - - if (this.Service.RequestedServerVersion >= ExchangeVersion.Exchange2013) - { - jsonRequest.Add(XmlElementNames.NumberOfDays, this.NumberOfDays); - } - - return jsonRequest; - } - /// /// Gets the request version. /// @@ -312,4 +288,4 @@ public int NumberOfDays } } } -} +} \ No newline at end of file diff --git a/Core/Requests/UninstallAppRequest.cs b/Core/Requests/UninstallAppRequest.cs index 601dcc5f..8270c96b 100644 --- a/Core/Requests/UninstallAppRequest.cs +++ b/Core/Requests/UninstallAppRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the UninstallAppRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Core/Requests/UnpinTeamMailboxRequest.cs b/Core/Requests/UnpinTeamMailboxRequest.cs index 92802e9a..8137ea8a 100644 --- a/Core/Requests/UnpinTeamMailboxRequest.cs +++ b/Core/Requests/UnpinTeamMailboxRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the UnpinTeamMailboxRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Core/Requests/UnsubscribeRequest.cs b/Core/Requests/UnsubscribeRequest.cs index 93676bf7..85b70f60 100644 --- a/Core/Requests/UnsubscribeRequest.cs +++ b/Core/Requests/UnsubscribeRequest.cs @@ -1,19 +1,34 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the UnsubscribeRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { /// /// Represents an Unsubscribe request. /// - internal class UnsubscribeRequest : MultiResponseServiceRequest, IJsonSerializable + internal class UnsubscribeRequest : MultiResponseServiceRequest { /// /// Initializes a new instance of the class. @@ -92,15 +107,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) this.SubscriptionId); } - object IJsonSerializable.ToJson(ExchangeService service) - { - JsonObject jsonRequest = new JsonObject(); - - jsonRequest.Add(XmlElementNames.SubscriptionId, this.SubscriptionId); - - return jsonRequest; - } - /// /// Gets the request version. /// @@ -118,4 +124,4 @@ public string SubscriptionId get; set; } } -} +} \ No newline at end of file diff --git a/Core/Requests/UpdateDelegateRequest.cs b/Core/Requests/UpdateDelegateRequest.cs index 86b8db63..399a370e 100644 --- a/Core/Requests/UpdateDelegateRequest.cs +++ b/Core/Requests/UpdateDelegateRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the UpdateDelegateRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -124,4 +139,4 @@ public List DelegateUsers get { return this.delegateUsers; } } } -} +} \ No newline at end of file diff --git a/Core/Requests/UpdateFolderRequest.cs b/Core/Requests/UpdateFolderRequest.cs index e3d5ee97..3887c700 100644 --- a/Core/Requests/UpdateFolderRequest.cs +++ b/Core/Requests/UpdateFolderRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the UpdateFolderRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -17,7 +32,7 @@ namespace Microsoft.Exchange.WebServices.Data /// /// Represents an UpdateFolder request. /// - internal sealed class UpdateFolderRequest : MultiResponseServiceRequest, IJsonSerializable + internal sealed class UpdateFolderRequest : MultiResponseServiceRequest { private List folders = new List(); @@ -114,28 +129,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) writer.WriteEndElement(); } - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object IJsonSerializable.ToJson(ExchangeService service) - { - JsonObject jsonRequest = new JsonObject(); - List jsonUpdates = new List(); - - foreach (Folder folder in this.folders) - { - jsonUpdates.Add(folder.WriteToJsonForUpdate(service)); - } - - jsonRequest.Add(XmlElementNames.FolderChanges, jsonUpdates.ToArray()); - - return jsonRequest; - } - /// /// Gets the request version. /// @@ -154,4 +147,4 @@ public List Folders get { return this.folders; } } } -} +} \ No newline at end of file diff --git a/Core/Requests/UpdateInboxRulesRequest.cs b/Core/Requests/UpdateInboxRulesRequest.cs index bff7ecad..f04fa50d 100644 --- a/Core/Requests/UpdateInboxRulesRequest.cs +++ b/Core/Requests/UpdateInboxRulesRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the UpdateInboxRulesRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Core/Requests/UpdateItemRequest.cs b/Core/Requests/UpdateItemRequest.cs index 471461ae..74311803 100644 --- a/Core/Requests/UpdateItemRequest.cs +++ b/Core/Requests/UpdateItemRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the UpdateItemRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -17,7 +32,7 @@ namespace Microsoft.Exchange.WebServices.Data /// /// Represents an UpdateItem request. /// - internal sealed class UpdateItemRequest : MultiResponseServiceRequest, IJsonSerializable + internal sealed class UpdateItemRequest : MultiResponseServiceRequest { private List items = new List(); private FolderId savedItemsDestinationFolder; @@ -36,7 +51,7 @@ internal UpdateItemRequest(ExchangeService service, ServiceErrorHandling errorHa } /// - /// Gets a value indicating whether the TimeZoneContext SOAP header should be eimitted. + /// Gets a value indicating whether the TimeZoneContext SOAP header should be emitted. /// /// /// true if the time zone should be emitted; otherwise, false. @@ -47,7 +62,7 @@ internal override bool EmitTimeZoneHeader { foreach (Item item in this.Items) { - if (item.GetIsTimeZoneHeaderRequired(true /* isUpdateOpeartion */)) + if (item.GetIsTimeZoneHeaderRequired(true /* isUpdateOperation */)) { return true; } @@ -191,53 +206,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer) writer.WriteEndElement(); } - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object IJsonSerializable.ToJson(ExchangeService service) - { - JsonObject jsonRequest = new JsonObject(); - - if (this.MessageDisposition.HasValue) - { - jsonRequest.Add(XmlAttributeNames.MessageDisposition, this.MessageDisposition); - } - - jsonRequest.Add(XmlAttributeNames.ConflictResolution, this.ConflictResolutionMode); - - if (this.SendInvitationsOrCancellationsMode.HasValue) - { - jsonRequest.Add( - XmlAttributeNames.SendMeetingInvitationsOrCancellations, - this.SendInvitationsOrCancellationsMode.Value); - } - - if (this.SuppressReadReceipts) - { - jsonRequest.Add(XmlAttributeNames.SuppressReadReceipts, true); - } - - if (this.SavedItemsDestinationFolder != null) - { - jsonRequest.Add(XmlElementNames.SavedItemFolderId, this.SavedItemsDestinationFolder.InternalToJson(service)); - } - - List jsonUpdates = new List(); - - foreach (Item item in this.items) - { - jsonUpdates.Add(item.WriteToJsonForUpdate(service)); - } - - jsonRequest.Add(XmlElementNames.ItemChanges, jsonUpdates.ToArray()); - - return jsonRequest; - } - /// /// Gets the request version. /// diff --git a/Core/Requests/UpdateUserConfigurationRequest.cs b/Core/Requests/UpdateUserConfigurationRequest.cs index 0bbe592f..dab96c55 100644 --- a/Core/Requests/UpdateUserConfigurationRequest.cs +++ b/Core/Requests/UpdateUserConfigurationRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the UpdateUserConfigurationRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -17,7 +32,7 @@ namespace Microsoft.Exchange.WebServices.Data /// /// Represents a UpdateUserConfiguration request. /// - internal class UpdateUserConfigurationRequest : MultiResponseServiceRequest, IJsonSerializable + internal class UpdateUserConfigurationRequest : MultiResponseServiceRequest { protected UserConfiguration userConfiguration; @@ -92,7 +107,7 @@ internal override string GetResponseMessageXmlElementName() /// The writer. internal override void WriteElementsToXml(EwsServiceXmlWriter writer) { - // Write UserConfiguation element + // Write UserConfiguration element this.userConfiguration.WriteToXml(writer, XmlNamespace.Messages, XmlElementNames.UserConfiguration); } @@ -114,21 +129,5 @@ public UserConfiguration UserConfiguration get { return this.userConfiguration; } set { this.userConfiguration = value; } } - - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object IJsonSerializable.ToJson(ExchangeService service) - { - JsonObject jsonObject = new JsonObject(); - - jsonObject.Add(XmlElementNames.UserConfiguration, ((IJsonSerializable)this.UserConfiguration).ToJson(service)); - - return jsonObject; - } } -} +} \ No newline at end of file diff --git a/Core/Responses/ArchiveItemResponse.cs b/Core/Responses/ArchiveItemResponse.cs index 2068d201..b0ede456 100644 --- a/Core/Responses/ArchiveItemResponse.cs +++ b/Core/Responses/ArchiveItemResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ArchiveItemResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -62,29 +77,6 @@ internal override void ReadElementsFromXml(EwsServiceXmlReader reader) } } - /// - /// Reads response elements from Json. - /// - /// The response object. - /// The service. - internal override void ReadElementsFromJson(JsonObject responseObject, ExchangeService service) - { - EwsServiceJsonReader jsonReader = new EwsServiceJsonReader(service); - - List items = jsonReader.ReadServiceObjectsCollectionFromJson( - responseObject, - XmlElementNames.Folders, - this.GetObjectInstance, - false, /* clearPropertyBag */ - null, /* requestedPropertySet */ - false); /* summaryPropertiesOnly */ - - if (items.Count > 0) - { - this.item = items[0]; - } - } - /// /// Gets the copied or moved item. /// @@ -93,4 +85,4 @@ public Item Item get { return this.item; } } } -} +} \ No newline at end of file diff --git a/Core/Responses/AttendeeAvailability.cs b/Core/Responses/AttendeeAvailability.cs index 1ff49e11..fb019309 100644 --- a/Core/Responses/AttendeeAvailability.cs +++ b/Core/Responses/AttendeeAvailability.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the AttendeeAvailability class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Core/Responses/ConvertIdResponse.cs b/Core/Responses/ConvertIdResponse.cs index ad35993f..0268e623 100644 --- a/Core/Responses/ConvertIdResponse.cs +++ b/Core/Responses/ConvertIdResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ConvertIdResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -73,37 +88,6 @@ internal override void ReadElementsFromXml(EwsServiceXmlReader reader) reader.ReadEndElementIfNecessary(XmlNamespace.Messages, XmlElementNames.AlternateId); } - /// - /// Reads response elements from Json. - /// - /// The response object. - /// The service. - internal override void ReadElementsFromJson(JsonObject responseObject, ExchangeService service) - { - string alternateIdClass = responseObject.ReadTypeString(); - - switch (alternateIdClass) - { - case AlternateId.SchemaTypeName: - this.convertedId = new AlternateId(); - break; - case AlternatePublicFolderId.SchemaTypeName: - this.convertedId = new AlternatePublicFolderId(); - break; - case AlternatePublicFolderItemId.SchemaTypeName: - this.convertedId = new AlternatePublicFolderItemId(); - break; - default: - EwsUtilities.Assert( - false, - "ConvertIdResponse.ReadElementsFromXml", - string.Format("Unknown alternate Id class: {0}", alternateIdClass)); - break; - } - - this.convertedId.LoadAttributesFromJson(responseObject); - } - /// /// Gets the converted Id. /// @@ -112,4 +96,4 @@ public AlternateIdBase ConvertedId get { return this.convertedId; } } } -} +} \ No newline at end of file diff --git a/Core/Responses/CreateAttachmentResponse.cs b/Core/Responses/CreateAttachmentResponse.cs index 49ed6994..10fb56a5 100644 --- a/Core/Responses/CreateAttachmentResponse.cs +++ b/Core/Responses/CreateAttachmentResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the CreateAttachmentResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -53,21 +68,6 @@ internal override void ReadElementsFromXml(EwsServiceXmlReader reader) reader.ReadEndElement(XmlNamespace.Messages, XmlElementNames.Attachments); } - /// - /// Reads response elements from Json. - /// - /// The response object. - /// The service. - internal override void ReadElementsFromJson(JsonObject responseObject, ExchangeService service) - { - object[] attachmentArray = responseObject.ReadAsArray(XmlElementNames.Attachments); - - if (attachmentArray != null && attachmentArray.Length > 0) - { - this.attachment.LoadFromJson(attachmentArray[0] as JsonObject, service); - } - } - /// /// Gets the attachment that was created. /// @@ -76,4 +76,4 @@ internal Attachment Attachment get { return this.attachment; } } } -} +} \ No newline at end of file diff --git a/Core/Responses/CreateFolderResponse.cs b/Core/Responses/CreateFolderResponse.cs index 8ef7a9d7..002434b8 100644 --- a/Core/Responses/CreateFolderResponse.cs +++ b/Core/Responses/CreateFolderResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the CreateFolderResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -67,26 +82,6 @@ internal override void ReadElementsFromXml(EwsServiceXmlReader reader) this.folder = folders[0]; } - /// - /// Reads response elements from Json. - /// - /// The response object. - /// The service. - internal override void ReadElementsFromJson(JsonObject responseObject, ExchangeService service) - { - base.ReadElementsFromJson(responseObject, service); - - List folders = new EwsServiceJsonReader(service).ReadServiceObjectsCollectionFromJson( - responseObject, - XmlElementNames.Folders, - this.GetObjectInstance, - false, /* clearPropertyBag */ - null, /* requestedPropertySet */ - false); /* summaryPropertiesOnly */ - - this.folder = folders[0]; - } - /// /// Clears the change log of the created folder if the creation succeeded. /// @@ -98,4 +93,4 @@ internal override void Loaded() } } } -} +} \ No newline at end of file diff --git a/Core/Responses/CreateItemResponse.cs b/Core/Responses/CreateItemResponse.cs index 75c2115a..efdbf641 100644 --- a/Core/Responses/CreateItemResponse.cs +++ b/Core/Responses/CreateItemResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the CreateItemResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -53,4 +68,4 @@ internal override void Loaded() } } } -} +} \ No newline at end of file diff --git a/Core/Responses/CreateItemResponseBase.cs b/Core/Responses/CreateItemResponseBase.cs index 806577f3..3849f450 100644 --- a/Core/Responses/CreateItemResponseBase.cs +++ b/Core/Responses/CreateItemResponseBase.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the CreateItemResponseBase class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -55,24 +70,6 @@ internal override void ReadElementsFromXml(EwsServiceXmlReader reader) false); /* summaryPropertiesOnly */ } - /// - /// Reads response elements from Json. - /// - /// The response object. - /// The service. - internal override void ReadElementsFromJson(JsonObject responseObject, ExchangeService service) - { - base.ReadElementsFromJson(responseObject, service); - - this.items = new EwsServiceJsonReader(service).ReadServiceObjectsCollectionFromJson( - responseObject, - XmlElementNames.Items, - this.GetObjectInstance, - false, /* clearPropertyBag */ - null, /* requestedPropertySet */ - false); /* summaryPropertiesOnly */ - } - /// /// Gets the items. /// @@ -81,4 +78,4 @@ public List Items get { return this.items; } } } -} +} \ No newline at end of file diff --git a/Core/Responses/CreateResponseObjectResponse.cs b/Core/Responses/CreateResponseObjectResponse.cs index a74f89ad..fa45339d 100644 --- a/Core/Responses/CreateResponseObjectResponse.cs +++ b/Core/Responses/CreateResponseObjectResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the CreateResponseObjectResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -40,4 +55,4 @@ internal CreateResponseObjectResponse() { } } -} +} \ No newline at end of file diff --git a/Core/Responses/DelegateManagementResponse.cs b/Core/Responses/DelegateManagementResponse.cs index cf2a2db0..af432d48 100644 --- a/Core/Responses/DelegateManagementResponse.cs +++ b/Core/Responses/DelegateManagementResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the DelegateManagementResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -83,4 +98,4 @@ internal Collection DelegateUserResponses get { return this.delegateUserResponses; } } } -} +} \ No newline at end of file diff --git a/Core/Responses/DelegateUserResponse.cs b/Core/Responses/DelegateUserResponse.cs index 285b2942..9ace9b89 100644 --- a/Core/Responses/DelegateUserResponse.cs +++ b/Core/Responses/DelegateUserResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the DelegateUserResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -60,4 +75,4 @@ public DelegateUser DelegateUser get { return this.delegateUser; } } } -} +} \ No newline at end of file diff --git a/Core/Responses/DeleteAttachmentResponse.cs b/Core/Responses/DeleteAttachmentResponse.cs index 15fbf171..b96851ff 100644 --- a/Core/Responses/DeleteAttachmentResponse.cs +++ b/Core/Responses/DeleteAttachmentResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the DeleteAttachmentResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -55,29 +70,6 @@ internal override void ReadElementsFromXml(EwsServiceXmlReader reader) reader.ReadEndElementIfNecessary(XmlNamespace.Messages, XmlElementNames.RootItemId); } - /// - /// Reads response elements from Json. - /// - /// The response object. - /// The service. - internal override void ReadElementsFromJson(JsonObject responseObject, ExchangeService service) - { - base.ReadElementsFromJson(responseObject, service); - - if (responseObject.ContainsKey(XmlElementNames.RootItemId)) - { - JsonObject jsonRootItemId = responseObject.ReadAsJsonObject(XmlElementNames.RootItemId); - string changeKey; - - if (jsonRootItemId.ContainsKey(XmlAttributeNames.RootItemChangeKey) && - !String.IsNullOrEmpty(changeKey = jsonRootItemId.ReadAsString(XmlAttributeNames.RootItemChangeKey)) && - this.attachment.Owner != null) - { - this.attachment.Owner.RootItemId.ChangeKey = changeKey; - } - } - } - /// /// Gets the attachment that was deleted. /// @@ -86,4 +78,4 @@ internal Attachment Attachment get { return this.attachment; } } } -} +} \ No newline at end of file diff --git a/Core/Responses/DisableAppResponse.cs b/Core/Responses/DisableAppResponse.cs index 5f3b2c1a..917afe2c 100644 --- a/Core/Responses/DisableAppResponse.cs +++ b/Core/Responses/DisableAppResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the DisableAppResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -29,4 +44,4 @@ public DisableAppResponse() { } } -} +} \ No newline at end of file diff --git a/Core/Responses/ExecuteDiagnosticMethodResponse.cs b/Core/Responses/ExecuteDiagnosticMethodResponse.cs index f895b1e1..523e7667 100644 --- a/Core/Responses/ExecuteDiagnosticMethodResponse.cs +++ b/Core/Responses/ExecuteDiagnosticMethodResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ExecuteDiagnosticMethodResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -61,4 +76,4 @@ internal XmlDocument ReturnValue private set; } } -} +} \ No newline at end of file diff --git a/Core/Responses/ExpandGroupResponse.cs b/Core/Responses/ExpandGroupResponse.cs index f449a865..810b315c 100644 --- a/Core/Responses/ExpandGroupResponse.cs +++ b/Core/Responses/ExpandGroupResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ExpandGroupResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -50,4 +65,4 @@ internal override void ReadElementsFromXml(EwsServiceXmlReader reader) this.Members.LoadFromXml(reader); } } -} +} \ No newline at end of file diff --git a/Core/Responses/FindConversationResponse.cs b/Core/Responses/FindConversationResponse.cs index 04156274..1a71e4d5 100644 --- a/Core/Responses/FindConversationResponse.cs +++ b/Core/Responses/FindConversationResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the FindConversationResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -129,65 +144,5 @@ internal override void ReadElementsFromXml(EwsServiceXmlReader reader) reader.Read(); } } - - /// - /// Reads response elements from Json. - /// - /// The response object. - /// The service. - internal override void ReadElementsFromJson(JsonObject responseObject, ExchangeService service) - { - EwsUtilities.Assert( - this.Results.Conversations != null, - "FindConversationResponse.ReadElementsFromXml", - "conversations is null."); - - EwsUtilities.Assert( - this.Results.HighlightTerms != null, - "FindConversationResponse.ReadElementsFromXml", - "highlightTerms is null."); - - foreach (object conversationObject in responseObject.ReadAsArray(XmlElementNames.Conversations)) - { - JsonObject jsonConversation = conversationObject as JsonObject; - - Conversation item = EwsUtilities.CreateEwsObjectFromXmlElementName(service, XmlElementNames.Conversation); - - if (item != null) - { - item.LoadFromJson( - jsonConversation, - service, - true, - null, - false); - - this.Conversations.Add(item); - } - } - - Object[] highlightTermObjects = responseObject.ReadAsArray(XmlElementNames.HighlightTerms); - if (highlightTermObjects != null) - { - foreach (object highlightTermObject in highlightTermObjects) - { - JsonObject jsonHighlightTerm = highlightTermObject as JsonObject; - HighlightTerm term = new HighlightTerm(); - - term.LoadFromJson(jsonHighlightTerm, service); - this.Results.HighlightTerms.Add(term); - } - } - - if (responseObject.ContainsKey(XmlElementNames.TotalConversationsInView)) - { - this.Results.TotalCount = responseObject.ReadAsInt(XmlElementNames.TotalConversationsInView); - } - - if (responseObject.ContainsKey(XmlElementNames.IndexedOffset)) - { - this.Results.IndexedOffset = responseObject.ReadAsInt(XmlElementNames.IndexedOffset); - } - } } -} +} \ No newline at end of file diff --git a/Core/Responses/FindFolderResponse.cs b/Core/Responses/FindFolderResponse.cs index 36c361d6..c62af8e1 100644 --- a/Core/Responses/FindFolderResponse.cs +++ b/Core/Responses/FindFolderResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the FindFolderResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -71,44 +86,6 @@ internal override void ReadElementsFromXml(EwsServiceXmlReader reader) reader.ReadEndElement(XmlNamespace.Messages, XmlElementNames.RootFolder); } - /// - /// Reads response elements from Json. - /// - /// The response object. - /// The service. - internal override void ReadElementsFromJson(JsonObject responseObject, ExchangeService service) - { - JsonObject rootFolder = responseObject.ReadAsJsonObject(XmlElementNames.RootFolder); - this.results.TotalCount = rootFolder.ReadAsInt(XmlAttributeNames.TotalItemsInView); - this.results.MoreAvailable = rootFolder.ReadAsBool(XmlAttributeNames.IncludesLastItemInRange); - - // Ignore IndexedPagingOffset attribute if MoreAvailable is false. - if (results.MoreAvailable) - { - if (rootFolder.ContainsKey(XmlAttributeNames.IndexedPagingOffset)) - { - this.results.NextPageOffset = rootFolder.ReadAsInt(XmlAttributeNames.IndexedPagingOffset); - } - else - { - this.results.NextPageOffset = null; - } - } - - if (rootFolder.ContainsKey(XmlElementNames.Folders)) - { - List folders = new EwsServiceJsonReader(service).ReadServiceObjectsCollectionFromJson( - rootFolder, - XmlElementNames.Folders, - this.CreateFolderInstance, - true, /* clearPropertyBag */ - this.propertySet, /* requestedPropertySet */ - true); /* summaryPropertiesOnly */ - - folders.ForEach((folder) => this.results.Folders.Add(folder)); - } - } - /// /// Creates a folder instance. /// @@ -143,4 +120,4 @@ public FindFoldersResults Results get { return this.results; } } } -} +} \ No newline at end of file diff --git a/Core/Responses/FindItemResponse.cs b/Core/Responses/FindItemResponse.cs index f5059ca1..2d7afa4c 100644 --- a/Core/Responses/FindItemResponse.cs +++ b/Core/Responses/FindItemResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the FindItemResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -177,119 +192,6 @@ private static void InternalReadItemsFromXml( } } - /// - /// Reads response elements from Json. - /// - /// The response object. - /// The service. - internal override void ReadElementsFromJson(JsonObject responseObject, ExchangeService service) - { - base.ReadElementsFromJson(responseObject, service); - - JsonObject rootFolder = responseObject.ReadAsJsonObject(XmlElementNames.RootFolder); - int totalItemsInView = rootFolder.ReadAsInt(XmlAttributeNames.TotalItemsInView); - bool moreItemsAvailable = !rootFolder.ReadAsBool(XmlAttributeNames.IncludesLastItemInRange); - - // Ignore IndexedPagingOffset attribute if moreItemsAvailable is false. - int? nextPageOffset = null; - if (moreItemsAvailable) - { - if (rootFolder.ContainsKey(XmlAttributeNames.IndexedPagingOffset)) - { - nextPageOffset = rootFolder.ReadAsInt(XmlAttributeNames.IndexedPagingOffset); - } - } - - if (!this.isGrouped) - { - this.results = new FindItemsResults(); - this.results.TotalCount = totalItemsInView; - this.results.NextPageOffset = nextPageOffset; - this.results.MoreAvailable = moreItemsAvailable; - this.InternalReadItemsFromJson( - rootFolder, - this.propertySet, - service, - this.results.Items); - } - else - { - this.groupedFindResults = new GroupedFindItemsResults(); - this.groupedFindResults.TotalCount = totalItemsInView; - this.groupedFindResults.NextPageOffset = nextPageOffset; - this.groupedFindResults.MoreAvailable = moreItemsAvailable; - - if (rootFolder.ContainsKey(XmlElementNames.Groups)) - { - object[] jsGroups = rootFolder.ReadAsArray(XmlElementNames.Groups); - - foreach (JsonObject jsGroup in jsGroups.OfType()) - { - if (jsGroup.ContainsKey(XmlElementNames.GroupedItems)) - { - JsonObject jsGroupedItems = jsGroup.ReadAsJsonObject(XmlElementNames.GroupedItems); - - string groupIndex = jsGroupedItems.ReadAsString(XmlElementNames.GroupIndex); - - List itemList = new List(); - this.InternalReadItemsFromJson( - jsGroupedItems, - this.propertySet, - service, - itemList); - - this.groupedFindResults.ItemGroups.Add(new ItemGroup(groupIndex, itemList)); - } - } - } - } - - Object[] highlightTermObjects = responseObject.ReadAsArray(XmlElementNames.HighlightTerms); - if (highlightTermObjects != null) - { - foreach (object highlightTermObject in highlightTermObjects) - { - JsonObject jsonHighlightTerm = highlightTermObject as JsonObject; - HighlightTerm term = new HighlightTerm(); - - term.LoadFromJson(jsonHighlightTerm, service); - this.results.HighlightTerms.Add(term); - } - } - } - - /// - /// Read items from JSON. - /// - /// The JSON object containing items. - /// The property set. - /// Exchange service. - /// The list in which to add the read items. - private void InternalReadItemsFromJson( - JsonObject jsonObject, - PropertySet propertySet, - ExchangeService service, - IList destinationList) - { - EwsUtilities.Assert( - destinationList != null, - "FindItemResponse.InternalReadItemsFromJson", - "destinationList is null."); - - if (jsonObject.ContainsKey(XmlElementNames.Items)) - { - List items = new EwsServiceJsonReader(service).ReadServiceObjectsCollectionFromJson( - jsonObject, - XmlElementNames.Items, - this.CreateItemInstance, - true, /* clearPropertyBag */ - this.propertySet, /* requestedPropertySet */ - true); /* summaryPropertiesOnly */ - - items.ForEach((item) => destinationList.Add(item)); - } - } - /// /// Creates an item instance. /// @@ -318,4 +220,4 @@ public FindItemsResults Results get { return this.results; } } } -} +} \ No newline at end of file diff --git a/Core/Responses/FindPeopleResponse.cs b/Core/Responses/FindPeopleResponse.cs new file mode 100644 index 00000000..409265a0 --- /dev/null +++ b/Core/Responses/FindPeopleResponse.cs @@ -0,0 +1,144 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + using System; + using System.Collections.Generic; + using System.Xml; + + /// + /// Represents the response to a Persona search operation. + /// + internal sealed class FindPeopleResponse : ServiceResponse + { + /// + /// Initializes a new instance of the class. + /// + internal FindPeopleResponse() + : base() + { + this.Results = new FindPeopleResults(); + this.Sources = new List(); + } + + /// + /// Gets the collection of Personas in results. + /// + internal ICollection Personas + { + get + { + return this.Results.Personas; + } + } + + /// + /// Gets FindPersona results. + /// + /// FindPersona results. + internal FindPeopleResults Results { get; private set; } + + /// + /// The transaction ID for the query + /// + internal string TransactionId { get; private set; } + + /// + /// Whether we queried GAL + /// + internal ICollection Sources { get; private set; } + + /// + /// Read Personas from XML. + /// + /// The reader. + internal override void ReadElementsFromXml(EwsServiceXmlReader reader) + { + EwsUtilities.Assert( + this.Results.Personas != null, + "FindPeopleResponse.ReadElementsFromXml", + "Personas is null."); + + reader.ReadStartElement(XmlNamespace.Messages, XmlElementNames.People); + if (!reader.IsEmptyElement) + { + do + { + reader.Read(); + + if (reader.NodeType == XmlNodeType.Element) + { + Persona item = EwsUtilities.CreateEwsObjectFromXmlElementName(reader.Service, reader.LocalName); + + if (item == null) + { + reader.SkipCurrentElement(); + } + else + { + // Don't clear propertyBag because all properties have been initialized in the persona constructor. + item.LoadFromXml(reader, false, null, false); + this.Results.Personas.Add(item); + } + } + } + while (!reader.IsEndElement(XmlNamespace.Messages, XmlElementNames.People)); + } + + reader.Read(); + + if (reader.IsStartElement(XmlNamespace.Messages, XmlElementNames.TotalNumberOfPeopleInView) && !reader.IsEmptyElement) + { + this.Results.TotalCount = reader.ReadElementValue(); + reader.Read(); + } + + if (reader.IsStartElement(XmlNamespace.Messages, XmlElementNames.FirstMatchingRowIndex) && !reader.IsEmptyElement) + { + this.Results.FirstMatchingRowIndex = reader.ReadElementValue(); + reader.Read(); + } + + if (reader.IsStartElement(XmlNamespace.Messages, XmlElementNames.FirstLoadedRowIndex) && !reader.IsEmptyElement) + { + this.Results.FirstLoadedRowIndex = reader.ReadElementValue(); + reader.Read(); + } + + if (reader.IsStartElement(XmlNamespace.Messages, XmlElementNames.FindPeopleTransactionId) && !reader.IsEmptyElement) + { + this.TransactionId = reader.ReadElementValue(); + reader.Read(); + } + + // Future proof by skipping any additional elements before returning + while (!reader.IsEndElement(XmlNamespace.Messages, XmlElementNames.FindPeopleResponse)) + { + reader.Read(); + } + } + } +} \ No newline at end of file diff --git a/Core/Responses/GetAppManifestsResponse.cs b/Core/Responses/GetAppManifestsResponse.cs index 3f2962ef..854a2507 100644 --- a/Core/Responses/GetAppManifestsResponse.cs +++ b/Core/Responses/GetAppManifestsResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetAppManifestsResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -165,4 +180,4 @@ private void ReadFromExchange2013Sp1(EwsServiceXmlReader reader) } } } -} +} \ No newline at end of file diff --git a/Core/Responses/GetAppMarketplaceUrlResponse.cs b/Core/Responses/GetAppMarketplaceUrlResponse.cs index 038592e0..4292abe6 100644 --- a/Core/Responses/GetAppMarketplaceUrlResponse.cs +++ b/Core/Responses/GetAppMarketplaceUrlResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetAppMarketplaceUrlResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -43,4 +58,4 @@ public string AppMarketplaceUrl get { return this.appMarketplaceUrl; } } } -} +} \ No newline at end of file diff --git a/Core/Responses/GetAttachmentResponse.cs b/Core/Responses/GetAttachmentResponse.cs index efd9bf7c..fd0de2f3 100644 --- a/Core/Responses/GetAttachmentResponse.cs +++ b/Core/Responses/GetAttachmentResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetAttachmentResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -66,38 +81,6 @@ internal override void ReadElementsFromXml(EwsServiceXmlReader reader) } } - /// - /// Reads response elements from Json. - /// - /// The response object. - /// The service. - internal override void ReadElementsFromJson(JsonObject responseObject, ExchangeService service) - { - object[] attachmentsArray; - if (responseObject.ContainsKey(XmlElementNames.Attachments) && - (attachmentsArray = responseObject.ReadAsArray(XmlElementNames.Attachments)).Length > 0) - { - JsonObject attachmentArrayJsonObject = attachmentsArray[0] as JsonObject; - - if (this.attachment == null && attachmentArrayJsonObject != null) - { - if (attachmentArrayJsonObject.ContainsKey(XmlElementNames.FileAttachment)) - { - this.attachment = new FileAttachment(service); - } - else if (attachmentArrayJsonObject.ContainsKey(XmlElementNames.ItemAttachment)) - { - this.attachment = new ItemAttachment(service); - } - } - - if (this.attachment != null) - { - this.attachment.LoadFromJson(attachmentArrayJsonObject, service); - } - } - } - /// /// Gets the attachment that was retrieved. /// @@ -106,4 +89,4 @@ public Attachment Attachment get { return this.attachment; } } } -} +} \ No newline at end of file diff --git a/Core/Responses/GetClientAccessTokenResponse.cs b/Core/Responses/GetClientAccessTokenResponse.cs index 3116d19a..4c91b442 100644 --- a/Core/Responses/GetClientAccessTokenResponse.cs +++ b/Core/Responses/GetClientAccessTokenResponse.cs @@ -1,8 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -42,26 +61,6 @@ internal override void ReadElementsFromXml(EwsServiceXmlReader reader) reader.ReadEndElementIfNecessary(XmlNamespace.Messages, XmlElementNames.Token); } - /// - /// Reads response elements from Json. - /// - /// The response object. - /// The service. - internal override void ReadElementsFromJson(JsonObject responseObject, ExchangeService service) - { - base.ReadElementsFromJson(responseObject, service); - - if (responseObject.ContainsKey(XmlElementNames.Token)) - { - JsonObject jsonObject = responseObject.ReadAsJsonObject(XmlElementNames.Token); - - this.Id = jsonObject.ReadAsString(XmlElementNames.Id); - this.TokenType = (ClientAccessTokenType)Enum.Parse(typeof(ClientAccessTokenType), jsonObject.ReadAsString(XmlElementNames.TokenType)); - this.TokenValue = jsonObject.ReadAsString(XmlElementNames.TokenValue); - this.TTL = jsonObject.ReadAsInt(XmlElementNames.TTL); - } - } - /// /// Gets the Id. /// @@ -82,4 +81,4 @@ internal override void ReadElementsFromJson(JsonObject responseObject, ExchangeS /// public int TTL { get; private set; } } -} +} \ No newline at end of file diff --git a/Core/Responses/GetClientExtensionResponse.cs b/Core/Responses/GetClientExtensionResponse.cs index 1f7dbe50..aa519d4a 100644 --- a/Core/Responses/GetClientExtensionResponse.cs +++ b/Core/Responses/GetClientExtensionResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetClientExtensionResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -84,4 +99,4 @@ internal override void ReadElementsFromXml(EwsServiceXmlReader reader) } } } -} +} \ No newline at end of file diff --git a/Core/Responses/GetConversationItemsResponse.cs b/Core/Responses/GetConversationItemsResponse.cs index 02e2ab78..3f0b1374 100644 --- a/Core/Responses/GetConversationItemsResponse.cs +++ b/Core/Responses/GetConversationItemsResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetConversationItemsResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -46,16 +61,5 @@ internal override void ReadElementsFromXml(EwsServiceXmlReader reader) reader.ReadStartElement(XmlNamespace.Messages, XmlElementNames.Conversation); this.Conversation.LoadFromXml(reader, XmlNamespace.Messages, XmlElementNames.Conversation); } - - /// - /// Reads response elements from Json. - /// - /// The response object. - /// The service. - internal override void ReadElementsFromJson(JsonObject responseObject, ExchangeService service) - { - this.Conversation = new ConversationResponse(this.propertySet); - this.Conversation.LoadFromJson(responseObject.ReadAsJsonObject(XmlElementNames.Conversation), service); - } } -} +} \ No newline at end of file diff --git a/Core/Responses/GetDelegateResponse.cs b/Core/Responses/GetDelegateResponse.cs index 6473b858..22125d54 100644 --- a/Core/Responses/GetDelegateResponse.cs +++ b/Core/Responses/GetDelegateResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetDelegateResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -60,4 +75,4 @@ internal MeetingRequestsDeliveryScope MeetingRequestsDeliveryScope get { return this.meetingRequestsDeliveryScope; } } } -} +} \ No newline at end of file diff --git a/Core/Responses/GetDiscoverySearchConfigurationResponse.cs b/Core/Responses/GetDiscoverySearchConfigurationResponse.cs index c850f797..7f1b9304 100644 --- a/Core/Responses/GetDiscoverySearchConfigurationResponse.cs +++ b/Core/Responses/GetDiscoverySearchConfigurationResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetDiscoverySearchConfigurationResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -55,27 +70,6 @@ internal override void ReadElementsFromXml(EwsServiceXmlReader reader) reader.ReadEndElementIfNecessary(XmlNamespace.Messages, XmlElementNames.DiscoverySearchConfigurations); } - /// - /// Reads response elements from Json. - /// - /// The response object. - /// The service. - internal override void ReadElementsFromJson(JsonObject responseObject, ExchangeService service) - { - this.configurations.Clear(); - - base.ReadElementsFromJson(responseObject, service); - - if (responseObject.ContainsKey(XmlElementNames.DiscoverySearchConfigurations)) - { - foreach (object searchConfiguration in responseObject.ReadAsArray(XmlElementNames.DiscoverySearchConfigurations)) - { - JsonObject jsonSearchConfiguration = searchConfiguration as JsonObject; - this.configurations.Add(DiscoverySearchConfiguration.LoadFromJson(jsonSearchConfiguration)); - } - } - } - /// /// Searchable mailboxes result /// @@ -84,4 +78,4 @@ public DiscoverySearchConfiguration[] DiscoverySearchConfigurations get { return this.configurations.ToArray(); } } } -} +} \ No newline at end of file diff --git a/Core/Responses/GetEncryptionConfigurationResponse.cs b/Core/Responses/GetEncryptionConfigurationResponse.cs index 7fce38c4..8da47b39 100644 --- a/Core/Responses/GetEncryptionConfigurationResponse.cs +++ b/Core/Responses/GetEncryptionConfigurationResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetEncryptionConfigurationResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -100,16 +115,7 @@ internal override void ReadElementsFromXml(EwsServiceXmlReader reader) this.emailText = reader.ReadElementValue(XmlNamespace.Messages, XmlElementNames.EncryptionConfigurationEmailText); this.portalText = reader.ReadElementValue(XmlNamespace.Messages, XmlElementNames.EncryptionConfigurationPortalText); this.disclaimerText = reader.ReadElementValue(XmlNamespace.Messages, XmlElementNames.EncryptionConfigurationDisclaimerText); - - // TODO: Remove the try/catch after both client & server have been deployed to all machines - try - { - this.otpEnabled = reader.ReadElementValue(XmlNamespace.Messages, XmlElementNames.EncryptionConfigurationOTPEnabled); - } - catch (ServiceXmlDeserializationException) - { - this.otpEnabled = true; - } + this.otpEnabled = reader.ReadElementValue(XmlNamespace.Messages, XmlElementNames.EncryptionConfigurationOTPEnabled); } } -} +} \ No newline at end of file diff --git a/Core/Responses/GetEventsResponse.cs b/Core/Responses/GetEventsResponse.cs index 3273a446..2c683a94 100644 --- a/Core/Responses/GetEventsResponse.cs +++ b/Core/Responses/GetEventsResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetEventsResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -40,13 +55,6 @@ internal override void ReadElementsFromXml(EwsServiceXmlReader reader) this.results.LoadFromXml(reader); } - internal override void ReadElementsFromJson(JsonObject responseObject, ExchangeService service) - { - base.ReadElementsFromJson(responseObject, service); - - this.results.LoadFromJson(responseObject.ReadAsJsonObject(XmlElementNames.Notification), service); - } - /// /// Gets event results from subscription. /// @@ -55,4 +63,4 @@ internal GetEventsResults Results get { return this.results; } } } -} +} \ No newline at end of file diff --git a/Core/Responses/GetFolderResponse.cs b/Core/Responses/GetFolderResponse.cs index b50b263c..afc338c3 100644 --- a/Core/Responses/GetFolderResponse.cs +++ b/Core/Responses/GetFolderResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetFolderResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -57,26 +72,6 @@ internal override void ReadElementsFromXml(EwsServiceXmlReader reader) this.folder = folders[0]; } - /// - /// Reads response elements from Json. - /// - /// The response object. - /// The service. - internal override void ReadElementsFromJson(JsonObject responseObject, ExchangeService service) - { - base.ReadElementsFromJson(responseObject, service); - - List folders = new EwsServiceJsonReader(service).ReadServiceObjectsCollectionFromJson( - responseObject, - XmlElementNames.Folders, - this.GetObjectInstance, - true, /* clearPropertyBag */ - this.propertySet, /* requestedPropertySet */ - false); /* summaryPropertiesOnly */ - - this.folder = folders[0]; - } - /// /// Gets the folder instance. /// @@ -103,4 +98,4 @@ public Folder Folder get { return this.folder; } } } -} +} \ No newline at end of file diff --git a/Core/Responses/GetHoldOnMailboxesResponse.cs b/Core/Responses/GetHoldOnMailboxesResponse.cs index 05050656..37649287 100644 --- a/Core/Responses/GetHoldOnMailboxesResponse.cs +++ b/Core/Responses/GetHoldOnMailboxesResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetHoldOnMailboxesResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -40,23 +55,6 @@ internal override void ReadElementsFromXml(EwsServiceXmlReader reader) this.holdResult = MailboxHoldResult.LoadFromXml(reader); } - /// - /// Reads response elements from Json. - /// - /// The response object. - /// The service. - internal override void ReadElementsFromJson(JsonObject responseObject, ExchangeService service) - { - base.ReadElementsFromJson(responseObject, service); - - if (responseObject.ContainsKey(XmlElementNames.MailboxHoldResult)) - { - JsonObject jsonMailboxHold = responseObject.ReadAsJsonObject(XmlElementNames.MailboxHoldResult); - - this.holdResult = MailboxHoldResult.LoadFromJson(jsonMailboxHold); - } - } - /// /// Mailbox hold result /// @@ -65,4 +63,4 @@ public MailboxHoldResult HoldResult get { return this.holdResult; } } } -} +} \ No newline at end of file diff --git a/Core/Responses/GetInboxRulesResponse.cs b/Core/Responses/GetInboxRulesResponse.cs index c4e82666..02a3f245 100644 --- a/Core/Responses/GetInboxRulesResponse.cs +++ b/Core/Responses/GetInboxRulesResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetInboxRulesResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Core/Responses/GetItemResponse.cs b/Core/Responses/GetItemResponse.cs index 37c8e650..6af125c9 100644 --- a/Core/Responses/GetItemResponse.cs +++ b/Core/Responses/GetItemResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetItemResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -57,26 +72,6 @@ internal override void ReadElementsFromXml(EwsServiceXmlReader reader) this.item = items[0]; } - /// - /// Reads response elements from Json. - /// - /// The response object. - /// The service. - internal override void ReadElementsFromJson(JsonObject responseObject, ExchangeService service) - { - base.ReadElementsFromJson(responseObject, service); - - List items = new EwsServiceJsonReader(service).ReadServiceObjectsCollectionFromJson( - responseObject, - XmlElementNames.Items, - this.GetObjectInstance, - true, /* clearPropertyBag */ - this.propertySet, /* requestedPropertySet */ - false); /* summaryPropertiesOnly */ - - this.item = items[0]; - } - /// /// Gets Item instance. /// @@ -103,4 +98,4 @@ public Item Item get { return this.item; } } } -} +} \ No newline at end of file diff --git a/Core/Responses/GetNonIndexableItemDetailsResponse.cs b/Core/Responses/GetNonIndexableItemDetailsResponse.cs index 08e4be58..52c98139 100644 --- a/Core/Responses/GetNonIndexableItemDetailsResponse.cs +++ b/Core/Responses/GetNonIndexableItemDetailsResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetNonIndexableItemDetailsResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -38,16 +53,6 @@ internal override void ReadElementsFromXml(EwsServiceXmlReader reader) this.NonIndexableItemsResult = NonIndexableItemDetailsResult.LoadFromXml(reader); } - /// - /// Reads response elements from Json. - /// - /// The response object. - /// The service. - internal override void ReadElementsFromJson(JsonObject responseObject, ExchangeService service) - { - throw new NotImplementedException("GetNonIndexableItemdDetails doesn't support JSON."); - } - /// /// Non indexable item result /// @@ -57,4 +62,4 @@ public NonIndexableItemDetailsResult NonIndexableItemsResult internal set; } } -} +} \ No newline at end of file diff --git a/Core/Responses/GetNonIndexableItemStatisticsResponse.cs b/Core/Responses/GetNonIndexableItemStatisticsResponse.cs index 7c841835..cc6417ca 100644 --- a/Core/Responses/GetNonIndexableItemStatisticsResponse.cs +++ b/Core/Responses/GetNonIndexableItemStatisticsResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetNonIndexableItemStatisticsResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -38,16 +53,6 @@ internal override void ReadElementsFromXml(EwsServiceXmlReader reader) this.NonIndexableStatistics = NonIndexableItemStatistic.LoadFromXml(reader); } - /// - /// Reads response elements from Json. - /// - /// The response object. - /// The service. - internal override void ReadElementsFromJson(JsonObject responseObject, ExchangeService service) - { - throw new NotImplementedException("GetNonIndexableItemStatistics doesn't support JSON."); - } - /// /// List of non indexable statistic /// @@ -57,4 +62,4 @@ public List NonIndexableStatistics internal set; } } -} +} \ No newline at end of file diff --git a/Core/Responses/GetOMEConfigurationResponse.cs b/Core/Responses/GetOMEConfigurationResponse.cs new file mode 100644 index 00000000..1316ce46 --- /dev/null +++ b/Core/Responses/GetOMEConfigurationResponse.cs @@ -0,0 +1,65 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + /// + /// Represents the response to a GetOMEConfiguration operation. + /// + public sealed class GetOMEConfigurationResponse : ServiceResponse + { + /// + /// The XML representation of EncryptionConfigurationData + /// + private string xml; + + /// + /// Initializes a new instance of the class. + /// + internal GetOMEConfigurationResponse() + : base() + { + } + + /// + /// The XML representation of EncryptionConfigurationData + /// + public string Xml + { + get { return this.xml; } + } + + /// + /// Reads response elements from XML. + /// + /// The reader. + internal override void ReadElementsFromXml(EwsServiceXmlReader reader) + { + base.ReadElementsFromXml(reader); + + this.xml = reader.ReadElementValue(XmlNamespace.Messages, XmlElementNames.OMEConfigurationXml); + } + } +} \ No newline at end of file diff --git a/Core/Responses/GetPasswordExpirationDateResponse.cs b/Core/Responses/GetPasswordExpirationDateResponse.cs index 3ad2a368..617cb453 100644 --- a/Core/Responses/GetPasswordExpirationDateResponse.cs +++ b/Core/Responses/GetPasswordExpirationDateResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetPasswordExpirationDateResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -39,17 +54,6 @@ internal override void ReadElementsFromXml(EwsServiceXmlReader reader) this.passwordExpirationDate = reader.ReadElementValueAsDateTime(XmlNamespace.NotSpecified, XmlElementNames.PasswordExpirationDate); } - /// - /// Reads response elements from Json. - /// - /// The response object. - /// The service. - internal override void ReadElementsFromJson(JsonObject responseObject, ExchangeService service) - { - base.ReadElementsFromJson(responseObject, service); - this.passwordExpirationDate = service.ConvertUniversalDateTimeStringToLocalDateTime(responseObject.ReadAsString(XmlElementNames.PasswordExpirationDate)).Value; - } - /// /// Password expiration date /// @@ -58,4 +62,4 @@ public DateTime? PasswordExpirationDate get { return this.passwordExpirationDate; } } } -} +} \ No newline at end of file diff --git a/Core/Responses/GetPeopleInsightsResponse.cs b/Core/Responses/GetPeopleInsightsResponse.cs new file mode 100644 index 00000000..de830dd5 --- /dev/null +++ b/Core/Responses/GetPeopleInsightsResponse.cs @@ -0,0 +1,80 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + using System.Collections.ObjectModel; + using System.IO; + using System.Xml; + + /// + /// Represents the response to a GetPeopleInsights operation. + /// + internal sealed class GetPeopleInsightsResponse : ServiceResponse + { + /// + /// Initializes a new instance of the class. + /// + public GetPeopleInsightsResponse() + : base() + { + this.People = new Collection(); + } + + /// + /// Gets the People + /// + internal Collection People { get; private set; } + + /// + /// Read Person from XML. + /// + /// The reader. + internal override void ReadElementsFromXml(EwsServiceXmlReader reader) + { + EwsUtilities.Assert( + this.People != null, + "GetPeopleInsightsResponse.ReadElementsFromXml", + "People is null."); + + reader.ReadStartElement(XmlNamespace.Messages, XmlElementNames.People); + if (!reader.IsEmptyElement) + { + do + { + reader.Read(); + + if (reader.NodeType == XmlNodeType.Element) + { + Person item = new Person(); + item.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.Person); + this.People.Add(item); + } + } + while (!reader.IsEndElement(XmlNamespace.Messages, XmlElementNames.People)); + } + } + } +} \ No newline at end of file diff --git a/Core/Responses/GetPhoneCallResponse.cs b/Core/Responses/GetPhoneCallResponse.cs index d8b7a98b..168919dc 100644 --- a/Core/Responses/GetPhoneCallResponse.cs +++ b/Core/Responses/GetPhoneCallResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetPhoneCallResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Core/Responses/GetRoomListsResponse.cs b/Core/Responses/GetRoomListsResponse.cs index e0455d7c..29d056c7 100644 --- a/Core/Responses/GetRoomListsResponse.cs +++ b/Core/Responses/GetRoomListsResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetRoomListsResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -61,4 +76,4 @@ internal override void ReadElementsFromXml(EwsServiceXmlReader reader) return; } } -} +} \ No newline at end of file diff --git a/Core/Responses/GetRoomsResponse.cs b/Core/Responses/GetRoomsResponse.cs index 2d266f1c..0fd3a4be 100644 --- a/Core/Responses/GetRoomsResponse.cs +++ b/Core/Responses/GetRoomsResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetPhoneCallResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Core/Responses/GetSearchableMailboxesResponse.cs b/Core/Responses/GetSearchableMailboxesResponse.cs index 05c1a0aa..ace588b1 100644 --- a/Core/Responses/GetSearchableMailboxesResponse.cs +++ b/Core/Responses/GetSearchableMailboxesResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetSearchableMailboxesResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -60,27 +75,6 @@ internal override void ReadElementsFromXml(EwsServiceXmlReader reader) } } - /// - /// Reads response elements from Json. - /// - /// The response object. - /// The service. - internal override void ReadElementsFromJson(JsonObject responseObject, ExchangeService service) - { - this.searchableMailboxes.Clear(); - - base.ReadElementsFromJson(responseObject, service); - - if (responseObject.ContainsKey(XmlElementNames.SearchMailboxes)) - { - foreach (object searchableMailboxObject in responseObject.ReadAsArray(XmlElementNames.SearchableMailboxes)) - { - JsonObject jsonSearchableMailbox = searchableMailboxObject as JsonObject; - this.searchableMailboxes.Add(SearchableMailbox.LoadFromJson(jsonSearchableMailbox)); - } - } - } - /// /// Searchable mailboxes result /// @@ -94,4 +88,4 @@ public SearchableMailbox[] SearchableMailboxes /// public FailedSearchMailbox[] FailedMailboxes { get; set; } } -} +} \ No newline at end of file diff --git a/Core/Responses/GetServerTimeZonesResponse.cs b/Core/Responses/GetServerTimeZonesResponse.cs index d7d1053a..d586fab1 100644 --- a/Core/Responses/GetServerTimeZonesResponse.cs +++ b/Core/Responses/GetServerTimeZonesResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetServerTimeZonesResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -49,7 +64,7 @@ internal override void ReadElementsFromXml(EwsServiceXmlReader reader) TimeZoneDefinition timeZoneDefinition = new TimeZoneDefinition(); timeZoneDefinition.LoadFromXml(reader); - this.timeZones.Add(timeZoneDefinition.ToTimeZoneInfo()); + this.timeZones.Add(timeZoneDefinition.ToTimeZoneInfo(reader.Service)); } } while (!reader.IsEndElement(XmlNamespace.Messages, XmlElementNames.TimeZoneDefinitions)); @@ -65,4 +80,4 @@ public Collection TimeZones get { return this.timeZones; } } } -} +} \ No newline at end of file diff --git a/Core/Responses/GetStreamingEventsResponse.cs b/Core/Responses/GetStreamingEventsResponse.cs index 49b2f05a..1ec3bc95 100644 --- a/Core/Responses/GetStreamingEventsResponse.cs +++ b/Core/Responses/GetStreamingEventsResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetStreamingEventsResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -128,4 +143,4 @@ internal List ErrorSubscriptionIds private set; } } -} +} \ No newline at end of file diff --git a/Core/Responses/GetUserConfigurationResponse.cs b/Core/Responses/GetUserConfigurationResponse.cs index c2c7013b..7e951838 100644 --- a/Core/Responses/GetUserConfigurationResponse.cs +++ b/Core/Responses/GetUserConfigurationResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetUserConfigurationResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -46,13 +61,6 @@ internal override void ReadElementsFromXml(EwsServiceXmlReader reader) this.userConfiguration.LoadFromXml(reader); } - internal override void ReadElementsFromJson(JsonObject responseObject, ExchangeService service) - { - base.ReadElementsFromJson(responseObject, service); - - this.UserConfiguration.LoadFromJson(responseObject.ReadAsJsonObject(XmlElementNames.UserConfiguration), service); - } - /// /// Gets the user configuration that was created. /// @@ -61,4 +69,4 @@ public UserConfiguration UserConfiguration get { return this.userConfiguration; } } } -} +} \ No newline at end of file diff --git a/Core/Responses/GetUserOofSettingsResponse.cs b/Core/Responses/GetUserOofSettingsResponse.cs index 5532b5e2..82296c1c 100644 --- a/Core/Responses/GetUserOofSettingsResponse.cs +++ b/Core/Responses/GetUserOofSettingsResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetUserOofSettingsResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -39,4 +54,4 @@ public OofSettings OofSettings internal set { this.oofSettings = value; } } } -} +} \ No newline at end of file diff --git a/Core/Responses/GetUserPhotoResponse.cs b/Core/Responses/GetUserPhotoResponse.cs new file mode 100644 index 00000000..968481e0 --- /dev/null +++ b/Core/Responses/GetUserPhotoResponse.cs @@ -0,0 +1,115 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + using System; + using System.Collections.Generic; + using System.Globalization; + using System.IO; + using System.Net; + using System.Xml; + + /// + /// Represents the response to GetUserPhoto operation. + /// + internal sealed class GetUserPhotoResponse : ServiceResponse + { + /// + /// Initializes a new instance of the class. + /// + internal GetUserPhotoResponse() + { + this.Results = new GetUserPhotoResults(); + } + + /// + /// Gets GetUserPhoto results. + /// + /// GetUserPhoto results. + internal GetUserPhotoResults Results { get; private set; } + + /// + /// Read Photo results from XML. + /// + /// The reader. + internal override void ReadElementsFromXml(EwsServiceXmlReader reader) + { + bool hasChanged = reader.ReadElementValue(XmlNamespace.Messages, XmlElementNames.HasChanged); + + reader.ReadStartElement(XmlNamespace.Messages, XmlElementNames.PictureData); + byte[] photoData = reader.ReadBase64ElementValue(); + + // We only get a content type if we get a photo + if (photoData.Length > 0) + { + this.Results.Photo = photoData; + this.Results.ContentType = reader.ReadElementValue(XmlNamespace.Messages, XmlElementNames.ContentType); + } + + if (hasChanged) + { + if (this.Results.Photo.Length == 0) + { + this.Results.Status = GetUserPhotoStatus.PhotoOrUserNotFound; + } + else + { + this.Results.Status = GetUserPhotoStatus.PhotoReturned; + } + } + else + { + this.Results.Status = GetUserPhotoStatus.PhotoUnchanged; + } + } + + /// + /// Read Photo response headers + /// + /// The response header. + internal override void ReadHeader(WebHeaderCollection responseHeaders) + { + // Parse out the ETag, trimming the quotes + string etag = responseHeaders[HttpResponseHeader.ETag]; + if (etag != null) + { + etag = etag.Replace("\"", ""); + + if (etag.Length > 0) + { + this.Results.EntityTag = etag; + } + } + + // Parse the Expires tag, leaving it in UTC + string expires = responseHeaders[HttpResponseHeader.Expires]; + if (expires != null && expires.Length > 0) + { + this.Results.Expires = DateTime.Parse(expires, null, DateTimeStyles.RoundtripKind); + } + } + } +} \ No newline at end of file diff --git a/Core/Responses/GetUserRetentionPolicyTagsResponse.cs b/Core/Responses/GetUserRetentionPolicyTagsResponse.cs index 787d7c5e..5ab26d9f 100644 --- a/Core/Responses/GetUserRetentionPolicyTagsResponse.cs +++ b/Core/Responses/GetUserRetentionPolicyTagsResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the GetUserRetentionPolicyTagsResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -55,27 +70,6 @@ internal override void ReadElementsFromXml(EwsServiceXmlReader reader) } } - /// - /// Reads response elements from Json. - /// - /// The response object. - /// The service. - internal override void ReadElementsFromJson(JsonObject responseObject, ExchangeService service) - { - this.retentionPolicyTags.Clear(); - - base.ReadElementsFromJson(responseObject, service); - - if (responseObject.ContainsKey(XmlElementNames.RetentionPolicyTags)) - { - foreach (object retentionPolicyTagObject in responseObject.ReadAsArray(XmlElementNames.RetentionPolicyTags)) - { - JsonObject jsonRetentionPolicyTag = retentionPolicyTagObject as JsonObject; - this.retentionPolicyTags.Add(RetentionPolicyTag.LoadFromJson(jsonRetentionPolicyTag)); - } - } - } - /// /// Retention policy tags result. /// @@ -84,4 +78,4 @@ public RetentionPolicyTag[] RetentionPolicyTags get { return this.retentionPolicyTags.ToArray(); } } } -} +} \ No newline at end of file diff --git a/Core/Responses/InstallAppResponse.cs b/Core/Responses/InstallAppResponse.cs index 55c8a491..38f4b133 100644 --- a/Core/Responses/InstallAppResponse.cs +++ b/Core/Responses/InstallAppResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the InstallAppResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -29,4 +44,4 @@ public InstallAppResponse() { } } -} +} \ No newline at end of file diff --git a/Core/Responses/MarkAsJunkResponse.cs b/Core/Responses/MarkAsJunkResponse.cs index 593dbaf5..5ed4c736 100644 --- a/Core/Responses/MarkAsJunkResponse.cs +++ b/Core/Responses/MarkAsJunkResponse.cs @@ -1,8 +1,27 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -40,24 +59,9 @@ internal override void ReadElementsFromXml(EwsServiceXmlReader reader) } } - /// - /// Reads response elements from Json. - /// - /// Json response object - /// Exchange service - internal override void ReadElementsFromJson(JsonObject responseObject, ExchangeService service) - { - base.ReadElementsFromJson(responseObject, service); - if (responseObject.ContainsKey(XmlElementNames.Token)) - { - this.MovedItemId = new ItemId(); - this.MovedItemId.LoadFromJson(responseObject.ReadAsJsonObject(XmlElementNames.MovedItemId), service); - } - } - /// /// Gets the moved item id. /// public ItemId MovedItemId { get; private set; } } -} +} \ No newline at end of file diff --git a/Core/Responses/MoveCopyFolderResponse.cs b/Core/Responses/MoveCopyFolderResponse.cs index 058e3685..f11c044f 100644 --- a/Core/Responses/MoveCopyFolderResponse.cs +++ b/Core/Responses/MoveCopyFolderResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the MoveCopyFolderResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -59,26 +74,6 @@ internal override void ReadElementsFromXml(EwsServiceXmlReader reader) this.folder = folders[0]; } - /// - /// Reads response elements from Json. - /// - /// The response object. - /// The service. - internal override void ReadElementsFromJson(JsonObject responseObject, ExchangeService service) - { - EwsServiceJsonReader jsonReader = new EwsServiceJsonReader(service); - - List folders = jsonReader.ReadServiceObjectsCollectionFromJson( - responseObject, - XmlElementNames.Folders, - this.GetObjectInstance, - false, /* clearPropertyBag */ - null, /* requestedPropertySet */ - false); /* summaryPropertiesOnly */ - - this.folder = folders[0]; - } - /// /// Gets the new (moved or copied) folder. /// @@ -87,4 +82,4 @@ public Folder Folder get { return this.folder; } } } -} +} \ No newline at end of file diff --git a/Core/Responses/MoveCopyItemResponse.cs b/Core/Responses/MoveCopyItemResponse.cs index 74cfdec6..6cddd4a3 100644 --- a/Core/Responses/MoveCopyItemResponse.cs +++ b/Core/Responses/MoveCopyItemResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the MoveCopyItemResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -65,32 +80,6 @@ internal override void ReadElementsFromXml(EwsServiceXmlReader reader) } } - /// - /// Reads response elements from Json. - /// - /// The response object. - /// The service. - internal override void ReadElementsFromJson(JsonObject responseObject, ExchangeService service) - { - EwsServiceJsonReader jsonReader = new EwsServiceJsonReader(service); - - List items = jsonReader.ReadServiceObjectsCollectionFromJson( - responseObject, - XmlElementNames.Folders, - this.GetObjectInstance, - false, /* clearPropertyBag */ - null, /* requestedPropertySet */ - false); /* summaryPropertiesOnly */ - - // We only receive the copied or moved items if the copy or move operation was within - // a single mailbox. No item is returned if the operation is cross-mailbox, from a - // mailbox to a public folder or from a public folder to a mailbox. - if (items.Count > 0) - { - this.item = items[0]; - } - } - /// /// Gets the copied or moved item. Item is null if the copy or move operation was between /// two mailboxes or between a mailbox and a public folder. @@ -100,4 +89,4 @@ public Item Item get { return this.item; } } } -} +} \ No newline at end of file diff --git a/Core/Responses/PlayOnPhoneResponse.cs b/Core/Responses/PlayOnPhoneResponse.cs index 80b8cf25..fade6694 100644 --- a/Core/Responses/PlayOnPhoneResponse.cs +++ b/Core/Responses/PlayOnPhoneResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the PlayOnPhoneResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -47,13 +62,6 @@ internal override void ReadElementsFromXml(EwsServiceXmlReader reader) reader.ReadEndElementIfNecessary(XmlNamespace.Messages, XmlElementNames.PhoneCallId); } - internal override void ReadElementsFromJson(JsonObject responseObject, ExchangeService service) - { - base.ReadElementsFromJson(responseObject, service); - - this.phoneCallId.LoadFromJson(responseObject.ReadAsJsonObject(XmlElementNames.PhoneCallId), service); - } - /// /// Gets the Id of the phone call. /// @@ -65,4 +73,4 @@ internal PhoneCallId PhoneCallId } } } -} +} \ No newline at end of file diff --git a/Core/Responses/RegisterConsentResponse.cs b/Core/Responses/RegisterConsentResponse.cs new file mode 100644 index 00000000..7b4904dd --- /dev/null +++ b/Core/Responses/RegisterConsentResponse.cs @@ -0,0 +1,47 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + using System.Collections.ObjectModel; + using System.IO; + using System.Xml; + + /// + /// Represents the response to a RegisterResponse operation. + /// Today this class doesn't add extra functionality. Keep this class here so in the future + /// we can return extension info upon installation complete. + /// + internal sealed class RegisterConsentResponse : ServiceResponse + { + /// + /// Initializes a new instance of the class. + /// + public RegisterConsentResponse() + : base() + { + } + } +} \ No newline at end of file diff --git a/Core/Responses/ResolveNamesResponse.cs b/Core/Responses/ResolveNamesResponse.cs index 59ec22c7..58d2d013 100644 --- a/Core/Responses/ResolveNamesResponse.cs +++ b/Core/Responses/ResolveNamesResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ResolveNamesResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -47,18 +62,6 @@ internal override void ReadElementsFromXml(EwsServiceXmlReader reader) this.Resolutions.LoadFromXml(reader); } - /// - /// Reads response elements from Json. - /// - /// The response object. - /// The service. - internal override void ReadElementsFromJson(JsonObject responseObject, ExchangeService service) - { - base.ReadElementsFromJson(responseObject, service); - - this.Resolutions.LoadFromJson(responseObject.ReadAsJsonObject(XmlElementNames.ResolutionSet), service); - } - /// /// Override base implementation so that API does not throw when name resolution fails to find a match. /// EWS returns an error in this case but the API will just return an empty NameResolutionCollection. @@ -79,4 +82,4 @@ public NameResolutionCollection Resolutions get { return this.resolutions; } } } -} +} \ No newline at end of file diff --git a/Core/Responses/SearchMailboxesResponse.cs b/Core/Responses/SearchMailboxesResponse.cs index ea75a612..ab20fd6e 100644 --- a/Core/Responses/SearchMailboxesResponse.cs +++ b/Core/Responses/SearchMailboxesResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SearchMailboxesResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -42,23 +57,6 @@ internal override void ReadElementsFromXml(EwsServiceXmlReader reader) this.searchResult = SearchMailboxesResult.LoadFromXml(reader); } - /// - /// Reads response elements from Json. - /// - /// The response object. - /// The service. - internal override void ReadElementsFromJson(JsonObject responseObject, ExchangeService service) - { - base.ReadElementsFromJson(responseObject, service); - - if (responseObject.ContainsKey(XmlElementNames.SearchMailboxesResult)) - { - JsonObject jsonSearchResult = responseObject.ReadAsJsonObject(XmlElementNames.SearchMailboxesResult); - - this.searchResult = SearchMailboxesResult.LoadFromJson(jsonSearchResult); - } - } - /// /// Search mailboxes result /// @@ -68,4 +66,4 @@ public SearchMailboxesResult SearchResult internal set { this.searchResult = value; } } } -} +} \ No newline at end of file diff --git a/Core/Responses/ServiceResponse.cs b/Core/Responses/ServiceResponse.cs index 82a60937..9a083c7f 100644 --- a/Core/Responses/ServiceResponse.cs +++ b/Core/Responses/ServiceResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ServiceResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -14,6 +29,7 @@ namespace Microsoft.Exchange.WebServices.Data using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; + using System.Net; /// /// Represents the standard response to an Exchange Web Services operation. @@ -129,35 +145,6 @@ internal void LoadFromXml(EwsServiceXmlReader reader, string xmlElementName) this.Loaded(); } - /// - /// Loads from json. - /// - /// The response object. - /// The service. - internal void LoadFromJson(JsonObject responseObject, ExchangeService service) - { - this.result = (ServiceResult)Enum.Parse(typeof(ServiceResult), responseObject.ReadAsString(XmlAttributeNames.ResponseClass)); - this.errorCode = (ServiceError)Enum.Parse(typeof(ServiceError), responseObject.ReadAsString(XmlElementNames.ResponseCode)); - - // TODO: Deal with a JSON version of "LoadExtraDetailsFromXml" - if (this.result == ServiceResult.Warning || this.result == ServiceResult.Error) - { - this.errorMessage = responseObject.ReadAsString(XmlElementNames.MessageText); - } - - if (this.result == ServiceResult.Success || this.result == ServiceResult.Warning) - { - if (!this.BatchProcessingStopped) - { - this.ReadElementsFromJson(responseObject, service); - } - } - - this.MapErrorCodeToErrorMessage(); - - this.Loaded(); - } - /// /// Parses the message XML. /// @@ -229,11 +216,10 @@ internal virtual void ReadElementsFromXml(EwsServiceXmlReader reader) } /// - /// Reads response elements from Json. + /// Reads the headers from a HTTP response /// - /// The response object. - /// The service. - internal virtual void ReadElementsFromJson(JsonObject responseObject, ExchangeService service) + /// a collection of response headers + internal virtual void ReadHeader(WebHeaderCollection responseHeaders) { } @@ -334,4 +320,4 @@ public Collection ErrorProperties get { return this.errorProperties; } } } -} +} \ No newline at end of file diff --git a/Core/Responses/ServiceResponseCollection.cs b/Core/Responses/ServiceResponseCollection.cs index f471eba2..03d53b22 100644 --- a/Core/Responses/ServiceResponseCollection.cs +++ b/Core/Responses/ServiceResponseCollection.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ServiceResponseCollection class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -114,4 +129,4 @@ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() #endregion } -} +} \ No newline at end of file diff --git a/Core/Responses/SetEncryptionConfigurationResponse.cs b/Core/Responses/SetEncryptionConfigurationResponse.cs index b302d1cd..4e3b1a38 100644 --- a/Core/Responses/SetEncryptionConfigurationResponse.cs +++ b/Core/Responses/SetEncryptionConfigurationResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SetEncryptionConfigurationResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Core/Responses/SetHoldOnMailboxesResponse.cs b/Core/Responses/SetHoldOnMailboxesResponse.cs index 96560412..56975c64 100644 --- a/Core/Responses/SetHoldOnMailboxesResponse.cs +++ b/Core/Responses/SetHoldOnMailboxesResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SetHoldOnMailboxesResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -40,23 +55,6 @@ internal override void ReadElementsFromXml(EwsServiceXmlReader reader) this.holdResult = MailboxHoldResult.LoadFromXml(reader); } - /// - /// Reads response elements from Json. - /// - /// The response object. - /// The service. - internal override void ReadElementsFromJson(JsonObject responseObject, ExchangeService service) - { - base.ReadElementsFromJson(responseObject, service); - - if (responseObject.ContainsKey(XmlElementNames.MailboxHoldResult)) - { - JsonObject jsonMailboxHold = responseObject.ReadAsJsonObject(XmlElementNames.MailboxHoldResult); - - this.holdResult = MailboxHoldResult.LoadFromJson(jsonMailboxHold); - } - } - /// /// Mailbox hold result /// @@ -65,4 +63,4 @@ public MailboxHoldResult HoldResult get { return this.holdResult; } } } -} +} \ No newline at end of file diff --git a/Core/Responses/SetOMEConfigurationResponse.cs b/Core/Responses/SetOMEConfigurationResponse.cs new file mode 100644 index 00000000..f8ebfa6f --- /dev/null +++ b/Core/Responses/SetOMEConfigurationResponse.cs @@ -0,0 +1,41 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + /// + /// Represents the response to a SetOMEConfigurationResponse operation. + /// + internal sealed class SetOMEConfigurationResponse : ServiceResponse + { + /// + /// Initializes a new instance of the class. + /// + public SetOMEConfigurationResponse() + : base() + { + } + } +} \ No newline at end of file diff --git a/Core/Responses/SubscribeResponse.cs b/Core/Responses/SubscribeResponse.cs index 1733d4fd..bc3cd955 100644 --- a/Core/Responses/SubscribeResponse.cs +++ b/Core/Responses/SubscribeResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SubscribeResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -49,13 +64,6 @@ internal override void ReadElementsFromXml(EwsServiceXmlReader reader) this.subscription.LoadFromXml(reader); } - internal override void ReadElementsFromJson(JsonObject responseObject, ExchangeService service) - { - base.ReadElementsFromJson(responseObject, service); - - this.subscription.LoadFromJson(responseObject, service); - } - /// /// Gets the subscription that was created. /// @@ -64,4 +72,4 @@ public TSubscription Subscription get { return this.subscription; } } } -} +} \ No newline at end of file diff --git a/Core/Responses/SuggestionsResponse.cs b/Core/Responses/SuggestionsResponse.cs index b019a487..85a7a4d3 100644 --- a/Core/Responses/SuggestionsResponse.cs +++ b/Core/Responses/SuggestionsResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SuggestionsResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -62,4 +77,4 @@ internal Collection Suggestions get { return this.daySuggestions; } } } -} +} \ No newline at end of file diff --git a/Core/Responses/SyncFolderHierarchyResponse.cs b/Core/Responses/SyncFolderHierarchyResponse.cs index ddf6208c..bfff7004 100644 --- a/Core/Responses/SyncFolderHierarchyResponse.cs +++ b/Core/Responses/SyncFolderHierarchyResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SyncFolderHierarchyResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -75,4 +90,4 @@ internal override bool SummaryPropertiesOnly get { return false; } } } -} +} \ No newline at end of file diff --git a/Core/Responses/SyncFolderItemsResponse.cs b/Core/Responses/SyncFolderItemsResponse.cs index cdec395c..4fbec901 100644 --- a/Core/Responses/SyncFolderItemsResponse.cs +++ b/Core/Responses/SyncFolderItemsResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SyncFolderItemsResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -75,4 +90,4 @@ internal override bool SummaryPropertiesOnly get { return true; } } } -} +} \ No newline at end of file diff --git a/Core/Responses/SyncResponse.cs b/Core/Responses/SyncResponse.cs index e87b82b6..39943dd4 100644 --- a/Core/Responses/SyncResponse.cs +++ b/Core/Responses/SyncResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SyncResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -157,85 +172,6 @@ internal override void ReadElementsFromXml(EwsServiceXmlReader reader) } } - /// - /// Reads response elements from Json. - /// - /// The response object. - /// The service. - internal override void ReadElementsFromJson(JsonObject responseObject, ExchangeService service) - { - this.Changes.SyncState = responseObject.ReadAsString(XmlElementNames.SyncState); - this.Changes.MoreChangesAvailable = !responseObject.ReadAsBool(this.GetIncludesLastInRangeXmlElementName()); - - JsonObject changesElement = responseObject.ReadAsJsonObject(XmlElementNames.Changes); - - foreach (object changeElement in changesElement.ReadAsArray(XmlElementNames.Changes)) - { - JsonObject jsonChange = changeElement as JsonObject; - - TChange change = this.CreateChangeInstance(); - - string changeType = jsonChange.ReadAsString(XmlElementNames.ChangeType); - - switch (changeType) - { - case XmlElementNames.Create: - change.ChangeType = ChangeType.Create; - break; - case XmlElementNames.Update: - change.ChangeType = ChangeType.Update; - break; - case XmlElementNames.Delete: - change.ChangeType = ChangeType.Delete; - break; - case XmlElementNames.ReadFlagChange: - change.ChangeType = ChangeType.ReadFlagChange; - break; - default: - break; - } - - if (change != null) - { - switch (change.ChangeType) - { - case ChangeType.Delete: - case ChangeType.ReadFlagChange: - change.Id = change.CreateId(); - JsonObject jsonChangeId = jsonChange.ReadAsJsonObject(this.GetChangeIdElementName()); - change.Id.LoadFromJson(jsonChangeId, service); - - if (change.ChangeType == ChangeType.ReadFlagChange) - { - ItemChange itemChange = change as ItemChange; - - EwsUtilities.Assert( - itemChange != null, - "SyncResponse.ReadElementsFromJson", - "ReadFlagChange is only valid on ItemChange"); - - itemChange.IsRead = jsonChange.ReadAsBool(XmlElementNames.IsRead); - } - - break; - default: - JsonObject jsonServiceObject = jsonChange.ReadAsJsonObject(this.GetChangeElementName()); - change.ServiceObject = EwsUtilities.CreateEwsObjectFromXmlElementName(service, jsonServiceObject.ReadTypeString()); - - change.ServiceObject.LoadFromJson( - jsonServiceObject, - service, - true, /* clearPropertyBag */ - this.propertySet, - this.SummaryPropertiesOnly); - break; - } - - this.changes.Add(change); - } - } - } - /// /// Gets a list of changes that occurred on the synchronized folder. /// @@ -252,4 +188,4 @@ internal abstract bool SummaryPropertiesOnly get; } } -} +} \ No newline at end of file diff --git a/Core/Responses/UninstallAppResponse.cs b/Core/Responses/UninstallAppResponse.cs index 547237bc..567af3fa 100644 --- a/Core/Responses/UninstallAppResponse.cs +++ b/Core/Responses/UninstallAppResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the UninstallAppResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -29,4 +44,4 @@ public UninstallAppResponse() { } } -} +} \ No newline at end of file diff --git a/Core/Responses/UpdateFolderResponse.cs b/Core/Responses/UpdateFolderResponse.cs index 6f2b071e..11c35c74 100644 --- a/Core/Responses/UpdateFolderResponse.cs +++ b/Core/Responses/UpdateFolderResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the UpdateFolderResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -74,4 +89,4 @@ private Folder GetObjectInstance(ExchangeService session, string xmlElementName) return this.folder; } } -} +} \ No newline at end of file diff --git a/Core/Responses/UpdateInboxRulesResponse.cs b/Core/Responses/UpdateInboxRulesResponse.cs index cb8e9de3..2365ba76 100644 --- a/Core/Responses/UpdateInboxRulesResponse.cs +++ b/Core/Responses/UpdateInboxRulesResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the UpdateInboxRulesResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Core/Responses/UpdateItemResponse.cs b/Core/Responses/UpdateItemResponse.cs index c8fb0690..965dc108 100644 --- a/Core/Responses/UpdateItemResponse.cs +++ b/Core/Responses/UpdateItemResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the UpdateItemResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -82,50 +97,6 @@ internal override void ReadElementsFromXml(EwsServiceXmlReader reader) } } - /// - /// Reads response elements from Json. - /// - /// The response object. - /// The service. - internal override void ReadElementsFromJson(JsonObject responseObject, ExchangeService service) - { - base.ReadElementsFromJson(responseObject, service); - - new EwsServiceJsonReader(service).ReadServiceObjectsCollectionFromJson( - responseObject, - XmlElementNames.Items, - this.GetObjectInstance, - false, /* clearPropertyBag */ - null, /* requestedPropertySet */ - false); /* summaryPropertiesOnly */ - - // ConflictResults was only added in 2007 SP1 so if this was a 2007 RTM request we shouldn't expect to find the element - if (!service.Exchange2007CompatibilityMode) - { - this.conflictCount = responseObject.ReadAsJsonObject(XmlElementNames.ConflictResults).ReadAsInt(XmlElementNames.Count); - } - - // If UpdateItem returned an item that has the same Id as the item that - // is being updated, this is a "normal" UpdateItem operation, and we need - // to update the ChangeKey of the item being updated with the one that was - // returned. Also set returnedItem to indicate that no new item was returned. - // - // Otherwise, this in a "special" UpdateItem operation, such as a recurring - // task marked as complete (the returned item in that case is the one-off - // task that represents the completed instance). - // - // Note that there can be no returned item at all, as in an UpdateItem call - // with MessageDisposition set to SendOnly or SendAndSaveCopy. - if (this.returnedItem != null) - { - if (this.item.Id.UniqueId == this.returnedItem.Id.UniqueId) - { - this.item.Id.ChangeKey = this.returnedItem.Id.ChangeKey; - this.returnedItem = null; - } - } - } - /// /// Clears the change log of the created folder if the creation succeeded. /// @@ -167,4 +138,4 @@ public int ConflictCount get { return this.conflictCount; } } } -} +} \ No newline at end of file diff --git a/Core/ServiceObjects/Folders/CalendarFolder.cs b/Core/ServiceObjects/Folders/CalendarFolder.cs index 5b97f400..2f9ff644 100644 --- a/Core/ServiceObjects/Folders/CalendarFolder.cs +++ b/Core/ServiceObjects/Folders/CalendarFolder.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the CalendarFolder class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -121,4 +136,4 @@ internal override ExchangeVersion GetMinimumRequiredServerVersion() return ExchangeVersion.Exchange2007_SP1; } } -} +} \ No newline at end of file diff --git a/Core/ServiceObjects/Folders/ContactsFolder.cs b/Core/ServiceObjects/Folders/ContactsFolder.cs index 9abd9580..a821ea34 100644 --- a/Core/ServiceObjects/Folders/ContactsFolder.cs +++ b/Core/ServiceObjects/Folders/ContactsFolder.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ContactsFolder class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -99,4 +114,4 @@ internal override ExchangeVersion GetMinimumRequiredServerVersion() return ExchangeVersion.Exchange2007_SP1; } } -} +} \ No newline at end of file diff --git a/Core/ServiceObjects/Folders/Folder.cs b/Core/ServiceObjects/Folders/Folder.cs index ff334a34..60f3d465 100644 --- a/Core/ServiceObjects/Folders/Folder.cs +++ b/Core/ServiceObjects/Folders/Folder.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the Folder class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -648,14 +663,35 @@ public ArchiveTag ArchiveTag } /// - /// Gets the name of the well known folder. + /// Gets the well known name of this folder, if any, as a string. /// - /// The name of the well known folder. + /// The well known name of this folder as a string, or null if this folder isn't a well known folder. + public string WellKnownFolderNameAsString + { + get { return (string)this.PropertyBag[FolderSchema.WellKnownFolderName]; } + } + + /// + /// Gets the well known name of this folder, if any. + /// + /// The well known name of this folder, or null if this folder isn't a well known folder. public WellKnownFolderName? WellKnownFolderName { - get { return (WellKnownFolderName?)this.PropertyBag[FolderSchema.WellKnownFolderName]; } + get + { + WellKnownFolderName result; + + if (EwsUtilities.TryParse(this.WellKnownFolderNameAsString, out result)) + { + return result; + } + else + { + return null; + } + } } #endregion } -} +} \ No newline at end of file diff --git a/Core/ServiceObjects/Folders/SearchFolder.cs b/Core/ServiceObjects/Folders/SearchFolder.cs index bb4dc451..0825740d 100644 --- a/Core/ServiceObjects/Folders/SearchFolder.cs +++ b/Core/ServiceObjects/Folders/SearchFolder.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SearchFolder class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -137,4 +152,4 @@ public SearchFolderParameters SearchParameters #endregion } -} +} \ No newline at end of file diff --git a/Core/ServiceObjects/Folders/TasksFolder.cs b/Core/ServiceObjects/Folders/TasksFolder.cs index e65eae9c..ca46df86 100644 --- a/Core/ServiceObjects/Folders/TasksFolder.cs +++ b/Core/ServiceObjects/Folders/TasksFolder.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the TasksFolder class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -103,4 +118,4 @@ internal override ExchangeVersion GetMinimumRequiredServerVersion() return ExchangeVersion.Exchange2007_SP1; } } -} +} \ No newline at end of file diff --git a/Core/ServiceObjects/Items/Appointment.cs b/Core/ServiceObjects/Items/Appointment.cs index f0f6c283..0f5fc3fe 100644 --- a/Core/ServiceObjects/Items/Appointment.cs +++ b/Core/ServiceObjects/Items/Appointment.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the Appointment class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Core/ServiceObjects/Items/Contact.cs b/Core/ServiceObjects/Items/Contact.cs index 3a797029..f91d45b9 100644 --- a/Core/ServiceObjects/Items/Contact.cs +++ b/Core/ServiceObjects/Items/Contact.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the Contact class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -580,4 +595,4 @@ public EmailAddressCollection DirectReports #endregion } -} +} \ No newline at end of file diff --git a/Core/ServiceObjects/Items/ContactGroup.cs b/Core/ServiceObjects/Items/ContactGroup.cs index 70ae5120..c5c033ba 100644 --- a/Core/ServiceObjects/Items/ContactGroup.cs +++ b/Core/ServiceObjects/Items/ContactGroup.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ContactGroup class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -138,4 +153,4 @@ internal override void SetSubject(string subject) throw new ServiceObjectPropertyException(Strings.PropertyIsReadOnly, ContactGroupSchema.Subject); } } -} +} \ No newline at end of file diff --git a/Core/ServiceObjects/Items/Conversation.cs b/Core/ServiceObjects/Items/Conversation.cs index 268133e5..ccc9935a 100644 --- a/Core/ServiceObjects/Items/Conversation.cs +++ b/Core/ServiceObjects/Items/Conversation.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the Conversation class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -123,16 +138,6 @@ internal override bool GetIsTimeZoneHeaderRequired(bool isUpdateOperation) throw new NotSupportedException(); } - /// - /// This method is not supported in this object. - /// Gets the extended properties collection. - /// - /// Extended properties collection. - internal override ExtendedPropertyCollection GetExtendedProperties() - { - throw new NotSupportedException(); - } - #endregion #region Conversation Action Methods diff --git a/Core/ServiceObjects/Items/EmailMessage.cs b/Core/ServiceObjects/Items/EmailMessage.cs index 66f7abc8..43c33f39 100644 --- a/Core/ServiceObjects/Items/EmailMessage.cs +++ b/Core/ServiceObjects/Items/EmailMessage.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the EmailMessage class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -276,6 +291,14 @@ public EmailAddressCollection BccRecipients get { return (EmailAddressCollection)this.PropertyBag[EmailMessageSchema.BccRecipients]; } } + /// + /// Gets the Likers associated with the message. + /// + public EmailAddressCollection Likers + { + get { return (EmailAddressCollection)this.PropertyBag[EmailMessageSchema.Likers]; } + } + /// /// Gets the list of Cc recipients for the e-mail message. /// @@ -360,7 +383,7 @@ public bool? IsResponseRequested } /// - /// Gets the Internat Message Id of the e-mail message. + /// Gets the Internet Message Id of the e-mail message. /// public string InternetMessageId { @@ -426,4 +449,4 @@ public VotingInformation VotingInformation } #endregion } -} +} \ No newline at end of file diff --git a/Core/ServiceObjects/Items/Item.cs b/Core/ServiceObjects/Items/Item.cs index 4c1fce0a..2381628e 100644 --- a/Core/ServiceObjects/Items/Item.cs +++ b/Core/ServiceObjects/Items/Item.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the Item class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Core/ServiceObjects/Items/MeetingCancellation.cs b/Core/ServiceObjects/Items/MeetingCancellation.cs index 557dd98d..b5ae806a 100644 --- a/Core/ServiceObjects/Items/MeetingCancellation.cs +++ b/Core/ServiceObjects/Items/MeetingCancellation.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the MeetingCancellation class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -139,4 +154,4 @@ public EnhancedLocation EnhancedLocation get { return (EnhancedLocation)this.PropertyBag[MeetingCancellationSchema.EnhancedLocation]; } } } -} +} \ No newline at end of file diff --git a/Core/ServiceObjects/Items/MeetingMessage.cs b/Core/ServiceObjects/Items/MeetingMessage.cs index 6be600c8..c3e2d0c4 100644 --- a/Core/ServiceObjects/Items/MeetingMessage.cs +++ b/Core/ServiceObjects/Items/MeetingMessage.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the MeetingMessage class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -163,4 +178,4 @@ public DateTime? ICalDateTimeStamp } #endregion } -} +} \ No newline at end of file diff --git a/Core/ServiceObjects/Items/MeetingRequest.cs b/Core/ServiceObjects/Items/MeetingRequest.cs index 4b9ac723..4430fced 100644 --- a/Core/ServiceObjects/Items/MeetingRequest.cs +++ b/Core/ServiceObjects/Items/MeetingRequest.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the MeetingRequest class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Core/ServiceObjects/Items/MeetingResponse.cs b/Core/ServiceObjects/Items/MeetingResponse.cs index ed389dab..274ba135 100644 --- a/Core/ServiceObjects/Items/MeetingResponse.cs +++ b/Core/ServiceObjects/Items/MeetingResponse.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the MeetingResponse class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -143,4 +158,4 @@ public EnhancedLocation EnhancedLocation get { return (EnhancedLocation)this.PropertyBag[MeetingResponseSchema.EnhancedLocation]; } } } -} +} \ No newline at end of file diff --git a/Core/ServiceObjects/Items/Persona.cs b/Core/ServiceObjects/Items/Persona.cs new file mode 100644 index 00000000..551deed4 --- /dev/null +++ b/Core/ServiceObjects/Items/Persona.cs @@ -0,0 +1,382 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + using System; + + /// + /// Represents a Persona. Properties available on Personas are defined in the PersonaSchema class. + /// + [Attachable] + [ServiceObjectDefinition(XmlElementNames.Persona)] + public class Persona : Item + { + /// + /// Initializes an unsaved local instance of . To bind to an existing Persona, use Persona.Bind() instead. + /// + /// The ExchangeService object to which the Persona will be bound. + public Persona(ExchangeService service) + : base(service) + { + this.PersonaType = string.Empty; + this.CreationTime = null; + this.DisplayNameFirstLastHeader = string.Empty; + this.DisplayNameLastFirstHeader = string.Empty; + this.DisplayName = string.Empty; + this.DisplayNameFirstLast = string.Empty; + this.DisplayNameLastFirst = string.Empty; + this.FileAs = string.Empty; + this.Generation = string.Empty; + this.DisplayNamePrefix = string.Empty; + this.GivenName = string.Empty; + this.Surname = string.Empty; + this.Title = string.Empty; + this.CompanyName = string.Empty; + this.ImAddress = string.Empty; + this.HomeCity = string.Empty; + this.WorkCity = string.Empty; + this.Alias = string.Empty; + this.RelevanceScore = 0; + + // Remaining properties are initialized when the property definition is created in + // PersonaSchema.cs. + } + + /// + /// Binds to an existing Persona and loads the specified set of properties. + /// Calling this method results in a call to EWS. + /// + /// The service to use to bind to the Persona. + /// The Id of the Persona to bind to. + /// The set of properties to load. + /// A Persona instance representing the Persona corresponding to the specified Id. + public static new Persona Bind( + ExchangeService service, + ItemId id, + PropertySet propertySet) + { + return service.BindToItem(id, propertySet); + } + + /// + /// Binds to an existing Persona and loads its first class properties. + /// Calling this method results in a call to EWS. + /// + /// The service to use to bind to the Persona. + /// The Id of the Persona to bind to. + /// A Persona instance representing the Persona corresponding to the specified Id. + public static new Persona Bind(ExchangeService service, ItemId id) + { + return Persona.Bind( + service, + id, + PropertySet.FirstClassProperties); + } + + /// + /// Internal method to return the schema associated with this type of object. + /// + /// The schema associated with this type of object. + internal override ServiceObjectSchema GetSchema() + { + return PersonaSchema.Instance; + } + + /// + /// Gets the minimum required server version. + /// + /// Earliest Exchange version in which this service object type is supported. + internal override ExchangeVersion GetMinimumRequiredServerVersion() + { + return ExchangeVersion.Exchange2013_SP1; + } + + /// + /// The property definition for the Id of this object. + /// + /// A PropertyDefinition instance. + internal override PropertyDefinition GetIdPropertyDefinition() + { + return PersonaSchema.PersonaId; + } + + /// + /// Validates this instance. + /// + internal override void Validate() + { + base.Validate(); + } + + #region Properties + + /// + /// Gets the persona id + /// + public ItemId PersonaId + { + get { return (ItemId)this.PropertyBag[this.GetIdPropertyDefinition()]; } + set { this.PropertyBag[this.GetIdPropertyDefinition()] = value; } + } + + /// + /// Gets the persona type + /// + public string PersonaType + { + get { return (string)this.PropertyBag[PersonaSchema.PersonaType]; } + set { this.PropertyBag[PersonaSchema.PersonaType] = value; } + } + + /// + /// Gets the creation time of the underlying contact + /// + public DateTime? CreationTime + { + get { return (DateTime?)this.PropertyBag[PersonaSchema.CreationTime]; } + set { this.PropertyBag[PersonaSchema.CreationTime] = value; } + } + + /// + /// Gets the header of the FirstLast display name + /// + public string DisplayNameFirstLastHeader + { + get { return (string)this.PropertyBag[PersonaSchema.DisplayNameFirstLastHeader]; } + set { this.PropertyBag[PersonaSchema.DisplayNameFirstLastHeader] = value; } + } + + /// + /// Gets the header of the LastFirst display name + /// + public string DisplayNameLastFirstHeader + { + get { return (string)this.PropertyBag[PersonaSchema.DisplayNameLastFirstHeader]; } + set { this.PropertyBag[PersonaSchema.DisplayNameLastFirstHeader] = value; } + } + + /// + /// Gets the display name + /// + public string DisplayName + { + get { return (string)this.PropertyBag[PersonaSchema.DisplayName]; } + set { this.PropertyBag[PersonaSchema.DisplayName] = value; } + } + + /// + /// Gets the display name in first last order + /// + public string DisplayNameFirstLast + { + get { return (string)this.PropertyBag[PersonaSchema.DisplayNameFirstLast]; } + set { this.PropertyBag[PersonaSchema.DisplayNameFirstLast] = value; } + } + + /// + /// Gets the display name in last first order + /// + public string DisplayNameLastFirst + { + get { return (string)this.PropertyBag[PersonaSchema.DisplayNameLastFirst]; } + set { this.PropertyBag[PersonaSchema.DisplayNameLastFirst] = value; } + } + + /// + /// Gets the name under which this Persona is filed as. FileAs can be manually set or + /// can be automatically calculated based on the value of the FileAsMapping property. + /// + public string FileAs + { + get { return (string)this.PropertyBag[PersonaSchema.FileAs]; } + set { this.PropertyBag[PersonaSchema.FileAs] = value; } + } + + /// + /// Gets the generation of the Persona + /// + public string Generation + { + get { return (string)this.PropertyBag[PersonaSchema.Generation]; } + set { this.PropertyBag[PersonaSchema.Generation] = value; } + } + + /// + /// Gets the DisplayNamePrefix of the Persona + /// + public string DisplayNamePrefix + { + get { return (string)this.PropertyBag[PersonaSchema.DisplayNamePrefix]; } + set { this.PropertyBag[PersonaSchema.DisplayNamePrefix] = value; } + } + + /// + /// Gets the given name of the Persona + /// + public string GivenName + { + get { return (string)this.PropertyBag[PersonaSchema.GivenName]; } + set { this.PropertyBag[PersonaSchema.GivenName] = value; } + } + + /// + /// Gets the surname of the Persona + /// + public string Surname + { + get { return (string)this.PropertyBag[PersonaSchema.Surname]; } + set { this.PropertyBag[PersonaSchema.Surname] = value; } + } + + /// + /// Gets the Persona's title + /// + public string Title + { + get { return (string)this.PropertyBag[PersonaSchema.Title]; } + set { this.PropertyBag[PersonaSchema.Title] = value; } + } + + /// + /// Gets the company name of the Persona + /// + public string CompanyName + { + get { return (string)this.PropertyBag[PersonaSchema.CompanyName]; } + set { this.PropertyBag[PersonaSchema.CompanyName] = value; } + } + + /// + /// Gets the email of the persona + /// + public PersonaEmailAddress EmailAddress + { + get { return (PersonaEmailAddress)this.PropertyBag[PersonaSchema.EmailAddress]; } + set { this.PropertyBag[PersonaSchema.EmailAddress] = value; } + } + + /// + /// Gets the list of e-mail addresses of the contact + /// + public PersonaEmailAddressCollection EmailAddresses + { + get { return (PersonaEmailAddressCollection)this.PropertyBag[PersonaSchema.EmailAddresses]; } + set { this.PropertyBag[PersonaSchema.EmailAddresses] = value; } + } + + /// + /// Gets the IM address of the persona + /// + public string ImAddress + { + get { return (string)this.PropertyBag[PersonaSchema.ImAddress]; } + set { this.PropertyBag[PersonaSchema.ImAddress] = value; } + } + + /// + /// Gets the city of the Persona's home + /// + public string HomeCity + { + get { return (string)this.PropertyBag[PersonaSchema.HomeCity]; } + set { this.PropertyBag[PersonaSchema.HomeCity] = value; } + } + + /// + /// Gets the city of the Persona's work place + /// + public string WorkCity + { + get { return (string)this.PropertyBag[PersonaSchema.WorkCity]; } + set { this.PropertyBag[PersonaSchema.WorkCity] = value; } + } + + /// + /// Gets the alias of the Persona + /// + public string Alias + { + get { return (string)this.PropertyBag[PersonaSchema.Alias]; } + set { this.PropertyBag[PersonaSchema.Alias] = value; } + } + + /// + /// Gets the relevance score + /// + public int RelevanceScore + { + get { return (int)this.PropertyBag[PersonaSchema.RelevanceScore]; } + set { this.PropertyBag[PersonaSchema.RelevanceScore] = value; } + } + + /// + /// Gets the list of attributions + /// + public AttributionCollection Attributions + { + get { return (AttributionCollection)this.PropertyBag[PersonaSchema.Attributions]; } + set { this.PropertyBag[PersonaSchema.Attributions] = value; } + } + + /// + /// Gets the list of office locations + /// + public AttributedStringCollection OfficeLocations + { + get { return (AttributedStringCollection)this.PropertyBag[PersonaSchema.OfficeLocations]; } + set { this.PropertyBag[PersonaSchema.OfficeLocations] = value; } + } + + /// + /// Gets the list of IM addresses of the persona + /// + public AttributedStringCollection ImAddresses + { + get { return (AttributedStringCollection)this.PropertyBag[PersonaSchema.ImAddresses]; } + set { this.PropertyBag[PersonaSchema.ImAddresses] = value; } + } + + /// + /// Gets the list of departments of the persona + /// + public AttributedStringCollection Departments + { + get { return (AttributedStringCollection)this.PropertyBag[PersonaSchema.Departments]; } + set { this.PropertyBag[PersonaSchema.Departments] = value; } + } + + /// + /// Gets the list of photo URLs + /// + public AttributedStringCollection ThirdPartyPhotoUrls + { + get { return (AttributedStringCollection)this.PropertyBag[PersonaSchema.ThirdPartyPhotoUrls]; } + set { this.PropertyBag[PersonaSchema.ThirdPartyPhotoUrls] = value; } + } + + #endregion + } +} \ No newline at end of file diff --git a/Core/ServiceObjects/Items/PostItem.cs b/Core/ServiceObjects/Items/PostItem.cs index d3ebc7bf..41f114bd 100644 --- a/Core/ServiceObjects/Items/PostItem.cs +++ b/Core/ServiceObjects/Items/PostItem.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the PostItem class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -248,4 +263,4 @@ public EmailAddress Sender #endregion } -} +} \ No newline at end of file diff --git a/Core/ServiceObjects/Items/Task.cs b/Core/ServiceObjects/Items/Task.cs index e3a0a507..783eac56 100644 --- a/Core/ServiceObjects/Items/Task.cs +++ b/Core/ServiceObjects/Items/Task.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the Task class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Core/ServiceObjects/ResponseObjects/AcceptMeetingInvitationMessage.cs b/Core/ServiceObjects/ResponseObjects/AcceptMeetingInvitationMessage.cs index 97f11500..36b9f0cc 100644 --- a/Core/ServiceObjects/ResponseObjects/AcceptMeetingInvitationMessage.cs +++ b/Core/ServiceObjects/ResponseObjects/AcceptMeetingInvitationMessage.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the AcceptMeetingInvitationMessage class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -75,4 +90,4 @@ public bool Tentative get { return this.tentative; } } } -} +} \ No newline at end of file diff --git a/Core/ServiceObjects/ResponseObjects/CalendarResponseMessage.cs b/Core/ServiceObjects/ResponseObjects/CalendarResponseMessage.cs index 96d96c1e..ed004a3f 100644 --- a/Core/ServiceObjects/ResponseObjects/CalendarResponseMessage.cs +++ b/Core/ServiceObjects/ResponseObjects/CalendarResponseMessage.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the CalendarResponseMessage class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -117,4 +132,4 @@ public EmailAddress Sender #endregion } -} +} \ No newline at end of file diff --git a/Core/ServiceObjects/ResponseObjects/CalendarResponseMessageBase.cs b/Core/ServiceObjects/ResponseObjects/CalendarResponseMessageBase.cs index e416d7ba..2fdd1ee3 100644 --- a/Core/ServiceObjects/ResponseObjects/CalendarResponseMessageBase.cs +++ b/Core/ServiceObjects/ResponseObjects/CalendarResponseMessageBase.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the CalendarResponseMessageBase class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -124,4 +139,4 @@ internal CalendarResponseMessageBase(Item referenceItem) return new CalendarActionResults(this.InternalCreate(null, MessageDisposition.SendAndSaveCopy)); } } -} +} \ No newline at end of file diff --git a/Core/ServiceObjects/ResponseObjects/CancelMeetingMessage.cs b/Core/ServiceObjects/ResponseObjects/CancelMeetingMessage.cs index 9eaa69c6..3b32f9cc 100644 --- a/Core/ServiceObjects/ResponseObjects/CancelMeetingMessage.cs +++ b/Core/ServiceObjects/ResponseObjects/CancelMeetingMessage.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the CancelMeetingMessage class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -60,4 +75,4 @@ public MessageBody Body #endregion } -} +} \ No newline at end of file diff --git a/Core/ServiceObjects/ResponseObjects/DeclineMeetingInvitationMessage.cs b/Core/ServiceObjects/ResponseObjects/DeclineMeetingInvitationMessage.cs index e92e98cf..ff02df1c 100644 --- a/Core/ServiceObjects/ResponseObjects/DeclineMeetingInvitationMessage.cs +++ b/Core/ServiceObjects/ResponseObjects/DeclineMeetingInvitationMessage.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the DeclineMeetingInvitationMessage class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -38,4 +53,4 @@ internal override ExchangeVersion GetMinimumRequiredServerVersion() return ExchangeVersion.Exchange2007_SP1; } } -} +} \ No newline at end of file diff --git a/Core/ServiceObjects/ResponseObjects/PostReply.cs b/Core/ServiceObjects/ResponseObjects/PostReply.cs index c5ef43ec..6e39d9e5 100644 --- a/Core/ServiceObjects/ResponseObjects/PostReply.cs +++ b/Core/ServiceObjects/ResponseObjects/PostReply.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the PostReply class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -168,4 +183,4 @@ public MessageBody BodyPrefix #endregion } -} +} \ No newline at end of file diff --git a/Core/ServiceObjects/ResponseObjects/RemoveFromCalendar.cs b/Core/ServiceObjects/ResponseObjects/RemoveFromCalendar.cs index 5c859d71..fa0a3bd9 100644 --- a/Core/ServiceObjects/ResponseObjects/RemoveFromCalendar.cs +++ b/Core/ServiceObjects/ResponseObjects/RemoveFromCalendar.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the RemoveFromCalendar class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -96,4 +111,4 @@ internal List InternalCreate(FolderId parentFolderId, MessageDisposition? messageDisposition); } } -} +} \ No newline at end of file diff --git a/Core/ServiceObjects/ResponseObjects/ResponseMessage.cs b/Core/ServiceObjects/ResponseObjects/ResponseMessage.cs index 322876ac..ea5388fa 100644 --- a/Core/ServiceObjects/ResponseObjects/ResponseMessage.cs +++ b/Core/ServiceObjects/ResponseObjects/ResponseMessage.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ResponseMessage class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -147,4 +162,4 @@ public MessageBody BodyPrefix } #endregion } -} +} \ No newline at end of file diff --git a/Core/ServiceObjects/ResponseObjects/ResponseObject.cs b/Core/ServiceObjects/ResponseObjects/ResponseObject.cs index b6d59a84..57c84f95 100644 --- a/Core/ServiceObjects/ResponseObjects/ResponseObject.cs +++ b/Core/ServiceObjects/ResponseObjects/ResponseObject.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ResponseObject class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -180,4 +195,4 @@ public bool IsDeliveryReceiptRequested #endregion } -} +} \ No newline at end of file diff --git a/Core/ServiceObjects/ResponseObjects/SuppressReadReceipt.cs b/Core/ServiceObjects/ResponseObjects/SuppressReadReceipt.cs index 706d90ad..1bf54569 100644 --- a/Core/ServiceObjects/ResponseObjects/SuppressReadReceipt.cs +++ b/Core/ServiceObjects/ResponseObjects/SuppressReadReceipt.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SuppressReadReceipt class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -95,4 +110,4 @@ internal void InternalCreate(FolderId parentFolderId, MessageDisposition? messag messageDisposition); } } -} +} \ No newline at end of file diff --git a/Core/ServiceObjects/Schemas/AppointmentSchema.cs b/Core/ServiceObjects/Schemas/AppointmentSchema.cs index c31f0ede..4c4ab864 100644 --- a/Core/ServiceObjects/Schemas/AppointmentSchema.cs +++ b/Core/ServiceObjects/Schemas/AppointmentSchema.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the AppointmentSchema class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Core/ServiceObjects/Schemas/CalendarResponseObjectSchema.cs b/Core/ServiceObjects/Schemas/CalendarResponseObjectSchema.cs index e5823864..13158ac9 100644 --- a/Core/ServiceObjects/Schemas/CalendarResponseObjectSchema.cs +++ b/Core/ServiceObjects/Schemas/CalendarResponseObjectSchema.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the CalendarResponseObjectSchema class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -39,4 +54,4 @@ internal override void RegisterProperties() this.RegisterProperty(ResponseObjectSchema.ReferenceItemId); } } -} +} \ No newline at end of file diff --git a/Core/ServiceObjects/Schemas/CancelMeetingMessageSchema.cs b/Core/ServiceObjects/Schemas/CancelMeetingMessageSchema.cs index 67e67b7f..f32679b0 100644 --- a/Core/ServiceObjects/Schemas/CancelMeetingMessageSchema.cs +++ b/Core/ServiceObjects/Schemas/CancelMeetingMessageSchema.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the CancelMeetingMessageSchema class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -41,4 +56,4 @@ internal override void RegisterProperties() this.RegisterProperty(CancelMeetingMessageSchema.Body); } } -} +} \ No newline at end of file diff --git a/Core/ServiceObjects/Schemas/ContactGroupSchema.cs b/Core/ServiceObjects/Schemas/ContactGroupSchema.cs index e6675078..74104831 100644 --- a/Core/ServiceObjects/Schemas/ContactGroupSchema.cs +++ b/Core/ServiceObjects/Schemas/ContactGroupSchema.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ContactGroupSchema class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Core/ServiceObjects/Schemas/ContactSchema.cs b/Core/ServiceObjects/Schemas/ContactSchema.cs index a8d39fec..8467d668 100644 --- a/Core/ServiceObjects/Schemas/ContactSchema.cs +++ b/Core/ServiceObjects/Schemas/ContactSchema.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ContactSchema class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -963,4 +978,4 @@ internal ContactSchema() { } } -} +} \ No newline at end of file diff --git a/Core/ServiceObjects/Schemas/ConversationSchema.cs b/Core/ServiceObjects/Schemas/ConversationSchema.cs index 2b4695c1..c3cde8de 100644 --- a/Core/ServiceObjects/Schemas/ConversationSchema.cs +++ b/Core/ServiceObjects/Schemas/ConversationSchema.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ConversationSchema class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Core/ServiceObjects/Schemas/EmailMessageSchema.cs b/Core/ServiceObjects/Schemas/EmailMessageSchema.cs index c38fecbe..3e0f49d5 100644 --- a/Core/ServiceObjects/Schemas/EmailMessageSchema.cs +++ b/Core/ServiceObjects/Schemas/EmailMessageSchema.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the EmailMessageSchema class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -41,6 +56,7 @@ private static class FieldUris public const string ReceivedRepresenting = "message:ReceivedRepresenting"; public const string ApprovalRequestData = "message:ApprovalRequestData"; public const string VotingInformation = "message:VotingInformation"; + public const string Likers = "message:Likers"; } /// @@ -254,6 +270,18 @@ private static class FieldUris ExchangeVersion.Exchange2013, delegate() { return new VotingInformation(); }); + /// + /// Defines the Likers property + /// + [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] + public static readonly PropertyDefinition Likers = + new ComplexPropertyDefinition( + XmlElementNames.Likers, + FieldUris.Likers, + PropertyDefinitionFlags.AutoInstantiateOnRead, + ExchangeVersion.Exchange2015, + delegate() { return new EmailAddressCollection(); }); + // This must be after the declaration of property definitions internal static new readonly EmailMessageSchema Instance = new EmailMessageSchema(); @@ -285,6 +313,7 @@ internal override void RegisterProperties() this.RegisterProperty(ReceivedRepresenting); this.RegisterProperty(ApprovalRequestData); this.RegisterProperty(VotingInformation); + this.RegisterProperty(Likers); } /// @@ -295,4 +324,4 @@ internal EmailMessageSchema() { } } -} +} \ No newline at end of file diff --git a/Core/ServiceObjects/Schemas/FolderSchema.cs b/Core/ServiceObjects/Schemas/FolderSchema.cs index f6d71c0b..f0930768 100644 --- a/Core/ServiceObjects/Schemas/FolderSchema.cs +++ b/Core/ServiceObjects/Schemas/FolderSchema.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the FolderSchema class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -156,12 +171,11 @@ private static class FieldUris /// [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition WellKnownFolderName = - new GenericPropertyDefinition( + new StringPropertyDefinition( XmlElementNames.DistinguishedFolderId, FieldUris.DistinguishedFolderId, - PropertyDefinitionFlags.CanFind, - ExchangeVersion.Exchange2013, - true); + PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanFind, + ExchangeVersion.Exchange2013); /// /// Defines the PolicyTag property. diff --git a/Core/ServiceObjects/Schemas/ItemSchema.cs b/Core/ServiceObjects/Schemas/ItemSchema.cs index 20ab14a4..544474c7 100644 --- a/Core/ServiceObjects/Schemas/ItemSchema.cs +++ b/Core/ServiceObjects/Schemas/ItemSchema.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ItemSchema class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Core/ServiceObjects/Schemas/MeetingCancellationSchema.cs b/Core/ServiceObjects/Schemas/MeetingCancellationSchema.cs index 705a9a09..050cf150 100644 --- a/Core/ServiceObjects/Schemas/MeetingCancellationSchema.cs +++ b/Core/ServiceObjects/Schemas/MeetingCancellationSchema.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the MeetingCancellationSchema class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -89,4 +104,4 @@ internal MeetingCancellationSchema() { } } -} +} \ No newline at end of file diff --git a/Core/ServiceObjects/Schemas/MeetingMessageSchema.cs b/Core/ServiceObjects/Schemas/MeetingMessageSchema.cs index 440a6ecb..5ba0863c 100644 --- a/Core/ServiceObjects/Schemas/MeetingMessageSchema.cs +++ b/Core/ServiceObjects/Schemas/MeetingMessageSchema.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the MeetingMessageSchema class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Core/ServiceObjects/Schemas/MeetingRequestSchema.cs b/Core/ServiceObjects/Schemas/MeetingRequestSchema.cs index ab75ef4b..df9f6a16 100644 --- a/Core/ServiceObjects/Schemas/MeetingRequestSchema.cs +++ b/Core/ServiceObjects/Schemas/MeetingRequestSchema.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the MeetingRequestSchema class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Core/ServiceObjects/Schemas/MeetingResponseSchema.cs b/Core/ServiceObjects/Schemas/MeetingResponseSchema.cs index 412212cb..63f2287e 100644 --- a/Core/ServiceObjects/Schemas/MeetingResponseSchema.cs +++ b/Core/ServiceObjects/Schemas/MeetingResponseSchema.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the MeetingResponseSchema class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Core/ServiceObjects/Schemas/PersonaSchema.cs b/Core/ServiceObjects/Schemas/PersonaSchema.cs new file mode 100644 index 00000000..99025f48 --- /dev/null +++ b/Core/ServiceObjects/Schemas/PersonaSchema.cs @@ -0,0 +1,426 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + using System.Diagnostics.CodeAnalysis; + + /// + /// Persona schema + /// + [Schema] + public class PersonaSchema : ItemSchema + { + /// + /// FieldURIs for persona. + /// + private static class FieldUris + { + public const string PersonaId = "persona:PersonaId"; + public const string PersonaType = "persona:PersonaType"; + public const string CreationTime = "persona:CreationTime"; + public const string DisplayNameFirstLastHeader = "persona:DisplayNameFirstLastHeader"; + public const string DisplayNameLastFirstHeader = "persona:DisplayNameLastFirstHeader"; + public const string DisplayName = "persona:DisplayName"; + public const string DisplayNameFirstLast = "persona:DisplayNameFirstLast"; + public const string DisplayNameLastFirst = "persona:DisplayNameLastFirst"; + public const string FileAs = "persona:FileAs"; + public const string Generation = "persona:Generation"; + public const string DisplayNamePrefix = "persona:DisplayNamePrefix"; + public const string GivenName = "persona:GivenName"; + public const string Surname = "persona:Surname"; + public const string Title = "persona:Title"; + public const string CompanyName = "persona:CompanyName"; + public const string EmailAddress = "persona:EmailAddress"; + public const string EmailAddresses = "persona:EmailAddresses"; + public const string ImAddress = "persona:ImAddress"; + public const string HomeCity = "persona:HomeCity"; + public const string WorkCity = "persona:WorkCity"; + public const string Alias = "persona:Alias"; + public const string RelevanceScore = "persona:RelevanceScore"; + public const string Attributions = "persona:Attributions"; + public const string OfficeLocations = "persona:OfficeLocations"; + public const string ImAddresses = "persona:ImAddresses"; + public const string Departments = "persona:Departments"; + public const string ThirdPartyPhotoUrls = "persona:ThirdPartyPhotoUrls"; + } + + /// + /// Defines the PersonaId property. + /// + [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] + public static readonly PropertyDefinition PersonaId = + new ComplexPropertyDefinition( + XmlElementNames.PersonaId, + FieldUris.PersonaId, + PropertyDefinitionFlags.AutoInstantiateOnRead | PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, + ExchangeVersion.Exchange2013_SP1, + delegate() { return new ItemId(); }); + + /// + /// Defines the PersonaType property. + /// + [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] + public static readonly PropertyDefinition PersonaType = + new StringPropertyDefinition( + XmlElementNames.PersonaType, + FieldUris.PersonaType, + PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, + ExchangeVersion.Exchange2013_SP1); + + /// + /// Defines the CreationTime property. + /// + [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] + public static readonly PropertyDefinition CreationTime = + new DateTimePropertyDefinition( + XmlElementNames.CreationTime, + FieldUris.CreationTime, + PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, + ExchangeVersion.Exchange2013_SP1); + + /// + /// Defines the DisplayNameFirstLastHeader property. + /// + [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] + public static readonly PropertyDefinition DisplayNameFirstLastHeader = + new StringPropertyDefinition( + XmlElementNames.DisplayNameFirstLastHeader, + FieldUris.DisplayNameFirstLastHeader, + PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, + ExchangeVersion.Exchange2013_SP1); + + /// + /// Defines the DisplayNameLastFirstHeader property. + /// + [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] + public static readonly PropertyDefinition DisplayNameLastFirstHeader = + new StringPropertyDefinition( + XmlElementNames.DisplayNameLastFirstHeader, + FieldUris.DisplayNameLastFirstHeader, + PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, + ExchangeVersion.Exchange2013_SP1); + + /// + /// Defines the DisplayName property. + /// + [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] + public static readonly PropertyDefinition DisplayName = + new StringPropertyDefinition( + XmlElementNames.DisplayName, + FieldUris.DisplayName, + PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, + ExchangeVersion.Exchange2013_SP1); + + /// + /// Defines the DisplayNameFirstLast property. + /// + [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] + public static readonly PropertyDefinition DisplayNameFirstLast = + new StringPropertyDefinition( + XmlElementNames.DisplayNameFirstLast, + FieldUris.DisplayNameFirstLast, + PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, + ExchangeVersion.Exchange2013_SP1); + + /// + /// Defines the DisplayNameLastFirst property. + /// + [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] + public static readonly PropertyDefinition DisplayNameLastFirst = + new StringPropertyDefinition( + XmlElementNames.DisplayNameLastFirst, + FieldUris.DisplayNameLastFirst, + PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, + ExchangeVersion.Exchange2013_SP1); + + /// + /// Defines the FileAs property. + /// + [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] + public static readonly PropertyDefinition FileAs = + new StringPropertyDefinition( + XmlElementNames.FileAs, + FieldUris.FileAs, + PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, + ExchangeVersion.Exchange2013_SP1); + + /// + /// Defines the Generation property. + /// + [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] + public static readonly PropertyDefinition Generation = + new StringPropertyDefinition( + XmlElementNames.Generation, + FieldUris.Generation, + PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, + ExchangeVersion.Exchange2013_SP1); + + /// + /// Defines the DisplayNamePrefix property. + /// + [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] + public static readonly PropertyDefinition DisplayNamePrefix = + new StringPropertyDefinition( + XmlElementNames.DisplayNamePrefix, + FieldUris.DisplayNamePrefix, + PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, + ExchangeVersion.Exchange2013_SP1); + + /// + /// Defines the GivenName property. + /// + [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] + public static readonly PropertyDefinition GivenName = + new StringPropertyDefinition( + XmlElementNames.GivenName, + FieldUris.GivenName, + PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, + ExchangeVersion.Exchange2013_SP1); + + /// + /// Defines the Surname property. + /// + [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] + public static readonly PropertyDefinition Surname = + new StringPropertyDefinition( + XmlElementNames.Surname, + FieldUris.Surname, + PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, + ExchangeVersion.Exchange2013_SP1); + + /// + /// Defines the Title property. + /// + [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] + public static readonly PropertyDefinition Title = + new StringPropertyDefinition( + XmlElementNames.Title, + FieldUris.Title, + PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, + ExchangeVersion.Exchange2013_SP1); + + /// + /// Defines the CompanyName property. + /// + [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] + public static readonly PropertyDefinition CompanyName = + new StringPropertyDefinition( + XmlElementNames.CompanyName, + FieldUris.CompanyName, + PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, + ExchangeVersion.Exchange2013_SP1); + + /// + /// Defines the EmailAddress property. + /// + [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] + public static readonly PropertyDefinition EmailAddress = + new ComplexPropertyDefinition( + XmlElementNames.EmailAddress, + FieldUris.EmailAddress, + PropertyDefinitionFlags.AutoInstantiateOnRead | PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, + ExchangeVersion.Exchange2013_SP1, + delegate() { return new PersonaEmailAddress(); }); + + /// + /// Defines the EmailAddresses property. + /// + [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] + public static readonly PropertyDefinition EmailAddresses = + new ComplexPropertyDefinition( + XmlElementNames.EmailAddresses, + FieldUris.EmailAddresses, + PropertyDefinitionFlags.AutoInstantiateOnRead | PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, + ExchangeVersion.Exchange2013_SP1, + delegate() { return new PersonaEmailAddressCollection(); }); + + /// + /// Defines the ImAddress property. + /// + [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] + public static readonly PropertyDefinition ImAddress = + new StringPropertyDefinition( + XmlElementNames.ImAddress, + FieldUris.ImAddress, + PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, + ExchangeVersion.Exchange2013_SP1); + + /// + /// Defines the HomeCity property. + /// + [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] + public static readonly PropertyDefinition HomeCity = + new StringPropertyDefinition( + XmlElementNames.HomeCity, + FieldUris.HomeCity, + PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, + ExchangeVersion.Exchange2013_SP1); + + /// + /// Defines the WorkCity property. + /// + [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] + public static readonly PropertyDefinition WorkCity = + new StringPropertyDefinition( + XmlElementNames.WorkCity, + FieldUris.WorkCity, + PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, + ExchangeVersion.Exchange2013_SP1); + + /// + /// Defines the Alias property. + /// + [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] + public static readonly PropertyDefinition Alias = + new StringPropertyDefinition( + XmlElementNames.Alias, + FieldUris.Alias, + PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, + ExchangeVersion.Exchange2013_SP1); + + /// + /// Defines the RelevanceScore property. + /// + [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] + public static readonly PropertyDefinition RelevanceScore = + new IntPropertyDefinition( + XmlElementNames.RelevanceScore, + FieldUris.RelevanceScore, + PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, + ExchangeVersion.Exchange2013_SP1, + true); + + /// + /// Defines the Attributions property + /// + [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] + public static readonly PropertyDefinition Attributions = + new ComplexPropertyDefinition( + XmlElementNames.Attributions, + FieldUris.Attributions, + PropertyDefinitionFlags.AutoInstantiateOnRead | PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, + ExchangeVersion.Exchange2013_SP1, + delegate() { return new AttributionCollection(); }); + + /// + /// Defines the OfficeLocations property. + /// + [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] + public static readonly PropertyDefinition OfficeLocations = + new ComplexPropertyDefinition( + XmlElementNames.OfficeLocations, + FieldUris.OfficeLocations, + PropertyDefinitionFlags.AutoInstantiateOnRead | PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, + ExchangeVersion.Exchange2013_SP1, + delegate() { return new AttributedStringCollection(); }); + + /// + /// Defines the ImAddresses property. + /// + [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] + public static readonly PropertyDefinition ImAddresses = + new ComplexPropertyDefinition( + XmlElementNames.ImAddresses, + FieldUris.ImAddresses, + PropertyDefinitionFlags.AutoInstantiateOnRead | PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, + ExchangeVersion.Exchange2013_SP1, + delegate() { return new AttributedStringCollection(); }); + + /// + /// Defines the Departments property. + /// + [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] + public static readonly PropertyDefinition Departments = + new ComplexPropertyDefinition( + XmlElementNames.Departments, + FieldUris.Departments, + PropertyDefinitionFlags.AutoInstantiateOnRead | PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, + ExchangeVersion.Exchange2013_SP1, + delegate() { return new AttributedStringCollection(); }); + + /// + /// Defines the ThirdPartyPhotoUrls property. + /// + [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] + public static readonly PropertyDefinition ThirdPartyPhotoUrls = + new ComplexPropertyDefinition( + XmlElementNames.ThirdPartyPhotoUrls, + FieldUris.ThirdPartyPhotoUrls, + PropertyDefinitionFlags.AutoInstantiateOnRead | PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, + ExchangeVersion.Exchange2013_SP1, + delegate() { return new AttributedStringCollection(); }); + + // This must be declared after the property definitions + internal static new readonly PersonaSchema Instance = new PersonaSchema(); + + /// + /// Registers properties. + /// + /// + /// IMPORTANT NOTE: PROPERTIES MUST BE REGISTERED IN SCHEMA ORDER (i.e. the same order as they are defined in types.xsd) + /// + internal override void RegisterProperties() + { + base.RegisterProperties(); + + this.RegisterProperty(PersonaId); + this.RegisterProperty(PersonaType); + this.RegisterProperty(CreationTime); + this.RegisterProperty(DisplayNameFirstLastHeader); + this.RegisterProperty(DisplayNameLastFirstHeader); + this.RegisterProperty(DisplayName); + this.RegisterProperty(DisplayNameFirstLast); + this.RegisterProperty(DisplayNameLastFirst); + this.RegisterProperty(FileAs); + this.RegisterProperty(Generation); + this.RegisterProperty(DisplayNamePrefix); + this.RegisterProperty(GivenName); + this.RegisterProperty(Surname); + this.RegisterProperty(Title); + this.RegisterProperty(CompanyName); + this.RegisterProperty(EmailAddress); + this.RegisterProperty(EmailAddresses); + this.RegisterProperty(ImAddress); + this.RegisterProperty(HomeCity); + this.RegisterProperty(WorkCity); + this.RegisterProperty(Alias); + this.RegisterProperty(RelevanceScore); + this.RegisterProperty(Attributions); + this.RegisterProperty(OfficeLocations); + this.RegisterProperty(ImAddresses); + this.RegisterProperty(Departments); + this.RegisterProperty(ThirdPartyPhotoUrls); + } + + /// + /// internal constructor + /// + internal PersonaSchema() + : base() + { + } + } +} \ No newline at end of file diff --git a/Core/ServiceObjects/Schemas/PostItemSchema.cs b/Core/ServiceObjects/Schemas/PostItemSchema.cs index d26b08a2..fe888cf3 100644 --- a/Core/ServiceObjects/Schemas/PostItemSchema.cs +++ b/Core/ServiceObjects/Schemas/PostItemSchema.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the PostItemSchema class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -117,4 +132,4 @@ internal PostItemSchema() { } } -} +} \ No newline at end of file diff --git a/Core/ServiceObjects/Schemas/PostReplySchema.cs b/Core/ServiceObjects/Schemas/PostReplySchema.cs index c4c5028b..d4f70a4f 100644 --- a/Core/ServiceObjects/Schemas/PostReplySchema.cs +++ b/Core/ServiceObjects/Schemas/PostReplySchema.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the PostReplySchema class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -38,4 +53,4 @@ internal override void RegisterProperties() this.RegisterProperty(ResponseObjectSchema.BodyPrefix); } } -} +} \ No newline at end of file diff --git a/Core/ServiceObjects/Schemas/ResponseMessageSchema.cs b/Core/ServiceObjects/Schemas/ResponseMessageSchema.cs index 7f52459b..88981f98 100644 --- a/Core/ServiceObjects/Schemas/ResponseMessageSchema.cs +++ b/Core/ServiceObjects/Schemas/ResponseMessageSchema.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ResponseMessageSchema class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -43,4 +58,4 @@ internal override void RegisterProperties() this.RegisterProperty(ResponseObjectSchema.BodyPrefix); } } -} +} \ No newline at end of file diff --git a/Core/ServiceObjects/Schemas/ResponseObjectSchema.cs b/Core/ServiceObjects/Schemas/ResponseObjectSchema.cs index 16308074..e2136fb0 100644 --- a/Core/ServiceObjects/Schemas/ResponseObjectSchema.cs +++ b/Core/ServiceObjects/Schemas/ResponseObjectSchema.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ResponseObjectSchema class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -45,4 +60,4 @@ internal override void RegisterProperties() this.RegisterProperty(ResponseObjectSchema.ReferenceItemId); } } -} +} \ No newline at end of file diff --git a/Core/ServiceObjects/Schemas/SearchFolderSchema.cs b/Core/ServiceObjects/Schemas/SearchFolderSchema.cs index f377ec63..55cd2ee7 100644 --- a/Core/ServiceObjects/Schemas/SearchFolderSchema.cs +++ b/Core/ServiceObjects/Schemas/SearchFolderSchema.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SearchFolderSchema class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -54,4 +69,4 @@ internal override void RegisterProperties() this.RegisterProperty(SearchParameters); } } -} +} \ No newline at end of file diff --git a/Core/ServiceObjects/Schemas/ServiceObjectSchema.cs b/Core/ServiceObjects/Schemas/ServiceObjectSchema.cs index 11b2d6d0..a6977710 100644 --- a/Core/ServiceObjects/Schemas/ServiceObjectSchema.cs +++ b/Core/ServiceObjects/Schemas/ServiceObjectSchema.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ServiceObjectSchema class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -52,6 +67,7 @@ public abstract class ServiceObjectSchema : IEnumerable typeList.Add(typeof(MeetingRequestSchema)); typeList.Add(typeof(MeetingCancellationSchema)); typeList.Add(typeof(MeetingResponseSchema)); + typeList.Add(typeof(PersonaSchema)); typeList.Add(typeof(PostItemSchema)); typeList.Add(typeof(PostReplySchema)); typeList.Add(typeof(ResponseMessageSchema)); diff --git a/Core/ServiceObjects/Schemas/TaskSchema.cs b/Core/ServiceObjects/Schemas/TaskSchema.cs index 3f50b35e..136d617f 100644 --- a/Core/ServiceObjects/Schemas/TaskSchema.cs +++ b/Core/ServiceObjects/Schemas/TaskSchema.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the TaskSchema class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -344,4 +359,4 @@ internal TaskSchema() { } } -} +} \ No newline at end of file diff --git a/Core/ServiceObjects/Schemas/Xsd/messages.xsd b/Core/ServiceObjects/Schemas/Xsd/messages.xsd deleted file mode 100644 index d2f6f0b0..00000000 --- a/Core/ServiceObjects/Schemas/Xsd/messages.xsd +++ /dev/null @@ -1,4139 +0,0 @@ - - - - - - - - - Represents the message keys that can be returned by response error messages - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Converts the passed source ids into the destination format. Change keys are not - returned. - - - - - - - - - - - - - - - - Response type for the ConvertId web method - - - - - - - - - - - Response Message for a single id conversion in the ConvertId web method. Note - that the AlternateId element will be missing in the case of an error. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Request type for the FindMailboxStatisticsByKeywords web method. - - - - - - - - - - - - - - - - - - - - - - - - - - Response type for the FindMailboxStatisticsByKeywords web method. - - - - - - - - - - - - Response message type for the FindMailboxStatisticsByKeywords web method. - - - - - - - - - - - - - - - - Request type for the GetSearchableMailboxes web method. - - - - - - - - - - - - - - - - - Response message type for the GetSearchableMailboxes web method. - - - - - - - - - - - - - - - - - - - Request type for the SearchMailboxes web method. - - - - - - - - - - - - - - - - - - - - - - - - Response type for the SearchMailboxes web method. - - - - - - - - - - - - Response message type for the SearchMailboxes web method. - - - - - - - - - - - - - - - - Request type for the GetDiscoverySearchConfiguration web method. - - - - - - - - - - - - - - - - - - Response message type for the GetDiscoverySearchConfiguration web method. - - - - - - - - - - - - - - - - - - Request type for the GetHoldOnMailboxes web method. - - - - - - - - - - - - - - - - Response message type for the GetHoldOnMailboxes web method. - - - - - - - - - - - - - - - - - - Request type for the SetHoldOnMailboxes web method. - - - - - - - - - - - - - - - - - - - - - - - - Response message type for the SetHoldOnMailboxes web method. - - - - - - - - - - - - - - - - - - Request type for the GetNonIndexableItemStatistics web method. - - - - - - - - - - - - - - - - - Response message type for the GetNonIndexableItemStatistics web method. - - - - - - - - - - - - - - - - - - Request type for the GetNonIndexableItemDetails web method. - - - - - - - - - - - - - - - - - - - - Response message type for the GetNonIndexableItemDetails web method. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Request type for the GetUserRetentionPolicyTags web method. - - - - - - - - - - - - - Response message type for the GetUserRetentionPolicyTags web method. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Core/ServiceObjects/Schemas/Xsd/types.xsd b/Core/ServiceObjects/Schemas/Xsd/types.xsd deleted file mode 100644 index 2d4e4d67..00000000 --- a/Core/ServiceObjects/Schemas/Xsd/types.xsd +++ /dev/null @@ -1,7542 +0,0 @@ - - - - - - - - - - - - Allow attributes in the soap namespace to be used here - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Allow attributes in the soap namespace to be used here - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Allow attributes in the soap namespace to be used here - - - - - - - - Surfaces the various logon types that are supported for conversion - - - - - - - - - - - - - - - - Allow attributes in the soap namespace to be used here - - - - - - - - - - - - - - - - - - - - - - - - - - - Allow attributes in the soap namespace to be used here - - - - - - - - - - - - - - - - - - - - - - - - - - - Allow attributes in the soap namespace to be used here - - - - - - - - - - Precision for returned DateTime values - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Identifier for a fully resolved email address - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The regular expression captures the standard representation of a GUID - - - - - - - - - - - Defines the well known property set ids for extended properties. - - - - - - - - - - - - - - - - - - - - Includes all of the extended property types that we support. Note that Error, Null, - Object and Object array can not be used in restrictions, or for setting/getting values. - They are only there for error reporting purposes. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This type represents the property tag (MINUS the type part). There are two options - for representation: - 1. Hex ==> 0x3fa4 - 2. Decimal ==> 0-65535 - - - - - - - - - - - - - - - Represents an extended property. Note that there are only a couple of valid attribute - combinations. Note that all occurances require the PropertyType attribute. - - 1. (DistinguishedPropertySetId || PropertySetId) + (PropertyName || Property Id) - 2. PropertyTag - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Represents an extended property instance (both its path identifier along with its - associated value). - - - - - - - - - - - - - - - Types of sub-tree traversal for deletion and enumeration - - - - - - - - - - - Types of sub-tree traversal for deletion and enumeration - - - - - - - - - - Types of sub-tree traversal for deletion and enumeration - - - - - - - - - - - Types of sub-tree traversal for conversations - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Type of conflict resolution to attempt during update - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Utility type which should never appear in user documents - - - - - - - - - - - URIs for the distinguished folders accessible from a mailbox - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Identifier for a distinguished folder - - - - - - - - - - - - - - - Identifier for a fully resolved folder - - - - - - - - - - - - Identifier for a address list - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Types of view filters for finding items/conversations - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Compound property for Managed Folder related information for Managed Folders. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Abstract base type for item identifiers. Should never be used in web service calls - - - - - - - - - - - Identifier for a fully resolved item - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Internal abstract base type for reply objects. - Should not appear in client code - - - - - - - - - - - - - - Abstract base type for reply objects - - - - - - - The name of this reply object class as an English string. The client - application is required to translate it if it's running in a different locale - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Allow attributes in the soap namespace to be used here - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This max/min evaluation is applied to the field specified within the group by - instance for EACH item within that group. This determines which item from each group - is to be selected as the representative for that group. - - - - - - - - - - - - Represents the field of each item to aggregate on and the qualifier to apply to that - field in determining which item will represent the group. - - - - - - - - - - - - - - - - - - - Allows consumers to specify arbitrary groupings for FindItem queries. - - - - - - - - - - - - - - - - - - - - - Represents standard groupings for GroupBy queries. - - - - - - - - - - - Allows consumers to access standard groupings for FindItem queries. This is in - contrast to the arbitrary (custom) groupings available via the t:GroupByType - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Surfaces the various id types that are supported for conversion - - - - - - - - - - - - - - - Surfaces alternate representations of an item or folder id. No change key is included. - - - - - - - - - Represents an alternate mailbox folder or item Id. - - - - - - - - - - - - - - - Represents an alternate public folder Id. - - - - - - - - - - - - - Represents an alternate public folder item Id. - - - - - - - - - - - - - A non-empty array of alternate Ids. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - A permission on a folder - - - - - - - - - - - - - - - - A permission on a folder - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The set of permissions on a folder - - - - - - - - - - The set of permissions on a folder - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Represents the message keys that can be returned for invalid recipients - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Size range type used for the WithinSizeRange rule predicate. - - - - - - - - - - Date range type used for the WithinDateRange rule predicate. - - - - - - - - - - Flagged for action enumeration, currently used in FlaggedForAction rule predicate - - - - - - - - - - - - - - - - - - - Rule predicates, used as rule conditions or exceptions - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Rule actions - - - - - - - - - - - - - - - - - - - - - Rule type - - - - - - - - - - - - - - - - - Array of rule objects - - - - - - - - Rule field URI enumerates all possible rule fields that could trigger validation error - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Rule validation error code describing what failed validation for each rule predicate or action. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Represents a single validation error on a particular rule property value, predicate property value or action property value - - - - - - - - - - - - Represents an array of rule validation errors - - - - - - - - - Represents a rule operation to be performed - - - - - - Represents an array of rule operations to be performed - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Array of search item kind enum. - - - - - - - - - - - User Mailbox. - - - - - - - - - - Array of user mailbox. - - - - - - - - - - - Searchable mailbox. - - - - - - - - - - - - - - - - - Array of searchable mailbox. - - - - - - - - - - - Keyword statistics search result. - - - - - - - - - - - - - Array of keyword statistics result. - - - - - - - - - - - Mailbox statistics search result. - - - - - - - - - - - - - Extended attributes of a target mailbox. - - - - - - - - - - - - Array of extended attributes of a target mailbox - - - - - - - - - - - - - - - - - - - Set of mailbox, search scope and its extended attributes. - - - - - - - - - - - - - Array of mailbox and its search scope. - - - - - - - - - - - Pair of query and a set of mailbox search scopes. - - - - - - - - - - - - Mailbox information for each preview item. - - - - - - - - - - - - Array of query and mailboxes. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Mailbox search preview item. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Array of search preview item. - - - - - - - - - - - Mailbox failed on search and its error message. - - - - - - - - - - - - - - Array of failed mailbox and error message. - - - - - - - - - - - Mailboxes search result. - - - - - - - - - - - - - - - - - - - - - Search refiner item. - - - - - - - - - - - - - - Array of search refiner item. - - - - - - - - - - - Mailbox statistics item. - - - - - - - - - - - - - - Array of mailbox statistics item. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Mailbox hold status. - - - - - - - - - - - - - Array of mailbox hold status. - - - - - - - - - - - Mailbox hold result. - - - - - - - - - - - - - - - - - - - Non indexable item statistic. - - - - - - - - - - - - - Array of non indexable item statistics. - - - - - - - - - - - - - - - - - - - - - - - - Non indexable item detail. - - - - - - - - - - - - - - - - - - - Array of non indexable item details. - - - - - - - - - - - Non indexable item details result. - - - - - - - - - - - - Discovery search configuration. - - - - - - - - - - - - - - - - Array of discovery search configuration. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Retention policy tag. - - - - - - - - - - - - - - - - - - - Array of retention policy tags. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - A Group on the ImContactList, with one or more members - - - - - - - - - - - - - - - - - - - - - - IM Contact List - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - List of possible reasons for disabling the client extension - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Core/ServiceObjects/ServiceObject.cs b/Core/ServiceObjects/ServiceObject.cs index 0e78a075..f30e93ab 100644 --- a/Core/ServiceObjects/ServiceObject.cs +++ b/Core/ServiceObjects/ServiceObject.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ServiceObject class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -243,40 +258,6 @@ internal void LoadFromXml( summaryPropertiesOnly); } - /// - /// Loads from json. - /// - /// The json service object. - /// The service. - /// if set to true [clear property bag]. - /// The requested property set. - /// if set to true [summary properties only]. - internal void LoadFromJson(JsonObject jsonServiceObject, ExchangeService service, bool clearPropertyBag, PropertySet requestedPropertySet, bool summaryPropertiesOnly) - { - this.PropertyBag.LoadFromJson( - jsonServiceObject, - service, - clearPropertyBag, - requestedPropertySet, - summaryPropertiesOnly); - } - - /// - /// Loads from json. - /// - /// The json object. - /// The service. - /// if set to true [clear property bag]. - internal void LoadFromJson(JsonObject jsonObject, ExchangeService service, bool clearPropertyBag) - { - this.PropertyBag.LoadFromJson( - jsonObject, - service, - clearPropertyBag, - null, /* propertySet */ - false); /* summaryPropertiesOnly */ - } - /// /// Clears the object's change log. /// @@ -294,19 +275,6 @@ internal void WriteToXml(EwsServiceXmlWriter writer) this.PropertyBag.WriteToXml(writer); } - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// if set to true [is update operation]. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - internal object ToJson(ExchangeService service, bool isUpdateOperation) - { - return this.PropertyBag.ToJson(service, isUpdateOperation); - } - /// /// Writes service object for update as XML. /// @@ -316,16 +284,6 @@ internal void WriteToXmlForUpdate(EwsServiceXmlWriter writer) this.PropertyBag.WriteToXmlForUpdate(writer); } - /// - /// Writes service object for update as Json. - /// - /// The service. - /// - internal object WriteToJsonForUpdate(ExchangeService service) - { - return this.PropertyBag.ToJson(service, true); - } - /// /// Loads the specified set of properties on the object. /// diff --git a/Core/ServiceObjects/ServiceObjectInfo.cs b/Core/ServiceObjects/ServiceObjectInfo.cs index 532340a4..0145000b 100644 --- a/Core/ServiceObjects/ServiceObjectInfo.cs +++ b/Core/ServiceObjects/ServiceObjectInfo.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ServiceObjectInfo class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -141,6 +156,13 @@ private void InitializeServiceObjectClassMap() delegate(ExchangeService srv) { return new MeetingResponse(srv); }, delegate(ItemAttachment itemAttachment, bool isNew) { return new MeetingResponse(itemAttachment); }); + // Persona + this.AddServiceObjectType( + XmlElementNames.Persona, + typeof(Persona), + delegate(ExchangeService srv) { return new Persona(srv); }, + null); + // PostItem this.AddServiceObjectType( XmlElementNames.PostItem, @@ -215,4 +237,4 @@ internal Dictionary ServiceObjectC get { return this.serviceObjectConstructorsWithAttachmentParam; } } } -} +} \ No newline at end of file diff --git a/Core/SimplePropertyBag.cs b/Core/SimplePropertyBag.cs index eb5d58f1..344d37f1 100644 --- a/Core/SimplePropertyBag.cs +++ b/Core/SimplePropertyBag.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SimplePropertyBag class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -218,4 +233,4 @@ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() #endregion } -} +} \ No newline at end of file diff --git a/Core/XmlAttributeNames.cs b/Core/XmlAttributeNames.cs index dae13309..e999eab3 100644 --- a/Core/XmlAttributeNames.cs +++ b/Core/XmlAttributeNames.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the XmlAttributeNames class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -109,4 +124,4 @@ internal static class XmlAttributeNames public const string Nil = "nil"; public const string Type = "type"; } -} +} \ No newline at end of file diff --git a/Core/XmlElementNames.cs b/Core/XmlElementNames.cs index 36330d94..cf16f273 100644 --- a/Core/XmlElementNames.cs +++ b/Core/XmlElementNames.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the XmlElementNames class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -22,6 +37,7 @@ internal static class XmlElementNames public const string ItemIds = "ItemIds"; public const string FolderId = "FolderId"; public const string FolderIds = "FolderIds"; + public const string SourceId = "SourceId"; public const string OccurrenceItemId = "OccurrenceItemId"; public const string RecurringMasterItemId = "RecurringMasterItemId"; public const string ItemShape = "ItemShape"; @@ -84,8 +100,11 @@ internal static class XmlElementNames public const string IsAssociated = "IsAssociated"; public const string IsDraft = "IsDraft"; public const string IsFromMe = "IsFromMe"; + public const string IsHidden = "IsHidden"; + public const string IsQuickContact = "IsQuickContact"; public const string IsResend = "IsResend"; public const string IsUnmodified = "IsUnmodified"; + public const string IsWritable = "IsWritable"; public const string InternetMessageHeader = "InternetMessageHeader"; public const string InternetMessageHeaders = "InternetMessageHeaders"; public const string DateTimeSent = "DateTimeSent"; @@ -101,6 +120,14 @@ internal static class XmlElementNames public const string Culture = "Culture"; public const string FileAttachment = "FileAttachment"; public const string ItemAttachment = "ItemAttachment"; + public const string ReferenceAttachment = "ReferenceAttachment"; + public const string AttachLongPathName = "AttachLongPathName"; + public const string ProviderType = "ProviderType"; + public const string ProviderEndpointUrl = "ProviderEndpointUrl"; + public const string AttachmentThumbnailUrl = "AttachmentThumbnailUrl"; + public const string AttachmentPreviewUrl = "AttachmentPreviewUrl"; + public const string PermissionType = "PermissionType"; + public const string AttachmentIsFolder = "AttachmentIsFolder"; public const string AttachmentIds = "AttachmentIds"; public const string AttachmentId = "AttachmentId"; public const string ContentType = "ContentType"; @@ -612,6 +639,7 @@ internal static class XmlElementNames public const string UserOptions = "UserOptions"; public const string VotingResponse = "VotingResponse"; public const string NumberOfDays = "NumberOfDays"; + public const string AcceptanceState = "AcceptanceState"; public const string NlgEntityExtractionResult = "EntityExtractionResult"; public const string NlgAddresses = "Addresses"; @@ -663,6 +691,184 @@ internal static class XmlElementNames public const string MarkAsJunkResponseMessage = "MarkAsJunkResponseMessage"; public const string MovedItemId = "MovedItemId"; + #region Persona + + public const string CreationTime = "CreationTime"; + public const string People = "People"; + public const string Persona = "Persona"; + public const string PersonaId = "PersonaId"; + public const string PersonaShape = "PersonaShape"; + public const string RelevanceScore = "RelevanceScore"; + public const string TotalNumberOfPeopleInView = "TotalNumberOfPeopleInView"; + public const string FirstMatchingRowIndex = "FirstMatchingRowIndex"; + public const string FirstLoadedRowIndex = "FirstLoadedRowIndex"; + public const string YomiCompanyName = "YomiCompanyName"; + public const string Emails1 = "Emails1"; + public const string Emails2 = "Emails2"; + public const string Emails3 = "Emails3"; + public const string HomeAddresses = "HomeAddresses"; + public const string BusinessAddresses = "BusinessAddresses"; + public const string OtherAddresses = "OtherAddresses"; + public const string BusinessPhoneNumbers = "BusinessPhoneNumbers"; + public const string BusinessPhoneNumbers2 = "BusinessPhoneNumbers2"; + public const string AssistantPhoneNumbers = "AssistantPhoneNumbers"; + public const string TTYTDDPhoneNumbers = "TTYTDDPhoneNumbers"; + public const string HomePhones = "HomePhones"; + public const string HomePhones2 = "HomePhones2"; + public const string MobilePhones = "MobilePhones"; + public const string MobilePhones2 = "MobilePhones2"; + public const string CallbackPhones = "CallbackPhones"; + public const string CarPhones = "CarPhones"; + public const string HomeFaxes = "HomeFaxes"; + public const string OrganizationMainPhones = "OrganizationMainPhones"; + public const string OtherFaxes = "OtherFaxes"; + public const string OtherTelephones = "OtherTelephones"; + public const string OtherPhones2 = "OtherPhones2"; + public const string Pagers = "Pagers"; + public const string RadioPhones = "RadioPhones"; + public const string TelexNumbers = "TelexNumbers"; + public const string WorkFaxes = "WorkFaxes"; + public const string FileAses = "FileAses"; + public const string CompanyNames = "CompanyNames"; + public const string DisplayNames = "DisplayNames"; + public const string DisplayNamePrefixes = "DisplayNamePrefixes"; + public const string GivenNames = "GivenNames"; + public const string MiddleNames = "MiddleNames"; + public const string Surnames = "Surnames"; + public const string Generations = "Generations"; + public const string Nicknames = "Nicknames"; + public const string YomiCompanyNames = "YomiCompanyNames"; + public const string YomiFirstNames = "YomiFirstNames"; + public const string YomiLastNames = "YomiLastNames"; + public const string Managers = "Managers"; + public const string AssistantNames = "AssistantNames"; + public const string Professions = "Professions"; + public const string SpouseNames = "SpouseNames"; + public const string Departments = "Departments"; + public const string Titles = "Titles"; + public const string ImAddresses2 = "ImAddresses2"; + public const string ImAddresses3 = "ImAddresses3"; + public const string DisplayNamePrefix = "DisplayNamePrefix"; + public const string DisplayNameFirstLast = "DisplayNameFirstLast"; + public const string DisplayNameLastFirst = "DisplayNameLastFirst"; + public const string DisplayNameFirstLastHeader = "DisplayNameFirstLastHeader"; + public const string DisplayNameLastFirstHeader = "DisplayNameLastFirstHeader"; + public const string IsFavorite = "IsFavorite"; + public const string Schools = "Schools"; + public const string Hobbies = "Hobbies"; + public const string Locations = "Locations"; + public const string OfficeLocations = "OfficeLocations"; + public const string BusinessHomePages = "BusinessHomePages"; + public const string PersonalHomePages = "PersonalHomePages"; + public const string ThirdPartyPhotoUrls = "ThirdPartyPhotoUrls"; + public const string Attribution = "Attribution"; + public const string Attributions = "Attributions"; + public const string StringAttributedValue = "StringAttributedValue"; + public const string DisplayNameFirstLastSortKey = "DisplayNameFirstLastSortKey"; + public const string DisplayNameLastFirstSortKey = "DisplayNameLastFirstSortKey"; + public const string CompanyNameSortKey = "CompanyNameSortKey"; + public const string HomeCitySortKey = "HomeCitySortKey"; + public const string WorkCitySortKey = "WorkCitySortKey"; + public const string FileAsId = "FileAsId"; + public const string FileAsIds = "FileAsIds"; + public const string HomeCity = "HomeCity"; + public const string WorkCity = "WorkCity"; + public const string PersonaType = "PersonaType"; + public const string Birthdays = "Birthdays"; + public const string BirthdaysLocal = "BirthdaysLocal"; + public const string WeddingAnniversaries = "WeddingAnniversaries"; + public const string WeddingAnniversariesLocal = "WeddingAnniversariesLocal"; + public const string OriginalDisplayName = "OriginalDisplayName"; + + #endregion + + #region People Insights + public const string Person = "Person"; + public const string Insights = "Insights"; + public const string Insight = "Insight"; + public const string InsightType = "InsightType"; + public const string InsightSourceType = "InsightSourceType"; + public const string InsightValue = "InsightValue"; + public const string InsightSource = "InsightSource"; + public const string UpdatedUtcTicks = "UpdatedUtcTicks"; + public const string StringInsightValue = "StringInsightValue"; + public const string ProfileInsightValue = "ProfileInsightValue"; + public const string JobInsightValue = "JobInsightValue"; + public const string OutOfOfficeInsightValue = "OutOfOfficeInsightValue"; + public const string UserProfilePicture = "UserProfilePicture"; + public const string EducationInsightValue = "EducationInsightValue"; + public const string SkillInsightValue = "SkillInsightValue"; + public const string MeetingInsightValue = "MeetingInsightValue"; + public const string Attendees = "Attendees"; + public const string EmailInsightValue = "EmailInsightValue"; + public const string ThreadId = "ThreadId"; + public const string LastEmailDateUtcTicks = "LastEmailDateUtcTicks"; + public const string LastEmailSender = "LastEmailSender"; + public const string EmailsCount = "EmailsCount"; + public const string DelveDocument = "DelveDocument"; + public const string CompanyInsightValue = "CompanyInsightValue"; + public const string ArrayOfInsightValue = "ArrayOfInsightValue"; + public const string InsightContent = "InsightContent"; + public const string SingleValueInsightContent = "SingleValueInsightContent"; + public const string MultiValueInsightContent = "MultiValueInsightContent"; + public const string ArrayOfInsight = "ArrayOfInsight"; + public const string PersonType = "PersonType"; + public const string SatoriId = "SatoriId"; + public const string DescriptionAttribution = "DescriptionAttribution"; + public const string ImageUrl = "ImageUrl"; + public const string ImageUrlAttribution = "ImageUrlAttribution"; + public const string YearFound = "YearFound"; + public const string FinanceSymbol = "FinanceSymbol"; + public const string WebsiteUrl = "WebsiteUrl"; + public const string Rank = "Rank"; + public const string Author = "Author"; + public const string Created = "Created"; + public const string DefaultEncodingURL = "DefaultEncodingURL"; + public const string FileType = "FileType"; + public const string Data = "Data"; + public const string ItemList = "ItemList"; + public const string Avatar = "Avatar"; + public const string JoinedUtcTicks = "JoinedUtcTicks"; + public const string Company = "Company"; + public const string StartUtcTicks = "StartUtcTicks"; + public const string EndUtcTicks = "EndUtcTicks"; + public const string Blob = "Blob"; + public const string PhotoSize = "PhotoSize"; + public const string Institute = "Institute"; + public const string Degree = "Degree"; + public const string Strength = "Strength"; + public const string ComputedInsightValueProperty = "ComputedInsightValueProperty"; + public const string ComputedInsightValue = "ComputedInsightValue"; + public const string Properties = "Properties"; + public const string Property = "Property"; + public const string Key = "Key"; + public const string SMSNumber = "SMSNumber"; + public const string FacebookProfileLink = "FacebookProfileLink"; + public const string LinkedInProfileLink = "LinkedInProfileLink"; + public const string ProfessionalBiography = "ProfessionalBiography"; + public const string TeamSize = "TeamSize"; + public const string Hometown = "Hometown"; + public const string CurrentLocation = "CurrentLocation"; + public const string Office = "Office"; + public const string Headline = "Headline"; + public const string ManagementChain = "ManagementChain"; + public const string Peers = "Peers"; + public const string MutualConnections = "MutualConnections"; + public const string MutualManager = "MutualManager"; + public const string Skills = "Skills"; + public const string JobInsight = "JobInsight"; + public const string CurrentJob = "CurrentJob"; + public const string CompanyProfile = "CompanyProfile"; + public const string CompanyInsight = "CompanyInsight"; + public const string Text = "Text"; + public const string ImageType = "ImageType"; + public const string DocumentId = "DocumentId"; + public const string PreviewURL = "PreviewURL"; + public const string LastEditor = "LastEditor"; + public const string ProfilePicture = "ProfilePicture"; + + #endregion + #region Conversations public const string Conversations = "Conversations"; @@ -973,6 +1179,14 @@ internal static class XmlElementNames public const string DirectReports = "DirectReports"; #endregion + #region Photos + + public const string SizeRequested = "SizeRequested"; + public const string HasChanged = "HasChanged"; + public const string PictureData = "PictureData"; + + #endregion + #region Request/response element names public const string ResponseMessage = "ResponseMessage"; public const string ResponseMessages = "ResponseMessages"; @@ -1078,6 +1292,26 @@ internal static class XmlElementNames public const string MarkAllItemsAsReadResponse = "MarkAllItemsAsReadResponse"; public const string MarkAllItemsAsReadResponseMessage = "MarkAllItemsAsReadResponseMessage"; + // FindPeople + public const string FindPeople = "FindPeople"; + public const string FindPeopleResponse = "FindPeopleResponse"; + public const string FindPeopleResponseMessage = "FindPeopleResponseMessage"; + public const string SearchPeopleSuggestionIndex = "SearchPeopleSuggestionIndex"; + public const string SearchPeopleContext = "Context"; + public const string SearchPeopleQuerySources = "QuerySources"; + public const string FindPeopleTransactionId = "TransactionId"; + public const string FindPeopleSources = "Sources"; + + // GetPeopleInsights + public const string GetPeopleInsights = "GetPeopleInsights"; + public const string GetPeopleInsightsResponse = "GetPeopleInsightsResponse"; + public const string GetPeopleInsightsResponseMessage = "GetPeopleInsightsResponseMessage"; + + // GetUserPhoto + public const string GetUserPhoto = "GetUserPhoto"; + public const string GetUserPhotoResponse = "GetUserPhotoResponse"; + public const string GetUserPhotoResponseMessage = "GetUserPhotoResponseMessage"; + // GetAttachment public const string GetAttachment = "GetAttachment"; public const string GetAttachmentResponse = "GetAttachmentResponse"; @@ -1395,6 +1629,13 @@ internal static class XmlElementNames public const string GetEncryptionConfigurationResponse = "GetEncryptionConfigurationResponse"; public const string SetEncryptionConfigurationResponse = "SetEncryptionConfigurationResponse"; + // GetOMEConfiguration/SetOMEConfiguration + public const string GetOMEConfigurationRequest = "GetOMEConfiguration"; + public const string SetOMEConfigurationRequest = "SetOMEConfiguration"; + public const string OMEConfigurationXml = "Xml"; + public const string GetOMEConfigurationResponse = "GetOMEConfigurationResponse"; + public const string SetOMEConfigurationResponse = "SetOMEConfigurationResponse"; + // InstallApp public const string InstallAppRequest = "InstallApp"; public const string InstallAppResponse = "InstallAppResponse"; @@ -1407,6 +1648,10 @@ internal static class XmlElementNames public const string DisableAppRequest = "DisableApp"; public const string DisableAppResponse = "DisableAppResponse"; + // RegisterConsent + public const string RegisterConsentRequest = "RegisterConsent"; + public const string RegisterConsentResponse = "RegisterConsentResponse"; + // GetAppMarketplaceUrl public const string GetAppMarketplaceUrlRequest = "GetAppMarketplaceUrl"; public const string GetAppMarketplaceUrlResponse = "GetAppMarketplaceUrlResponse"; @@ -1428,6 +1673,46 @@ internal static class XmlElementNames #endregion + #region Groups + + // Like + public const string Likers = "Likers"; + + // GetUserUnifiedGroups + public const string GetUserUnifiedGroups = "GetUserUnifiedGroups"; + public const string RequestedGroupsSets = "RequestedGroupsSets"; + public const string RequestedUnifiedGroupsSetItem = "RequestedUnifiedGroupsSet"; + public const string SortType = "SortType"; + public const string FilterType = "FilterType"; + public const string SortDirection = "SortDirection"; + public const string GroupsLimit = "GroupsLimit"; + public const string UserSmtpAddress = "UserSmtpAddress"; + + public const string GetUserUnifiedGroupsResponseMessage = "GetUserUnifiedGroupsResponseMessage"; + public const string GroupsSets = "GroupsSets"; + public const string UnifiedGroupsSet = "UnifiedGroupsSet"; + public const string TotalGroups = "TotalGroups"; + public const string GroupsTag = "Groups"; + public const string UnifiedGroup = "UnifiedGroup"; + public const string MailboxGuid = "MailboxGuid"; + public const string LastVisitedTimeUtc = "LastVisitedTimeUtc"; + public const string AccessType = "AccessType"; + public const string ExternalDirectoryObjectId = "ExternalDirectoryObjectId"; + + // GetUnifiedGroupUnseenCount + public const string GetUnifiedGroupUnseenCount = "GetUnifiedGroupUnseenCount"; + public const string GroupIdentity = "GroupIdentity"; + public const string GroupIdentityType = "IdentityType"; + public const string GroupIdentityValue = "Value"; + + public const string GetUnifiedGroupUnseenCountResponseMessage = "GetUnifiedGroupUnseenCountResponseMessage"; + public const string UnseenCount = "UnseenCount"; + + // SetUnifiedGroupLastVisitedTimeRequest + public const string SetUnifiedGroupLastVisitedTime = "SetUnifiedGroupLastVisitedTime"; + public const string SetUnifiedGroupLastVisitedTimeResponseMessage = "SetUnifiedGroupLastVisitedTimeResponseMessage"; + #endregion + #region SOAP element names public const string SOAPEnvelopeElementName = "Envelope"; @@ -1447,4 +1732,4 @@ internal static class XmlElementNames #endregion } -} +} \ No newline at end of file diff --git a/Credentials/BasicAuthModuleForUTF8.cs b/Credentials/BasicAuthModuleForUTF8.cs index cc933e90..b4953793 100644 --- a/Credentials/BasicAuthModuleForUTF8.cs +++ b/Credentials/BasicAuthModuleForUTF8.cs @@ -1,12 +1,28 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ -//----------------------------------------------------------------------- -// Defines the BasicAuthModuleForUTF8 class. -//----------------------------------------------------------------------- namespace Microsoft.Exchange.WebServices.Data { using System; @@ -143,4 +159,4 @@ private Authorization Authenticate(HttpWebRequest httpWebRequest, ICredentials c return new Authorization(responseHeader, true); } } -} +} \ No newline at end of file diff --git a/Credentials/ClientCertificateCredentials.cs b/Credentials/ClientCertificateCredentials.cs index 83e394e2..09d24f15 100644 --- a/Credentials/ClientCertificateCredentials.cs +++ b/Credentials/ClientCertificateCredentials.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ClientCertificateCredentials class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -51,4 +66,4 @@ public X509CertificateCollection ClientCertificates get { return this.clientCertificates; } } } -} +} \ No newline at end of file diff --git a/Credentials/ExchangeCredentials.cs b/Credentials/ExchangeCredentials.cs index 264c4841..6f0596eb 100644 --- a/Credentials/ExchangeCredentials.cs +++ b/Credentials/ExchangeCredentials.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ExchangeCredentials class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -151,4 +166,4 @@ internal virtual void Sign(MemoryStream memoryStream) throw new InvalidOperationException(); } } -} +} \ No newline at end of file diff --git a/Credentials/OAuthCredentials.cs b/Credentials/OAuthCredentials.cs index e5b36536..c6cfeaef 100644 --- a/Credentials/OAuthCredentials.cs +++ b/Credentials/OAuthCredentials.cs @@ -1,8 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Credentials/PartnerTokenCredentials.cs b/Credentials/PartnerTokenCredentials.cs index 47cad7b8..1b778ece 100644 --- a/Credentials/PartnerTokenCredentials.cs +++ b/Credentials/PartnerTokenCredentials.cs @@ -1,8 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -103,4 +122,4 @@ internal override void Sign(MemoryStream memoryStream) document.Save(memoryStream); } } -} +} \ No newline at end of file diff --git a/Credentials/TokenCredentials.cs b/Credentials/TokenCredentials.cs index ede934f5..6e67aaab 100644 --- a/Credentials/TokenCredentials.cs +++ b/Credentials/TokenCredentials.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the TokenCredentials class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -38,4 +53,4 @@ internal override void PrepareWebRequest(IEwsHttpWebRequest request) this.EwsUrl = request.RequestUri; } } -} +} \ No newline at end of file diff --git a/Credentials/WSSecurityBasedCredentials.cs b/Credentials/WSSecurityBasedCredentials.cs index 4a53d3de..ec2fe2ef 100644 --- a/Credentials/WSSecurityBasedCredentials.cs +++ b/Credentials/WSSecurityBasedCredentials.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the WSSecurityBasedCredentials class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -224,4 +239,4 @@ internal static XmlNamespaceManager NamespaceManager } } } -} +} \ No newline at end of file diff --git a/Credentials/WSSecurityUtilityIdSignedXml.cs b/Credentials/WSSecurityUtilityIdSignedXml.cs index 2ba36aec..b5766ff2 100644 --- a/Credentials/WSSecurityUtilityIdSignedXml.cs +++ b/Credentials/WSSecurityUtilityIdSignedXml.cs @@ -1,8 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -90,4 +109,4 @@ public override XmlElement GetIdElement(XmlDocument document, string idValue) return this.ids[idValue]; } } -} +} \ No newline at end of file diff --git a/Credentials/WebCredentials.cs b/Credentials/WebCredentials.cs index f37e9339..28ab1c27 100644 --- a/Credentials/WebCredentials.cs +++ b/Credentials/WebCredentials.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the WebCredentials class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -98,4 +113,4 @@ internal override Uri AdjustUrl(Uri url) return url; } } -} +} \ No newline at end of file diff --git a/Credentials/WindowsLiveCredentials.cs b/Credentials/WindowsLiveCredentials.cs index d9c3849f..591e3efa 100644 --- a/Credentials/WindowsLiveCredentials.cs +++ b/Credentials/WindowsLiveCredentials.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the WindowsLiveCredentials class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -556,4 +571,4 @@ private void ProcessTokenResponse(HttpWebResponse response) } } } -} +} \ No newline at end of file diff --git a/Credentials/X509CertificateCredentials.cs b/Credentials/X509CertificateCredentials.cs index 36bf9b38..7cdd11c8 100644 --- a/Credentials/X509CertificateCredentials.cs +++ b/Credentials/X509CertificateCredentials.cs @@ -1,8 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -139,4 +158,4 @@ public override string ToString() this.certificate.Subject); } } -} +} \ No newline at end of file diff --git a/Dns/DnsClient.cs b/Dns/DnsClient.cs index 888584b6..4e1bc165 100644 --- a/Dns/DnsClient.cs +++ b/Dns/DnsClient.cs @@ -1,12 +1,28 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ -//--------------------------------------------------------------------- -// Defines the DnsClient class. -//--------------------------------------------------------------------- namespace Microsoft.Exchange.WebServices.Dns { using System; @@ -49,7 +65,7 @@ internal class DnsClient // Each strongly-typed DnsRecord type maps to a DnsRecordType enum. DnsRecordType dnsRecordTypeToQuery = typeToDnsTypeMap.Member[typeof(T)]; - // queryResultsPtr will point to unmanaged heap memoery if DnsQuery succeeds. + // queryResultsPtr will point to unmanaged heap memory if DnsQuery succeeds. IntPtr queryResultsPtr = IntPtr.Zero; try @@ -95,4 +111,4 @@ internal class DnsClient return dnsRecordList; } } -} +} \ No newline at end of file diff --git a/Dns/DnsNativeMethods.cs b/Dns/DnsNativeMethods.cs index cf78f3e3..21ce4539 100644 --- a/Dns/DnsNativeMethods.cs +++ b/Dns/DnsNativeMethods.cs @@ -1,12 +1,28 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//--------------------------------------------------------------------- -// Defines the DnsNativeMethods class. -//--------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + namespace Microsoft.Exchange.WebServices.Dns { using System; @@ -175,4 +191,4 @@ internal static void FreeDnsQueryResults(IntPtr ptrRecords) DnsNativeMethods.DnsRecordListFree( ptrRecords, FreeType.RecordList); } } -} +} \ No newline at end of file diff --git a/Dns/DnsRecord.cs b/Dns/DnsRecord.cs index 5309508e..f6eaa3f7 100644 --- a/Dns/DnsRecord.cs +++ b/Dns/DnsRecord.cs @@ -1,12 +1,28 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ -//--------------------------------------------------------------------- -// Defines the DnsRecord class. -//--------------------------------------------------------------------- namespace Microsoft.Exchange.WebServices.Dns { using System; @@ -62,4 +78,4 @@ public TimeSpan TimeToLive get { return TimeSpan.FromSeconds((double)this.timeToLive); } } } -} +} \ No newline at end of file diff --git a/Dns/DnsRecordHeader.cs b/Dns/DnsRecordHeader.cs index 74698663..7931f9fd 100644 --- a/Dns/DnsRecordHeader.cs +++ b/Dns/DnsRecordHeader.cs @@ -1,12 +1,28 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//--------------------------------------------------------------------- -// Defines the DnsRecordHeader class. -//--------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + namespace Microsoft.Exchange.WebServices.Dns { using System; @@ -49,4 +65,4 @@ internal struct DnsRecordHeader /// internal UInt32 Reserved; } -} +} \ No newline at end of file diff --git a/Dns/DnsSrvRecord.cs b/Dns/DnsSrvRecord.cs index f394c08e..ed1cc56e 100644 --- a/Dns/DnsSrvRecord.cs +++ b/Dns/DnsSrvRecord.cs @@ -1,12 +1,28 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//--------------------------------------------------------------------- -// Defines the DnsSrvRecord class. -//--------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + namespace Microsoft.Exchange.WebServices.Dns { using System; @@ -115,4 +131,4 @@ private struct Win32DnsSrvRecord public UInt16 Pad; // keep ptrs ulong aligned } } -} +} \ No newline at end of file diff --git a/Elc/RetentionPolicyTag.cs b/Elc/RetentionPolicyTag.cs index 7f4cf9c7..d4e02920 100644 --- a/Elc/RetentionPolicyTag.cs +++ b/Elc/RetentionPolicyTag.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the RetentionPolicyTag class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -87,63 +102,6 @@ internal static RetentionPolicyTag LoadFromXml(EwsServiceXmlReader reader) return retentionPolicyTag; } - /// - /// Load from json. - /// - /// The json object. - /// Retention policy tag object. - internal static RetentionPolicyTag LoadFromJson(JsonObject jsonObject) - { - RetentionPolicyTag retentionPolicyTag = new RetentionPolicyTag(); - - if (jsonObject.ContainsKey(XmlElementNames.DisplayName)) - { - retentionPolicyTag.DisplayName = jsonObject.ReadAsString(XmlElementNames.DisplayName); - } - - if (jsonObject.ContainsKey(XmlElementNames.RetentionId)) - { - retentionPolicyTag.RetentionId = new Guid(jsonObject.ReadAsString(XmlElementNames.RetentionId)); - } - - if (jsonObject.ContainsKey(XmlElementNames.RetentionPeriod)) - { - retentionPolicyTag.RetentionPeriod = jsonObject.ReadAsInt(XmlElementNames.RetentionPeriod); - } - - if (jsonObject.ContainsKey(XmlElementNames.Type)) - { - retentionPolicyTag.Type = jsonObject.ReadEnumValue(XmlElementNames.Type); - } - - if (jsonObject.ContainsKey(XmlElementNames.RetentionAction)) - { - retentionPolicyTag.RetentionAction = jsonObject.ReadEnumValue(XmlElementNames.RetentionAction); - } - - if (jsonObject.ContainsKey(XmlElementNames.Description)) - { - retentionPolicyTag.Description = jsonObject.ReadAsString(XmlElementNames.Description); - } - - if (jsonObject.ContainsKey(XmlElementNames.IsVisible)) - { - retentionPolicyTag.IsVisible = jsonObject.ReadAsBool(XmlElementNames.IsVisible); - } - - if (jsonObject.ContainsKey(XmlElementNames.OptedInto)) - { - retentionPolicyTag.OptedInto = jsonObject.ReadAsBool(XmlElementNames.OptedInto); - } - - if (jsonObject.ContainsKey(XmlElementNames.IsArchive)) - { - retentionPolicyTag.IsArchive = jsonObject.ReadAsBool(XmlElementNames.IsArchive); - } - - return retentionPolicyTag; - } - /// /// Retention policy tag display name. /// @@ -189,4 +147,4 @@ internal static RetentionPolicyTag LoadFromJson(JsonObject jsonObject) /// public bool IsArchive { get; set; } } -} +} \ No newline at end of file diff --git a/Enumerations/AffectedTaskOccurrence.cs b/Enumerations/AffectedTaskOccurrence.cs index f4d194d0..14328ab3 100644 --- a/Enumerations/AffectedTaskOccurrence.cs +++ b/Enumerations/AffectedTaskOccurrence.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//------------------------------------------------------------------------------ -// Defines the AffectedTaskOccurrence enumeration. -//------------------------------------------------------------------------------ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Enumerations/AggregateType.cs b/Enumerations/AggregateType.cs index dea294a4..6807415e 100644 --- a/Enumerations/AggregateType.cs +++ b/Enumerations/AggregateType.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the AggregateType enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -29,4 +44,4 @@ public enum AggregateType /// Maximum } -} +} \ No newline at end of file diff --git a/Enumerations/AppointmentType.cs b/Enumerations/AppointmentType.cs index 0e39320e..ed5caf22 100644 --- a/Enumerations/AppointmentType.cs +++ b/Enumerations/AppointmentType.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the AppointmentType enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -39,4 +54,4 @@ public enum AppointmentType /// RecurringMaster } -} +} \ No newline at end of file diff --git a/Enumerations/AutodiscoverEndpoints.cs b/Enumerations/AutodiscoverEndpoints.cs index bf0bbea6..7dfaf631 100644 --- a/Enumerations/AutodiscoverEndpoints.cs +++ b/Enumerations/AutodiscoverEndpoints.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the AutodiscoverEndpoints enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -55,4 +70,4 @@ internal enum AutodiscoverEndpoints /// OAuth = 32, } -} +} \ No newline at end of file diff --git a/Enumerations/AutodiscoverErrorCode.cs b/Enumerations/AutodiscoverErrorCode.cs index 63f0cc9c..68abf0fb 100644 --- a/Enumerations/AutodiscoverErrorCode.cs +++ b/Enumerations/AutodiscoverErrorCode.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the AutodiscoverErrorCode enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Autodiscover { @@ -74,4 +89,4 @@ public enum AutodiscoverErrorCode /// InternalServerError, } -} +} \ No newline at end of file diff --git a/Enumerations/AutodiscoverResponseType.cs b/Enumerations/AutodiscoverResponseType.cs index f7715b99..df888a73 100644 --- a/Enumerations/AutodiscoverResponseType.cs +++ b/Enumerations/AutodiscoverResponseType.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the AutodiscoverResponseType class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Autodiscover { @@ -39,4 +54,4 @@ internal enum AutodiscoverResponseType /// Success } -} +} \ No newline at end of file diff --git a/Enumerations/AvailabilityData.cs b/Enumerations/AvailabilityData.cs index 99ca0ac4..0a7f953a 100644 --- a/Enumerations/AvailabilityData.cs +++ b/Enumerations/AvailabilityData.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the AvailabilityData enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -30,4 +45,4 @@ public enum AvailabilityData /// FreeBusyAndSuggestions } -} +} \ No newline at end of file diff --git a/Enumerations/BasePropertySet.cs b/Enumerations/BasePropertySet.cs index 8f4fe7ce..a8e8c4cf 100644 --- a/Enumerations/BasePropertySet.cs +++ b/Enumerations/BasePropertySet.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the BasePropertySet enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Enumerations/BodyType.cs b/Enumerations/BodyType.cs index a6b1057a..84c3339a 100644 --- a/Enumerations/BodyType.cs +++ b/Enumerations/BodyType.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the BodyType enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -29,4 +44,4 @@ public enum BodyType /// Text } -} +} \ No newline at end of file diff --git a/Enumerations/ChangeType.cs b/Enumerations/ChangeType.cs index 1a58619c..46802ff6 100644 --- a/Enumerations/ChangeType.cs +++ b/Enumerations/ChangeType.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ChangeType enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -39,4 +54,4 @@ public enum ChangeType /// ReadFlagChange, } -} +} \ No newline at end of file diff --git a/Enumerations/ClientAccessTokenType.cs b/Enumerations/ClientAccessTokenType.cs index 3522b1a5..61ff2665 100644 --- a/Enumerations/ClientAccessTokenType.cs +++ b/Enumerations/ClientAccessTokenType.cs @@ -1,8 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -26,4 +45,4 @@ public enum ClientAccessTokenType /// ScopedToken, } -} +} \ No newline at end of file diff --git a/Enumerations/ClientExtensionProvidedTo.cs b/Enumerations/ClientExtensionProvidedTo.cs index 06c27b35..a1bd0c26 100644 --- a/Enumerations/ClientExtensionProvidedTo.cs +++ b/Enumerations/ClientExtensionProvidedTo.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ClientExtensionProvidedTo enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -25,4 +40,4 @@ public enum ClientExtensionProvidedTo /// SpecificUsers, } -} +} \ No newline at end of file diff --git a/Enumerations/ComparisonMode.cs b/Enumerations/ComparisonMode.cs index 6c91f886..aa6bfb22 100644 --- a/Enumerations/ComparisonMode.cs +++ b/Enumerations/ComparisonMode.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ComparisonMode enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -49,4 +64,4 @@ public enum ComparisonMode // LooseAndIgnoreNonSpace, // LooseAndIgnoreCaseAndIgnoreNonSpace } -} +} \ No newline at end of file diff --git a/Enumerations/ConflictResolutionMode.cs b/Enumerations/ConflictResolutionMode.cs index 1b937ebb..df187639 100644 --- a/Enumerations/ConflictResolutionMode.cs +++ b/Enumerations/ConflictResolutionMode.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ConflictResolution enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -34,4 +49,4 @@ public enum ConflictResolutionMode /// AlwaysOverwrite } -} +} \ No newline at end of file diff --git a/Enumerations/ConflictType.cs b/Enumerations/ConflictType.cs index 3ecd094d..93af1ddc 100644 --- a/Enumerations/ConflictType.cs +++ b/Enumerations/ConflictType.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ConflictType enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -35,4 +50,4 @@ public enum ConflictType /// UnknownAttendeeConflict } -} +} \ No newline at end of file diff --git a/Enumerations/ConnectingIdType.cs b/Enumerations/ConnectingIdType.cs index 6bf0417e..c18a2986 100644 --- a/Enumerations/ConnectingIdType.cs +++ b/Enumerations/ConnectingIdType.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ConnectingIdType enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -34,4 +49,4 @@ public enum ConnectingIdType /// SmtpAddress } -} +} \ No newline at end of file diff --git a/Enumerations/ConnectionFailureCause.cs b/Enumerations/ConnectionFailureCause.cs index 423dc986..d94d1afe 100644 --- a/Enumerations/ConnectionFailureCause.cs +++ b/Enumerations/ConnectionFailureCause.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ConnectionFailureCause enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Enumerations/ConsentState.cs b/Enumerations/ConsentState.cs new file mode 100644 index 00000000..c997ec3a --- /dev/null +++ b/Enumerations/ConsentState.cs @@ -0,0 +1,51 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data.Enumerations +{ + using System; + + /// + /// The consent states enumeration + /// + [Serializable] + public enum ConsentState + { + /// + /// User has closed the consent page or has not responded yet. + /// + NotResponded = 0, + + /// + /// User has requested to disable the extension. + /// + NotConsented = 1, + + /// + /// User has requested to enable the extension. + /// + Consented = 2 + } +} \ No newline at end of file diff --git a/Enumerations/ContactSource.cs b/Enumerations/ContactSource.cs index 48dc1957..3eabc4cb 100644 --- a/Enumerations/ContactSource.cs +++ b/Enumerations/ContactSource.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ContactSource enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -29,4 +44,4 @@ public enum ContactSource /// Store } -} +} \ No newline at end of file diff --git a/Enumerations/ContainmentMode.cs b/Enumerations/ContainmentMode.cs index 983f0eea..379cd2be 100644 --- a/Enumerations/ContainmentMode.cs +++ b/Enumerations/ContainmentMode.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ContainmentMode enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -44,4 +59,4 @@ public enum ContainmentMode /// ExactPhrase } -} +} \ No newline at end of file diff --git a/Enumerations/ConversationAction.cs b/Enumerations/ConversationAction.cs index 4e76502e..6ee9bd63 100644 --- a/Enumerations/ConversationAction.cs +++ b/Enumerations/ConversationAction.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ConversationAction enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Enumerations/ConversationFlagStatus.cs b/Enumerations/ConversationFlagStatus.cs index 37ec494d..7e5bcf3d 100644 --- a/Enumerations/ConversationFlagStatus.cs +++ b/Enumerations/ConversationFlagStatus.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ConversationFlagStatus enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Enumerations/ConversationQueryTraversal.cs b/Enumerations/ConversationQueryTraversal.cs index 5a4bee42..58482252 100644 --- a/Enumerations/ConversationQueryTraversal.cs +++ b/Enumerations/ConversationQueryTraversal.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ConversationQueryTraversal enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ using System.Xml.Serialization; diff --git a/Enumerations/ConversationSortOrder.cs b/Enumerations/ConversationSortOrder.cs index 93537f7d..6f2c1299 100644 --- a/Enumerations/ConversationSortOrder.cs +++ b/Enumerations/ConversationSortOrder.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ConversationSortOrder enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -39,4 +54,4 @@ public enum ConversationSortOrder /// DateOrderDescending, } -} +} \ No newline at end of file diff --git a/Enumerations/DateTimePrecision.cs b/Enumerations/DateTimePrecision.cs index 7e1c0fea..8d1df979 100644 --- a/Enumerations/DateTimePrecision.cs +++ b/Enumerations/DateTimePrecision.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the DateTimePrecision enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -34,4 +49,4 @@ public enum DateTimePrecision /// Milliseconds } -} +} \ No newline at end of file diff --git a/Enumerations/DayOfTheWeek.cs b/Enumerations/DayOfTheWeek.cs index e7003ca9..3c4ccb37 100644 --- a/Enumerations/DayOfTheWeek.cs +++ b/Enumerations/DayOfTheWeek.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the DayOfTheWeek enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -72,4 +87,4 @@ public enum DayOfTheWeek /// WeekendDay, } -} +} \ No newline at end of file diff --git a/Enumerations/DayOfTheWeekIndex.cs b/Enumerations/DayOfTheWeekIndex.cs index 05e62777..a9729649 100644 --- a/Enumerations/DayOfTheWeekIndex.cs +++ b/Enumerations/DayOfTheWeekIndex.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the DayOfTheWeekIndex enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -40,4 +55,4 @@ public enum DayOfTheWeekIndex /// Last } -} +} \ No newline at end of file diff --git a/Enumerations/DefaultExtendedPropertySet.cs b/Enumerations/DefaultExtendedPropertySet.cs index a4e0916b..34b69f8a 100644 --- a/Enumerations/DefaultExtendedPropertySet.cs +++ b/Enumerations/DefaultExtendedPropertySet.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the DefaultExtendedPropertySet enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -64,4 +79,4 @@ public enum DefaultExtendedPropertySet /// Task } -} +} \ No newline at end of file diff --git a/Enumerations/DelegateFolderPermissionLevel.cs b/Enumerations/DelegateFolderPermissionLevel.cs index f54b7070..80f10c9a 100644 --- a/Enumerations/DelegateFolderPermissionLevel.cs +++ b/Enumerations/DelegateFolderPermissionLevel.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the DelegateFolderPermissionLevel enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -44,4 +59,4 @@ public enum DelegateFolderPermissionLevel /// Custom } -} +} \ No newline at end of file diff --git a/Enumerations/DeleteMode.cs b/Enumerations/DeleteMode.cs index 1d5ecfd3..27d0a3f5 100644 --- a/Enumerations/DeleteMode.cs +++ b/Enumerations/DeleteMode.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the DeleteMode enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -34,4 +49,4 @@ public enum DeleteMode /// MoveToDeletedItems } -} +} \ No newline at end of file diff --git a/Enumerations/DnsRecordType.cs b/Enumerations/DnsRecordType.cs index cabcc051..53e60656 100644 --- a/Enumerations/DnsRecordType.cs +++ b/Enumerations/DnsRecordType.cs @@ -1,12 +1,28 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ -//--------------------------------------------------------------------- -// Defines the DnsRecordType enumeration. -//--------------------------------------------------------------------- namespace Microsoft.Exchange.WebServices.Dns { /// @@ -54,4 +70,4 @@ internal enum DnsRecordType : ushort /// SRV = 0x0021, } -} +} \ No newline at end of file diff --git a/Enumerations/DomainSettingName.cs b/Enumerations/DomainSettingName.cs index 8f2fd69d..b7693915 100644 --- a/Enumerations/DomainSettingName.cs +++ b/Enumerations/DomainSettingName.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the DomainSettingName enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ using System; using System.Collections.Generic; @@ -30,4 +45,4 @@ public enum DomainSettingName /// ExternalEwsVersion, } -} +} \ No newline at end of file diff --git a/Enumerations/EffectiveRights.cs b/Enumerations/EffectiveRights.cs index 3b37c734..fc43b063 100644 --- a/Enumerations/EffectiveRights.cs +++ b/Enumerations/EffectiveRights.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the EffectiveRights enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -60,4 +75,4 @@ public enum EffectiveRights /// ViewPrivateItems = 64 } -} +} \ No newline at end of file diff --git a/Enumerations/ElcFolderType.cs b/Enumerations/ElcFolderType.cs index 64eed036..2b811c98 100644 --- a/Enumerations/ElcFolderType.cs +++ b/Enumerations/ElcFolderType.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ElcFolderType enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ using System.Xml.Serialization; @@ -113,4 +128,4 @@ public enum ElcFolderType /// NonIpmRoot = 19, } -} +} \ No newline at end of file diff --git a/Enumerations/EmailAddressKey.cs b/Enumerations/EmailAddressKey.cs index a480534f..da1f428d 100644 --- a/Enumerations/EmailAddressKey.cs +++ b/Enumerations/EmailAddressKey.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the EmailAddressKey enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -34,4 +49,4 @@ public enum EmailAddressKey /// EmailAddress3 } -} +} \ No newline at end of file diff --git a/Enumerations/EmailPosition.cs b/Enumerations/EmailPosition.cs index de957030..cb4b7742 100644 --- a/Enumerations/EmailPosition.cs +++ b/Enumerations/EmailPosition.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the EmailPosition enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -39,4 +54,4 @@ public enum EmailPosition /// Signature, } -} +} \ No newline at end of file diff --git a/Enumerations/EventType.cs b/Enumerations/EventType.cs index c119f3f8..90222a61 100644 --- a/Enumerations/EventType.cs +++ b/Enumerations/EventType.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the EventType enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -65,4 +80,4 @@ public enum EventType [EwsEnum("FreeBusyChangedEvent")] FreeBusyChanged } -} +} \ No newline at end of file diff --git a/Enumerations/ExchangeVersion.cs b/Enumerations/ExchangeVersion.cs index d1d59d42..e816329f 100644 --- a/Enumerations/ExchangeVersion.cs +++ b/Enumerations/ExchangeVersion.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ExchangeVersion enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -46,5 +61,20 @@ public enum ExchangeVersion /// Microsoft Exchange 2013 SP1 /// Exchange2013_SP1 = 5, + + /// + /// Microsoft Exchange 2015 (aka Exchange 2016) + /// + Exchange2015 = 6, + + /// + /// Microsoft Exchange 2016 + /// + Exchange2016 = 7, + + /// + /// Functionality starting 10/05/2015 + /// + V2015_10_05 = 8, } -} +} \ No newline at end of file diff --git a/Enumerations/ExtensionInstallScope.cs b/Enumerations/ExtensionInstallScope.cs index fbb28c25..a51770bf 100644 --- a/Enumerations/ExtensionInstallScope.cs +++ b/Enumerations/ExtensionInstallScope.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ExtensionInstallScope enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -35,4 +50,4 @@ public enum ExtensionInstallScope /// Default = 3, } -} +} \ No newline at end of file diff --git a/Enumerations/ExtensionType.cs b/Enumerations/ExtensionType.cs index fd4e74dc..951b850e 100644 --- a/Enumerations/ExtensionType.cs +++ b/Enumerations/ExtensionType.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ExtensionType enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -30,4 +45,4 @@ public enum ExtensionType /// MarketPlace = 2, } -} +} \ No newline at end of file diff --git a/Enumerations/FileAsMapping.cs b/Enumerations/FileAsMapping.cs index e6f03800..2775f042 100644 --- a/Enumerations/FileAsMapping.cs +++ b/Enumerations/FileAsMapping.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the FileAsMapping enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -128,4 +143,4 @@ public enum FileAsMapping [RequiredServerVersion(ExchangeVersion.Exchange2010)] Empty } -} +} \ No newline at end of file diff --git a/Enumerations/FlaggedForAction.cs b/Enumerations/FlaggedForAction.cs index 626336c2..0e46a558 100644 --- a/Enumerations/FlaggedForAction.cs +++ b/Enumerations/FlaggedForAction.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the FlaggedForAction enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -70,4 +85,4 @@ public enum FlaggedForAction /// Review } -} +} \ No newline at end of file diff --git a/Enumerations/FolderPermissionLevel.cs b/Enumerations/FolderPermissionLevel.cs index c92a30b4..78184310 100644 --- a/Enumerations/FolderPermissionLevel.cs +++ b/Enumerations/FolderPermissionLevel.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the FolderPermissionLevel enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -81,4 +96,4 @@ public enum FolderPermissionLevel /// Custom } -} +} \ No newline at end of file diff --git a/Enumerations/FolderPermissionReadAccess.cs b/Enumerations/FolderPermissionReadAccess.cs index c94a309c..22ef89cd 100644 --- a/Enumerations/FolderPermissionReadAccess.cs +++ b/Enumerations/FolderPermissionReadAccess.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the FolderPermissionReadAccess enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -39,4 +54,4 @@ public enum FolderPermissionReadAccess /// FullDetails } -} +} \ No newline at end of file diff --git a/Enumerations/FolderTraversal.cs b/Enumerations/FolderTraversal.cs index 69e36aed..3bc082ff 100644 --- a/Enumerations/FolderTraversal.cs +++ b/Enumerations/FolderTraversal.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the FolderTraversal enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -34,4 +49,4 @@ public enum FolderTraversal /// SoftDeleted } -} +} \ No newline at end of file diff --git a/Enumerations/FreeBusyViewType.cs b/Enumerations/FreeBusyViewType.cs index 6ff58c23..36e23557 100644 --- a/Enumerations/FreeBusyViewType.cs +++ b/Enumerations/FreeBusyViewType.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the FreeBusyViewType enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -60,4 +75,4 @@ public enum FreeBusyViewType /// DetailedMerged } -} +} \ No newline at end of file diff --git a/Enumerations/GetUserPhotoStatus.cs b/Enumerations/GetUserPhotoStatus.cs new file mode 100644 index 00000000..06a22b88 --- /dev/null +++ b/Enumerations/GetUserPhotoStatus.cs @@ -0,0 +1,48 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + /// + /// Defines the response types from a GetUserPhoto request + /// + public enum GetUserPhotoStatus + { + /// + /// The photo was successfully returned + /// + PhotoReturned, + + /// + /// The photo has not changed since it was last obtained + /// + PhotoUnchanged, + + /// + /// The photo or user was not found on the server + /// + PhotoOrUserNotFound, + } +} \ No newline at end of file diff --git a/Enumerations/HoldAction.cs b/Enumerations/HoldAction.cs index 9e8601f7..d5890e58 100644 --- a/Enumerations/HoldAction.cs +++ b/Enumerations/HoldAction.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the HoldAction enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -34,4 +49,4 @@ public enum HoldAction /// Remove, } -} +} \ No newline at end of file diff --git a/Enumerations/HoldStatus.cs b/Enumerations/HoldStatus.cs index 38dc30c9..a279ec6e 100644 --- a/Enumerations/HoldStatus.cs +++ b/Enumerations/HoldStatus.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the HoldStatus enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -44,4 +59,4 @@ public enum HoldStatus /// Failed, } -} +} \ No newline at end of file diff --git a/Enumerations/IconIndex.cs b/Enumerations/IconIndex.cs index c8d140b1..4a446759 100644 --- a/Enumerations/IconIndex.cs +++ b/Enumerations/IconIndex.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the icon index enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -195,4 +210,4 @@ public enum IconIndex /// TaskDelegated, } -} +} \ No newline at end of file diff --git a/Enumerations/IdFormat.cs b/Enumerations/IdFormat.cs index 8fa7b1a9..20c47751 100644 --- a/Enumerations/IdFormat.cs +++ b/Enumerations/IdFormat.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the IdFormat enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -49,4 +64,4 @@ public enum IdFormat /// OwaId } -} +} \ No newline at end of file diff --git a/Enumerations/ImAddressKey.cs b/Enumerations/ImAddressKey.cs index 986865cb..31e5bdc8 100644 --- a/Enumerations/ImAddressKey.cs +++ b/Enumerations/ImAddressKey.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ImAddressKey enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -34,4 +49,4 @@ public enum ImAddressKey /// ImAddress3 } -} +} \ No newline at end of file diff --git a/Enumerations/Importance.cs b/Enumerations/Importance.cs index 19bfd5be..1797ff49 100644 --- a/Enumerations/Importance.cs +++ b/Enumerations/Importance.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the Importance enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -34,4 +49,4 @@ public enum Importance /// High } -} +} \ No newline at end of file diff --git a/Enumerations/ItemFlagStatus.cs b/Enumerations/ItemFlagStatus.cs index 7e6f09e8..cb68d826 100644 --- a/Enumerations/ItemFlagStatus.cs +++ b/Enumerations/ItemFlagStatus.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ItemFlagStatus enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Enumerations/ItemTraversal.cs b/Enumerations/ItemTraversal.cs index 4c94bf71..4f4c60cf 100644 --- a/Enumerations/ItemTraversal.cs +++ b/Enumerations/ItemTraversal.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ItemTraversal enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -35,4 +50,4 @@ public enum ItemTraversal [RequiredServerVersion(ExchangeVersion.Exchange2010)] Associated } -} +} \ No newline at end of file diff --git a/Enumerations/LegacyFreeBusyStatus.cs b/Enumerations/LegacyFreeBusyStatus.cs index ea96471f..17d18e76 100644 --- a/Enumerations/LegacyFreeBusyStatus.cs +++ b/Enumerations/LegacyFreeBusyStatus.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the LegacyFreeBusyStatus enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -49,4 +64,4 @@ public enum LegacyFreeBusyStatus /// NoData = 5 } -} +} \ No newline at end of file diff --git a/Enumerations/LocationSource.cs b/Enumerations/LocationSource.cs index d052d10f..617d143a 100644 --- a/Enumerations/LocationSource.cs +++ b/Enumerations/LocationSource.cs @@ -1,8 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -32,4 +51,4 @@ public enum LocationSource /// Sourced from a resource (such as a conference room) Resource = 5, } -} +} \ No newline at end of file diff --git a/Enumerations/LogicalOperator.cs b/Enumerations/LogicalOperator.cs index ad9037ae..a859909b 100644 --- a/Enumerations/LogicalOperator.cs +++ b/Enumerations/LogicalOperator.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the LogicalOperator enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -29,4 +44,4 @@ public enum LogicalOperator /// Or } -} +} \ No newline at end of file diff --git a/Enumerations/MailboxSearchLocation.cs b/Enumerations/MailboxSearchLocation.cs index b9249ce7..374322e0 100644 --- a/Enumerations/MailboxSearchLocation.cs +++ b/Enumerations/MailboxSearchLocation.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the MailboxSearchLocation enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ using System.Xml.Serialization; diff --git a/Enumerations/MailboxSearchScopeType.cs b/Enumerations/MailboxSearchScopeType.cs index 0a5cefb8..b6739262 100644 --- a/Enumerations/MailboxSearchScopeType.cs +++ b/Enumerations/MailboxSearchScopeType.cs @@ -1,13 +1,28 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft. All rights reserved. -// -// --------------------------------------------------------------------------- -// --------------------------------------------------------------------------- -// -// MailboxSearchScopeType.cs -// -// --------------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + namespace Microsoft.Exchange.WebServices.Data { using System; @@ -60,4 +75,4 @@ internal enum MailboxSearchScopeType /// AutoDetect = 7, } -} +} \ No newline at end of file diff --git a/Enumerations/MailboxType.cs b/Enumerations/MailboxType.cs index fb710946..2adb5fd8 100644 --- a/Enumerations/MailboxType.cs +++ b/Enumerations/MailboxType.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the MailboxType enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ using System.Xml.Serialization; @@ -56,5 +71,11 @@ public enum MailboxType /// The EmailAddress represents a store contact or AD mail contact. /// Contact, + + /// + /// The EmailAddress represents a GroupMailbox + /// + [RequiredServerVersion(ExchangeVersion.Exchange2015)] + GroupMailbox, } -} +} \ No newline at end of file diff --git a/Enumerations/MapiPropertyType.cs b/Enumerations/MapiPropertyType.cs index 32ef9ae4..3f81d2bf 100644 --- a/Enumerations/MapiPropertyType.cs +++ b/Enumerations/MapiPropertyType.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the MapiPropertyType enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -154,4 +169,4 @@ public enum MapiPropertyType /// StringArray } -} +} \ No newline at end of file diff --git a/Enumerations/MeetingAttendeeType.cs b/Enumerations/MeetingAttendeeType.cs index 82f96ec4..66a4217f 100644 --- a/Enumerations/MeetingAttendeeType.cs +++ b/Enumerations/MeetingAttendeeType.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the MeetingAttendeeType enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -44,4 +59,4 @@ public enum MeetingAttendeeType /// Resource } -} +} \ No newline at end of file diff --git a/Enumerations/MeetingRequestType.cs b/Enumerations/MeetingRequestType.cs index fa06c501..4dfc71f2 100644 --- a/Enumerations/MeetingRequestType.cs +++ b/Enumerations/MeetingRequestType.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the MeetingRequestType enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -54,4 +69,4 @@ public enum MeetingRequestType /// PrincipalWantsCopy } -} +} \ No newline at end of file diff --git a/Enumerations/MeetingRequestsDeliveryScope.cs b/Enumerations/MeetingRequestsDeliveryScope.cs index 4c37cdef..5f337c9e 100644 --- a/Enumerations/MeetingRequestsDeliveryScope.cs +++ b/Enumerations/MeetingRequestsDeliveryScope.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the MeetingRequestsDeliveryScope enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -41,4 +56,4 @@ public enum MeetingRequestsDeliveryScope [RequiredServerVersion(ExchangeVersion.Exchange2010_SP1)] NoForward } -} +} \ No newline at end of file diff --git a/Enumerations/MemberStatus.cs b/Enumerations/MemberStatus.cs index cbe6c32a..26a6d8f0 100644 --- a/Enumerations/MemberStatus.cs +++ b/Enumerations/MemberStatus.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the MemberStatus enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -30,4 +45,4 @@ public enum MemberStatus /// Demoted } -} +} \ No newline at end of file diff --git a/Enumerations/MessageDisposition.cs b/Enumerations/MessageDisposition.cs index 9fbaa883..337715e7 100644 --- a/Enumerations/MessageDisposition.cs +++ b/Enumerations/MessageDisposition.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the MessageDisposition enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -34,4 +49,4 @@ public enum MessageDisposition /// SendOnly } -} +} \ No newline at end of file diff --git a/Enumerations/Month.cs b/Enumerations/Month.cs index 94296786..d61fbbb6 100644 --- a/Enumerations/Month.cs +++ b/Enumerations/Month.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the Month enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -79,4 +94,4 @@ public enum Month /// December = 12 } -} +} \ No newline at end of file diff --git a/Enumerations/OffsetBasePoint.cs b/Enumerations/OffsetBasePoint.cs index fbd54f2f..7cc59be8 100644 --- a/Enumerations/OffsetBasePoint.cs +++ b/Enumerations/OffsetBasePoint.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the OffsetBasePoint enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -29,4 +44,4 @@ public enum OffsetBasePoint /// End } -} +} \ No newline at end of file diff --git a/Enumerations/OofExternalAudience.cs b/Enumerations/OofExternalAudience.cs index e484ad01..24fb39af 100644 --- a/Enumerations/OofExternalAudience.cs +++ b/Enumerations/OofExternalAudience.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the OofExternalAudience enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -34,4 +49,4 @@ public enum OofExternalAudience /// All } -} +} \ No newline at end of file diff --git a/Enumerations/OofState.cs b/Enumerations/OofState.cs index d8e757d0..38cbe575 100644 --- a/Enumerations/OofState.cs +++ b/Enumerations/OofState.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the OofState enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -34,4 +49,4 @@ public enum OofState /// Scheduled } -} +} \ No newline at end of file diff --git a/Enumerations/OutlookProtocolType.cs b/Enumerations/OutlookProtocolType.cs index 33a1c432..805132af 100644 --- a/Enumerations/OutlookProtocolType.cs +++ b/Enumerations/OutlookProtocolType.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the OutlookProtocolType enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Autodiscover { @@ -35,4 +50,4 @@ internal enum OutlookProtocolType /// Unknown, } -} +} \ No newline at end of file diff --git a/Enumerations/PeopleQueryContextKeys.cs b/Enumerations/PeopleQueryContextKeys.cs new file mode 100644 index 00000000..a0bd4e16 --- /dev/null +++ b/Enumerations/PeopleQueryContextKeys.cs @@ -0,0 +1,55 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + using System; + using System.Collections.Generic; + using System.Collections.ObjectModel; + + /// + /// Lists different keys that can be passed to the people query context dictionary + /// + public sealed class PeopleQueryContextKeys + { + /// Topic Query + public static readonly string TopicQuery = "TopicQuery"; + + /// Guid for client session + public static readonly string ClientSessionId = "ClientSessionId"; + + /// Client Flight Number + public static readonly string ClientFlightNumber = "ClientFlightNumber"; + + /// User Agent + public static readonly string UserAgent = "UserAgent"; + + /// App Name + public static readonly string AppName = "AppName"; + + /// App Scenario + public static readonly string AppScenario = "AppScenario"; + } +} \ No newline at end of file diff --git a/Enumerations/PeopleQuerySource.cs b/Enumerations/PeopleQuerySource.cs new file mode 100644 index 00000000..3739b1d6 --- /dev/null +++ b/Enumerations/PeopleQuerySource.cs @@ -0,0 +1,43 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + using System; + using System.Collections.Generic; + using System.Collections.ObjectModel; + + /// + /// Lists the names of various sources of people + /// + public sealed class PeopleQuerySource + { + /// The users mailbox + public static readonly string Mailbox = "Mailbox"; + + /// The users directory + public static readonly string Directory = "Directory"; + } +} \ No newline at end of file diff --git a/Enumerations/PermissionScope.cs b/Enumerations/PermissionScope.cs index ac820829..6c965ac3 100644 --- a/Enumerations/PermissionScope.cs +++ b/Enumerations/PermissionScope.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the PermissionScope enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -34,4 +49,4 @@ public enum PermissionScope /// All } -} +} \ No newline at end of file diff --git a/Enumerations/PhoneCallState.cs b/Enumerations/PhoneCallState.cs index 9342f633..64b641d2 100644 --- a/Enumerations/PhoneCallState.cs +++ b/Enumerations/PhoneCallState.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the PhoneCallState enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -59,4 +74,4 @@ public enum PhoneCallState /// Forwarding } -} +} \ No newline at end of file diff --git a/Enumerations/PhoneNumberKey.cs b/Enumerations/PhoneNumberKey.cs index 4be498ee..8614a9f7 100644 --- a/Enumerations/PhoneNumberKey.cs +++ b/Enumerations/PhoneNumberKey.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the PhoneNumberKey enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -114,4 +129,4 @@ public enum PhoneNumberKey /// TtyTddPhone } -} +} \ No newline at end of file diff --git a/Enumerations/PhysicalAddressIndex.cs b/Enumerations/PhysicalAddressIndex.cs index 6f109b4c..4cc792eb 100644 --- a/Enumerations/PhysicalAddressIndex.cs +++ b/Enumerations/PhysicalAddressIndex.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the PhysicalAddressType enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Enumerations/PhysicalAddressKey.cs b/Enumerations/PhysicalAddressKey.cs index de463efc..34ea2a2b 100644 --- a/Enumerations/PhysicalAddressKey.cs +++ b/Enumerations/PhysicalAddressKey.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the PhysicalAddressKey enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -34,4 +49,4 @@ public enum PhysicalAddressKey /// Other } -} +} \ No newline at end of file diff --git a/Enumerations/PreviewItemBaseShape.cs b/Enumerations/PreviewItemBaseShape.cs index 2f0addf0..f47f80ed 100644 --- a/Enumerations/PreviewItemBaseShape.cs +++ b/Enumerations/PreviewItemBaseShape.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the PreviewItemBaseShape enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -29,4 +44,4 @@ public enum PreviewItemBaseShape /// Compact, } -} +} \ No newline at end of file diff --git a/Enumerations/PrivilegedLogonType.cs b/Enumerations/PrivilegedLogonType.cs index 61498a18..c1c5c57b 100644 --- a/Enumerations/PrivilegedLogonType.cs +++ b/Enumerations/PrivilegedLogonType.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the PrivilegedLogonType enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -25,4 +40,4 @@ internal enum PrivilegedLogonType /// SystemService, } -} +} \ No newline at end of file diff --git a/Enumerations/PropertyDefinitionFlags.cs b/Enumerations/PropertyDefinitionFlags.cs index 7a3ffd6f..70dcc9f4 100644 --- a/Enumerations/PropertyDefinitionFlags.cs +++ b/Enumerations/PropertyDefinitionFlags.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the PropertyDefinitionFlags enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -67,4 +82,4 @@ internal enum PropertyDefinitionFlags /// UpdateCollectionItems = 128, } -} +} \ No newline at end of file diff --git a/Enumerations/ResolveNameSearchLocation.cs b/Enumerations/ResolveNameSearchLocation.cs index 061c8428..8ae707b4 100644 --- a/Enumerations/ResolveNameSearchLocation.cs +++ b/Enumerations/ResolveNameSearchLocation.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ResolveNameSearchLocation enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Enumerations/ResponseActions.cs b/Enumerations/ResponseActions.cs index 1b8a516d..c0e6be71 100644 --- a/Enumerations/ResponseActions.cs +++ b/Enumerations/ResponseActions.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ResponseActions enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Enumerations/ResponseMessageType.cs b/Enumerations/ResponseMessageType.cs index 2069b179..413bfb3a 100644 --- a/Enumerations/ResponseMessageType.cs +++ b/Enumerations/ResponseMessageType.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ResponseMessageType enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -34,4 +49,4 @@ public enum ResponseMessageType /// Forward } -} +} \ No newline at end of file diff --git a/Enumerations/ResponseType.cs b/Enumerations/ResponseType.cs index 5732af3e..77199174 100644 --- a/Enumerations/ResponseType.cs +++ b/Enumerations/ResponseType.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ResponseType enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -49,4 +64,4 @@ public enum MeetingResponseType /// NoResponseReceived } -} +} \ No newline at end of file diff --git a/Enumerations/RetentionActionType.cs b/Enumerations/RetentionActionType.cs index c4ec1b19..3c7ce51a 100644 --- a/Enumerations/RetentionActionType.cs +++ b/Enumerations/RetentionActionType.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the RetentionActionType enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ using System.Xml.Serialization; @@ -53,4 +68,4 @@ public enum RetentionActionType /// MoveToArchive = 6, } -} +} \ No newline at end of file diff --git a/Enumerations/RetentionType.cs b/Enumerations/RetentionType.cs index ebf6edd9..f6f8eb04 100644 --- a/Enumerations/RetentionType.cs +++ b/Enumerations/RetentionType.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the RetentionType enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ using System.Xml.Serialization; @@ -27,4 +42,4 @@ public enum RetentionType /// Archive = 1, } -} +} \ No newline at end of file diff --git a/Enumerations/RuleErrorCode.cs b/Enumerations/RuleErrorCode.cs index 25ddc4b8..fb960190 100644 --- a/Enumerations/RuleErrorCode.cs +++ b/Enumerations/RuleErrorCode.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the RuleErrorCode enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -138,4 +153,4 @@ public enum RuleErrorCode /// UnsupportedRule } -} +} \ No newline at end of file diff --git a/Enumerations/RuleProperty.cs b/Enumerations/RuleProperty.cs index ce84d6f8..be1d93d1 100644 --- a/Enumerations/RuleProperty.cs +++ b/Enumerations/RuleProperty.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the RuleProperty enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -561,4 +576,4 @@ public enum RuleProperty [EwsEnum("Exceptions")] Exceptions } -} +} \ No newline at end of file diff --git a/Enumerations/SearchFolderTraversal.cs b/Enumerations/SearchFolderTraversal.cs index f5b26274..599ce798 100644 --- a/Enumerations/SearchFolderTraversal.cs +++ b/Enumerations/SearchFolderTraversal.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SearchFolderTraversal enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -29,4 +44,4 @@ public enum SearchFolderTraversal /// Deep } -} +} \ No newline at end of file diff --git a/Enumerations/SearchPageDirection.cs b/Enumerations/SearchPageDirection.cs index 0ac8dd04..38bb8680 100644 --- a/Enumerations/SearchPageDirection.cs +++ b/Enumerations/SearchPageDirection.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SearchPageDirection enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -29,4 +44,4 @@ public enum SearchPageDirection /// Previous } -} +} \ No newline at end of file diff --git a/Enumerations/SearchResultType.cs b/Enumerations/SearchResultType.cs index b3e06a23..5ba235c1 100644 --- a/Enumerations/SearchResultType.cs +++ b/Enumerations/SearchResultType.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SearchResultType enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -29,4 +44,4 @@ public enum SearchResultType /// PreviewOnly, } -} +} \ No newline at end of file diff --git a/Enumerations/SendCancellationsMode.cs b/Enumerations/SendCancellationsMode.cs index fab826db..c7ca0701 100644 --- a/Enumerations/SendCancellationsMode.cs +++ b/Enumerations/SendCancellationsMode.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SendCancellationsMode enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -34,4 +49,4 @@ public enum SendCancellationsMode /// SendToAllAndSaveCopy, } -} +} \ No newline at end of file diff --git a/Enumerations/SendInvitationsMode.cs b/Enumerations/SendInvitationsMode.cs index ef683dc2..2efc9d24 100644 --- a/Enumerations/SendInvitationsMode.cs +++ b/Enumerations/SendInvitationsMode.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SendInvitationsMode enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -34,4 +49,4 @@ public enum SendInvitationsMode /// SendToAllAndSaveCopy } -} +} \ No newline at end of file diff --git a/Enumerations/SendInvitationsOrCancellationsMode.cs b/Enumerations/SendInvitationsOrCancellationsMode.cs index b88e49e5..d063bb78 100644 --- a/Enumerations/SendInvitationsOrCancellationsMode.cs +++ b/Enumerations/SendInvitationsOrCancellationsMode.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SendInvitationsOrCancellationsMode enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -44,4 +59,4 @@ public enum SendInvitationsOrCancellationsMode /// SendToChangedAndSaveCopy } -} +} \ No newline at end of file diff --git a/Enumerations/SendPrompt.cs b/Enumerations/SendPrompt.cs index 00ea43f3..c3e39be0 100644 --- a/Enumerations/SendPrompt.cs +++ b/Enumerations/SendPrompt.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SendPrompt enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -30,4 +45,4 @@ public enum SendPrompt /// VotingOption, } -} +} \ No newline at end of file diff --git a/Enumerations/Sensitivity.cs b/Enumerations/Sensitivity.cs index bfdd29dd..121bef0c 100644 --- a/Enumerations/Sensitivity.cs +++ b/Enumerations/Sensitivity.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the Sensitivity enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -39,4 +54,4 @@ public enum Sensitivity /// Confidential } -} +} \ No newline at end of file diff --git a/Enumerations/ServiceError.cs b/Enumerations/ServiceError.cs index b7156afb..6d36096d 100644 --- a/Enumerations/ServiceError.cs +++ b/Enumerations/ServiceError.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ServiceError enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -2287,6 +2302,72 @@ public enum ServiceError /// /// Receive quota message per folder is exceeded. /// - ErrorMessagePerFolderCountReceiveQuotaExceeded + ErrorMessagePerFolderCountReceiveQuotaExceeded, + + /// + /// Unified group was not found. + /// + ErrorUnifiedGroupMailboxNotFound, + + /// + /// Invalid channel id. + /// + ErrorInvalidChannelId, + + /// + /// Another connection is opened on the same channel. + /// + ErrorNewChannelConnectionOpened, + + /// + /// The channel subscription cannot be found. + /// + ErrorChannelSubscriptionNotFound, + + /// + /// The channel contains too many subscriptions. + /// + ErrorExceededChannelSubscriptionCount, + + /// + /// The channel subscription already exists. + /// + ErrorChannelSubscriptionAlreadyExists, + + /// + /// The given channel subscription id is invalid. + /// + ErrorInvalidChannelSubscriptionId, + + #region Error codes to map WASCL errors + + /// Error indicating that message submission blocked by WASCL for a consumer mailboxes + ErrorMessageSubmissionBlocked, + + /// Error indicating that number of submitted messages exceeded the limit and message submission is blocked by WASCL + ErrorExceededMessageLimit, + + /// Error indicating that recipients number for a consumer mailbox has exceeded the limit defined by WASCL + ErrorExceededMaxRecipientLimitBlock, + + /// Error indicating that access to the consumer mailbox is suspended by WASCL + ErrorAccountSuspend, + + /// Error indicating that recipients number for a consumer mailbox has exceeded the limit defined by WASCL + ErrorExceededMaxRecipientLimit, + + /// Error indicating that particular message cannot be sent for a consumer mailbox as it is considered as SPAM by WASCL + ErrorMessageBlocked, + + /// Error indicating that access to the consumer mailbox is suspended by WASCL + ErrorAccountSuspendShowTierUpgrade, + + /// Error indicating that message sent from a consumer mailbox has exceeded the limit defined by WASCL + ErrorExceededMessageLimitShowTierUpgrade, + + /// Error indicating that recipients number for a consumer mailbox has exceeded the limit defined by WASCL + ErrorExceededMaxRecipientLimitShowTierUpgrade, + + #endregion } -} +} \ No newline at end of file diff --git a/Enumerations/ServiceErrorHandling.cs b/Enumerations/ServiceErrorHandling.cs index feaa4960..9d5ce584 100644 --- a/Enumerations/ServiceErrorHandling.cs +++ b/Enumerations/ServiceErrorHandling.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ServiceErrorHandling enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -25,4 +40,4 @@ internal enum ServiceErrorHandling /// ThrowOnError } -} +} \ No newline at end of file diff --git a/Enumerations/ServiceObjectType.cs b/Enumerations/ServiceObjectType.cs index 51584999..3db5a971 100644 --- a/Enumerations/ServiceObjectType.cs +++ b/Enumerations/ServiceObjectType.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ServiceObjectType enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -32,6 +47,11 @@ public enum ServiceObjectType /// /// Data represents a conversation /// - Conversation + Conversation, + + /// + /// Data represents a persona + /// + Persona } -} +} \ No newline at end of file diff --git a/Enumerations/ServiceResult.cs b/Enumerations/ServiceResult.cs index b2c5e63b..1ab3d918 100644 --- a/Enumerations/ServiceResult.cs +++ b/Enumerations/ServiceResult.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ServiceResult enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -35,4 +50,4 @@ public enum ServiceResult /// Error } -} +} \ No newline at end of file diff --git a/Enumerations/SetClientExtensionActionId.cs b/Enumerations/SetClientExtensionActionId.cs index ef40a8b2..dcdfcc97 100644 --- a/Enumerations/SetClientExtensionActionId.cs +++ b/Enumerations/SetClientExtensionActionId.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SetClientExtensionActionId enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -30,4 +45,4 @@ public enum SetClientExtensionActionId /// Configure, } -} +} \ No newline at end of file diff --git a/Enumerations/SortDirection.cs b/Enumerations/SortDirection.cs index 0cadced0..eefce351 100644 --- a/Enumerations/SortDirection.cs +++ b/Enumerations/SortDirection.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SortDirection enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -29,4 +44,4 @@ public enum SortDirection /// Descending } -} +} \ No newline at end of file diff --git a/Enumerations/StandardUser.cs b/Enumerations/StandardUser.cs index 484fc0d0..bf51c27e 100644 --- a/Enumerations/StandardUser.cs +++ b/Enumerations/StandardUser.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the StandardUser enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -29,4 +44,4 @@ public enum StandardUser /// Anonymous } -} +} \ No newline at end of file diff --git a/Enumerations/SuggestionQuality.cs b/Enumerations/SuggestionQuality.cs index 4add7e77..9638f998 100644 --- a/Enumerations/SuggestionQuality.cs +++ b/Enumerations/SuggestionQuality.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SuggestionQuality enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -39,4 +54,4 @@ public enum SuggestionQuality /// Poor } -} +} \ No newline at end of file diff --git a/Enumerations/SyncFolderItemsScope.cs b/Enumerations/SyncFolderItemsScope.cs index 2253f8bb..6f29b2e3 100644 --- a/Enumerations/SyncFolderItemsScope.cs +++ b/Enumerations/SyncFolderItemsScope.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SyncFolderItemsScope enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -29,4 +44,4 @@ public enum SyncFolderItemsScope /// NormalAndAssociatedItems } -} +} \ No newline at end of file diff --git a/Enumerations/TaskDelegationState.cs b/Enumerations/TaskDelegationState.cs index 7da49c94..126c9343 100644 --- a/Enumerations/TaskDelegationState.cs +++ b/Enumerations/TaskDelegationState.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the TaskDelegationState enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -47,4 +62,4 @@ public enum TaskDelegationState // The original Declined value has no mapping // The original Max value has no mapping } -} +} \ No newline at end of file diff --git a/Enumerations/TaskMode.cs b/Enumerations/TaskMode.cs index 3dc26ced..f76e3d35 100644 --- a/Enumerations/TaskMode.cs +++ b/Enumerations/TaskMode.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the TaskMode enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -49,4 +64,4 @@ public enum TaskMode /// SelfDelegated = 5 } -} +} \ No newline at end of file diff --git a/Enumerations/TaskStatus.cs b/Enumerations/TaskStatus.cs index 0f2aac42..8ff684ce 100644 --- a/Enumerations/TaskStatus.cs +++ b/Enumerations/TaskStatus.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the TaskStatus enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -44,4 +59,4 @@ public enum TaskStatus /// Deferred } -} +} \ No newline at end of file diff --git a/Enumerations/TeamMailboxLifecycleState.cs b/Enumerations/TeamMailboxLifecycleState.cs index fefa1a95..7d80aa67 100644 --- a/Enumerations/TeamMailboxLifecycleState.cs +++ b/Enumerations/TeamMailboxLifecycleState.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the TeamMailbox lifecycle state enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Enumerations/TraceFlags.cs b/Enumerations/TraceFlags.cs index 5a05269a..9f24997a 100644 --- a/Enumerations/TraceFlags.cs +++ b/Enumerations/TraceFlags.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the TraceFlags enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -73,9 +88,14 @@ public enum TraceFlags : long /// AutodiscoverRequestHttpHeaders = 512, + /// + /// Trace EWS timezone related logic. + /// + EwsTimeZones = 1024, + /// /// All trace types enabled. /// All = Int64.MaxValue, } -} +} \ No newline at end of file diff --git a/Enumerations/UnifiedGroupEnumTypes.cs b/Enumerations/UnifiedGroupEnumTypes.cs new file mode 100644 index 00000000..8f95ad69 --- /dev/null +++ b/Enumerations/UnifiedGroupEnumTypes.cs @@ -0,0 +1,128 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data.Groups +{ + using System; + + /// + /// The UnifiedGroupsSortType enum + /// + public enum UnifiedGroupsSortType + { + /// + /// None + /// + None = 0, + + /// + /// Display Name + /// + DisplayName = 1, + + /// + /// Join Date + /// + JoinDate = 2, + + /// + /// Favorite Date + /// + FavoriteDate = 3, + + /// + /// Relevance + /// + Relevance = 4, + } + + /// + /// The UnifiedGroupsFilterType enum + /// + public enum UnifiedGroupsFilterType + { + /// + /// All + /// + All = 0, + + /// + /// Favorites + /// + Favorites = 1, + + /// + /// Exclude Favorites + /// + ExcludeFavorites = 2 + } + + /// + /// The UnifiedGroupAccessType enum + /// + public enum UnifiedGroupAccessType + { + /// + /// None + /// + None = 0, + + /// + /// Private Group + /// + Private = 1, + + /// + /// Secret Group + /// + Secret = 2, + + /// + /// Public Group + /// + Public = 3, + } + + /// + /// The UnifiedGroupIdentityType enum + /// + public enum UnifiedGroupIdentityType + { + /// + /// Smtp Address + /// + SmtpAddress = 0, + + /// + /// Legacy DN + /// + LegacyDn = 1, + + /// + /// ExternalDirectoryObjectId + /// + ExternalDirectoryObjectId = 2 + } +} \ No newline at end of file diff --git a/Enumerations/UserConfigurationDictionaryObjectType.cs b/Enumerations/UserConfigurationDictionaryObjectType.cs index efb633a8..0483efc5 100644 --- a/Enumerations/UserConfigurationDictionaryObjectType.cs +++ b/Enumerations/UserConfigurationDictionaryObjectType.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the UserConfigurationDictionaryObjectType enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -69,4 +84,4 @@ public enum UserConfigurationDictionaryObjectType /// ByteArray, } -} +} \ No newline at end of file diff --git a/Enumerations/UserConfigurationProperties.cs b/Enumerations/UserConfigurationProperties.cs index a46914b9..4d13daf1 100644 --- a/Enumerations/UserConfigurationProperties.cs +++ b/Enumerations/UserConfigurationProperties.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the UserConfigurationProperties enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -48,4 +63,4 @@ public enum UserConfigurationProperties UserConfigurationProperties.XmlData | UserConfigurationProperties.BinaryData } -} +} \ No newline at end of file diff --git a/Enumerations/UserPhotoSize.cs b/Enumerations/UserPhotoSize.cs new file mode 100644 index 00000000..71c2cf6e --- /dev/null +++ b/Enumerations/UserPhotoSize.cs @@ -0,0 +1,60 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data +{ + /// + /// Defines the different user photo sizes that can be requested + /// + public static class UserPhotoSize + { + /// Image of size 48x48 + public static readonly string HR48x48 = "HR48x48"; + + /// Image of size 64x64 + public static readonly string HR64x64 = "HR64x64"; + + /// Image of size 96x96 + public static readonly string HR96x96 = "HR96x96"; + + /// Image of size 120x120 + public static readonly string HR120x120 = "HR120x120"; + + /// Image of size 240x240 + public static readonly string HR240x240 = "HR240x240"; + + /// Image of size 360x360 + public static readonly string HR360x360 = "HR360x360"; + + /// Image of size 432x432 + public static readonly string HR432x432 = "HR432x432"; + + /// Image of size 504x504 + public static readonly string HR504x504 = "HR504x504"; + + /// Image of size 648x648 + public static readonly string HR648x648 = "HR648x648"; + } +} \ No newline at end of file diff --git a/Enumerations/UserSettingName.cs b/Enumerations/UserSettingName.cs index c1d518bd..973b5f7a 100644 --- a/Enumerations/UserSettingName.cs +++ b/Enumerations/UserSettingName.cs @@ -1,8 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Autodiscover { @@ -503,5 +522,15 @@ public enum UserSettingName /// The grouping hint for certain clients. /// GroupingInformation = 96, + + /// + /// Internal OutlookService URL + /// + InternalOutlookServiceUrl = 98, + + /// + /// External OutlookService URL + /// + ExternalOutlookServiceUrl = 99 } -} +} \ No newline at end of file diff --git a/Enumerations/ViewFilter.cs b/Enumerations/ViewFilter.cs index 72179705..433242ac 100644 --- a/Enumerations/ViewFilter.cs +++ b/Enumerations/ViewFilter.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ViewFilter enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ using System.Xml.Serialization; diff --git a/Enumerations/WellKnownFolderName.cs b/Enumerations/WellKnownFolderName.cs index 31ca7d78..da4aa16f 100644 --- a/Enumerations/WellKnownFolderName.cs +++ b/Enumerations/WellKnownFolderName.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the WellKnownFolderName enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -147,6 +162,13 @@ public enum WellKnownFolderName [EwsEnum("recoverableitemspurges")] RecoverableItemsPurges, + /// + /// The Dumpster 2.0 discovery hold folder + /// + [RequiredServerVersion(ExchangeVersion.Exchange2013_SP1)] + [EwsEnum("recoverableitemsdiscoveryholds")] + RecoverableItemsDiscoveryHolds, + /// /// The root of the archive mailbox. /// @@ -154,6 +176,13 @@ public enum WellKnownFolderName [EwsEnum("archiveroot")] ArchiveRoot, + /// + /// The root of the archive mailbox. + /// + [RequiredServerVersion(ExchangeVersion.Exchange2013_SP1)] + [EwsEnum("archiveinbox")] + ArchiveInbox, + /// /// The message folder root in the archive mailbox. /// @@ -196,6 +225,13 @@ public enum WellKnownFolderName [EwsEnum("archiverecoverableitemspurges")] ArchiveRecoverableItemsPurges, + /// + /// The Dumpster 2.0 discovery hold folder in the archive mailbox. + /// + [RequiredServerVersion(ExchangeVersion.Exchange2013_SP1)] + [EwsEnum("archiverecoverableitemsdiscoveryholds")] + ArchiveRecoverableItemsDiscoveryHolds, + /// /// The Sync Issues folder. /// @@ -245,6 +281,13 @@ public enum WellKnownFolderName [EwsEnum("conversationhistory")] ConversationHistory, + /// + /// AdminAuditLogs folder + /// + [RequiredServerVersion(ExchangeVersion.Exchange2013)] + [EwsEnum("adminauditlogs")] + AdminAuditLogs, + /// /// ToDo search folder /// @@ -252,6 +295,42 @@ public enum WellKnownFolderName [EwsEnum("todosearch")] ToDoSearch, + /// + /// MyContacts folder + /// + [RequiredServerVersion(ExchangeVersion.Exchange2013)] + [EwsEnum("mycontacts")] + MyContacts, + + /// + /// Directory (GAL) + /// It is not a mailbox folder. It only indicates any GAL operation. + /// + [RequiredServerVersion(ExchangeVersion.Exchange2013_SP1)] + [EwsEnum("directory")] + Directory, + + /// + /// IMContactList folder + /// + [RequiredServerVersion(ExchangeVersion.Exchange2013)] + [EwsEnum("imcontactlist")] + IMContactList, + + /// + /// PeopleConnect folder + /// + [RequiredServerVersion(ExchangeVersion.Exchange2013)] + [EwsEnum("peopleconnect")] + PeopleConnect, + + /// + /// Favorites folder + /// + [RequiredServerVersion(ExchangeVersion.Exchange2013)] + [EwsEnum("favorites")] + Favorites, + //// Note when you adding new folder id here, please update sources\test\Services\src\ComponentTests\GlobalVersioningControl.cs //// IsExchange2013Folder method accordingly. } diff --git a/Enumerations/XmlNamespace.cs b/Enumerations/XmlNamespace.cs index b7b0bd94..a960cee2 100644 --- a/Enumerations/XmlNamespace.cs +++ b/Enumerations/XmlNamespace.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the xMLNamespace enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -74,4 +89,4 @@ internal enum XmlNamespace /// Autodiscover, } -} +} \ No newline at end of file diff --git a/Exceptions/AccountIsLockedException.cs b/Exceptions/AccountIsLockedException.cs index e5c2c1ee..eb343007 100644 --- a/Exceptions/AccountIsLockedException.cs +++ b/Exceptions/AccountIsLockedException.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the AccountIsLockedException class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -39,4 +54,4 @@ public Uri AccountUnlockUrl private set; } } -} +} \ No newline at end of file diff --git a/Exceptions/AutodiscoverLocalException.cs b/Exceptions/AutodiscoverLocalException.cs index 3611b8ec..875041ba 100644 --- a/Exceptions/AutodiscoverLocalException.cs +++ b/Exceptions/AutodiscoverLocalException.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the AutodiscoverLocalException class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -47,4 +62,4 @@ public AutodiscoverLocalException(string message, Exception innerException) { } } -} +} \ No newline at end of file diff --git a/Exceptions/AutodiscoverRemoteException.cs b/Exceptions/AutodiscoverRemoteException.cs index 2207039e..bb9614f8 100644 --- a/Exceptions/AutodiscoverRemoteException.cs +++ b/Exceptions/AutodiscoverRemoteException.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the AutodiscoverRemoteException class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Autodiscover { diff --git a/Exceptions/AutodiscoverResponseException.cs b/Exceptions/AutodiscoverResponseException.cs index 2a20ba57..c4b5cfa9 100644 --- a/Exceptions/AutodiscoverResponseException.cs +++ b/Exceptions/AutodiscoverResponseException.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the AutodiscoverResponseException class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Autodiscover { @@ -45,4 +60,4 @@ public AutodiscoverErrorCode ErrorCode get { return this.errorCode; } } } -} +} \ No newline at end of file diff --git a/Exceptions/BatchServiceResponseException.cs b/Exceptions/BatchServiceResponseException.cs index 8a2836ae..bc047bde 100644 --- a/Exceptions/BatchServiceResponseException.cs +++ b/Exceptions/BatchServiceResponseException.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the BatchServiceResponseException class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -73,4 +88,4 @@ public ServiceResponseCollection ServiceResponses get { return this.responses; } } } -} +} \ No newline at end of file diff --git a/Exceptions/CreateAttachmentException.cs b/Exceptions/CreateAttachmentException.cs index a0305e53..6f607c2d 100644 --- a/Exceptions/CreateAttachmentException.cs +++ b/Exceptions/CreateAttachmentException.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the CreateAttachmentException enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -46,4 +61,4 @@ internal CreateAttachmentException( { } } -} +} \ No newline at end of file diff --git a/Exceptions/DeleteAttachmentException.cs b/Exceptions/DeleteAttachmentException.cs index 506ff244..ebd6475c 100644 --- a/Exceptions/DeleteAttachmentException.cs +++ b/Exceptions/DeleteAttachmentException.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the DeleteAttachmentException enumeration. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -46,4 +61,4 @@ internal DeleteAttachmentException( { } } -} +} \ No newline at end of file diff --git a/Exceptions/DnsException.cs b/Exceptions/DnsException.cs index d877dcad..14eb8171 100644 --- a/Exceptions/DnsException.cs +++ b/Exceptions/DnsException.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the DnsException class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Dns { @@ -28,4 +43,4 @@ internal DnsException(int errorCode) { } } -} +} \ No newline at end of file diff --git a/Exceptions/JsonDeserializationNotImplementedException.cs b/Exceptions/JsonDeserializationNotImplementedException.cs deleted file mode 100644 index f9934ac3..00000000 --- a/Exceptions/JsonDeserializationNotImplementedException.cs +++ /dev/null @@ -1,37 +0,0 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Microsoft.Exchange.WebServices.Data -{ - /// - /// Exception thrown for a method that does not support Json deserialization - /// - [Serializable] - internal class JsonDeserializationNotImplementedException : ServiceLocalException - { - /// - /// Initializes a new instance of the class. - /// - internal JsonDeserializationNotImplementedException() : - base(Strings.JsonDeserializationNotImplemented) - { - } - - /// - /// Initializes a new instance of the class. - /// - /// The message. - internal JsonDeserializationNotImplementedException(string message) : - base(message) - { - } - } -} diff --git a/Exceptions/JsonSerializationNotImplementedException.cs b/Exceptions/JsonSerializationNotImplementedException.cs deleted file mode 100644 index 5f2278ac..00000000 --- a/Exceptions/JsonSerializationNotImplementedException.cs +++ /dev/null @@ -1,22 +0,0 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Microsoft.Exchange.WebServices.Data -{ - [Serializable] - internal class JsonSerializationNotImplementedException : Exception - { - internal JsonSerializationNotImplementedException() : - base(Strings.JsonSerializationNotImplemented) - { - } - } -} diff --git a/Exceptions/PropertyException.cs b/Exceptions/PropertyException.cs index 98a8979d..36c6cec3 100644 --- a/Exceptions/PropertyException.cs +++ b/Exceptions/PropertyException.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the PropertyException class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -69,4 +84,4 @@ public string Name get { return this.name; } } } -} +} \ No newline at end of file diff --git a/Exceptions/ServerBusyException.cs b/Exceptions/ServerBusyException.cs index f89fe284..561db945 100644 --- a/Exceptions/ServerBusyException.cs +++ b/Exceptions/ServerBusyException.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ServerBusyException class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Exceptions/ServiceJsonDeserializationException.cs b/Exceptions/ServiceJsonDeserializationException.cs deleted file mode 100644 index 2f5f7f67..00000000 --- a/Exceptions/ServiceJsonDeserializationException.cs +++ /dev/null @@ -1,50 +0,0 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ServiceJsonDeserializationException class. -//----------------------------------------------------------------------- - -namespace Microsoft.Exchange.WebServices.Data -{ - using System; - using System.Collections.Generic; - using System.Text; - - /// - /// Represents an error that occurs when the XML for a response cannot be deserialized. - /// - [Serializable] - public sealed class ServiceJsonDeserializationException : ServiceLocalException - { - /// - /// ServiceJsonDeserializationException Constructor. - /// - public ServiceJsonDeserializationException() - : base() - { - } - - /// - /// ServiceJsonDeserializationException Constructor. - /// - /// Error message text. - public ServiceJsonDeserializationException(string message) - : base(message) - { - } - - /// - /// ServiceJsonDeserializationException Constructor. - /// - /// Error message text. - /// Inner exception. - public ServiceJsonDeserializationException(string message, Exception innerException) - : base(message, innerException) - { - } - } -} diff --git a/Exceptions/ServiceLocalException.cs b/Exceptions/ServiceLocalException.cs index 5eead60b..0b66a309 100644 --- a/Exceptions/ServiceLocalException.cs +++ b/Exceptions/ServiceLocalException.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ServiceLocalException class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -47,4 +62,4 @@ public ServiceLocalException(string message, Exception innerException) { } } -} +} \ No newline at end of file diff --git a/Exceptions/ServiceObjectPropertyException.cs b/Exceptions/ServiceObjectPropertyException.cs index 4d922519..89c96b3a 100644 --- a/Exceptions/ServiceObjectPropertyException.cs +++ b/Exceptions/ServiceObjectPropertyException.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ServiceObjectPropertyException class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -69,4 +84,4 @@ public PropertyDefinitionBase PropertyDefinition get { return this.propertyDefinition; } } } -} +} \ No newline at end of file diff --git a/Exceptions/ServiceRemoteException.cs b/Exceptions/ServiceRemoteException.cs index 53929662..a32141f3 100644 --- a/Exceptions/ServiceRemoteException.cs +++ b/Exceptions/ServiceRemoteException.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ServiceRemoteException class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -47,4 +62,4 @@ public ServiceRemoteException(string message, Exception innerException) { } } -} +} \ No newline at end of file diff --git a/Exceptions/ServiceRequestException.cs b/Exceptions/ServiceRequestException.cs index 1de945ac..f29e3cd9 100644 --- a/Exceptions/ServiceRequestException.cs +++ b/Exceptions/ServiceRequestException.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ServiceRequestException class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -47,4 +62,4 @@ public ServiceRequestException(string message, Exception innerException) { } } -} +} \ No newline at end of file diff --git a/Exceptions/ServiceResponseException.cs b/Exceptions/ServiceResponseException.cs index bceb3c11..a1e5e6ae 100644 --- a/Exceptions/ServiceResponseException.cs +++ b/Exceptions/ServiceResponseException.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ServiceResponseException class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -88,4 +103,4 @@ public override string Message } } } -} +} \ No newline at end of file diff --git a/Exceptions/ServiceValidationException.cs b/Exceptions/ServiceValidationException.cs index 2364651d..d3459d0e 100644 --- a/Exceptions/ServiceValidationException.cs +++ b/Exceptions/ServiceValidationException.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ServiceValidationException class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -47,4 +62,4 @@ public ServiceValidationException(string message, Exception innerException) { } } -} +} \ No newline at end of file diff --git a/Exceptions/ServiceVersionException.cs b/Exceptions/ServiceVersionException.cs index 9fbe355c..72d45044 100644 --- a/Exceptions/ServiceVersionException.cs +++ b/Exceptions/ServiceVersionException.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ServiceVersionException class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -47,4 +62,4 @@ public ServiceVersionException(string message, Exception innerException) { } } -} +} \ No newline at end of file diff --git a/Exceptions/ServiceXmlDeserializationException.cs b/Exceptions/ServiceXmlDeserializationException.cs index 237f57d3..95482cf7 100644 --- a/Exceptions/ServiceXmlDeserializationException.cs +++ b/Exceptions/ServiceXmlDeserializationException.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ServiceXmlDeserializationException class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -47,4 +62,4 @@ public ServiceXmlDeserializationException(string message, Exception innerExcepti { } } -} +} \ No newline at end of file diff --git a/Exceptions/ServiceXmlSerializationException.cs b/Exceptions/ServiceXmlSerializationException.cs index 50aad9bd..928cec3e 100644 --- a/Exceptions/ServiceXmlSerializationException.cs +++ b/Exceptions/ServiceXmlSerializationException.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ServiceXmlSerializationException class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -47,4 +62,4 @@ public ServiceXmlSerializationException(string message, Exception innerException { } } -} +} \ No newline at end of file diff --git a/Exceptions/TimeZoneConversionException.cs b/Exceptions/TimeZoneConversionException.cs index 56dfaa4f..a54b3f6d 100644 --- a/Exceptions/TimeZoneConversionException.cs +++ b/Exceptions/TimeZoneConversionException.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ServiceLocalException class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Exceptions/UpdateInboxRulesException.cs b/Exceptions/UpdateInboxRulesException.cs index f52b82fc..48999a88 100644 --- a/Exceptions/UpdateInboxRulesException.cs +++ b/Exceptions/UpdateInboxRulesException.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the UpdateInboxRulesException class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/Groups/ComplexProperties/RequestedUnifiedGroupsSet.cs b/Groups/ComplexProperties/RequestedUnifiedGroupsSet.cs new file mode 100644 index 00000000..4966dbb4 --- /dev/null +++ b/Groups/ComplexProperties/RequestedUnifiedGroupsSet.cs @@ -0,0 +1,86 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data.Groups +{ + /// + /// Defines the RequestedUnifiedGroupsSet class. + /// + public sealed class RequestedUnifiedGroupsSet : ComplexProperty, ISelfValidate + { + /// + /// Initializes a new instance of the class. + /// + public RequestedUnifiedGroupsSet() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// The filterType for the list of groups to be returned + /// The sort type for the list of groups to be returned + /// The sort direction for list of groups to be returned + public RequestedUnifiedGroupsSet( + UnifiedGroupsFilterType filterType, + UnifiedGroupsSortType sortType, + SortDirection sortDirection) + { + this.FilterType = filterType; + this.SortType = sortType; + this.SortDirection = sortDirection; + } + + /// + /// Gets or sets the sort type for the list of groups to be returned + /// + public UnifiedGroupsSortType SortType { get; set; } + + /// + /// Gets or sets the filter Type for the list of groups to be returned + /// + public UnifiedGroupsFilterType FilterType { get; set; } + + /// + /// Gets or sets the Sort Direction for the list of groups to be returned. + /// + public SortDirection SortDirection { get; set; } + + /// + /// Writes to XML. + /// + /// The writer. + /// Name of the XML element. + internal override void WriteToXml(EwsServiceXmlWriter writer, string xmlElementName) + { + writer.WriteStartElement(XmlNamespace.Types, xmlElementName); + writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.SortType, this.SortType.ToString()); + writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.FilterType, this.FilterType.ToString()); + writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.SortDirection, this.SortDirection.ToString()); + + writer.WriteEndElement(); + } + } +} \ No newline at end of file diff --git a/Groups/ComplexProperties/UnifiedGroup.cs b/Groups/ComplexProperties/UnifiedGroup.cs new file mode 100644 index 00000000..2b162fd6 --- /dev/null +++ b/Groups/ComplexProperties/UnifiedGroup.cs @@ -0,0 +1,133 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data.Groups +{ + using System; + using System.Collections.Generic; + using System.Text; + + /// + /// Represents a UnifiedGroup class. + /// + public class UnifiedGroup : ComplexProperty + { + /// + /// Initializes a new instance of the class. + /// + internal UnifiedGroup() : + base() + { + } + + /// + /// Gets or sets whether this groups is a favorite group + /// + public bool IsFavorite { get; set; } + + /// + /// Gets or sets the ExternalDirectoryObjectId for this group + /// + public string ExternalDirectoryObjectId { get; set; } + + /// + /// Gets or sets the LastVisitedTimeUtc for this group and user + /// + public string LastVisitedTimeUtc { get; set; } + + /// + /// Gets or sets the SmtpAddress associated with this group + /// + public string SmtpAddress { get; set; } + + /// + /// Gets or sets the LegacyDN associated with this group + /// + public string LegacyDN { get; set; } + + /// + /// Gets or sets the MailboxGuid associated with this group + /// + public string MailboxGuid { get; set; } + + /// + /// Gets or sets the DisplayName associated with this group + /// + public string DisplayName { get; set; } + + /// + /// Gets or sets the AccessType associated with this group + /// + public UnifiedGroupAccessType AccessType { get; set; } + + /// + /// Read Conversations from XML. + /// + /// The reader. + /// The xml element to read. + internal override void LoadFromXml(EwsServiceXmlReader reader, string xmlElementName) + { + reader.EnsureCurrentNodeIsStartElement(XmlNamespace.Types, XmlElementNames.UnifiedGroup); + do + { + reader.Read(); + switch (reader.LocalName) + { + case XmlElementNames.SmtpAddress: + this.SmtpAddress = reader.ReadElementValue(); + break; + case XmlElementNames.LegacyDN: + this.LegacyDN = reader.ReadElementValue(); + break; + case XmlElementNames.MailboxGuid: + this.MailboxGuid = reader.ReadElementValue(); + break; + case XmlElementNames.DisplayName: + this.DisplayName = reader.ReadElementValue(); + break; + case XmlElementNames.IsFavorite: + this.IsFavorite = reader.ReadElementValue(); + break; + case XmlElementNames.LastVisitedTimeUtc: + this.LastVisitedTimeUtc = reader.ReadElementValue(); + break; + case XmlElementNames.AccessType: + this.AccessType = (UnifiedGroupAccessType)Enum.Parse(typeof(UnifiedGroupAccessType), reader.ReadElementValue(), false); + break; + case XmlElementNames.ExternalDirectoryObjectId: + this.ExternalDirectoryObjectId = reader.ReadElementValue(); + break; + default: + break; + } + } + while (!reader.IsEndElement(XmlNamespace.Types, XmlElementNames.UnifiedGroup)); + + // Skip end element + reader.EnsureCurrentNodeIsEndElement(XmlNamespace.NotSpecified, XmlElementNames.UnifiedGroup); + reader.Read(); + } + } +} \ No newline at end of file diff --git a/Groups/ComplexProperties/UnifiedGroupIdentity.cs b/Groups/ComplexProperties/UnifiedGroupIdentity.cs new file mode 100644 index 00000000..e9005aef --- /dev/null +++ b/Groups/ComplexProperties/UnifiedGroupIdentity.cs @@ -0,0 +1,72 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data.Groups +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Text; + + /// + /// Defines the UnifiedGroupIdentity class. + /// + internal sealed class UnifiedGroupIdentity : ComplexProperty, ISelfValidate + { + /// + /// Initializes a new instance of the class + /// + /// The identity type + /// The value assocaited with the identity type + public UnifiedGroupIdentity(UnifiedGroupIdentityType identityType, string value) + { + this.IdentityType = identityType; + this.Value = value; + } + + /// + /// Gets or sets the IdentityType of the UnifiedGroup + /// + public UnifiedGroupIdentityType IdentityType { get; set; } + + /// + /// Gets or sets the value associated with the IdentityType for the UnifiedGroup + /// + public string Value { get; set; } + + /// + /// Writes to XML. + /// + /// The writer. + /// Name of the XML element. + internal override void WriteToXml(EwsServiceXmlWriter writer, string xmlElementName) + { + writer.WriteStartElement(XmlNamespace.Types, xmlElementName); + writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.GroupIdentityType, this.IdentityType.ToString()); + writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.GroupIdentityValue, this.Value); + writer.WriteEndElement(); + } + } +} \ No newline at end of file diff --git a/Groups/ComplexProperties/UnifiedGroupsSet.cs b/Groups/ComplexProperties/UnifiedGroupsSet.cs new file mode 100644 index 00000000..842c0a17 --- /dev/null +++ b/Groups/ComplexProperties/UnifiedGroupsSet.cs @@ -0,0 +1,115 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data.Groups +{ + using System; + using System.Collections.Generic; + using System.Text; + + /// + /// Represents a UnifiedGroupsSet + /// + public class UnifiedGroupsSet : ComplexProperty + { + /// + /// The list of unifiedGroups in this set. + /// + private List unifiedGroups = new List(); + + /// + /// Initializes a new instance of the class. + /// + internal UnifiedGroupsSet() : + base() + { + } + + /// + /// Gets or sets the FilterType associated with this set + /// + public UnifiedGroupsFilterType FilterType { get; set; } + + /// + /// Gets or sets the total groups in this set + /// + public int TotalGroups { get; set; } + + /// + /// Gets the Groups contained in this set. + /// + public List Groups + { + get + { + return this.unifiedGroups; + } + } + + /// + /// Read Conversations from XML. + /// + /// The reader. + /// The name of the xml element + internal override void LoadFromXml(EwsServiceXmlReader reader, string xmlElementName) + { + reader.EnsureCurrentNodeIsStartElement(XmlNamespace.Types, XmlElementNames.UnifiedGroupsSet); + + do + { + reader.Read(); + switch (reader.LocalName) + { + case XmlElementNames.FilterType: + this.FilterType = (UnifiedGroupsFilterType)Enum.Parse(typeof(UnifiedGroupsFilterType), reader.ReadElementValue(), false); + break; + case XmlElementNames.TotalGroups: + this.TotalGroups = reader.ReadElementValue(); + break; + case XmlElementNames.GroupsTag: + reader.Read(); + while (reader.IsStartElement(XmlNamespace.Types, XmlElementNames.UnifiedGroup)) + { + UnifiedGroup unifiedGroup = new UnifiedGroup(); + unifiedGroup.LoadFromXml(reader, XmlElementNames.UnifiedGroup); + this.unifiedGroups.Add(unifiedGroup); + } + + // Skip end element. + reader.EnsureCurrentNodeIsEndElement(XmlNamespace.NotSpecified, XmlElementNames.GroupsTag); + reader.Read(); + break; + default: + break; + } + } + while (!reader.IsEndElement(XmlNamespace.Types, XmlElementNames.UnifiedGroupsSet)); + + // Skip end element + reader.EnsureCurrentNodeIsEndElement(XmlNamespace.Types, XmlElementNames.UnifiedGroupsSet); + reader.Read(); + } + } +} \ No newline at end of file diff --git a/Groups/Requests/GetUnifiedGroupUnseenCountRequest.cs b/Groups/Requests/GetUnifiedGroupUnseenCountRequest.cs new file mode 100644 index 00000000..de97c602 --- /dev/null +++ b/Groups/Requests/GetUnifiedGroupUnseenCountRequest.cs @@ -0,0 +1,131 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data.Groups +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Text; + + /// + /// Represents a request to the GetUnifiedGroupUnseenCount operation. + /// + internal sealed class GetUnifiedGroupUnseenCountRequest : SimpleServiceRequestBase + { + /// + /// The last visited time utc for the group + /// + private readonly DateTime lastVisitedTimeUtc; + + /// + /// The identify type associated with the group + /// + private readonly UnifiedGroupIdentityType identityType; + + /// + /// The value of identity associated with the group + /// + private readonly string identityValue; + + /// + /// Initializes a new instance of the class. + /// + /// The service. + /// The last visited time utc for the group + /// The identity type for the group + /// The value associated with the identify type for the group + internal GetUnifiedGroupUnseenCountRequest( + ExchangeService service, + DateTime lastVisitedTimeUtc, + UnifiedGroupIdentityType identityType, + string value) : base(service) + { + this.lastVisitedTimeUtc = lastVisitedTimeUtc; + this.identityType = identityType; + this.identityValue = value; + } + + /// + /// Gets the name of the response XML element. + /// + /// XML element name. + internal override string GetResponseXmlElementName() + { + return XmlElementNames.GetUnifiedGroupUnseenCountResponseMessage; + } + + /// + /// Gets the name of the XML element. + /// + /// XML element name. + internal override string GetXmlElementName() + { + return XmlElementNames.GetUnifiedGroupUnseenCount; + } + + /// + /// Parses the response. + /// + /// The reader. + /// Response object. + internal override object ParseResponse(EwsServiceXmlReader reader) + { + GetUnifiedGroupUnseenCountResponse response = new GetUnifiedGroupUnseenCountResponse(); + response.LoadFromXml(reader, GetResponseXmlElementName()); + return response; + } + + /// + /// Writes XML elements. + /// + /// The writer. + internal override void WriteElementsToXml(EwsServiceXmlWriter writer) + { + UnifiedGroupIdentity groupIdentity = new UnifiedGroupIdentity(this.identityType, this.identityValue); + + groupIdentity.WriteToXml(writer, XmlElementNames.GroupIdentity); + writer.WriteElementValue(XmlNamespace.Messages, XmlElementNames.LastVisitedTimeUtc, this.lastVisitedTimeUtc.ToString("yyyy-MM-ddTHH:mm:ss.fffffffZ")); + } + + /// + /// Gets the request version. + /// + /// Earliest Exchange version in which this request is supported. + internal override ExchangeVersion GetMinimumRequiredServerVersion() + { + return ExchangeVersion.Exchange2015; + } + + /// + /// Executes this request. + /// + /// Service response. + internal GetUnifiedGroupUnseenCountResponse Execute() + { + return (GetUnifiedGroupUnseenCountResponse)this.InternalExecute(); + } + } +} \ No newline at end of file diff --git a/Groups/Requests/GetUserUnifiedGroupsRequest.cs b/Groups/Requests/GetUserUnifiedGroupsRequest.cs new file mode 100644 index 00000000..e8480c3c --- /dev/null +++ b/Groups/Requests/GetUserUnifiedGroupsRequest.cs @@ -0,0 +1,125 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data.Groups +{ + using System; + using System.Collections.Generic; + using System.Text; + using Microsoft.Exchange.WebServices.Data.Groups; + + /// + /// Represents a request to a GetUserUnifiedGroupsRequest operation + /// + internal sealed class GetUserUnifiedGroupsRequest : SimpleServiceRequestBase + { + /// + /// Initializes a new instance of the class. + /// + /// The service. + internal GetUserUnifiedGroupsRequest(ExchangeService service) : base(service) + { + } + + /// + /// Gets or sets the RequestedUnifiedGroupsSet + /// + public IEnumerable RequestedUnifiedGroupsSets { get; set; } + + /// + /// Gets or sets the UserSmptAddress + /// + public string UserSmtpAddress { get; set; } + + /// + /// Gets the name of the response XML element. + /// + /// XML element name. + internal override string GetResponseXmlElementName() + { + return XmlElementNames.GetUserUnifiedGroupsResponseMessage; + } + + /// + /// Gets the name of the XML element. + /// + /// XML element name. + internal override string GetXmlElementName() + { + return XmlElementNames.GetUserUnifiedGroups; + } + + /// + /// Parses the response. + /// + /// The reader. + /// Response object. + internal override object ParseResponse(EwsServiceXmlReader reader) + { + GetUserUnifiedGroupsResponse response = new GetUserUnifiedGroupsResponse(); + response.LoadFromXml(reader, GetResponseXmlElementName()); + return response; + } + + /// + /// Writes XML elements. + /// + /// The writer. + internal override void WriteElementsToXml(EwsServiceXmlWriter writer) + { + writer.WriteStartElement(XmlNamespace.Messages, XmlElementNames.RequestedGroupsSets); + + if (this.RequestedUnifiedGroupsSets != null) + { + this.RequestedUnifiedGroupsSets.ForEach((unifiedGroupsSet) => unifiedGroupsSet.WriteToXml(writer, XmlElementNames.RequestedUnifiedGroupsSetItem)); + } + + writer.WriteEndElement(); + + if (!string.IsNullOrEmpty(this.UserSmtpAddress)) + { + writer.WriteElementValue(XmlNamespace.NotSpecified, XmlElementNames.UserSmtpAddress, this.UserSmtpAddress); + } + } + + /// + /// Gets the request version. + /// + /// Earliest Exchange version in which this request is supported. + internal override ExchangeVersion GetMinimumRequiredServerVersion() + { + return ExchangeVersion.Exchange2015; + } + + /// + /// Executes this request. + /// + /// Service response. + internal GetUserUnifiedGroupsResponse Execute() + { + return (GetUserUnifiedGroupsResponse)this.InternalExecute(); + } + } +} \ No newline at end of file diff --git a/Groups/Requests/SetUnifiedGroupLastVisitedTimeRequest.cs b/Groups/Requests/SetUnifiedGroupLastVisitedTimeRequest.cs new file mode 100644 index 00000000..9e057223 --- /dev/null +++ b/Groups/Requests/SetUnifiedGroupLastVisitedTimeRequest.cs @@ -0,0 +1,132 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data.Groups +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Text; + + /// + /// Represents a request to the SetUnifiedGroupLastVisitedTimeRequest operation. + /// + internal sealed class SetUnifiedGroupLastVisitedTimeRequest : SimpleServiceRequestBase + { + /// + /// The last visited time utc for the group + /// + private readonly DateTime lastVisitedTimeUtc; + + /// + /// The identify type associated with the group + /// + private readonly UnifiedGroupIdentityType identityType; + + /// + /// The value of identity associated with the group + /// + private readonly string identityValue; + + /// + /// Initializes a new instance of the class. + /// + /// The service. + /// The last visited time utc for the group + /// The identity type for the group + /// The value associated with the identify type for the group + internal SetUnifiedGroupLastVisitedTimeRequest( + ExchangeService service, + DateTime lastVisitedTimeUtc, + UnifiedGroupIdentityType identityType, + string value) : base(service) + { + this.lastVisitedTimeUtc = lastVisitedTimeUtc; + this.identityType = identityType; + this.identityValue = value; + } + + /// + /// Gets the name of the response XML element. + /// + /// XML element name. + internal override string GetResponseXmlElementName() + { + return XmlElementNames.SetUnifiedGroupLastVisitedTimeResponseMessage; + } + + /// + /// Gets the name of the XML element. + /// + /// XML element name. + internal override string GetXmlElementName() + { + return XmlElementNames.SetUnifiedGroupLastVisitedTime; + } + + /// + /// Parses the response. + /// + /// The reader. + /// Response object. + internal override object ParseResponse(EwsServiceXmlReader reader) + { + ServiceResponse response = new ServiceResponse(); + response.LoadFromXml(reader, GetResponseXmlElementName()); + return response; + } + + /// + /// Writes XML elements. + /// + /// The writer. + internal override void WriteElementsToXml(EwsServiceXmlWriter writer) + { + UnifiedGroupIdentity groupIdentity = new UnifiedGroupIdentity(this.identityType, this.identityValue); + + groupIdentity.WriteToXml(writer, XmlElementNames.GroupIdentity); + + writer.WriteElementValue(XmlNamespace.Messages, XmlElementNames.LastVisitedTimeUtc, this.lastVisitedTimeUtc.ToString("yyyy-MM-ddTHH:mm:ss.fffffffZ")); + } + + /// + /// Gets the request version. + /// + /// Earliest Exchange version in which this request is supported. + internal override ExchangeVersion GetMinimumRequiredServerVersion() + { + return ExchangeVersion.Exchange2015; + } + + /// + /// Executes this request. + /// + /// Service response. + internal ServiceResponse Execute() + { + return (ServiceResponse)this.InternalExecute(); + } + } +} \ No newline at end of file diff --git a/Groups/Responses/GetUnifiedGroupUnseenCountResponse.cs b/Groups/Responses/GetUnifiedGroupUnseenCountResponse.cs new file mode 100644 index 00000000..1930c4bb --- /dev/null +++ b/Groups/Responses/GetUnifiedGroupUnseenCountResponse.cs @@ -0,0 +1,61 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data.Groups +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Text; + + /// + /// Represents a response to the GetUnifiedGroupUnseenCount operation + /// + internal sealed class GetUnifiedGroupUnseenCountResponse : ServiceResponse + { + /// + /// Initializes a new instance of the class. + /// + internal GetUnifiedGroupUnseenCountResponse() : + base() + { + } + + /// + /// Gets or sets the unseen count + /// + public int UnseenCount { get; set; } + + /// + /// Read response elements from XML. + /// + /// The reader. + internal override void ReadElementsFromXml(EwsServiceXmlReader reader) + { + base.ReadElementsFromXml(reader); + this.UnseenCount = reader.ReadElementValue(XmlNamespace.NotSpecified, XmlElementNames.UnseenCount); + } + } +} \ No newline at end of file diff --git a/Groups/Responses/GetUserUnifiedGroupsResponse.cs b/Groups/Responses/GetUserUnifiedGroupsResponse.cs new file mode 100644 index 00000000..4ff927fd --- /dev/null +++ b/Groups/Responses/GetUserUnifiedGroupsResponse.cs @@ -0,0 +1,89 @@ +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +namespace Microsoft.Exchange.WebServices.Data.Groups +{ + using System; + using System.Collections.Generic; + using System.Collections.ObjectModel; + using System.Text; + + /// + /// Represents a response to a GetUserUnifiedGroupsResponse operation + /// + internal sealed class GetUserUnifiedGroupsResponse : ServiceResponse + { + /// + /// The UnifiedGroups Sets associated with this response + /// + private Collection groupsSets = new Collection(); + + /// + /// Initializes a new instance of the class. + /// + internal GetUserUnifiedGroupsResponse() : + base() + { + } + + /// + /// Gets or sets the UnifiedGroupsSet associated with the response + /// + public Collection GroupsSets + { + get + { + return this.groupsSets; + } + } + + /// + /// Read Conversations from XML. + /// + /// The reader. + internal override void ReadElementsFromXml(EwsServiceXmlReader reader) + { + this.groupsSets.Clear(); + base.ReadElementsFromXml(reader); + + reader.ReadStartElement(XmlNamespace.Messages, XmlElementNames.GroupsSets); + + if (!reader.IsEmptyElement) + { + reader.Read(); + while (reader.IsStartElement(XmlNamespace.Types, XmlElementNames.UnifiedGroupsSet)) + { + UnifiedGroupsSet unifiedGroupsSet = new UnifiedGroupsSet(); + unifiedGroupsSet.LoadFromXml(reader, XmlElementNames.UnifiedGroupsSet); + this.groupsSets.Add(unifiedGroupsSet); + } + + // Skip end element GroupsSets + reader.EnsureCurrentNodeIsEndElement(XmlNamespace.NotSpecified, XmlElementNames.GroupsSets); + reader.Read(); + } + } + } +} \ No newline at end of file diff --git a/Interfaces/ICalendarActionProvider.cs b/Interfaces/ICalendarActionProvider.cs index a2ce6ed0..cec41484 100644 --- a/Interfaces/ICalendarActionProvider.cs +++ b/Interfaces/ICalendarActionProvider.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ICalendarActionProvider interface. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -49,4 +64,4 @@ internal interface ICalendarActionProvider /// A new DeclineMeetingInvitationMessage. DeclineMeetingInvitationMessage CreateDeclineMessage(); } -} +} \ No newline at end of file diff --git a/Interfaces/ICustomXmlUpdateSerializer.cs b/Interfaces/ICustomXmlUpdateSerializer.cs index e511d0e4..70c8379c 100644 --- a/Interfaces/ICustomXmlUpdateSerializer.cs +++ b/Interfaces/ICustomXmlUpdateSerializer.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ICustomXmlUpdateSerializer interface. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ using System.Collections.Generic; @@ -36,32 +51,5 @@ bool WriteSetUpdateToXml( /// The ews object. /// True if property generated serialization. bool WriteDeleteUpdateToXml(EwsServiceXmlWriter writer, ServiceObject ewsObject); - - /// - /// Writes the update to Json. - /// - /// The service. - /// The ews object. - /// Property definition. - /// The updates. - /// - /// True if property generated serialization. - /// - bool WriteSetUpdateToJson( - ExchangeService service, - ServiceObject ewsObject, - PropertyDefinition propertyDefinition, - List updates); - - /// - /// Writes the deletion update to Json. - /// - /// The service. - /// The ews object. - /// The updates. - /// - /// True if property generated serialization. - /// - bool WriteDeleteUpdateToJson(ExchangeService service, ServiceObject ewsObject, List updates); } -} +} \ No newline at end of file diff --git a/Interfaces/IEwsHttpWebRequest.cs b/Interfaces/IEwsHttpWebRequest.cs index f0dec8e7..caa2df6e 100644 --- a/Interfaces/IEwsHttpWebRequest.cs +++ b/Interfaces/IEwsHttpWebRequest.cs @@ -1,9 +1,27 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Defines the IEwsHttpWebRequest interface. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -218,4 +236,4 @@ string ConnectionGroupName get; set; } } -} +} \ No newline at end of file diff --git a/Interfaces/IEwsHttpWebRequestFactory.cs b/Interfaces/IEwsHttpWebRequestFactory.cs index 24ece6e6..c6c4a081 100644 --- a/Interfaces/IEwsHttpWebRequestFactory.cs +++ b/Interfaces/IEwsHttpWebRequestFactory.cs @@ -1,9 +1,27 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Defines the IEwsHttpWebRequestFactory interface. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -31,4 +49,4 @@ internal interface IEwsHttpWebRequestFactory /// IEwsHttpWebResponse CreateExceptionResponse(WebException exception); } -} +} \ No newline at end of file diff --git a/Interfaces/IEwsHttpWebResponse.cs b/Interfaces/IEwsHttpWebResponse.cs index 30a1ae01..86888f9d 100644 --- a/Interfaces/IEwsHttpWebResponse.cs +++ b/Interfaces/IEwsHttpWebResponse.cs @@ -1,9 +1,27 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Defines the IEwsHttpWebResponse interface. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -71,4 +89,4 @@ internal interface IEwsHttpWebResponse : IDisposable /// System.Version that contains the HTTP protocol version of the response. Version ProtocolVersion { get; } } -} +} \ No newline at end of file diff --git a/Interfaces/IFileAttachmentContentHandler.cs b/Interfaces/IFileAttachmentContentHandler.cs index 79dc5f0b..37156b73 100644 --- a/Interfaces/IFileAttachmentContentHandler.cs +++ b/Interfaces/IFileAttachmentContentHandler.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the IFileAttachmentContentHandler interface. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -28,4 +43,4 @@ public interface IFileAttachmentContentHandler /// A Stream to which the content of the attachment will be written. Stream GetOutputStream(string attachmentId); } -} +} \ No newline at end of file diff --git a/Interfaces/IJSonSerializable.cs b/Interfaces/IJSonSerializable.cs deleted file mode 100644 index 7081fd98..00000000 --- a/Interfaces/IJSonSerializable.cs +++ /dev/null @@ -1,28 +0,0 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Microsoft.Exchange.WebServices.Data -{ - /// - /// Represents a class that can be serialized into a JSON object. - /// - internal interface IJsonSerializable - { - /// - /// Creates a JSON representation of this object. - /// - /// The service. - /// - /// A Json value (either a JsonObject, an array of Json values, or a Json primitive) - /// - object ToJson(ExchangeService service); - } -} diff --git a/Interfaces/IJsonCollectionDeserializer.cs b/Interfaces/IJsonCollectionDeserializer.cs deleted file mode 100644 index 41dd5743..00000000 --- a/Interfaces/IJsonCollectionDeserializer.cs +++ /dev/null @@ -1,32 +0,0 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Microsoft.Exchange.WebServices.Data -{ - /// - /// Interface for Complex Properties that load from a JSON collection. - /// - internal interface IJsonCollectionDeserializer - { - /// - /// Loads from json collection to create a new collection item. - /// - /// The json collection. - /// The service. - void CreateFromJsonCollection(object[] jsonCollection, ExchangeService service); - - /// - /// Loads from json collection to update the existing collection item. - /// - /// The json collection. - /// The service. - void UpdateFromJsonCollection(object[] jsonCollection, ExchangeService service); - } -} diff --git a/Interfaces/IOwnedProperty.cs b/Interfaces/IOwnedProperty.cs index 05290ce8..34d3d8e0 100644 --- a/Interfaces/IOwnedProperty.cs +++ b/Interfaces/IOwnedProperty.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the IOwnedProperty interface. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -26,4 +41,4 @@ internal interface IOwnedProperty /// The owner. ServiceObject Owner { get; set; } } -} +} \ No newline at end of file diff --git a/Interfaces/ISearchStringProvider.cs b/Interfaces/ISearchStringProvider.cs index 49225bb6..93b2d701 100644 --- a/Interfaces/ISearchStringProvider.cs +++ b/Interfaces/ISearchStringProvider.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ISearchStringProvider interface. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -21,4 +36,4 @@ public interface ISearchStringProvider /// String representation of instance. string GetSearchString(); } -} +} \ No newline at end of file diff --git a/Interfaces/ISelfValidate.cs b/Interfaces/ISelfValidate.cs index ed4f5d68..33b38020 100644 --- a/Interfaces/ISelfValidate.cs +++ b/Interfaces/ISelfValidate.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ISelfValidate interface. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -24,4 +39,4 @@ internal interface ISelfValidate /// void Validate(); } -} +} \ No newline at end of file diff --git a/Interfaces/ITraceListener.cs b/Interfaces/ITraceListener.cs index b2fc74e7..b108fef3 100644 --- a/Interfaces/ITraceListener.cs +++ b/Interfaces/ITraceListener.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the ITraceListener interface. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -24,4 +39,4 @@ public interface ITraceListener /// The trace message. void Trace(string traceType, string traceMessage); } -} +} \ No newline at end of file diff --git a/MailboxSearch/DiscoverySearchConfiguration.cs b/MailboxSearch/DiscoverySearchConfiguration.cs index 4ae56e9d..eb482614 100644 --- a/MailboxSearch/DiscoverySearchConfiguration.cs +++ b/MailboxSearch/DiscoverySearchConfiguration.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the MailboxQuery class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -121,55 +136,5 @@ internal static DiscoverySearchConfiguration LoadFromXml(EwsServiceXmlReader rea return configuration; } - - /// - /// Load from json - /// - /// The json object - /// Discovery search configuration object - internal static DiscoverySearchConfiguration LoadFromJson(JsonObject jsonObject) - { - List mailboxes = new List(); - DiscoverySearchConfiguration configuration = new DiscoverySearchConfiguration(); - - if (jsonObject.ContainsKey(XmlElementNames.SearchId)) - { - configuration.SearchId = jsonObject.ReadAsString(XmlElementNames.SearchId); - } - - if (jsonObject.ContainsKey(XmlElementNames.InPlaceHoldIdentity)) - { - configuration.InPlaceHoldIdentity = jsonObject.ReadAsString(XmlElementNames.InPlaceHoldIdentity); - } - - if (jsonObject.ContainsKey(XmlElementNames.ManagedByOrganization)) - { - configuration.ManagedByOrganization = jsonObject.ReadAsString(XmlElementNames.ManagedByOrganization); - } - - if (jsonObject.ContainsKey(XmlElementNames.SearchQuery)) - { - configuration.SearchQuery = jsonObject.ReadAsString(XmlElementNames.SearchQuery); - } - - if (jsonObject.ContainsKey(XmlElementNames.SearchableMailboxes)) - { - foreach (object searchableMailboxObject in jsonObject.ReadAsArray(XmlElementNames.SearchableMailboxes)) - { - JsonObject jsonSearchableMailbox = searchableMailboxObject as JsonObject; - - mailboxes.Add(SearchableMailbox.LoadFromJson(jsonSearchableMailbox)); - } - } - - if (jsonObject.ContainsKey(XmlElementNames.Language)) - { - configuration.Language = jsonObject.ReadAsString(XmlElementNames.Language); - } - - configuration.SearchableMailboxes = mailboxes.Count == 0 ? null : mailboxes.ToArray(); - - return configuration; - } } } \ No newline at end of file diff --git a/MailboxSearch/ExtendedAttributes.cs b/MailboxSearch/ExtendedAttributes.cs index 50d0838d..50bb7d70 100644 --- a/MailboxSearch/ExtendedAttributes.cs +++ b/MailboxSearch/ExtendedAttributes.cs @@ -1,13 +1,28 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft. All rights reserved. -// -// --------------------------------------------------------------------------- -// --------------------------------------------------------------------------- -// -// ExtendedAttributes.cs -// -// --------------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + namespace Microsoft.Exchange.WebServices.Data { using System; @@ -57,4 +72,4 @@ public ExtendedAttribute(string name, string value) /// The value. public string Value { get; set; } } -} +} \ No newline at end of file diff --git a/MailboxSearch/FailedSearchMailbox.cs b/MailboxSearch/FailedSearchMailbox.cs index 21574839..55573ba9 100644 --- a/MailboxSearch/FailedSearchMailbox.cs +++ b/MailboxSearch/FailedSearchMailbox.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the FailedSearchMailbox class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -96,4 +111,4 @@ internal static FailedSearchMailbox[] LoadFailedMailboxesXml(XmlNamespace rootXm return failedMailboxes.Count == 0 ? null : failedMailboxes.ToArray(); } } -} +} \ No newline at end of file diff --git a/MailboxSearch/KeywordStatisticsSearchResult.cs b/MailboxSearch/KeywordStatisticsSearchResult.cs index 48fa64c8..3d08c2c3 100644 --- a/MailboxSearch/KeywordStatisticsSearchResult.cs +++ b/MailboxSearch/KeywordStatisticsSearchResult.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the KeywordStatisticsSearchResult class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -35,4 +50,4 @@ public sealed class KeywordStatisticsSearchResult [CLSCompliant(false)] public ulong Size { get; set; } } -} +} \ No newline at end of file diff --git a/MailboxSearch/MailboxHoldResult.cs b/MailboxSearch/MailboxHoldResult.cs index 0fdd5d49..11402f20 100644 --- a/MailboxSearch/MailboxHoldResult.cs +++ b/MailboxSearch/MailboxHoldResult.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the MailboxHoldResult class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -102,57 +117,6 @@ internal static MailboxHoldResult LoadFromXml(EwsServiceXmlReader reader) return holdResult; } - /// - /// Load from json - /// - /// The json object - /// Mailbox hold object - internal static MailboxHoldResult LoadFromJson(JsonObject jsonObject) - { - List statuses = new List(); - MailboxHoldResult holdResult = new MailboxHoldResult(); - - if (jsonObject.ContainsKey(XmlElementNames.HoldId)) - { - holdResult.HoldId = jsonObject.ReadAsString(XmlElementNames.HoldId); - } - - if (jsonObject.ContainsKey(XmlElementNames.Query)) - { - holdResult.Query = jsonObject.ReadAsString(XmlElementNames.Query); - } - - if (jsonObject.ContainsKey(XmlElementNames.Statuses)) - { - foreach (object statusObject in jsonObject.ReadAsArray(XmlElementNames.Statuses)) - { - MailboxHoldStatus status = new MailboxHoldStatus(); - JsonObject jsonStatus = statusObject as JsonObject; - - if (jsonStatus.ContainsKey(XmlElementNames.Mailbox)) - { - status.Mailbox = jsonStatus.ReadAsString(XmlElementNames.Mailbox); - } - - if (jsonStatus.ContainsKey(XmlElementNames.Status)) - { - status.Status = (HoldStatus)Enum.Parse(typeof(HoldStatus), jsonStatus.ReadAsString(XmlElementNames.Status)); - } - - if (jsonStatus.ContainsKey(XmlElementNames.AdditionalInfo)) - { - status.AdditionalInfo = jsonStatus.ReadAsString(XmlElementNames.AdditionalInfo); - } - - statuses.Add(status); - } - } - - holdResult.Statuses = statuses.Count == 0 ? null : statuses.ToArray(); - - return holdResult; - } - /// /// Hold id /// @@ -168,4 +132,4 @@ internal static MailboxHoldResult LoadFromJson(JsonObject jsonObject) /// public MailboxHoldStatus[] Statuses { get; set; } } -} +} \ No newline at end of file diff --git a/MailboxSearch/MailboxQuery.cs b/MailboxSearch/MailboxQuery.cs index 772aa943..4f726503 100644 --- a/MailboxSearch/MailboxQuery.cs +++ b/MailboxSearch/MailboxQuery.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the MailboxQuery class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -128,4 +143,4 @@ public PreviewItemMailbox(string mailboxId, string primarySmtpAddress) /// public string PrimarySmtpAddress { get; set; } } -} +} \ No newline at end of file diff --git a/MailboxSearch/NonIndexableItem.cs b/MailboxSearch/NonIndexableItem.cs index a6e77747..f3cad967 100644 --- a/MailboxSearch/NonIndexableItem.cs +++ b/MailboxSearch/NonIndexableItem.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the NonIndexableItem class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -181,4 +196,4 @@ internal static NonIndexableItem LoadFromXml(EwsServiceXmlReader reader) return result; } } -} +} \ No newline at end of file diff --git a/MailboxSearch/NonIndexableItemDetailsResult.cs b/MailboxSearch/NonIndexableItemDetailsResult.cs index 017297b2..54cb795b 100644 --- a/MailboxSearch/NonIndexableItemDetailsResult.cs +++ b/MailboxSearch/NonIndexableItemDetailsResult.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the NonIndexableItemDetailsResult class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -63,18 +78,6 @@ internal static NonIndexableItemDetailsResult LoadFromXml(EwsServiceXmlReader re return nonIndexableItemDetailsResult; } - /// - /// Load from json - /// - /// The json object - /// Non indexable item details result object - internal static NonIndexableItemDetailsResult LoadFromJson(JsonObject jsonObject) - { - NonIndexableItemDetailsResult nonIndexableItemDetailsResult = new NonIndexableItemDetailsResult(); - - return nonIndexableItemDetailsResult; - } - /// /// Collection of items /// @@ -85,4 +88,4 @@ internal static NonIndexableItemDetailsResult LoadFromJson(JsonObject jsonObject /// public FailedSearchMailbox[] FailedMailboxes { get; set; } } -} +} \ No newline at end of file diff --git a/MailboxSearch/NonIndexableItemParameters.cs b/MailboxSearch/NonIndexableItemParameters.cs index 90e129c8..09d96763 100644 --- a/MailboxSearch/NonIndexableItemParameters.cs +++ b/MailboxSearch/NonIndexableItemParameters.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the NonIndexableItemParameters class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/MailboxSearch/NonIndexableItemStatistic.cs b/MailboxSearch/NonIndexableItemStatistic.cs index cefc4f89..2a27553f 100644 --- a/MailboxSearch/NonIndexableItemStatistic.cs +++ b/MailboxSearch/NonIndexableItemStatistic.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the NonIndexableItemStatistic class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -68,4 +83,4 @@ internal static List LoadFromXml(EwsServiceXmlReader return results; } } -} +} \ No newline at end of file diff --git a/MailboxSearch/PreviewItemResponseShape.cs b/MailboxSearch/PreviewItemResponseShape.cs index 067df10b..f1dd91a4 100644 --- a/MailboxSearch/PreviewItemResponseShape.cs +++ b/MailboxSearch/PreviewItemResponseShape.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the PreviewItemResponseShape class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -47,4 +62,4 @@ public PreviewItemResponseShape(PreviewItemBaseShape baseShape, ExtendedProperty /// public ExtendedPropertyDefinition[] AdditionalProperties { get; set; } } -} +} \ No newline at end of file diff --git a/MailboxSearch/SearchMailboxesParameters.cs b/MailboxSearch/SearchMailboxesParameters.cs index 15840461..23aca844 100644 --- a/MailboxSearch/SearchMailboxesParameters.cs +++ b/MailboxSearch/SearchMailboxesParameters.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SearchMailboxesParameters class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/MailboxSearch/SearchMailboxesResult.cs b/MailboxSearch/SearchMailboxesResult.cs index 6448d00f..11fc445e 100644 --- a/MailboxSearch/SearchMailboxesResult.cs +++ b/MailboxSearch/SearchMailboxesResult.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SearchMailboxesResult class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -125,18 +140,6 @@ internal static SearchMailboxesResult LoadFromXml(EwsServiceXmlReader reader) return searchResult; } - /// - /// Load from json - /// - /// The json object - /// Search result object - internal static SearchMailboxesResult LoadFromJson(JsonObject jsonObject) - { - SearchMailboxesResult searchResult = new SearchMailboxesResult(); - - return searchResult; - } - /// /// Load keyword stats xml /// @@ -475,4 +478,4 @@ internal static MailboxStatisticsItem LoadFromXml(EwsServiceXmlReader reader) } #endregion -} +} \ No newline at end of file diff --git a/MailboxSearch/SearchPreviewItem.cs b/MailboxSearch/SearchPreviewItem.cs index b9cabe3b..1cf4676c 100644 --- a/MailboxSearch/SearchPreviewItem.cs +++ b/MailboxSearch/SearchPreviewItem.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SearchPreviewItem class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -125,4 +140,4 @@ public sealed class SearchPreviewItem /// public ExtendedPropertyCollection ExtendedProperties { get; set; } } -} +} \ No newline at end of file diff --git a/MailboxSearch/SearchableMailbox.cs b/MailboxSearch/SearchableMailbox.cs index 050640a3..92cbb0eb 100644 --- a/MailboxSearch/SearchableMailbox.cs +++ b/MailboxSearch/SearchableMailbox.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SearchableMailbox class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { @@ -79,53 +94,6 @@ internal static SearchableMailbox LoadFromXml(EwsServiceXmlReader reader) return searchableMailbox; } - /// - /// Load from json - /// - /// The json object - /// Searchable mailbox object - internal static SearchableMailbox LoadFromJson(JsonObject jsonObject) - { - SearchableMailbox searchableMailbox = new SearchableMailbox(); - - if (jsonObject.ContainsKey(XmlElementNames.Guid)) - { - searchableMailbox.Guid = new Guid(jsonObject.ReadAsString(XmlElementNames.Guid)); - } - - if (jsonObject.ContainsKey(XmlElementNames.DisplayName)) - { - searchableMailbox.DisplayName = jsonObject.ReadAsString(XmlElementNames.DisplayName); - } - - if (jsonObject.ContainsKey(XmlElementNames.PrimarySmtpAddress)) - { - searchableMailbox.SmtpAddress = jsonObject.ReadAsString(XmlElementNames.PrimarySmtpAddress); - } - - if (jsonObject.ContainsKey(XmlElementNames.IsExternalMailbox)) - { - searchableMailbox.IsExternalMailbox = jsonObject.ReadAsBool(XmlElementNames.IsExternalMailbox); - } - - if (jsonObject.ContainsKey(XmlElementNames.ExternalEmailAddress)) - { - searchableMailbox.ExternalEmailAddress = jsonObject.ReadAsString(XmlElementNames.ExternalEmailAddress); - } - - if (jsonObject.ContainsKey(XmlElementNames.IsMembershipGroup)) - { - searchableMailbox.IsMembershipGroup = jsonObject.ReadAsBool(XmlElementNames.IsMembershipGroup); - } - - if (jsonObject.ContainsKey(XmlElementNames.ReferenceId)) - { - searchableMailbox.ReferenceId = jsonObject.ReadAsString(XmlElementNames.ReferenceId); - } - - return searchableMailbox; - } - /// /// Guid /// @@ -161,4 +129,4 @@ internal static SearchableMailbox LoadFromJson(JsonObject jsonObject) /// public string ReferenceId { get; set; } } -} +} \ No newline at end of file diff --git a/MailboxSearch/SetHoldOnMailboxesParameters.cs b/MailboxSearch/SetHoldOnMailboxesParameters.cs index 6b799050..0dd9308d 100644 --- a/MailboxSearch/SetHoldOnMailboxesParameters.cs +++ b/MailboxSearch/SetHoldOnMailboxesParameters.cs @@ -1,12 +1,27 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// --------------------------------------------------------------------------- - -//----------------------------------------------------------------------- -// Defines the SetHoldOnMailboxesParameters class. -//----------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ namespace Microsoft.Exchange.WebServices.Data { diff --git a/MailboxSearch/Versioning.cs b/MailboxSearch/Versioning.cs index ff554377..970d0450 100644 --- a/MailboxSearch/Versioning.cs +++ b/MailboxSearch/Versioning.cs @@ -1,13 +1,28 @@ -// --------------------------------------------------------------------------- -// -// Copyright (c) Microsoft. All rights reserved. -// -// --------------------------------------------------------------------------- -// --------------------------------------------------------------------------- -// -// Versioning.cs -// -// --------------------------------------------------------------------------- +/* + * Exchange Web Services Managed API + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + using System; using System.Collections.Generic; using System.Linq; @@ -120,4 +135,4 @@ internal bool IsCompatible(IDiscoveryVersionable versionable) } } } -} +} \ No newline at end of file diff --git a/Microsoft.Exchange.WebServices.Data.csproj b/Microsoft.Exchange.WebServices.Data.csproj index 0d924255..d7675a1e 100644 --- a/Microsoft.Exchange.WebServices.Data.csproj +++ b/Microsoft.Exchange.WebServices.Data.csproj @@ -9,7 +9,7 @@ Library Properties Microsoft.Exchange.WebServices.Data - Microsoft.Exchange.WebServices.Data + Microsoft.Exchange.WebServices 4.0 @@ -42,9 +42,10 @@ DEBUG;TRACE prompt 4 - bin\Debug\Microsoft.Exchange.WebServices.Data.xml + bin\Debug\Microsoft.Exchange.WebServices.xml false true + false pdbonly @@ -53,6 +54,7 @@ TRACE prompt 4 + false @@ -61,12 +63,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -100,6 +153,10 @@ + + + + @@ -141,6 +198,7 @@ + @@ -177,15 +235,7 @@ - - Code - - - - - - @@ -214,6 +264,7 @@ + @@ -262,6 +313,7 @@ + @@ -323,19 +375,14 @@ - - - - - @@ -354,7 +401,6 @@ - @@ -386,17 +432,21 @@ - + + + + + @@ -499,6 +549,7 @@ + @@ -571,6 +622,8 @@ + + @@ -658,7 +711,6 @@ - @@ -675,6 +727,7 @@ + @@ -771,12 +824,14 @@ + + @@ -817,14 +872,6 @@ - - - Designer - - - Designer - -