pub fn with_description<I: IntoIterator<Item = Flow>, S: Into<String>>(
        flows: I,
        description: S,
    ) -> Self {
        Self {
            flows: HashMap::from_iter(
                flows
                    .into_iter()
                    .map(|auth_flow| (String::from(auth_flow.get_type_as_str()), auth_flow)),
            ),
            description: Some(description.into()),
        }
    }
/// Construct a new OAuth2 flow with optional description supporting markdown syntax.
///
/// # Examples
///
/// Create new OAuth2 flow with multiple authentication flows with description.
/// ```rust
/// # use std::collections::HashMap;
/// # use utoipa::openapi::security::{OAuth2, Flow, Password, AuthorizationCode, Scopes};
/// OAuth2::with_description([Flow::Password(
///     Password::with_refresh_url(
///         "https://localhost/oauth/token",
///         Scopes::from_iter([
///             ("edit:items", "edit my items"),
///             ("read:items", "read my items")
///         ]),
///         "https://localhost/refresh/token"
///     )),
///     Flow::AuthorizationCode(
///         AuthorizationCode::new(
///         "https://localhost/authorization/token",
///         "https://localhost/token/url",
///         Scopes::from_iter([
///             ("edit:items", "edit my items"),
///             ("read:items", "read my items")
///         ])
///      ),
///    ),
/// ], "my oauth2 flow");
/// ```
Construct a new OAuth2 flow with optional description supporting markdown syntax.
Construct a new OAuth2 flow with optional description supporting markdown syntax .
pub fn with_description<I: IntoIterator<Item = Flow>, S: Into<String>>(
        flows: I,
        description: S,
    ) -> Self {
        Self {
            flows: HashMap::from_iter(
                flows
                    .into_iter()
                    .map(|auth_flow| (String::from(auth_flow.get_type_as_str()), auth_flow)),
            ),
            description: Some(description.into()),
        }
    }
pub fn with_description < I : IntoIterator < Item = Flow > , S : Into < String > > ( flows : I , description : S , ) -> Self { Self { flows : HashMap :: from_iter ( flows . into_iter ( ) . map ( | auth_flow | ( String :: from ( auth_flow . get_type_as_str ( ) ) , auth_flow ) ) , ) , description : Some ( description . into ( ) ) , } }
Construct a new OAuth2 flow with optional description supporting markdown syntax.
Construct a new OAuth2 flow with optional description supporting markdown syntax .
flows
I
description
S
examples
Create new OAuth2 flow with multiple authentication flows with description.
Create new OAuth2 flow with multiple authentication flows with description .
use std::collections::hashmap;
None
use utoipa::openapi::security::{oauth2, flow, password, authorizationcode, scopes};
None