pub enum ApiCommands {
Get {
endpoint: String,
query: Vec<(String, String)>,
header: Vec<(String, String)>,
out_file: Option<PathBuf>,
verbose: bool,
},
Post {
endpoint: String,
data: Option<String>,
data_file: Option<PathBuf>,
query: Vec<(String, String)>,
header: Vec<(String, String)>,
out_file: Option<PathBuf>,
verbose: bool,
},
Put {
endpoint: String,
data: Option<String>,
data_file: Option<PathBuf>,
query: Vec<(String, String)>,
header: Vec<(String, String)>,
out_file: Option<PathBuf>,
verbose: bool,
},
Patch {
endpoint: String,
data: Option<String>,
data_file: Option<PathBuf>,
query: Vec<(String, String)>,
header: Vec<(String, String)>,
out_file: Option<PathBuf>,
verbose: bool,
},
Delete {
endpoint: String,
query: Vec<(String, String)>,
header: Vec<(String, String)>,
verbose: bool,
},
}Expand description
Custom API call commands
Variants§
Get
Execute HTTP GET request
Fields
Post
Execute HTTP POST request
Fields
Put
Execute HTTP PUT request
Fields
Patch
Execute HTTP PATCH request
Fields
Delete
Execute HTTP DELETE request
Implementations§
Source§impl ApiCommands
impl ApiCommands
Sourcepub async fn execute(
self,
config: &Config,
auth_client: &AuthClient,
http_config: &HttpClientConfig,
output_format: OutputFormat,
) -> Result<()>
pub async fn execute( self, config: &Config, auth_client: &AuthClient, http_config: &HttpClientConfig, output_format: OutputFormat, ) -> Result<()>
Execute the API command
Trait Implementations§
Source§impl Debug for ApiCommands
impl Debug for ApiCommands
Source§impl FromArgMatches for ApiCommands
impl FromArgMatches for ApiCommands
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>
Assign values from
ArgMatches to self.Source§fn update_from_arg_matches_mut<'b>(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches to self.Source§impl Subcommand for ApiCommands
impl Subcommand for ApiCommands
Source§fn augment_subcommands<'b>(__clap_app: Command) -> Command
fn augment_subcommands<'b>(__clap_app: Command) -> Command
Source§fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
Append to
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§fn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Test whether
Self can parse a specific subcommandAuto Trait Implementations§
impl Freeze for ApiCommands
impl RefUnwindSafe for ApiCommands
impl Send for ApiCommands
impl Sync for ApiCommands
impl Unpin for ApiCommands
impl UnsafeUnpin for ApiCommands
impl UnwindSafe for ApiCommands
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more