// Generated by the Protocol Buffers 3.0 compiler.  DO NOT EDIT!
// Source file "api.proto"
// Syntax "Proto3"

import Foundation

public extension Google.Protobuf{}

public func == (lhs: Google.Protobuf.Api, rhs: Google.Protobuf.Api) -> Bool {
  if (lhs === rhs) {
    return true
  }
  var fieldCheck:Bool = (lhs.hashValue == rhs.hashValue)
  fieldCheck = fieldCheck && (lhs.hasName == rhs.hasName) && (!lhs.hasName || lhs.name == rhs.name)
  fieldCheck = fieldCheck && (lhs.methods == rhs.methods)
  fieldCheck = fieldCheck && (lhs.options == rhs.options)
  fieldCheck = fieldCheck && (lhs.hasVersion == rhs.hasVersion) && (!lhs.hasVersion || lhs.version == rhs.version)
  fieldCheck = fieldCheck && (lhs.hasSourceContext == rhs.hasSourceContext) && (!lhs.hasSourceContext || lhs.sourceContext == rhs.sourceContext)
  fieldCheck = (fieldCheck && (lhs.unknownFields == rhs.unknownFields))
  return fieldCheck
}

public func == (lhs: Google.Protobuf.Method, rhs: Google.Protobuf.Method) -> Bool {
  if (lhs === rhs) {
    return true
  }
  var fieldCheck:Bool = (lhs.hashValue == rhs.hashValue)
  fieldCheck = fieldCheck && (lhs.hasName == rhs.hasName) && (!lhs.hasName || lhs.name == rhs.name)
  fieldCheck = fieldCheck && (lhs.hasRequestTypeUrl == rhs.hasRequestTypeUrl) && (!lhs.hasRequestTypeUrl || lhs.requestTypeUrl == rhs.requestTypeUrl)
  fieldCheck = fieldCheck && (lhs.hasRequestStreaming == rhs.hasRequestStreaming) && (!lhs.hasRequestStreaming || lhs.requestStreaming == rhs.requestStreaming)
  fieldCheck = fieldCheck && (lhs.hasResponseTypeUrl == rhs.hasResponseTypeUrl) && (!lhs.hasResponseTypeUrl || lhs.responseTypeUrl == rhs.responseTypeUrl)
  fieldCheck = fieldCheck && (lhs.hasResponseStreaming == rhs.hasResponseStreaming) && (!lhs.hasResponseStreaming || lhs.responseStreaming == rhs.responseStreaming)
  fieldCheck = fieldCheck && (lhs.options == rhs.options)
  fieldCheck = (fieldCheck && (lhs.unknownFields == rhs.unknownFields))
  return fieldCheck
}

public extension Google.Protobuf {
  public struct ApiRoot {
    public static var sharedInstance : ApiRoot {
     struct Static {
         static let instance : ApiRoot = ApiRoot()
     }
     return Static.instance
    }
    public var extensionRegistry:ExtensionRegistry

    init() {
      extensionRegistry = ExtensionRegistry()
      registerAllExtensions(registry: extensionRegistry)
      Google.Protobuf.SwiftDescriptorRoot.sharedInstance.registerAllExtensions(registry: extensionRegistry)
      Google.Protobuf.SourceContextRoot.sharedInstance.registerAllExtensions(registry: extensionRegistry)
      Google.Protobuf.TypesRoot.sharedInstance.registerAllExtensions(registry: extensionRegistry)
    }
    public func registerAllExtensions(registry: ExtensionRegistry) {
    }
  }

  // Api is a light-weight descriptor for a protocol buffer service.
  final public class Api : GeneratedMessage, GeneratedMessageProtocol {
    // The fully qualified name of this api, including package name
    // followed by the api's simple name.
    public private(set) var name:String = ""

    public private(set) var hasName:Bool = false
    public private(set) var methods:Array<Google.Protobuf.Method>  = Array<Google.Protobuf.Method>()
    public private(set) var options:Array<Google.Protobuf.Option>  = Array<Google.Protobuf.Option>()
    // A version string for this api. If specified, must have the form
    // `major-version.minor-version`, as in `1.10`. If the minor version
    // is omitted, it defaults to zero. If the entire version field is
    // empty, the major version is derived from the package name, as
    // outlined below. If the field is not empty, the version in the
    // package name will be verified to be consistent with what is
    // provided here.
    // The versioning schema uses [semantic
    // versioning](http://semver.org) where the major version number
    // indicates a breaking change and the minor version an additive,
    // non-breaking change. Both version numbers are signals to users
    // what to expect from different versions, and should be carefully
    // chosen based on the product plan.
    // The major version is also reflected in the package name of the
    // API, which must end in `v<major-version>`, as in
    // `google.feature.v1`. For major versions 0 and 1, the suffix can
    // be omitted. Zero major versions must only be used for
    // experimental, none-GA apis.
    // See also: [design doc](http://go/api-versioning).
    public private(set) var version:String = ""

