//
// DO NOT EDIT.
//
// Generated by the protocol buffer compiler.
// Source: github.com/TheThingsNetwork/api/discovery/discovery.proto
//

//
// Copyright 2018, gRPC Authors All rights reserved.
//
// 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.
//
import Dispatch
import Foundation
import SwiftGRPC
import SwiftProtobuf

internal protocol Discovery_DiscoveryAnnounceCall: ClientCallUnary {}

fileprivate final class Discovery_DiscoveryAnnounceCallBase: ClientCallUnaryBase<Discovery_Announcement, SwiftProtobuf.Google_Protobuf_Empty>, Discovery_DiscoveryAnnounceCall {
  override class var method: String { return "/discovery.Discovery/Announce" }
}

internal protocol Discovery_DiscoveryGetAllCall: ClientCallUnary {}

fileprivate final class Discovery_DiscoveryGetAllCallBase: ClientCallUnaryBase<Discovery_GetServiceRequest, Discovery_AnnouncementsResponse>, Discovery_DiscoveryGetAllCall {
  override class var method: String { return "/discovery.Discovery/GetAll" }
}

internal protocol Discovery_DiscoveryGetCall: ClientCallUnary {}

fileprivate final class Discovery_DiscoveryGetCallBase: ClientCallUnaryBase<Discovery_GetRequest, Discovery_Announcement>, Discovery_DiscoveryGetCall {
  override class var method: String { return "/discovery.Discovery/Get" }
}

internal protocol Discovery_DiscoveryAddMetadataCall: ClientCallUnary {}

fileprivate final class Discovery_DiscoveryAddMetadataCallBase: ClientCallUnaryBase<Discovery_MetadataRequest, SwiftProtobuf.Google_Protobuf_Empty>, Discovery_DiscoveryAddMetadataCall {
  override class var method: String { return "/discovery.Discovery/AddMetadata" }
}

internal protocol Discovery_DiscoveryDeleteMetadataCall: ClientCallUnary {}

fileprivate final class Discovery_DiscoveryDeleteMetadataCallBase: ClientCallUnaryBase<Discovery_MetadataRequest, SwiftProtobuf.Google_Protobuf_Empty>, Discovery_DiscoveryDeleteMetadataCall {
  override class var method: String { return "/discovery.Discovery/DeleteMetadata" }
}

internal protocol Discovery_DiscoveryGetByAppIDCall: ClientCallUnary {}

fileprivate final class Discovery_DiscoveryGetByAppIDCallBase: ClientCallUnaryBase<Discovery_GetByAppIDRequest, Discovery_Announcement>, Discovery_DiscoveryGetByAppIDCall {
  override class var method: String { return "/discovery.Discovery/GetByAppID" }
}

internal protocol Discovery_DiscoveryGetByGatewayIDCall: ClientCallUnary {}

fileprivate final class Discovery_DiscoveryGetByGatewayIDCallBase: ClientCallUnaryBase<Discovery_GetByGatewayIDRequest, Discovery_Announcement>, Discovery_DiscoveryGetByGatewayIDCall {
  override class var method: String { return "/discovery.Discovery/GetByGatewayID" }
}

internal protocol Discovery_DiscoveryGetByAppEUICall: ClientCallUnary {}

fileprivate final class Discovery_DiscoveryGetByAppEUICallBase: ClientCallUnaryBase<Discovery_GetByAppEUIRequest, Discovery_Announcement>, Discovery_DiscoveryGetByAppEUICall {
  override class var method: String { return "/discovery.Discovery/GetByAppEUI" }
}


/// Instantiate Discovery_DiscoveryServiceClient, then call methods of this protocol to make API calls.
internal protocol Discovery_DiscoveryService: ServiceClient {
  /// Synchronous. Unary.
  func announce(_ request: Discovery_Announcement, metadata customMetadata: Metadata) throws -> SwiftProtobuf.Google_Protobuf_Empty
  /// Asynchronous. Unary.
  @discardableResult
  func announce(_ request: Discovery_Announcement, metadata customMetadata: Metadata, completion: @escaping (SwiftProtobuf.Google_Protobuf_Empty?, CallResult) -> Void) throws -> Discovery_DiscoveryAnnounceCall

  /// Synchronous. Unary.
  func getAll(_ request: Discovery_GetServiceRequest, metadata customMetadata: Metadata) throws -> Discovery_AnnouncementsResponse
  /// Asynchronous. Unary.
  @discardableResult
  func getAll(_ request: Discovery_GetServiceRequest, metadata customMetadata: Metadata, completion: @escaping (Discovery_AnnouncementsResponse?, CallResult) -> Void) throws -> Discovery_DiscoveryGetAllCall

