//-----------------------------------------------------------------------
//
// Copyright (c) Andrew Arnott. All rights reserved.
//
//-----------------------------------------------------------------------
namespace DotNetOAuth {
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DotNetOAuth.Messaging;
///
/// A description of an individual endpoint on a Service Provider.
///
public class ServiceProviderEndpoint {
///
/// Initializes a new instance of the class.
///
/// The URL of this Service Provider endpoint.
/// The HTTP method(s) allowed.
public ServiceProviderEndpoint(string locationUri, HttpDeliveryMethod method)
: this(new Uri(locationUri), method) { }
///
/// Initializes a new instance of the class.
///
/// The URL of this Service Provider endpoint.
/// The HTTP method(s) allowed.
public ServiceProviderEndpoint(Uri location, HttpDeliveryMethod method) {
if (location == null) {
throw new ArgumentNullException("location");
}
if (method == HttpDeliveryMethod.None) {
throw new ArgumentOutOfRangeException("method");
}
this.Location = location;
this.AllowedMethods = method;
}
///
/// Gets or sets the URL of this Service Provider endpoint.
///
public Uri Location { get; set; }
///
/// Gets or sets the HTTP method(s) allowed.
///
public HttpDeliveryMethod AllowedMethods { get; set; }
}
}