FxCop fixes.
[dotnetoauth.git] / src / DotNetOpenAuth / OpenId / Messages / AssociateUnsuccessfulResponse.cs
blobc5e0fd4076067e1b6cc92ae591b5a3f3c1e44a46
1 //-----------------------------------------------------------------------
2 // <copyright file="AssociateUnsuccessfulResponse.cs" company="Andrew Arnott">
3 // Copyright (c) Andrew Arnott. All rights reserved.
4 // </copyright>
5 //-----------------------------------------------------------------------
7 namespace DotNetOpenAuth.OpenId.Messages {
8 using System.Diagnostics;
9 using System.Diagnostics.CodeAnalysis;
10 using System.Globalization;
11 using DotNetOpenAuth.Messaging;
13 /// <summary>
14 /// The Provider's response to a Relying Party that requested an association that the Provider does not support.
15 /// </summary>
16 /// <remarks>
17 /// This message type described in OpenID 2.0 section 8.2.4.
18 /// </remarks>
19 [DebuggerDisplay("OpenID {Version} associate (failed) response")]
20 internal class AssociateUnsuccessfulResponse : DirectErrorResponse {
21 /// <summary>
22 /// A hard-coded string indicating an error occurred.
23 /// </summary>
24 /// <value>"unsupported-type" </value>
25 [SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Read by reflection")]
26 [MessagePart("error_code", IsRequired = true, AllowEmpty = false)]
27 #pragma warning disable 0414 // read by reflection
28 private readonly string Error = "unsupported-type";
29 #pragma warning restore 0414
31 /// <summary>
32 /// Initializes a new instance of the <see cref="AssociateUnsuccessfulResponse"/> class.
33 /// </summary>
34 /// <param name="originatingRequest">The originating request.</param>
35 internal AssociateUnsuccessfulResponse(AssociateRequest originatingRequest)
36 : base(originatingRequest) {
37 this.ErrorMessage = string.Format(CultureInfo.CurrentCulture, OpenIdStrings.AssociationOrSessionTypeUnrecognizedOrNotSupported, originatingRequest.AssociationType, originatingRequest.SessionType);
40 /// <summary>
41 /// Gets or sets an association type supported by the OP from Section 8.3 (Association Types).
42 /// </summary>
43 [MessagePart("assoc_type", IsRequired = false, AllowEmpty = false)]
44 internal string AssociationType { get; set; }
46 /// <summary>
47 /// Gets or sets a valid association session type from Section 8.4 (Association Session Types) that the OP supports.
48 /// </summary>
49 [MessagePart("session_type", IsRequired = false, AllowEmpty = false)]
50 internal string SessionType { get; set; }