  /// Synchronous. Unary.
  func get(_ request: Discovery_GetRequest, metadata customMetadata: Metadata) throws -> Discovery_Announcement
  /// Asynchronous. Unary.
  @discardableResult
  func get(_ request: Discovery_GetRequest, metadata customMetadata: Metadata, completion: @escaping (Discovery_Announcement?, CallResult) -> Void) throws -> Discovery_DiscoveryGetCall

  /// Synchronous. Unary.
  func addMetadata(_ request: Discovery_MetadataRequest, metadata customMetadata: Metadata) throws -> SwiftProtobuf.Google_Protobuf_Empty
  /// Asynchronous. Unary.
  @discardableResult
  func addMetadata(_ request: Discovery_MetadataRequest, metadata customMetadata: Metadata, completion: @escaping (SwiftProtobuf.Google_Protobuf_Empty?, CallResult) -> Void) throws -> Discovery_DiscoveryAddMetadataCall

  /// Synchronous. Unary.
  func deleteMetadata(_ request: Discovery_MetadataRequest, metadata customMetadata: Metadata) throws -> SwiftProtobuf.Google_Protobuf_Empty
  /// Asynchronous. Unary.
  @discardableResult
  func deleteMetadata(_ request: Discovery_MetadataRequest, metadata customMetadata: Metadata, completion: @escaping (SwiftProtobuf.Google_Protobuf_Empty?, CallResult) -> Void) throws -> Discovery_DiscoveryDeleteMetadataCall

  /// Synchronous. Unary.
  func getByAppID(_ request: Discovery_GetByAppIDRequest, metadata customMetadata: Metadata) throws -> Discovery_Announcement
  /// Asynchronous. Unary.
  @discardableResult
  func getByAppID(_ request: Discovery_GetByAppIDRequest, metadata customMetadata: Metadata, completion: @escaping (Discovery_Announcement?, CallResult) -> Void) throws -> Discovery_DiscoveryGetByAppIDCall

  /// Synchronous. Unary.
  func getByGatewayID(_ request: Discovery_GetByGatewayIDRequest, metadata customMetadata: Metadata) throws -> Discovery_Announcement
  /// Asynchronous. Unary.
  @discardableResult
  func getByGatewayID(_ request: Discovery_GetByGatewayIDRequest, metadata customMetadata: Metadata, completion: @escaping (Discovery_Announcement?, CallResult) -> Void) throws -> Discovery_DiscoveryGetByGatewayIDCall

  /// Synchronous. Unary.
  func getByAppEUI(_ request: Discovery_GetByAppEUIRequest, metadata customMetadata: Metadata) throws -> Discovery_Announcement
  /// Asynchronous. Unary.
  @discardableResult
  func getByAppEUI(_ request: Discovery_GetByAppEUIRequest, metadata customMetadata: Metadata, completion: @escaping (Discovery_Announcement?, CallResult) -> Void) throws -> Discovery_DiscoveryGetByAppEUICall

}

internal extension Discovery_DiscoveryService {
  /// Synchronous. Unary.
  func announce(_ request: Discovery_Announcement) throws -> SwiftProtobuf.Google_Protobuf_Empty {
    return try self.announce(request, metadata: self.metadata)
  }
  /// Asynchronous. Unary.
  @discardableResult
  func announce(_ request: Discovery_Announcement, completion: @escaping (SwiftProtobuf.Google_Protobuf_Empty?, CallResult) -> Void) throws -> Discovery_DiscoveryAnnounceCall {
    return try self.announce(request, metadata: self.metadata, completion: completion)
  }

  /// Synchronous. Unary.
  func getAll(_ request: Discovery_GetServiceRequest) throws -> Discovery_AnnouncementsResponse {
    return try self.getAll(request, metadata: self.metadata)
  }
  /// Asynchronous. Unary.
  @discardableResult
  func getAll(_ request: Discovery_GetServiceRequest, completion: @escaping (Discovery_AnnouncementsResponse?, CallResult) -> Void) throws -> Discovery_DiscoveryGetAllCall {
    return try self.getAll(request, metadata: self.metadata, completion: completion)
  }

