// DO NOT EDIT.
// swift-format-ignore-file
//
// Generated by the Swift generator plugin for the protocol buffer compiler.
// Source: gimbal.proto
//
// For information on using the generated types, please see the documentation:
//   https://github.com/apple/swift-protobuf/

import Foundation
import SwiftProtobuf

// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
// incompatible with the version of SwiftProtobuf to which you are linking.
// Please ensure that you are building against the same version of the API
// that was used to generate this file.
fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
  struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
  typealias Version = _2
}

/// Gimbal mode type.
enum Mavsdk_Rpc_Gimbal_GimbalMode: SwiftProtobuf.Enum {
  typealias RawValue = Int

  /// Yaw follow will point the gimbal to the vehicle heading
  case yawFollow // = 0

  /// Yaw lock will fix the gimbal poiting to an absolute direction
  case yawLock // = 1
  case UNRECOGNIZED(Int)

  init() {
    self = .yawFollow
  }

  init?(rawValue: Int) {
    switch rawValue {
    case 0: self = .yawFollow
    case 1: self = .yawLock
    default: self = .UNRECOGNIZED(rawValue)
    }
  }

  var rawValue: Int {
    switch self {
    case .yawFollow: return 0
    case .yawLock: return 1
    case .UNRECOGNIZED(let i): return i
    }
  }

}

#if swift(>=4.2)

extension Mavsdk_Rpc_Gimbal_GimbalMode: CaseIterable {
  // The compiler won't synthesize support with the UNRECOGNIZED case.
  static var allCases: [Mavsdk_Rpc_Gimbal_GimbalMode] = [
    .yawFollow,
    .yawLock,
  ]
}

#endif  // swift(>=4.2)

struct Mavsdk_Rpc_Gimbal_SetPitchAndYawRequest {
  // SwiftProtobuf.Message conformance is added in an extension below. See the
  // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  // methods supported on all messages.

  /// Pitch angle in degrees (negative points down)
  var pitchDeg: Float = 0

  /// Yaw angle in degrees (positive is clock-wise, range: -180 to 180 or 0 to 360)
  var yawDeg: Float = 0

  var unknownFields = SwiftProtobuf.UnknownStorage()

  init() {}
}

struct Mavsdk_Rpc_Gimbal_SetPitchAndYawResponse {
  // SwiftProtobuf.Message conformance is added in an extension below. See the
  // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  // methods supported on all messages.

  var gimbalResult: Mavsdk_Rpc_Gimbal_GimbalResult {
    get {return _gimbalResult ?? Mavsdk_Rpc_Gimbal_GimbalResult()}
    set {_gimbalResult = newValue}
  }
  /// Returns true if `gimbalResult` has been explicitly set.
  var hasGimbalResult: Bool {return self._gimbalResult != nil}
  /// Clears the value of `gimbalResult`. Subsequent reads from it will return its default value.
  mutating func clearGimbalResult() {self._gimbalResult = nil}

  var unknownFields = SwiftProtobuf.UnknownStorage()

  init() {}

  fileprivate var _gimbalResult: Mavsdk_Rpc_Gimbal_GimbalResult? = nil
}

struct Mavsdk_Rpc_Gimbal_SetModeRequest {
  // SwiftProtobuf.Message conformance is added in an extension below. See the
  // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  // methods supported on all messages.

  /// The mode to be set.
  var gimbalMode: Mavsdk_Rpc_Gimbal_GimbalMode = .yawFollow

  var unknownFields = SwiftProtobuf.UnknownStorage()

  init() {}
}

struct Mavsdk_Rpc_Gimbal_SetModeResponse {
  // SwiftProtobuf.Message conformance is added in an extension below. See the
  // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  // methods supported on all messages.

  var gimbalResult: Mavsdk_Rpc_Gimbal_GimbalResult {
    get {return _gimbalResult ?? Mavsdk_Rpc_Gimbal_GimbalResult()}
    set {_gimbalResult = newValue}
  }
  /// Returns true if `gimbalResult` has been explicitly set.
  var hasGimbalResult: Bool {return self._gimbalResult != nil}
  /// Clears the value of `gimbalResult`. Subsequent reads from it will return its default value.
  mutating func clearGimbalResult() {self._gimbalResult = nil}

  var unknownFields = SwiftProtobuf.UnknownStorage()

  init() {}

  fileprivate var _gimbalResult: Mavsdk_Rpc_Gimbal_GimbalResult? = nil
}

struct Mavsdk_Rpc_Gimbal_SetRoiLocationRequest {
  // SwiftProtobuf.Message conformance is added in an extension below. See the
  // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  // methods supported on all messages.

  /// Latitude in degrees
  var latitudeDeg: Double = 0

  /// Longitude in degrees
  var longitudeDeg: Double = 0

  /// Altitude in metres (AMSL)
  var altitudeM: Float = 0

  var unknownFields = SwiftProtobuf.UnknownStorage()

  init() {}
}

struct Mavsdk_Rpc_Gimbal_SetRoiLocationResponse {
  // SwiftProtobuf.Message conformance is added in an extension below. See the
  // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  // methods supported on all messages.

