// automatically generated by the FlatBuffers compiler, do not modify
// @generated
extern crate alloc;


#[allow(unused_imports, dead_code)]
pub mod nexus {

#[allow(unused_imports, dead_code)]
pub mod wal {


pub enum WebhookRecordV1Offset {}
#[derive(Copy, Clone, PartialEq)]

pub struct WebhookRecordV1<'a> {
  pub _tab: ::flatbuffers::Table<'a>,
}

impl<'a> ::flatbuffers::Follow<'a> for WebhookRecordV1<'a> {
  type Inner = WebhookRecordV1<'a>;
  #[inline]
  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
    Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
  }
}

impl<'a> WebhookRecordV1<'a> {
  pub const VT_SEQ: ::flatbuffers::VOffsetT = 4;
  pub const VT_OP: ::flatbuffers::VOffsetT = 6;
  pub const VT_BUCKET: ::flatbuffers::VOffsetT = 8;
  pub const VT_RULE_ID: ::flatbuffers::VOffsetT = 10;
  pub const VT_RULE_JSON: ::flatbuffers::VOffsetT = 12;
  pub const VT_TS_UNIX_MS: ::flatbuffers::VOffsetT = 14;

  #[inline]
  pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
    WebhookRecordV1 { _tab: table }
  }
  #[allow(unused_mut)]
  pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
    _fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
    args: &'args WebhookRecordV1Args<'args>
  ) -> ::flatbuffers::WIPOffset<WebhookRecordV1<'bldr>> {
    let mut builder = WebhookRecordV1Builder::new(_fbb);
    builder.add_ts_unix_ms(args.ts_unix_ms);
    builder.add_seq(args.seq);
    if let Some(x) = args.rule_json { builder.add_rule_json(x); }
    if let Some(x) = args.rule_id { builder.add_rule_id(x); }
    if let Some(x) = args.bucket { builder.add_bucket(x); }
    if let Some(x) = args.op { builder.add_op(x); }
    builder.finish()
  }


  #[inline]
  pub fn seq(&self) -> u64 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<u64>(WebhookRecordV1::VT_SEQ, Some(0)).unwrap()}
  }
  #[inline]
  pub fn op(&self) -> Option<&'a str> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(WebhookRecordV1::VT_OP, None)}
  }
  #[inline]
  pub fn bucket(&self) -> Option<&'a str> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(WebhookRecordV1::VT_BUCKET, None)}
  }
  #[inline]
  pub fn rule_id(&self) -> Option<&'a str> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(WebhookRecordV1::VT_RULE_ID, None)}
  }
  #[inline]
  pub fn rule_json(&self) -> Option<&'a str> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(WebhookRecordV1::VT_RULE_JSON, None)}
  }
  #[inline]
  pub fn ts_unix_ms(&self) -> u64 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<u64>(WebhookRecordV1::VT_TS_UNIX_MS, Some(0)).unwrap()}
  }
}

impl ::flatbuffers::Verifiable for WebhookRecordV1<'_> {
  #[inline]
  fn run_verifier(
    v: &mut ::flatbuffers::Verifier, pos: usize
  ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
    v.visit_table(pos)?
     .visit_field::<u64>("seq", Self::VT_SEQ, false)?
     .visit_field::<::flatbuffers::ForwardsUOffset<&str>>("op", Self::VT_OP, false)?
     .visit_field::<::flatbuffers::ForwardsUOffset<&str>>("bucket", Self::VT_BUCKET, false)?
     .visit_field::<::flatbuffers::ForwardsUOffset<&str>>("rule_id", Self::VT_RULE_ID, false)?
     .visit_field::<::flatbuffers::ForwardsUOffset<&str>>("rule_json", Self::VT_RULE_JSON, false)?
     .visit_field::<u64>("ts_unix_ms", Self::VT_TS_UNIX_MS, false)?
     .finish();
    Ok(())
  }
}
pub struct WebhookRecordV1Args<'a> {
    pub seq: u64,
    pub op: Option<::flatbuffers::WIPOffset<&'a str>>,
    pub bucket: Option<::flatbuffers::WIPOffset<&'a str>>,
    pub rule_id: Option<::flatbuffers::WIPOffset<&'a str>>,
    pub rule_json: Option<::flatbuffers::WIPOffset<&'a str>>,
    pub ts_unix_ms: u64,
}
impl<'a> Default for WebhookRecordV1Args<'a> {
  #[inline]
  fn default() -> Self {
    WebhookRecordV1Args {
      seq: 0,
      op: None,
      bucket: None,
      rule_id: None,
      rule_json: None,
      ts_unix_ms: 0,
    }
  }
}

pub struct WebhookRecordV1Builder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
  fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
  start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
}
impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> WebhookRecordV1Builder<'a, 'b, A> {
  #[inline]
  pub fn add_seq(&mut self, seq: u64) {
    self.fbb_.push_slot::<u64>(WebhookRecordV1::VT_SEQ, seq, 0);
  }
  #[inline]
  pub fn add_op(&mut self, op: ::flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(WebhookRecordV1::VT_OP, op);
  }
  #[inline]
  pub fn add_bucket(&mut self, bucket: ::flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(WebhookRecordV1::VT_BUCKET, bucket);
  }
  #[inline]
  pub fn add_rule_id(&mut self, rule_id: ::flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(WebhookRecordV1::VT_RULE_ID, rule_id);
  }
  #[inline]
  pub fn add_rule_json(&mut self, rule_json: ::flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(WebhookRecordV1::VT_RULE_JSON, rule_json);
  }
  #[inline]
  pub fn add_ts_unix_ms(&mut self, ts_unix_ms: u64) {
    self.fbb_.push_slot::<u64>(WebhookRecordV1::VT_TS_UNIX_MS, ts_unix_ms, 0);
  }
  #[inline]
  pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> WebhookRecordV1Builder<'a, 'b, A> {
    let start = _fbb.start_table();
    WebhookRecordV1Builder {
      fbb_: _fbb,
      start_: start,
    }
  }
  #[inline]
  pub fn finish(self) -> ::flatbuffers::WIPOffset<WebhookRecordV1<'a>> {
    let o = self.fbb_.end_table(self.start_);
    ::flatbuffers::WIPOffset::new(o.value())
  }
}