  /// Synchronous. Unary.
  func get(_ request: Discovery_GetRequest) throws -> Discovery_Announcement {
    return try self.get(request, metadata: self.metadata)
  }
  /// Asynchronous. Unary.
  @discardableResult
  func get(_ request: Discovery_GetRequest, completion: @escaping (Discovery_Announcement?, CallResult) -> Void) throws -> Discovery_DiscoveryGetCall {
    return try self.get(request, metadata: self.metadata, completion: completion)
  }

  /// Synchronous. Unary.
  func addMetadata(_ request: Discovery_MetadataRequest) throws -> SwiftProtobuf.Google_Protobuf_Empty {
    return try self.addMetadata(request, metadata: self.metadata)
  }
  /// Asynchronous. Unary.
  @discardableResult
  func addMetadata(_ request: Discovery_MetadataRequest, completion: @escaping (SwiftProtobuf.Google_Protobuf_Empty?, CallResult) -> Void) throws -> Discovery_DiscoveryAddMetadataCall {
    return try self.addMetadata(request, metadata: self.metadata, completion: completion)
  }

  /// Synchronous. Unary.
  func deleteMetadata(_ request: Discovery_MetadataRequest) throws -> SwiftProtobuf.Google_Protobuf_Empty {
    return try self.deleteMetadata(request, metadata: self.metadata)
  }
  /// Asynchronous. Unary.
  @discardableResult
  func deleteMetadata(_ request: Discovery_MetadataRequest, completion: @escaping (SwiftProtobuf.Google_Protobuf_Empty?, CallResult) -> Void) throws -> Discovery_DiscoveryDeleteMetadataCall {
    return try self.deleteMetadata(request, metadata: self.metadata, completion: completion)
  }

  /// Synchronous. Unary.
  func getByAppID(_ request: Discovery_GetByAppIDRequest) throws -> Discovery_Announcement {
    return try self.getByAppID(request, metadata: self.metadata)
  }
  /// Asynchronous. Unary.
  @discardableResult
  func getByAppID(_ request: Discovery_GetByAppIDRequest, completion: @escaping (Discovery_Announcement?, CallResult) -> Void) throws -> Discovery_DiscoveryGetByAppIDCall {
    return try self.getByAppID(request, metadata: self.metadata, completion: completion)
  }

  /// Synchronous. Unary.
  func getByGatewayID(_ request: Discovery_GetByGatewayIDRequest) throws -> Discovery_Announcement {
    return try self.getByGatewayID(request, metadata: self.metadata)
  }
  /// Asynchronous. Unary.
  @discardableResult
  func getByGatewayID(_ request: Discovery_GetByGatewayIDRequest, completion: @escaping (Discovery_Announcement?, CallResult) -> Void) throws -> Discovery_DiscoveryGetByGatewayIDCall {
    return try self.getByGatewayID(request, metadata: self.metadata, completion: completion)
  }

  /// Synchronous. Unary.
  func getByAppEUI(_ request: Discovery_GetByAppEUIRequest) throws -> Discovery_Announcement {
    return try self.getByAppEUI(request, metadata: self.metadata)
  }
  /// Asynchronous. Unary.
  @discardableResult
  func getByAppEUI(_ request: Discovery_GetByAppEUIRequest, completion: @escaping (Discovery_Announcement?, CallResult) -> Void) throws -> Discovery_DiscoveryGetByAppEUICall {
    return try self.getByAppEUI(request, metadata: self.metadata, completion: completion)
  }

}

internal final class Discovery_DiscoveryServiceClient: ServiceClientBase, Discovery_DiscoveryService {
  /// Synchronous. Unary.
  internal func announce(_ request: Discovery_Announcement, metadata customMetadata: Metadata) throws -> SwiftProtobuf.Google_Protobuf_Empty {
    return try Discovery_DiscoveryAnnounceCallBase(channel)
      .run(request: request, metadata: customMetadata)
  }
  /// Asynchronous. Unary.
  @discardableResult
  internal func announce(_ request: Discovery_Announcement, metadata customMetadata: Metadata, completion: @escaping (SwiftProtobuf.Google_Protobuf_Empty?, CallResult) -> Void) throws -> Discovery_DiscoveryAnnounceCall {
    return try Discovery_DiscoveryAnnounceCallBase(channel)
      .start(request: request, metadata: customMetadata, completion: completion)
  }

