pub struct GmailCommand {
pub account: Option<String>,
pub command: GmailSubcommands,
}Expand description
Gmail: read Gmail messages, threads, and labels (and, with gmail.modify, mutate labels).
Fields§
§account: Option<String>Selects a named Gmail account configured in
~/.omni-dev/settings.json (AWS-CLI style, mirrors the top-level
--profile) for this invocation.
Orthogonal to --profile: switching the Gmail account never changes
which profile is active, and vice versa (see
ADR-0066). Overrides
OMNI_DEV_GMAIL_ACCOUNT. Scoped to the gmail subtree — unlike
--profile/--instance it is not usable before the gmail
subcommand name, only after it (gmail --account NAME <cmd> or
gmail <cmd> --account NAME), so it can’t collide with an unrelated
subcommand’s own --account flag elsewhere in the CLI (e.g.
snowflake query --account).
command: GmailSubcommandsThe Gmail subcommand to execute.
Implementations§
Source§impl GmailCommand
impl GmailCommand
Sourcepub async fn execute(self) -> Result<()>
pub async fn execute(self) -> Result<()>
Executes the Gmail command.
auth manages credentials and must run without them; account
manages which named account is selected and must equally run
without a resolved client (import-legacy’s whole point is working
in a pre-migration state). sync-all also runs without the shared
client: it resolves one client per configured account itself
(helpers::create_client_for, never the env var below, which is
unsafe across its concurrent tasks — ADR-0068). extract-attachments
also runs without a client — it never contacts Gmail at all, only
the local archive under --archive-dir, so --account has no
meaning for it either (#1510). Every other subcommand needs an
authenticated client, which is resolved once here and threaded
down so each leaf takes &GmailClient and stays free of process
env. render also runs without a client — like
extract-attachments, it only ever reads .eml files already on
disk (#1513).
Trait Implementations§
Source§impl Args for GmailCommand
impl Args for GmailCommand
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl CommandFactory for GmailCommand
impl CommandFactory for GmailCommand
Source§impl FromArgMatches for GmailCommand
impl FromArgMatches for GmailCommand
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.