    public private(set) var hasVersion:Bool = false
    public private(set) var sourceContext:Google.Protobuf.SourceContext!
    public private(set) var hasSourceContext:Bool = false
    required public init() {
         super.init()
    }
    override public func isInitialized() -> Bool {
     return true
    }
    override public func writeTo(codedOutputStream: CodedOutputStream) throws {
      if hasName {
        try codedOutputStream.writeString(fieldNumber: 1, value:name)
      }
      for oneElementMethods in methods {
          try codedOutputStream.writeMessage(fieldNumber: 2, value:oneElementMethods)
      }
      for oneElementOptions in options {
          try codedOutputStream.writeMessage(fieldNumber: 3, value:oneElementOptions)
      }
      if hasVersion {
        try codedOutputStream.writeString(fieldNumber: 4, value:version)
      }
      if hasSourceContext {
        try codedOutputStream.writeMessage(fieldNumber: 5, value:sourceContext)
      }
      try unknownFields.writeTo(codedOutputStream: codedOutputStream)
    }
    override public func serializedSize() -> Int32 {
      var serialize_size:Int32 = memoizedSerializedSize
      if serialize_size != -1 {
       return serialize_size
      }

      serialize_size = 0
      if hasName {
        serialize_size += name.computeStringSize(fieldNumber: 1)
      }
      for oneElementMethods in methods {
          serialize_size += oneElementMethods.computeMessageSize(fieldNumber: 2)
      }
      for oneElementOptions in options {
          serialize_size += oneElementOptions.computeMessageSize(fieldNumber: 3)
      }
      if hasVersion {
        serialize_size += version.computeStringSize(fieldNumber: 4)
      }
      if hasSourceContext {
          if let varSizesourceContext = sourceContext?.computeMessageSize(fieldNumber: 5) {
              serialize_size += varSizesourceContext
          }
      }
      serialize_size += unknownFields.serializedSize()
      memoizedSerializedSize = serialize_size
      return serialize_size
    }
    public class func parseArrayDelimitedFrom(inputStream: InputStream) throws -> Array<Google.Protobuf.Api> {
      var mergedArray = Array<Google.Protobuf.Api>()
      while let value = try parseDelimitedFrom(inputStream: inputStream) {
        mergedArray.append(value)
      }
      return mergedArray
    }
    public class func parseDelimitedFrom(inputStream: InputStream) throws -> Google.Protobuf.Api? {
      return try Google.Protobuf.Api.Builder().mergeDelimitedFrom(inputStream: inputStream)?.build()
    }
    public class func parseFrom(data: Data) throws -> Google.Protobuf.Api {
      return try Google.Protobuf.Api.Builder().mergeFrom(data: data, extensionRegistry:Google.Protobuf.ApiRoot.sharedInstance.extensionRegistry).build()
    }
    public class func parseFrom(data: Data, extensionRegistry:ExtensionRegistry) throws -> Google.Protobuf.Api {
      return try Google.Protobuf.Api.Builder().mergeFrom(data: data, extensionRegistry:extensionRegistry).build()
    }
    public class func parseFrom(inputStream: InputStream) throws -> Google.Protobuf.Api {
      return try Google.Protobuf.Api.Builder().mergeFrom(inputStream: inputStream).build()
    }
    public class func parseFrom(inputStream: InputStream, extensionRegistry:ExtensionRegistry) throws -> Google.Protobuf.Api {
      return try Google.Protobuf.Api.Builder().mergeFrom(inputStream: inputStream, extensionRegistry:extensionRegistry).build()
    }
    public class func parseFrom(codedInputStream: CodedInputStream) throws -> Google.Protobuf.Api {
      return try Google.Protobuf.Api.Builder().mergeFrom(codedInputStream: codedInputStream).build()
    }
    public class func parseFrom(codedInputStream: CodedInputStream, extensionRegistry:ExtensionRegistry) throws -> Google.Protobuf.Api {
      return try Google.Protobuf.Api.Builder().mergeFrom(codedInputStream: codedInputStream, extensionRegistry:extensionRegistry).build()
    }
    public class func getBuilder() -> Google.Protobuf.Api.Builder {
      return Google.Protobuf.Api.classBuilder() as! Google.Protobuf.Api.Builder
    }
    public func getBuilder() -> Google.Protobuf.Api.Builder {
      return classBuilder() as! Google.Protobuf.Api.Builder
    }
    override public class func classBuilder() -> MessageBuilder {
      return Google.Protobuf.Api.Builder()
    }
    override public func classBuilder() -> MessageBuilder {
      return Google.Protobuf.Api.Builder()
    }
    public func toBuilder() throws -> Google.Protobuf.Api.Builder {
      return try Google.Protobuf.Api.builderWithPrototype(prototype:self)
    }
    public class func builderWithPrototype(prototype:Google.Protobuf.Api) throws -> Google.Protobuf.Api.Builder {
      return try Google.Protobuf.Api.Builder().mergeFrom(other:prototype)
    }
    override public func encode() throws -> Dictionary<String,AnyObject> {
      guard isInitialized() else {
        throw ProtocolBuffersError.invalidProtocolBuffer("Uninitialized Message")
      }

      var jsonMap:Dictionary<String,AnyObject> = Dictionary<String,AnyObject>()
      if hasName {
        jsonMap["name"] = name
      }
      if !methods.isEmpty {
        var jsonArrayMethods:Array<Dictionary<String,AnyObject>> = []
          for oneValueMethods in methods {
            let ecodedMessageMethods = try oneValueMethods.encode()
            jsonArrayMethods.append(ecodedMessageMethods)
          }
        jsonMap["methods"] = jsonArrayMethods
      }
      if !options.isEmpty {
        var jsonArrayOptions:Array<Dictionary<String,AnyObject>> = []
          for oneValueOptions in options {
            let ecodedMessageOptions = try oneValueOptions.encode()
            jsonArrayOptions.append(ecodedMessageOptions)
          }
        jsonMap["options"] = jsonArrayOptions
      }
      if hasVersion {
        jsonMap["version"] = version
      }
      if hasSourceContext {
        jsonMap["sourceContext"] = try sourceContext.encode()
      }
      return jsonMap
    }
    override class public func decode(jsonMap:Dictionary<String,AnyObject>) throws -> Google.Protobuf.Api {
      return try Google.Protobuf.Api.Builder.decodeToBuilder(jsonMap:jsonMap).build()
    }
    override class public func fromJSON(data:Data) throws -> Google.Protobuf.Api {
      return try Google.Protobuf.Api.Builder.fromJSONToBuilder(data:data).build()
    }
    override public func getDescription(indent:String) throws -> String {
      var output = ""
      if hasName {
        output += "\(indent) name: \(name) \n"
      }
      var methodsElementIndex:Int = 0
      for oneElementMethods in methods {
          output += "\(indent) methods[\(methodsElementIndex)] {\n"
          output += try oneElementMethods.getDescription(indent: "\(indent)  ")
          output += "\(indent)}\n"
          methodsElementIndex += 1
      }
      var optionsElementIndex:Int = 0
      for oneElementOptions in options {
          output += "\(indent) options[\(optionsElementIndex)] {\n"
          output += try oneElementOptions.getDescription(indent: "\(indent)  ")
          output += "\(indent)}\n"
          optionsElementIndex += 1
      }
      if hasVersion {
        output += "\(indent) version: \(version) \n"
      }
      if hasSourceContext {
        output += "\(indent) sourceContext {\n"
        if let outDescSourceContext = sourceContext {
          output += try outDescSourceContext.getDescription(indent: "\(indent)  ")
        }
        output += "\(indent) }\n"
      }
      output += unknownFields.getDescription(indent: indent)
      return output
    }
    override public var hashValue:Int {
        get {
            var hashCode:Int = 7
            if hasName {
               hashCode = (hashCode &* 31) &+ name.hashValue
            }
            for oneElementMethods in methods {
                hashCode = (hashCode &* 31) &+ oneElementMethods.hashValue
            }
            for oneElementOptions in options {
                hashCode = (hashCode &* 31) &+ oneElementOptions.hashValue
            }
            if hasVersion {
               hashCode = (hashCode &* 31) &+ version.hashValue
            }
            if hasSourceContext {
                if let hashValuesourceContext = sourceContext?.hashValue {
                    hashCode = (hashCode &* 31) &+ hashValuesourceContext
                }
            }
            hashCode = (hashCode &* 31) &+  unknownFields.hashValue
            return hashCode
        }
    }