  /// Synchronous. Unary.
  internal func getAll(_ request: Discovery_GetServiceRequest, metadata customMetadata: Metadata) throws -> Discovery_AnnouncementsResponse {
    return try Discovery_DiscoveryGetAllCallBase(channel)
      .run(request: request, metadata: customMetadata)
  }
  /// Asynchronous. Unary.
  @discardableResult
  internal func getAll(_ request: Discovery_GetServiceRequest, metadata customMetadata: Metadata, completion: @escaping (Discovery_AnnouncementsResponse?, CallResult) -> Void) throws -> Discovery_DiscoveryGetAllCall {
    return try Discovery_DiscoveryGetAllCallBase(channel)
      .start(request: request, metadata: customMetadata, completion: completion)
  }

  /// Synchronous. Unary.
  internal func get(_ request: Discovery_GetRequest, metadata customMetadata: Metadata) throws -> Discovery_Announcement {
    return try Discovery_DiscoveryGetCallBase(channel)
      .run(request: request, metadata: customMetadata)
  }
  /// Asynchronous. Unary.
  @discardableResult
  internal func get(_ request: Discovery_GetRequest, metadata customMetadata: Metadata, completion: @escaping (Discovery_Announcement?, CallResult) -> Void) throws -> Discovery_DiscoveryGetCall {
    return try Discovery_DiscoveryGetCallBase(channel)
      .start(request: request, metadata: customMetadata, completion: completion)
  }

  /// Synchronous. Unary.
  internal func addMetadata(_ request: Discovery_MetadataRequest, metadata customMetadata: Metadata) throws -> SwiftProtobuf.Google_Protobuf_Empty {
    return try Discovery_DiscoveryAddMetadataCallBase(channel)
      .run(request: request, metadata: customMetadata)
  }
  /// Asynchronous. Unary.
  @discardableResult
  internal func addMetadata(_ request: Discovery_MetadataRequest, metadata customMetadata: Metadata, completion: @escaping (SwiftProtobuf.Google_Protobuf_Empty?, CallResult) -> Void) throws -> Discovery_DiscoveryAddMetadataCall {
    return try Discovery_DiscoveryAddMetadataCallBase(channel)
      .start(request: request, metadata: customMetadata, completion: completion)
  }

  /// Synchronous. Unary.
  internal func deleteMetadata(_ request: Discovery_MetadataRequest, metadata customMetadata: Metadata) throws -> SwiftProtobuf.Google_Protobuf_Empty {
    return try Discovery_DiscoveryDeleteMetadataCallBase(channel)
      .run(request: request, metadata: customMetadata)
  }
  /// Asynchronous. Unary.
  @discardableResult
  internal func deleteMetadata(_ request: Discovery_MetadataRequest, metadata customMetadata: Metadata, completion: @escaping (SwiftProtobuf.Google_Protobuf_Empty?, CallResult) -> Void) throws -> Discovery_DiscoveryDeleteMetadataCall {
    return try Discovery_DiscoveryDeleteMetadataCallBase(channel)
      .start(request: request, metadata: customMetadata, completion: completion)
  }

  /// Synchronous. Unary.
  internal func getByAppID(_ request: Discovery_GetByAppIDRequest, metadata customMetadata: Metadata) throws -> Discovery_Announcement {
    return try Discovery_DiscoveryGetByAppIDCallBase(channel)
      .run(request: request, metadata: customMetadata)
  }
  /// Asynchronous. Unary.
  @discardableResult
  internal func getByAppID(_ request: Discovery_GetByAppIDRequest, metadata customMetadata: Metadata, completion: @escaping (Discovery_Announcement?, CallResult) -> Void) throws -> Discovery_DiscoveryGetByAppIDCall {
    return try Discovery_DiscoveryGetByAppIDCallBase(channel)
      .start(request: request, metadata: customMetadata, completion: completion)
  }

  /// Synchronous. Unary.
  internal func getByGatewayID(_ request: Discovery_GetByGatewayIDRequest, metadata customMetadata: Metadata) throws -> Discovery_Announcement {
    return try Discovery_DiscoveryGetByGatewayIDCallBase(channel)
      .run(request: request, metadata: customMetadata)
  }
  /// Asynchronous. Unary.
  @discardableResult
  internal func getByGatewayID(_ request: Discovery_GetByGatewayIDRequest, metadata customMetadata: Metadata, completion: @escaping (Discovery_Announcement?, CallResult) -> Void) throws -> Discovery_DiscoveryGetByGatewayIDCall {
    return try Discovery_DiscoveryGetByGatewayIDCallBase(channel)
      .start(request: request, metadata: customMetadata, completion: completion)
  }

