using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Globalization;
using Octokit.Internal;
namespace Octokit
{
///
/// Used to create an Oauth device flow initiation request.
///
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class OauthDeviceFlowRequest
: RequestParameters
{
///
/// Creates an instance of the OAuth login request with the required parameter.
///
/// The client Id you received from GitHub when you registered the application.
public OauthDeviceFlowRequest(string clientId)
{
Ensure.ArgumentNotNullOrEmptyString(clientId, nameof(clientId));
ClientId = clientId;
Scopes = new Collection();
}
///
/// The client Id you received from GitHub when you registered the application.
///
[Parameter(Key = "client_id")]
public string ClientId { get; private set; }
///
/// A set of scopes to request. If not provided, scope defaults to an empty list of scopes for users that don’t
/// have a valid token for the app. For users who do already have a valid token for the app, the user won't be
/// shown the OAuth authorization page with the list of scopes. Instead, this step of the flow will
/// automatically complete with the same scopes that were used last time the user completed the flow.
///
///
/// See the scopes documentation for more
/// information about scopes.
///
[Parameter(Key = "scope")]
public Collection Scopes { get; private set; }
internal string DebuggerDisplay
{
get
{
return string.Format(CultureInfo.InvariantCulture, "ClientId: {0}, Scopes: {1}", ClientId, Scopes);
}
}
}
}