Index: Src/GoogleApis.Auth.WP81/OAuth2/SerializableWebAuthResult.cs =================================================================== new file mode 100644 --- /dev/null +++ b/Src/GoogleApis.Auth.WP81/OAuth2/SerializableWebAuthResult.cs @@ -0,0 +1,47 @@ +/* +Copyright 2014 Google Inc + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +using Windows.Security.Authentication.Web; + +namespace Google.Apis.Auth.OAuth2 +{ + /// + /// Contains the WebAuthenticationResult data. WebAuthenticationResult doesn't have an empty constructor, and as a + /// result it can't be deserialized. + /// + public class SerializableWebAuthResult + { + public static string Name = "authorization_result"; + + /// Gets or sets the the protocol data when the operation successfully completes. + public string ResponseData { get; set; } + /// Gets or sets the HTTP error code when ResponseStatus is equal to ErrorHttp. + public uint ResponseErrorDetail { get; set; } + /// Gets or sets the status of the asynchronous operation when it completes. + public WebAuthenticationStatus ResponseStatus { get; set; } + + /// Empty default constructor. + public SerializableWebAuthResult() { } + + /// Constructs a new instance of the class and set its properties by the specified result. + public SerializableWebAuthResult(WebAuthenticationResult result) + { + this.ResponseData = result.ResponseData; + this.ResponseErrorDetail = result.ResponseErrorDetail; + this.ResponseStatus = result.ResponseStatus; + } + } +} \ No newline at end of file