  /// Synchronous. Unary.
  internal func getByAppEUI(_ request: Discovery_GetByAppEUIRequest, metadata customMetadata: Metadata) throws -> Discovery_Announcement {
    return try Discovery_DiscoveryGetByAppEUICallBase(channel)
      .run(request: request, metadata: customMetadata)
  }
  /// Asynchronous. Unary.
  @discardableResult
  internal func getByAppEUI(_ request: Discovery_GetByAppEUIRequest, metadata customMetadata: Metadata, completion: @escaping (Discovery_Announcement?, CallResult) -> Void) throws -> Discovery_DiscoveryGetByAppEUICall {
    return try Discovery_DiscoveryGetByAppEUICallBase(channel)
      .start(request: request, metadata: customMetadata, completion: completion)
  }

}

/// Instantiate Discovery_DiscoveryManagerServiceClient, then call methods of this protocol to make API calls.
internal protocol Discovery_DiscoveryManagerService: ServiceClient {
}

internal extension Discovery_DiscoveryManagerService {
}

internal final class Discovery_DiscoveryManagerServiceClient: ServiceClientBase, Discovery_DiscoveryManagerService {
}

/// To build a server, implement a class that conforms to this protocol.
/// If one of the methods returning `ServerStatus?` returns nil,
/// it is expected that you have already returned a status to the client by means of `session.close`.
internal protocol Discovery_DiscoveryProvider: ServiceProvider {
  func announce(request: Discovery_Announcement, session: Discovery_DiscoveryAnnounceSession) throws -> SwiftProtobuf.Google_Protobuf_Empty
  func getAll(request: Discovery_GetServiceRequest, session: Discovery_DiscoveryGetAllSession) throws -> Discovery_AnnouncementsResponse
  func get(request: Discovery_GetRequest, session: Discovery_DiscoveryGetSession) throws -> Discovery_Announcement
  func addMetadata(request: Discovery_MetadataRequest, session: Discovery_DiscoveryAddMetadataSession) throws -> SwiftProtobuf.Google_Protobuf_Empty
  func deleteMetadata(request: Discovery_MetadataRequest, session: Discovery_DiscoveryDeleteMetadataSession) throws -> SwiftProtobuf.Google_Protobuf_Empty
  func getByAppID(request: Discovery_GetByAppIDRequest, session: Discovery_DiscoveryGetByAppIDSession) throws -> Discovery_Announcement
  func getByGatewayID(request: Discovery_GetByGatewayIDRequest, session: Discovery_DiscoveryGetByGatewayIDSession) throws -> Discovery_Announcement
  func getByAppEUI(request: Discovery_GetByAppEUIRequest, session: Discovery_DiscoveryGetByAppEUISession) throws -> Discovery_Announcement
}

extension Discovery_DiscoveryProvider {
  internal var serviceName: String { return "discovery.Discovery" }

  /// Determines and calls the appropriate request handler, depending on the request's method.
  /// Throws `HandleMethodError.unknownMethod` for methods not handled by this service.
  internal func handleMethod(_ method: String, handler: Handler) throws -> ServerStatus? {
    switch method {
    case "/discovery.Discovery/Announce":
      return try Discovery_DiscoveryAnnounceSessionBase(
        handler: handler,
        providerBlock: { try self.announce(request: $0, session: $1 as! Discovery_DiscoveryAnnounceSessionBase) })
          .run()
    case "/discovery.Discovery/GetAll":
      return try Discovery_DiscoveryGetAllSessionBase(
        handler: handler,
        providerBlock: { try self.getAll(request: $0, session: $1 as! Discovery_DiscoveryGetAllSessionBase) })
          .run()
    case "/discovery.Discovery/Get":
      return try Discovery_DiscoveryGetSessionBase(
        handler: handler,
        providerBlock: { try self.get(request: $0, session: $1 as! Discovery_DiscoveryGetSessionBase) })
          .run()
    case "/discovery.Discovery/AddMetadata":
      return try Discovery_DiscoveryAddMetadataSessionBase(
        handler: handler,
        providerBlock: { try self.addMetadata(request: $0, session: $1 as! Discovery_DiscoveryAddMetadataSessionBase) })
          .run()
    case "/discovery.Discovery/DeleteMetadata":
      return try Discovery_DiscoveryDeleteMetadataSessionBase(
        handler: handler,
        providerBlock: { try self.deleteMetadata(request: $0, session: $1 as! Discovery_DiscoveryDeleteMetadataSessionBase) })
          .run()
    case "/discovery.Discovery/GetByAppID":
      return try Discovery_DiscoveryGetByAppIDSessionBase(
        handler: handler,
        providerBlock: { try self.getByAppID(request: $0, session: $1 as! Discovery_DiscoveryGetByAppIDSessionBase) })
          .run()
    case "/discovery.Discovery/GetByGatewayID":
      return try Discovery_DiscoveryGetByGatewayIDSessionBase(
        handler: handler,
        providerBlock: { try self.getByGatewayID(request: $0, session: $1 as! Discovery_DiscoveryGetByGatewayIDSessionBase) })
          .run()
    case "/discovery.Discovery/GetByAppEUI":
      return try Discovery_DiscoveryGetByAppEUISessionBase(
        handler: handler,
        providerBlock: { try self.getByAppEUI(request: $0, session: $1 as! Discovery_DiscoveryGetByAppEUISessionBase) })
          .run()
    default:
      throw HandleMethodError.unknownMethod
    }
  }
}