impl ::core::fmt::Debug for WebhookRecordV1<'_> {
  fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
    let mut ds = f.debug_struct("WebhookRecordV1");
      ds.field("seq", &self.seq());
      ds.field("op", &self.op());
      ds.field("bucket", &self.bucket());
      ds.field("rule_id", &self.rule_id());
      ds.field("rule_json", &self.rule_json());
      ds.field("ts_unix_ms", &self.ts_unix_ms());
      ds.finish()
  }
}
#[inline]
/// Verifies that a buffer of bytes contains a `WebhookRecordV1`
/// and returns it.
/// Note that verification is still experimental and may not
/// catch every error, or be maximally performant. For the
/// previous, unchecked, behavior use
/// `root_as_webhook_record_v1_unchecked`.
pub fn root_as_webhook_record_v1(buf: &[u8]) -> Result<WebhookRecordV1<'_>, ::flatbuffers::InvalidFlatbuffer> {
  ::flatbuffers::root::<WebhookRecordV1>(buf)
}
#[inline]
/// Verifies that a buffer of bytes contains a size prefixed
/// `WebhookRecordV1` and returns it.
/// Note that verification is still experimental and may not
/// catch every error, or be maximally performant. For the
/// previous, unchecked, behavior use
/// `size_prefixed_root_as_webhook_record_v1_unchecked`.
pub fn size_prefixed_root_as_webhook_record_v1(buf: &[u8]) -> Result<WebhookRecordV1<'_>, ::flatbuffers::InvalidFlatbuffer> {
  ::flatbuffers::size_prefixed_root::<WebhookRecordV1>(buf)
}
#[inline]
/// Verifies, with the given options, that a buffer of bytes
/// contains a `WebhookRecordV1` and returns it.
/// Note that verification is still experimental and may not
/// catch every error, or be maximally performant. For the
/// previous, unchecked, behavior use
/// `root_as_webhook_record_v1_unchecked`.
pub fn root_as_webhook_record_v1_with_opts<'b, 'o>(
  opts: &'o ::flatbuffers::VerifierOptions,
  buf: &'b [u8],
) -> Result<WebhookRecordV1<'b>, ::flatbuffers::InvalidFlatbuffer> {
  ::flatbuffers::root_with_opts::<WebhookRecordV1<'b>>(opts, buf)
}
#[inline]
/// Verifies, with the given verifier options, that a buffer of
/// bytes contains a size prefixed `WebhookRecordV1` and returns
/// it. Note that verification is still experimental and may not
/// catch every error, or be maximally performant. For the
/// previous, unchecked, behavior use
/// `root_as_webhook_record_v1_unchecked`.
pub fn size_prefixed_root_as_webhook_record_v1_with_opts<'b, 'o>(
  opts: &'o ::flatbuffers::VerifierOptions,
  buf: &'b [u8],
) -> Result<WebhookRecordV1<'b>, ::flatbuffers::InvalidFlatbuffer> {
  ::flatbuffers::size_prefixed_root_with_opts::<WebhookRecordV1<'b>>(opts, buf)
}
#[inline]
/// Assumes, without verification, that a buffer of bytes contains a WebhookRecordV1 and returns it.
/// # Safety
/// Callers must trust the given bytes do indeed contain a valid `WebhookRecordV1`.
pub unsafe fn root_as_webhook_record_v1_unchecked(buf: &[u8]) -> WebhookRecordV1<'_> {
  unsafe { ::flatbuffers::root_unchecked::<WebhookRecordV1>(buf) }
}
#[inline]
/// Assumes, without verification, that a buffer of bytes contains a size prefixed WebhookRecordV1 and returns it.
/// # Safety
/// Callers must trust the given bytes do indeed contain a valid size prefixed `WebhookRecordV1`.
pub unsafe fn size_prefixed_root_as_webhook_record_v1_unchecked(buf: &[u8]) -> WebhookRecordV1<'_> {
  unsafe { ::flatbuffers::size_prefixed_root_unchecked::<WebhookRecordV1>(buf) }
}
#[inline]
pub fn finish_webhook_record_v1_buffer<'a, 'b, A: ::flatbuffers::Allocator + 'a>(
    fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
    root: ::flatbuffers::WIPOffset<WebhookRecordV1<'a>>) {
  fbb.finish(root, None);
}

#[inline]
pub fn finish_size_prefixed_webhook_record_v1_buffer<'a, 'b, A: ::flatbuffers::Allocator + 'a>(fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>, root: ::flatbuffers::WIPOffset<WebhookRecordV1<'a>>) {
  fbb.finish_size_prefixed(root, None);
}
}  // pub mod wal
}  // pub mod nexus

