// DO NOT EDIT.
//
// Generated by the Swift generator plugin for the protocol buffer compiler.
// Source: syft_proto/execution/v1/role.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
}

struct SyftProto_Execution_V1_Role {
  // 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 id: SyftProto_Types_Syft_V1_Id {
    get {return _id ?? SyftProto_Types_Syft_V1_Id()}
    set {_id = newValue}
  }
  /// Returns true if `id` has been explicitly set.
  var hasID: Bool {return self._id != nil}
  /// Clears the value of `id`. Subsequent reads from it will return its default value.
  mutating func clearID() {self._id = nil}

  var actions: [SyftProto_Execution_V1_ComputationAction] = []

  var state: SyftProto_Execution_V1_State {
    get {return _state ?? SyftProto_Execution_V1_State()}
    set {_state = newValue}
  }
  /// Returns true if `state` has been explicitly set.
  var hasState: Bool {return self._state != nil}
  /// Clears the value of `state`. Subsequent reads from it will return its default value.
  mutating func clearState() {self._state = nil}

  var placeholders: [SyftProto_Execution_V1_Placeholder] = []

  var inputPlaceholderIds: [SyftProto_Types_Syft_V1_Id] = []

  var outputPlaceholderIds: [SyftProto_Types_Syft_V1_Id] = []

  var tags: [String] = []

  var description_p: String = String()

  var unknownFields = SwiftProtobuf.UnknownStorage()

  init() {}

  fileprivate var _id: SyftProto_Types_Syft_V1_Id? = nil
  fileprivate var _state: SyftProto_Execution_V1_State? = nil
}

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

fileprivate let _protobuf_package = "syft_proto.execution.v1"

extension SyftProto_Execution_V1_Role: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = _protobuf_package + ".Role"
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .same(proto: "id"),
    2: .same(proto: "actions"),
    3: .same(proto: "state"),
    4: .same(proto: "placeholders"),
    5: .standard(proto: "input_placeholder_ids"),
    6: .standard(proto: "output_placeholder_ids"),
    7: .same(proto: "tags"),
    8: .same(proto: "description"),
  ]

  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._id)
      case 2: try decoder.decodeRepeatedMessageField(value: &self.actions)
      case 3: try decoder.decodeSingularMessageField(value: &self._state)
      case 4: try decoder.decodeRepeatedMessageField(value: &self.placeholders)
      case 5: try decoder.decodeRepeatedMessageField(value: &self.inputPlaceholderIds)
      case 6: try decoder.decodeRepeatedMessageField(value: &self.outputPlaceholderIds)
      case 7: try decoder.decodeRepeatedStringField(value: &self.tags)
      case 8: try decoder.decodeSingularStringField(value: &self.description_p)
      default: break
      }
    }
  }

  func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if let v = self._id {
      try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
    }
    if !self.actions.isEmpty {
      try visitor.visitRepeatedMessageField(value: self.actions, fieldNumber: 2)
    }
    if let v = self._state {
      try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
    }
    if !self.placeholders.isEmpty {
      try visitor.visitRepeatedMessageField(value: self.placeholders, fieldNumber: 4)
    }
    if !self.inputPlaceholderIds.isEmpty {
      try visitor.visitRepeatedMessageField(value: self.inputPlaceholderIds, fieldNumber: 5)
    }
    if !self.outputPlaceholderIds.isEmpty {
      try visitor.visitRepeatedMessageField(value: self.outputPlaceholderIds, fieldNumber: 6)
    }
    if !self.tags.isEmpty {
      try visitor.visitRepeatedStringField(value: self.tags, fieldNumber: 7)
    }
    if !self.description_p.isEmpty {
      try visitor.visitSingularStringField(value: self.description_p, fieldNumber: 8)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  static func ==(lhs: SyftProto_Execution_V1_Role, rhs: SyftProto_Execution_V1_Role) -> Bool {
    if lhs._id != rhs._id {return false}
    if lhs.actions != rhs.actions {return false}
    if lhs._state != rhs._state {return false}
    if lhs.placeholders != rhs.placeholders {return false}
    if lhs.inputPlaceholderIds != rhs.inputPlaceholderIds {return false}
    if lhs.outputPlaceholderIds != rhs.outputPlaceholderIds {return false}
    if lhs.tags != rhs.tags {return false}
    if lhs.description_p != rhs.description_p {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}