internal protocol Discovery_DiscoveryAnnounceSession: ServerSessionUnary {}

fileprivate final class Discovery_DiscoveryAnnounceSessionBase: ServerSessionUnaryBase<Discovery_Announcement, SwiftProtobuf.Google_Protobuf_Empty>, Discovery_DiscoveryAnnounceSession {}

internal protocol Discovery_DiscoveryGetAllSession: ServerSessionUnary {}

fileprivate final class Discovery_DiscoveryGetAllSessionBase: ServerSessionUnaryBase<Discovery_GetServiceRequest, Discovery_AnnouncementsResponse>, Discovery_DiscoveryGetAllSession {}

internal protocol Discovery_DiscoveryGetSession: ServerSessionUnary {}

fileprivate final class Discovery_DiscoveryGetSessionBase: ServerSessionUnaryBase<Discovery_GetRequest, Discovery_Announcement>, Discovery_DiscoveryGetSession {}

internal protocol Discovery_DiscoveryAddMetadataSession: ServerSessionUnary {}

fileprivate final class Discovery_DiscoveryAddMetadataSessionBase: ServerSessionUnaryBase<Discovery_MetadataRequest, SwiftProtobuf.Google_Protobuf_Empty>, Discovery_DiscoveryAddMetadataSession {}

internal protocol Discovery_DiscoveryDeleteMetadataSession: ServerSessionUnary {}

fileprivate final class Discovery_DiscoveryDeleteMetadataSessionBase: ServerSessionUnaryBase<Discovery_MetadataRequest, SwiftProtobuf.Google_Protobuf_Empty>, Discovery_DiscoveryDeleteMetadataSession {}

internal protocol Discovery_DiscoveryGetByAppIDSession: ServerSessionUnary {}

fileprivate final class Discovery_DiscoveryGetByAppIDSessionBase: ServerSessionUnaryBase<Discovery_GetByAppIDRequest, Discovery_Announcement>, Discovery_DiscoveryGetByAppIDSession {}

internal protocol Discovery_DiscoveryGetByGatewayIDSession: ServerSessionUnary {}

fileprivate final class Discovery_DiscoveryGetByGatewayIDSessionBase: ServerSessionUnaryBase<Discovery_GetByGatewayIDRequest, Discovery_Announcement>, Discovery_DiscoveryGetByGatewayIDSession {}

internal protocol Discovery_DiscoveryGetByAppEUISession: ServerSessionUnary {}

fileprivate final class Discovery_DiscoveryGetByAppEUISessionBase: ServerSessionUnaryBase<Discovery_GetByAppEUIRequest, Discovery_Announcement>, Discovery_DiscoveryGetByAppEUISession {}

/// To build a server, implement a class that conforms to this protocol.
/// If one of the methods returning `ServerStatus?` returns nil,
/// it is expected that you have already returned a status to the client by means of `session.close`.
internal protocol Discovery_DiscoveryManagerProvider: ServiceProvider {
}

extension Discovery_DiscoveryManagerProvider {
  internal var serviceName: String { return "discovery.DiscoveryManager" }

  /// Determines and calls the appropriate request handler, depending on the request's method.
  /// Throws `HandleMethodError.unknownMethod` for methods not handled by this service.
  internal func handleMethod(_ method: String, handler: Handler) throws -> ServerStatus? {
    switch method {
    default:
      throw HandleMethodError.unknownMethod
    }
  }
}