  var gimbalResult: Mavsdk_Rpc_Gimbal_GimbalResult {
    get {return _gimbalResult ?? Mavsdk_Rpc_Gimbal_GimbalResult()}
    set {_gimbalResult = newValue}
  }
  /// Returns true if `gimbalResult` has been explicitly set.
  var hasGimbalResult: Bool {return self._gimbalResult != nil}
  /// Clears the value of `gimbalResult`. Subsequent reads from it will return its default value.
  mutating func clearGimbalResult() {self._gimbalResult = nil}

  var unknownFields = SwiftProtobuf.UnknownStorage()

  init() {}

  fileprivate var _gimbalResult: Mavsdk_Rpc_Gimbal_GimbalResult? = nil
}

/// Result type.
struct Mavsdk_Rpc_Gimbal_GimbalResult {
  // SwiftProtobuf.Message conformance is added in an extension below. See the
  // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  // methods supported on all messages.

  /// Result enum value
  var result: Mavsdk_Rpc_Gimbal_GimbalResult.Result = .unknown

  /// Human-readable English string describing the result
  var resultStr: String = String()

  var unknownFields = SwiftProtobuf.UnknownStorage()

  /// Possible results returned for gimbal commands.
  enum Result: SwiftProtobuf.Enum {
    typealias RawValue = Int

    /// Unknown result
    case unknown // = 0

    /// Command was accepted
    case success // = 1

    /// Error occurred sending the command
    case error // = 2

    /// Command timed out
    case timeout // = 3

    /// Functionality not supported
    case unsupported // = 4
    case UNRECOGNIZED(Int)

    init() {
      self = .unknown
    }

    init?(rawValue: Int) {
      switch rawValue {
      case 0: self = .unknown
      case 1: self = .success
      case 2: self = .error
      case 3: self = .timeout
      case 4: self = .unsupported
      default: self = .UNRECOGNIZED(rawValue)
      }
    }

    var rawValue: Int {
      switch self {
      case .unknown: return 0
      case .success: return 1
      case .error: return 2
      case .timeout: return 3
      case .unsupported: return 4
      case .UNRECOGNIZED(let i): return i
      }
    }

  }

  init() {}
}

#if swift(>=4.2)

extension Mavsdk_Rpc_Gimbal_GimbalResult.Result: CaseIterable {
  // The compiler won't synthesize support with the UNRECOGNIZED case.
  static var allCases: [Mavsdk_Rpc_Gimbal_GimbalResult.Result] = [
    .unknown,
    .success,
    .error,
    .timeout,
    .unsupported,
  ]
}

#endif  // swift(>=4.2)

// MARK: - Code below here is support for the SwiftProtobuf runtime.

fileprivate let _protobuf_package = "mavsdk.rpc.gimbal"

extension Mavsdk_Rpc_Gimbal_GimbalMode: SwiftProtobuf._ProtoNameProviding {
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    0: .same(proto: "GIMBAL_MODE_YAW_FOLLOW"),
    1: .same(proto: "GIMBAL_MODE_YAW_LOCK"),
  ]
}