    //Meta information declaration start

    override public class func className() -> String {
        return "Google.Protobuf.Api"
    }
    override public func className() -> String {
        return "Google.Protobuf.Api"
    }
    override public func classMetaType() -> GeneratedMessage.Type {
        return Google.Protobuf.Api.self
    }
    //Meta information declaration end

    final public class Builder : GeneratedMessageBuilder {
      private var builderResult:Google.Protobuf.Api = Google.Protobuf.Api()
      public func getMessage() -> Google.Protobuf.Api {
          return builderResult
      }

      required override public init () {
         super.init()
      }
      public var hasName:Bool {
           get {
                return builderResult.hasName
           }
      }
      public var name:String {
           get {
                return builderResult.name
           }
           set (value) {
               builderResult.hasName = true
               builderResult.name = value
           }
      }
      public func setName(_ value:String) -> Google.Protobuf.Api.Builder {
        self.name = value
        return self
      }
      public func clearName() -> Google.Protobuf.Api.Builder{
           builderResult.hasName = false
           builderResult.name = ""
           return self
      }
      public var methods:Array<Google.Protobuf.Method> {
           get {
               return builderResult.methods
           }
           set (value) {
               builderResult.methods = value
           }
      }
      public func setMethods(_ value:Array<Google.Protobuf.Method>) -> Google.Protobuf.Api.Builder {
        self.methods = value
        return self
      }
      public func clearMethods() -> Google.Protobuf.Api.Builder {
        builderResult.methods.removeAll(keepingCapacity: false)
        return self
      }
      public var options:Array<Google.Protobuf.Option> {
           get {
               return builderResult.options
           }
           set (value) {
               builderResult.options = value
           }
      }
      public func setOptions(_ value:Array<Google.Protobuf.Option>) -> Google.Protobuf.Api.Builder {
        self.options = value
        return self
      }
      public func clearOptions() -> Google.Protobuf.Api.Builder {
        builderResult.options.removeAll(keepingCapacity: false)
        return self
      }
      public var hasVersion:Bool {
           get {
                return builderResult.hasVersion
           }
      }
      public var version:String {
           get {
                return builderResult.version
           }
           set (value) {
               builderResult.hasVersion = true
               builderResult.version = value
           }
      }
      public func setVersion(_ value:String) -> Google.Protobuf.Api.Builder {
        self.version = value
        return self
      }
      public func clearVersion() -> Google.Protobuf.Api.Builder{
           builderResult.hasVersion = false
           builderResult.version = ""
           return self
      }
      public var hasSourceContext:Bool {
           get {
               return builderResult.hasSourceContext
           }
      }
      public var sourceContext:Google.Protobuf.SourceContext! {
           get {
               if sourceContextBuilder_ != nil {
                  builderResult.sourceContext = sourceContextBuilder_.getMessage()
               }
               return builderResult.sourceContext
           }
           set (value) {
               builderResult.hasSourceContext = true
               builderResult.sourceContext = value
           }
      }
      private var sourceContextBuilder_:Google.Protobuf.SourceContext.Builder! {
           didSet {
              builderResult.hasSourceContext = true
           }
      }
      public func getSourceContextBuilder() -> Google.Protobuf.SourceContext.Builder {
        if sourceContextBuilder_ == nil {
           sourceContextBuilder_ = Google.Protobuf.SourceContext.Builder()
           builderResult.sourceContext = sourceContextBuilder_.getMessage()
           if sourceContext != nil {
              _ = try! sourceContextBuilder_.mergeFrom(other: sourceContext)
           }
        }
        return sourceContextBuilder_
      }
      public func setSourceContext(_ value:Google.Protobuf.SourceContext!) -> Google.Protobuf.Api.Builder {
        self.sourceContext = value
        return self
      }
      public func mergeSourceContext(value:Google.Protobuf.SourceContext) throws -> Google.Protobuf.Api.Builder {
        if builderResult.hasSourceContext {
          builderResult.sourceContext = try Google.Protobuf.SourceContext.builderWithPrototype(prototype:builderResult.sourceContext).mergeFrom(other: value).buildPartial()
        } else {
          builderResult.sourceContext = value
        }
        builderResult.hasSourceContext = true
        return self
      }
      public func clearSourceContext() -> Google.Protobuf.Api.Builder {
        sourceContextBuilder_ = nil
        builderResult.hasSourceContext = false
        builderResult.sourceContext = nil
        return self
      }
      override public var internalGetResult:GeneratedMessage {
           get {
              return builderResult
           }
      }
      override public func clear() -> Google.Protobuf.Api.Builder {
        builderResult = Google.Protobuf.Api()
        return self
      }
      override public func clone() throws -> Google.Protobuf.Api.Builder {
        return try Google.Protobuf.Api.builderWithPrototype(prototype:builderResult)
      }
      override public func build() throws -> Google.Protobuf.Api {
           try checkInitialized()
           return buildPartial()
      }
      public func buildPartial() -> Google.Protobuf.Api {
        let returnMe:Google.Protobuf.Api = builderResult
        return returnMe
      }
      public func mergeFrom(other:Google.Protobuf.Api) throws -> Google.Protobuf.Api.Builder {
        if other == Google.Protobuf.Api() {
         return self
        }
        if other.hasName {
             name = other.name
        }
        if !other.methods.isEmpty  {
           builderResult.methods += other.methods
        }
        if !other.options.isEmpty  {
           builderResult.options += other.options
        }
        if other.hasVersion {
             version = other.version
        }
        if (other.hasSourceContext) {
            _ = try mergeSourceContext(value: other.sourceContext)
        }
        _ = try merge(unknownField: other.unknownFields)
        return self
      }
      override public func mergeFrom(codedInputStream: CodedInputStream) throws -> Google.Protobuf.Api.Builder {
           return try mergeFrom(codedInputStream: codedInputStream, extensionRegistry:ExtensionRegistry())
      }
      override public func mergeFrom(codedInputStream: CodedInputStream, extensionRegistry:ExtensionRegistry) throws -> Google.Protobuf.Api.Builder {
        let unknownFieldsBuilder:UnknownFieldSet.Builder = try UnknownFieldSet.builderWithUnknownFields(copyFrom:self.unknownFields)
        while (true) {
          let protobufTag = try codedInputStream.readTag()
          switch protobufTag {
          case 0: 
            self.unknownFields = try unknownFieldsBuilder.build()
            return self

          case 10:
            name = try codedInputStream.readString()

          case 18:
            let subBuilder = Google.Protobuf.Method.Builder()
            try codedInputStream.readMessage(builder: subBuilder,extensionRegistry:extensionRegistry)
            methods.append(subBuilder.buildPartial())

          case 26:
            let subBuilder = Google.Protobuf.Option.Builder()
            try codedInputStream.readMessage(builder: subBuilder,extensionRegistry:extensionRegistry)
            options.append(subBuilder.buildPartial())

          case 34:
            version = try codedInputStream.readString()

          case 42:
            let subBuilder:Google.Protobuf.SourceContext.Builder = Google.Protobuf.SourceContext.Builder()
            if hasSourceContext {
              _ = try subBuilder.mergeFrom(other: sourceContext)
            }
            try codedInputStream.readMessage(builder: subBuilder, extensionRegistry:extensionRegistry)
            sourceContext = subBuilder.buildPartial()

          default:
            if (!(try parse(codedInputStream:codedInputStream, unknownFields:unknownFieldsBuilder, extensionRegistry:extensionRegistry, tag:protobufTag))) {
               unknownFields = try unknownFieldsBuilder.build()
               return self
            }
          }
        }
      }
      override class public func decodeToBuilder(jsonMap:Dictionary<String,AnyObject>) throws -> Google.Protobuf.Api.Builder {
        let resultDecodedBuilder = Google.Protobuf.Api.Builder()
        if let jsonValueName = jsonMap["name"] as? String {
          resultDecodedBuilder.name = jsonValueName
        }
        if let jsonValueMethods = jsonMap["methods"] as? Array<Dictionary<String,AnyObject>> {
          var jsonArrayMethods:Array<Google.Protobuf.Method> = []
          for oneValueMethods in jsonValueMethods {
            let messageFromStringMethods = try Google.Protobuf.Method.Builder.decodeToBuilder(jsonMap:oneValueMethods).build()

            jsonArrayMethods.append(messageFromStringMethods)
          }
          resultDecodedBuilder.methods = jsonArrayMethods
        }
        if let jsonValueOptions = jsonMap["options"] as? Array<Dictionary<String,AnyObject>> {
          var jsonArrayOptions:Array<Google.Protobuf.Option> = []
          for oneValueOptions in jsonValueOptions {
            let messageFromStringOptions = try Google.Protobuf.Option.Builder.decodeToBuilder(jsonMap:oneValueOptions).build()

            jsonArrayOptions.append(messageFromStringOptions)
          }
          resultDecodedBuilder.options = jsonArrayOptions
        }
        if let jsonValueVersion = jsonMap["version"] as? String {
          resultDecodedBuilder.version = jsonValueVersion
        }
        if let jsonValueSourceContext = jsonMap["sourceContext"] as? Dictionary<String,AnyObject> {
          resultDecodedBuilder.sourceContext = try Google.Protobuf.SourceContext.Builder.decodeToBuilder(jsonMap:jsonValueSourceContext).build()

        }
        return resultDecodedBuilder
      }
      override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.Api.Builder {
        let jsonData = try JSONSerialization.jsonObject(with:data, options: JSONSerialization.ReadingOptions(rawValue: 0))
        guard let jsDataCast = jsonData as? Dictionary<String,AnyObject> else {
          throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data")
        }
        return try Google.Protobuf.Api.Builder.decodeToBuilder(jsonMap:jsDataCast)
      }
    }

  }

