#[non_exhaustive]pub struct Route {
pub id: &'static str,
pub service: &'static str,
pub method: Method,
pub path: &'static str,
pub pattern: &'static str,
pub account_scoped: bool,
pub resource_type: &'static str,
pub params: &'static [RouteParam],
pub idempotent: bool,
pub readonly: bool,
pub pagination: Pagination,
pub retry: Option<Retry>,
}Expand description
One API operation: its method, its path template and the behaviour the Smithy model
attaches to it. Every route the SDK knows lives in crate::routes.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: &'static strThe OpenAPI operation id: ListBoards.
service: &'static strThe service handle whose method sends this route: Boards, AccessTokens.
method: MethodThe HTTP method.
path: &'static strThe path as Fizzy serves it, {param} placeholders included.
pattern: &'static strThe path without a .json suffix, for recognizing pasted URLs.
account_scoped: boolThe path starts with /{accountId}, which Route::fill takes first.
resource_type: &'static strThe kind of record the route acts on, snake_cased: board, card.
params: &'static [RouteParam]The path parameters after the account, in order.
idempotent: boolSafe to resend.
readonly: boolThe route only reads; nothing it does changes anything.
pagination: PaginationHow a list continues past its first page.
retry: Option<Retry>The retry budget, or None for a route that is sent once and never resent.
Implementations§
Source§impl Route
impl Route
Sourcepub fn fill(&self, account_id: Option<&str>, values: &[&dyn Display]) -> String
pub fn fill(&self, account_id: Option<&str>, values: &[&dyn Display]) -> String
Substitutes the path parameters, in order, percent-encoding each value. An account-scoped route takes the account first.
§Panics
When values is not exactly as long as Route::params (plus one for the account
on an account-scoped route). A short list would leave a {param} in the path and
send it to Fizzy as written, which is worse than stopping; every generated caller
passes the right count, so reaching this means the call was built by hand and built
wrong.
Sourcepub fn try_fill(
&self,
account_id: Option<&str>,
values: &[&dyn Display],
) -> Result<String, Error>
pub fn try_fill( &self, account_id: Option<&str>, values: &[&dyn Display], ) -> Result<String, Error>
Route::fill as a Result: a wrong parameter count, a missing account or a value
that is not one path segment is a usage error rather than a panic, for a caller
building the operation by hand.