extension Mavsdk_Rpc_Gimbal_SetPitchAndYawRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = _protobuf_package + ".SetPitchAndYawRequest"
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "pitch_deg"),
    2: .standard(proto: "yaw_deg"),
  ]

  mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let fieldNumber = try decoder.nextFieldNumber() {
      switch fieldNumber {
      case 1: try decoder.decodeSingularFloatField(value: &self.pitchDeg)
      case 2: try decoder.decodeSingularFloatField(value: &self.yawDeg)
      default: break
      }
    }
  }

  func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if self.pitchDeg != 0 {
      try visitor.visitSingularFloatField(value: self.pitchDeg, fieldNumber: 1)
    }
    if self.yawDeg != 0 {
      try visitor.visitSingularFloatField(value: self.yawDeg, fieldNumber: 2)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  static func ==(lhs: Mavsdk_Rpc_Gimbal_SetPitchAndYawRequest, rhs: Mavsdk_Rpc_Gimbal_SetPitchAndYawRequest) -> Bool {
    if lhs.pitchDeg != rhs.pitchDeg {return false}
    if lhs.yawDeg != rhs.yawDeg {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension Mavsdk_Rpc_Gimbal_SetPitchAndYawResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = _protobuf_package + ".SetPitchAndYawResponse"
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "gimbal_result"),
  ]

  mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let fieldNumber = try decoder.nextFieldNumber() {
      switch fieldNumber {
      case 1: try decoder.decodeSingularMessageField(value: &self._gimbalResult)
      default: break
      }
    }
  }

  func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if let v = self._gimbalResult {
      try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  static func ==(lhs: Mavsdk_Rpc_Gimbal_SetPitchAndYawResponse, rhs: Mavsdk_Rpc_Gimbal_SetPitchAndYawResponse) -> Bool {
    if lhs._gimbalResult != rhs._gimbalResult {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension Mavsdk_Rpc_Gimbal_SetModeRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = _protobuf_package + ".SetModeRequest"
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "gimbal_mode"),
  ]

  mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let fieldNumber = try decoder.nextFieldNumber() {
      switch fieldNumber {
      case 1: try decoder.decodeSingularEnumField(value: &self.gimbalMode)
      default: break
      }
    }
  }

  func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if self.gimbalMode != .yawFollow {
      try visitor.visitSingularEnumField(value: self.gimbalMode, fieldNumber: 1)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  static func ==(lhs: Mavsdk_Rpc_Gimbal_SetModeRequest, rhs: Mavsdk_Rpc_Gimbal_SetModeRequest) -> Bool {
    if lhs.gimbalMode != rhs.gimbalMode {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension Mavsdk_Rpc_Gimbal_SetModeResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = _protobuf_package + ".SetModeResponse"
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "gimbal_result"),
  ]

  mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let fieldNumber = try decoder.nextFieldNumber() {
      switch fieldNumber {
      case 1: try decoder.decodeSingularMessageField(value: &self._gimbalResult)
      default: break
      }
    }
  }

  func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if let v = self._gimbalResult {
      try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  static func ==(lhs: Mavsdk_Rpc_Gimbal_SetModeResponse, rhs: Mavsdk_Rpc_Gimbal_SetModeResponse) -> Bool {
    if lhs._gimbalResult != rhs._gimbalResult {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension Mavsdk_Rpc_Gimbal_SetRoiLocationRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = _protobuf_package + ".SetRoiLocationRequest"
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "latitude_deg"),
    2: .standard(proto: "longitude_deg"),
    3: .standard(proto: "altitude_m"),
  ]

  mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let fieldNumber = try decoder.nextFieldNumber() {
      switch fieldNumber {
      case 1: try decoder.decodeSingularDoubleField(value: &self.latitudeDeg)
      case 2: try decoder.decodeSingularDoubleField(value: &self.longitudeDeg)
      case 3: try decoder.decodeSingularFloatField(value: &self.altitudeM)
      default: break
      }
    }
  }

  func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if self.latitudeDeg != 0 {
      try visitor.visitSingularDoubleField(value: self.latitudeDeg, fieldNumber: 1)
    }
    if self.longitudeDeg != 0 {
      try visitor.visitSingularDoubleField(value: self.longitudeDeg, fieldNumber: 2)
    }
    if self.altitudeM != 0 {
      try visitor.visitSingularFloatField(value: self.altitudeM, fieldNumber: 3)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  static func ==(lhs: Mavsdk_Rpc_Gimbal_SetRoiLocationRequest, rhs: Mavsdk_Rpc_Gimbal_SetRoiLocationRequest) -> Bool {
    if lhs.latitudeDeg != rhs.latitudeDeg {return false}
    if lhs.longitudeDeg != rhs.longitudeDeg {return false}
    if lhs.altitudeM != rhs.altitudeM {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension Mavsdk_Rpc_Gimbal_SetRoiLocationResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = _protobuf_package + ".SetRoiLocationResponse"
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "gimbal_result"),
  ]

  mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let fieldNumber = try decoder.nextFieldNumber() {
      switch fieldNumber {
      case 1: try decoder.decodeSingularMessageField(value: &self._gimbalResult)
      default: break
      }
    }
  }

  func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if let v = self._gimbalResult {
      try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  static func ==(lhs: Mavsdk_Rpc_Gimbal_SetRoiLocationResponse, rhs: Mavsdk_Rpc_Gimbal_SetRoiLocationResponse) -> Bool {
    if lhs._gimbalResult != rhs._gimbalResult {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension Mavsdk_Rpc_Gimbal_GimbalResult: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = _protobuf_package + ".GimbalResult"
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .same(proto: "result"),
    2: .standard(proto: "result_str"),
  ]

  mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let fieldNumber = try decoder.nextFieldNumber() {
      switch fieldNumber {
      case 1: try decoder.decodeSingularEnumField(value: &self.result)
      case 2: try decoder.decodeSingularStringField(value: &self.resultStr)
      default: break
      }
    }
  }

  func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if self.result != .unknown {
      try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1)
    }
    if !self.resultStr.isEmpty {
      try visitor.visitSingularStringField(value: self.resultStr, fieldNumber: 2)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  static func ==(lhs: Mavsdk_Rpc_Gimbal_GimbalResult, rhs: Mavsdk_Rpc_Gimbal_GimbalResult) -> Bool {
    if lhs.result != rhs.result {return false}
    if lhs.resultStr != rhs.resultStr {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension Mavsdk_Rpc_Gimbal_GimbalResult.Result: SwiftProtobuf._ProtoNameProviding {
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    0: .same(proto: "RESULT_UNKNOWN"),
    1: .same(proto: "RESULT_SUCCESS"),
    2: .same(proto: "RESULT_ERROR"),
    3: .same(proto: "RESULT_TIMEOUT"),
    4: .same(proto: "RESULT_UNSUPPORTED"),
  ]
}