  // Method represents a method of an api.
  final public class Method : GeneratedMessage, GeneratedMessageProtocol {
    // The simple name of this method.
    public private(set) var name:String = ""

    public private(set) var hasName:Bool = false
    // A URL of the input message type.
    public private(set) var requestTypeUrl:String = ""

    public private(set) var hasRequestTypeUrl:Bool = false
    // If true, the request is streamed.
    public private(set) var requestStreaming:Bool = false

    public private(set) var hasRequestStreaming:Bool = false
    // The URL of the output message type.
    public private(set) var responseTypeUrl:String = ""

    public private(set) var hasResponseTypeUrl:Bool = false
    // If true, the response is streamed.
    public private(set) var responseStreaming:Bool = false

    public private(set) var hasResponseStreaming:Bool = false
    public private(set) var options:Array<Google.Protobuf.Option>  = Array<Google.Protobuf.Option>()
    required public init() {
         super.init()
    }
    override public func isInitialized() -> Bool {
     return true
    }
    override public func writeTo(codedOutputStream: CodedOutputStream) throws {
      if hasName {
        try codedOutputStream.writeString(fieldNumber: 1, value:name)
      }
      if hasRequestTypeUrl {
        try codedOutputStream.writeString(fieldNumber: 2, value:requestTypeUrl)
      }
      if hasRequestStreaming {
        try codedOutputStream.writeBool(fieldNumber: 3, value:requestStreaming)
      }
      if hasResponseTypeUrl {
        try codedOutputStream.writeString(fieldNumber: 4, value:responseTypeUrl)
      }
      if hasResponseStreaming {
        try codedOutputStream.writeBool(fieldNumber: 5, value:responseStreaming)
      }
      for oneElementOptions in options {
          try codedOutputStream.writeMessage(fieldNumber: 6, value:oneElementOptions)
      }
      try unknownFields.writeTo(codedOutputStream: codedOutputStream)
    }
    override public func serializedSize() -> Int32 {
      var serialize_size:Int32 = memoizedSerializedSize
      if serialize_size != -1 {
       return serialize_size
      }

      serialize_size = 0
      if hasName {
        serialize_size += name.computeStringSize(fieldNumber: 1)
      }
      if hasRequestTypeUrl {
        serialize_size += requestTypeUrl.computeStringSize(fieldNumber: 2)
      }
      if hasRequestStreaming {
        serialize_size += requestStreaming.computeBoolSize(fieldNumber: 3)
      }
      if hasResponseTypeUrl {
        serialize_size += responseTypeUrl.computeStringSize(fieldNumber: 4)
      }
      if hasResponseStreaming {
        serialize_size += responseStreaming.computeBoolSize(fieldNumber: 5)
      }
      for oneElementOptions in options {
          serialize_size += oneElementOptions.computeMessageSize(fieldNumber: 6)
      }
      serialize_size += unknownFields.serializedSize()
      memoizedSerializedSize = serialize_size
      return serialize_size
    }
    public class func parseArrayDelimitedFrom(inputStream: InputStream) throws -> Array<Google.Protobuf.Method> {
      var mergedArray = Array<Google.Protobuf.Method>()
      while let value = try parseDelimitedFrom(inputStream: inputStream) {
        mergedArray.append(value)
      }
      return mergedArray
    }
    public class func parseDelimitedFrom(inputStream: InputStream) throws -> Google.Protobuf.Method? {
      return try Google.Protobuf.Method.Builder().mergeDelimitedFrom(inputStream: inputStream)?.build()
    }
    public class func parseFrom(data: Data) throws -> Google.Protobuf.Method {
      return try Google.Protobuf.Method.Builder().mergeFrom(data: data, extensionRegistry:Google.Protobuf.ApiRoot.sharedInstance.extensionRegistry).build()
    }
    public class func parseFrom(data: Data, extensionRegistry:ExtensionRegistry) throws -> Google.Protobuf.Method {
      return try Google.Protobuf.Method.Builder().mergeFrom(data: data, extensionRegistry:extensionRegistry).build()
    }
    public class func parseFrom(inputStream: InputStream) throws -> Google.Protobuf.Method {
      return try Google.Protobuf.Method.Builder().mergeFrom(inputStream: inputStream).build()
    }
    public class func parseFrom(inputStream: InputStream, extensionRegistry:ExtensionRegistry) throws -> Google.Protobuf.Method {
      return try Google.Protobuf.Method.Builder().mergeFrom(inputStream: inputStream, extensionRegistry:extensionRegistry).build()
    }
    public class func parseFrom(codedInputStream: CodedInputStream) throws -> Google.Protobuf.Method {
      return try Google.Protobuf.Method.Builder().mergeFrom(codedInputStream: codedInputStream).build()
    }
    public class func parseFrom(codedInputStream: CodedInputStream, extensionRegistry:ExtensionRegistry) throws -> Google.Protobuf.Method {
      return try Google.Protobuf.Method.Builder().mergeFrom(codedInputStream: codedInputStream, extensionRegistry:extensionRegistry).build()
    }
    public class func getBuilder() -> Google.Protobuf.Method.Builder {
      return Google.Protobuf.Method.classBuilder() as! Google.Protobuf.Method.Builder
    }
    public func getBuilder() -> Google.Protobuf.Method.Builder {
      return classBuilder() as! Google.Protobuf.Method.Builder
    }
    override public class func classBuilder() -> MessageBuilder {
      return Google.Protobuf.Method.Builder()
    }
    override public func classBuilder() -> MessageBuilder {
      return Google.Protobuf.Method.Builder()
    }
    public func toBuilder() throws -> Google.Protobuf.Method.Builder {
      return try Google.Protobuf.Method.builderWithPrototype(prototype:self)
    }
    public class func builderWithPrototype(prototype:Google.Protobuf.Method) throws -> Google.Protobuf.Method.Builder {
      return try Google.Protobuf.Method.Builder().mergeFrom(other:prototype)
    }
    override public func encode() throws -> Dictionary<String,AnyObject> {
      guard isInitialized() else {
        throw ProtocolBuffersError.invalidProtocolBuffer("Uninitialized Message")
      }

      var jsonMap:Dictionary<String,AnyObject> = Dictionary<String,AnyObject>()
      if hasName {
        jsonMap["name"] = name
      }
      if hasRequestTypeUrl {
        jsonMap["requestTypeUrl"] = requestTypeUrl
      }
      if hasRequestStreaming {
        jsonMap["requestStreaming"] = requestStreaming
      }
      if hasResponseTypeUrl {
        jsonMap["responseTypeUrl"] = responseTypeUrl
      }
      if hasResponseStreaming {
        jsonMap["responseStreaming"] = responseStreaming
      }
      if !options.isEmpty {
        var jsonArrayOptions:Array<Dictionary<String,AnyObject>> = []
          for oneValueOptions in options {
            let ecodedMessageOptions = try oneValueOptions.encode()
            jsonArrayOptions.append(ecodedMessageOptions)
          }
        jsonMap["options"] = jsonArrayOptions
      }
      return jsonMap
    }
    override class public func decode(jsonMap:Dictionary<String,AnyObject>) throws -> Google.Protobuf.Method {
      return try Google.Protobuf.Method.Builder.decodeToBuilder(jsonMap:jsonMap).build()
    }
    override class public func fromJSON(data:Data) throws -> Google.Protobuf.Method {
      return try Google.Protobuf.Method.Builder.fromJSONToBuilder(data:data).build()
    }
    override public func getDescription(indent:String) throws -> String {
      var output = ""
      if hasName {
        output += "\(indent) name: \(name) \n"
      }
      if hasRequestTypeUrl {
        output += "\(indent) requestTypeUrl: \(requestTypeUrl) \n"
      }
      if hasRequestStreaming {
        output += "\(indent) requestStreaming: \(requestStreaming) \n"
      }
      if hasResponseTypeUrl {
        output += "\(indent) responseTypeUrl: \(responseTypeUrl) \n"
      }
      if hasResponseStreaming {
        output += "\(indent) responseStreaming: \(responseStreaming) \n"
      }
      var optionsElementIndex:Int = 0
      for oneElementOptions in options {
          output += "\(indent) options[\(optionsElementIndex)] {\n"
          output += try oneElementOptions.getDescription(indent: "\(indent)  ")
          output += "\(indent)}\n"
          optionsElementIndex += 1
      }
      output += unknownFields.getDescription(indent: indent)
      return output
    }
    override public var hashValue:Int {
        get {
            var hashCode:Int = 7
            if hasName {
               hashCode = (hashCode &* 31) &+ name.hashValue
            }
            if hasRequestTypeUrl {
               hashCode = (hashCode &* 31) &+ requestTypeUrl.hashValue
            }
            if hasRequestStreaming {
               hashCode = (hashCode &* 31) &+ requestStreaming.hashValue
            }
            if hasResponseTypeUrl {
               hashCode = (hashCode &* 31) &+ responseTypeUrl.hashValue
            }
            if hasResponseStreaming {
               hashCode = (hashCode &* 31) &+ responseStreaming.hashValue
            }
            for oneElementOptions in options {
                hashCode = (hashCode &* 31) &+ oneElementOptions.hashValue
            }
            hashCode = (hashCode &* 31) &+  unknownFields.hashValue
            return hashCode
        }
    }


