Index: Src/GoogleApis/Apis/Discovery/Method.cs
===================================================================
deleted file mode 100644
--- a/Src/GoogleApis/Apis/Discovery/Method.cs
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
-Copyright 2010 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 System;
-using System.Collections.Generic;
-
-using Google.Apis.Json;
-using Google.Apis.Logging;
-using Google.Apis.Util;
-
-namespace Google.Apis.Discovery
-{
- ///
- /// Abstract implementation of a method.
- ///
- internal abstract class BaseMethod : ServiceObject, IMethod
- {
- private const string PathUrl = "path";
- private static readonly ILogger logger = ApplicationContext.Logger.ForType();
-
- private readonly JsonDictionary information;
-
- private Dictionary parameters;
- private IEnumerable parameterOrder;
-
- protected JsonDictionary Information { get { return information; } }
-
- internal BaseMethod(IServiceFactory factory, string name, JsonDictionary dictionary)
- : base(factory)
- {
- Name = name;
- information = dictionary;
- if (information == null)
- {
- throw new ArgumentException("got no valid dictionary");
- }
- }
-
- #region IMethod Members
-
- public string Name { get; set; }
-
- public string Description
- {
- get { return information.GetValueAsNull(ServiceFactory.Description) as string; }
- }
-
- public virtual string RestPath
- {
- get { return information.GetValueAsNull(PathUrl) as string; }
- }
-
- public string RpcName
- {
- get { return information[ServiceFactory.RpcName] as string; }
- }
-
- public string HttpMethod
- {
- get { return information.GetValueAsNull(ServiceFactory.HttpMethod) as string; }
- }
-
- public string ResponseType
- {
- get
- {
- var responseDict = information.GetValueAsNull(ServiceFactory.ResponseType) as JsonDictionary;
- if (responseDict == null)
- {
- logger.Debug("No ReponseType for method [{0}]", Name);
- return null;
- }
- return responseDict.GetValueAsNull("$ref") as string;
- }
- }
-
- public string RequestType
- {
- get
- {
- var requestDict = information.GetValueAsNull(ServiceFactory.RequestType) as JsonDictionary;
- if (requestDict == null)
- {
- logger.Debug("No RequestType for method [{0}]", Name);
- return null;
- }
- return requestDict.GetValueAsNull("$ref") as string;
- }
- }
-
- public bool HasBody
- {
- get { return information.GetValueAsNull(ServiceFactory.RequestType) != null; }
- }
-
- public Dictionary Parameters
- {
- get { return parameters ?? (parameters = FetchParameters()); }
- }
-
- public IEnumerable ParameterOrder
- {
- get
- {
- return parameterOrder ??
- (parameterOrder = information.GetValueAsStringListOrEmpty(ServiceFactory.ParameterOrder));
- }
- }
-
- public MediaUpload MediaUpload
- {
- get
- {
- var dict = information.GetValueAsNull(ServiceFactory.MediaUpload) as JsonDictionary;
- return dict == null ? null : new MediaUpload(dict);
- }
- }
-
- public bool SupportMediaUpload
- {
- get
- {
- var support = information.GetValueAsNull(ServiceFactory.SupportMediaUpload);
- return support is bool && (bool)support;
- }
- }
-
- public bool SupportMediaDownload
- {
- get
- {
- var support = information.GetValueAsNull(ServiceFactory.SupportMediaDownload);
- return support is bool && (bool)support;
- }
- }
-
- #endregion
-
- private Dictionary FetchParameters()
- {
- if (information.ContainsKey(ServiceFactory.Parameters) == false)
- {
- return new Dictionary { };
- }
-
- JsonDictionary js = information[ServiceFactory.Parameters] as JsonDictionary;
- if (js == null)
- {
- return new Dictionary { };
- }
-
- var parameters = new Dictionary();
- foreach (KeyValuePair kvp in js)
- {
- IDiscoveryParameter p = CreateParameter(kvp);
- parameters.Add(kvp.Key, p);
- }
- return parameters;
- }
- }
-
- ///
- /// Represents a Method from Discovery Version 1.0
- ///
- internal class MethodV1_0 : BaseMethod
- {
- public MethodV1_0(IServiceFactory factory, string name, JsonDictionary dictionary) :
- base(factory, name, dictionary) { }
- }
-
- ///
- /// Represents a Method from Discovery Version 0.3
- ///
- internal class MethodV0_3 : BaseMethod
- {
- private const string PathUrl = "restPath";
-
- public MethodV0_3(IServiceFactory factory, string name, JsonDictionary dictionary)
- : base(factory, name, dictionary) { }
-
- public override string RestPath
- {
- get { return Information.GetValueAsNull(PathUrl) as string; }
- }
- }
-}
\ No newline at end of file