    //Meta information declaration start

    override public class func className() -> String {
        return "Google.Protobuf.Method"
    }
    override public func className() -> String {
        return "Google.Protobuf.Method"
    }
    override public func classMetaType() -> GeneratedMessage.Type {
        return Google.Protobuf.Method.self
    }
    //Meta information declaration end

    final public class Builder : GeneratedMessageBuilder {
      private var builderResult:Google.Protobuf.Method = Google.Protobuf.Method()
      public func getMessage() -> Google.Protobuf.Method {
          return builderResult
      }

      required override public init () {
         super.init()
      }
      public var hasName:Bool {
           get {
                return builderResult.hasName
           }
      }
      public var name:String {
           get {
                return builderResult.name
           }
           set (value) {
               builderResult.hasName = true
               builderResult.name = value
           }
      }
      public func setName(_ value:String) -> Google.Protobuf.Method.Builder {
        self.name = value
        return self
      }
      public func clearName() -> Google.Protobuf.Method.Builder{
           builderResult.hasName = false
           builderResult.name = ""
           return self
      }
      public var hasRequestTypeUrl:Bool {
           get {
                return builderResult.hasRequestTypeUrl
           }
      }
      public var requestTypeUrl:String {
           get {
                return builderResult.requestTypeUrl
           }
           set (value) {
               builderResult.hasRequestTypeUrl = true
               builderResult.requestTypeUrl = value
           }
      }
      public func setRequestTypeUrl(_ value:String) -> Google.Protobuf.Method.Builder {
        self.requestTypeUrl = value
        return self
      }
      public func clearRequestTypeUrl() -> Google.Protobuf.Method.Builder{
           builderResult.hasRequestTypeUrl = false
           builderResult.requestTypeUrl = ""
           return self
      }
      public var hasRequestStreaming:Bool {
           get {
                return builderResult.hasRequestStreaming
           }
      }
      public var requestStreaming:Bool {
           get {
                return builderResult.requestStreaming
           }
           set (value) {
               builderResult.hasRequestStreaming = true
               builderResult.requestStreaming = value
           }
      }
      public func setRequestStreaming(_ value:Bool) -> Google.Protobuf.Method.Builder {
        self.requestStreaming = value
        return self
      }
      public func clearRequestStreaming() -> Google.Protobuf.Method.Builder{
           builderResult.hasRequestStreaming = false
           builderResult.requestStreaming = false
           return self
      }
      public var hasResponseTypeUrl:Bool {
           get {
                return builderResult.hasResponseTypeUrl
           }
      }
      public var responseTypeUrl:String {
           get {
                return builderResult.responseTypeUrl
           }
           set (value) {
               builderResult.hasResponseTypeUrl = true
               builderResult.responseTypeUrl = value
           }
      }
      public func setResponseTypeUrl(_ value:String) -> Google.Protobuf.Method.Builder {
        self.responseTypeUrl = value
        return self
      }
      public func clearResponseTypeUrl() -> Google.Protobuf.Method.Builder{
           builderResult.hasResponseTypeUrl = false
           builderResult.responseTypeUrl = ""
           return self
      }
      public var hasResponseStreaming:Bool {
           get {
                return builderResult.hasResponseStreaming
           }
      }
      public var responseStreaming:Bool {
           get {
                return builderResult.responseStreaming
           }
           set (value) {
               builderResult.hasResponseStreaming = true
               builderResult.responseStreaming = value
           }
      }
      public func setResponseStreaming(_ value:Bool) -> Google.Protobuf.Method.Builder {
        self.responseStreaming = value
        return self
      }
      public func clearResponseStreaming() -> Google.Protobuf.Method.Builder{
           builderResult.hasResponseStreaming = false
           builderResult.responseStreaming = false
           return self
      }
      public var options:Array<Google.Protobuf.Option> {
           get {
               return builderResult.options
           }
           set (value) {
               builderResult.options = value
           }
      }
      public func setOptions(_ value:Array<Google.Protobuf.Option>) -> Google.Protobuf.Method.Builder {
        self.options = value
        return self
      }
      public func clearOptions() -> Google.Protobuf.Method.Builder {
        builderResult.options.removeAll(keepingCapacity: false)
        return self
      }
      override public var internalGetResult:GeneratedMessage {
           get {
              return builderResult
           }
      }
      override public func clear() -> Google.Protobuf.Method.Builder {
        builderResult = Google.Protobuf.Method()
        return self
      }
      override public func clone() throws -> Google.Protobuf.Method.Builder {
        return try Google.Protobuf.Method.builderWithPrototype(prototype:builderResult)
      }
      override public func build() throws -> Google.Protobuf.Method {
           try checkInitialized()
           return buildPartial()
      }
      public func buildPartial() -> Google.Protobuf.Method {
        let returnMe:Google.Protobuf.Method = builderResult
        return returnMe
      }
      public func mergeFrom(other:Google.Protobuf.Method) throws -> Google.Protobuf.Method.Builder {
        if other == Google.Protobuf.Method() {
         return self
        }
        if other.hasName {
             name = other.name
        }
        if other.hasRequestTypeUrl {
             requestTypeUrl = other.requestTypeUrl
        }
        if other.hasRequestStreaming {
             requestStreaming = other.requestStreaming
        }
        if other.hasResponseTypeUrl {
             responseTypeUrl = other.responseTypeUrl
        }
        if other.hasResponseStreaming {
             responseStreaming = other.responseStreaming
        }
        if !other.options.isEmpty  {
           builderResult.options += other.options
        }
        _ = try merge(unknownField: other.unknownFields)
        return self
      }
      override public func mergeFrom(codedInputStream: CodedInputStream) throws -> Google.Protobuf.Method.Builder {
           return try mergeFrom(codedInputStream: codedInputStream, extensionRegistry:ExtensionRegistry())
      }
      override public func mergeFrom(codedInputStream: CodedInputStream, extensionRegistry:ExtensionRegistry) throws -> Google.Protobuf.Method.Builder {
        let unknownFieldsBuilder:UnknownFieldSet.Builder = try UnknownFieldSet.builderWithUnknownFields(copyFrom:self.unknownFields)
        while (true) {
          let protobufTag = try codedInputStream.readTag()
          switch protobufTag {
          case 0: 
            self.unknownFields = try unknownFieldsBuilder.build()
            return self

          case 10:
            name = try codedInputStream.readString()

          case 18:
            requestTypeUrl = try codedInputStream.readString()

          case 24:
            requestStreaming = try codedInputStream.readBool()

          case 34:
            responseTypeUrl = try codedInputStream.readString()

          case 40:
            responseStreaming = try codedInputStream.readBool()

          case 50:
            let subBuilder = Google.Protobuf.Option.Builder()
            try codedInputStream.readMessage(builder: subBuilder,extensionRegistry:extensionRegistry)
            options.append(subBuilder.buildPartial())

          default:
            if (!(try parse(codedInputStream:codedInputStream, unknownFields:unknownFieldsBuilder, extensionRegistry:extensionRegistry, tag:protobufTag))) {
               unknownFields = try unknownFieldsBuilder.build()
               return self
            }
          }
        }
      }
      override class public func decodeToBuilder(jsonMap:Dictionary<String,AnyObject>) throws -> Google.Protobuf.Method.Builder {
        let resultDecodedBuilder = Google.Protobuf.Method.Builder()
        if let jsonValueName = jsonMap["name"] as? String {
          resultDecodedBuilder.name = jsonValueName
        }
        if let jsonValueRequestTypeUrl = jsonMap["requestTypeUrl"] as? String {
          resultDecodedBuilder.requestTypeUrl = jsonValueRequestTypeUrl
        }
        if let jsonValueRequestStreaming = jsonMap["requestStreaming"] as? Bool {
          resultDecodedBuilder.requestStreaming = jsonValueRequestStreaming
        }
        if let jsonValueResponseTypeUrl = jsonMap["responseTypeUrl"] as? String {
          resultDecodedBuilder.responseTypeUrl = jsonValueResponseTypeUrl
        }
        if let jsonValueResponseStreaming = jsonMap["responseStreaming"] as? Bool {
          resultDecodedBuilder.responseStreaming = jsonValueResponseStreaming
        }
        if let jsonValueOptions = jsonMap["options"] as? Array<Dictionary<String,AnyObject>> {
          var jsonArrayOptions:Array<Google.Protobuf.Option> = []
          for oneValueOptions in jsonValueOptions {
            let messageFromStringOptions = try Google.Protobuf.Option.Builder.decodeToBuilder(jsonMap:oneValueOptions).build()

            jsonArrayOptions.append(messageFromStringOptions)
          }
          resultDecodedBuilder.options = jsonArrayOptions
        }
        return resultDecodedBuilder
      }
      override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.Method.Builder {
        let jsonData = try JSONSerialization.jsonObject(with:data, options: JSONSerialization.ReadingOptions(rawValue: 0))
        guard let jsDataCast = jsonData as? Dictionary<String,AnyObject> else {
          throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data")
        }
        return try Google.Protobuf.Method.Builder.decodeToBuilder(jsonMap:jsDataCast)
      }
    }

  }

}

// @@protoc_insertion_point(global_scope)
