pub struct ParameterBuilder<S: State = Empty> { /* private fields */ }
Expand description
Use builder syntax to set the inputs and finish with build()
.
Implementations§
Source§impl<S: State> ParameterBuilder<S>
impl<S: State> ParameterBuilder<S>
Sourcepub fn build(self) -> Parameterwhere
S: IsComplete,
pub fn build(self) -> Parameterwhere
S: IsComplete,
Finish building and return the requested object
Sourcepub fn name(self, value: impl Into<String>) -> ParameterBuilder<SetName<S>>where
S::Name: IsUnset,
pub fn name(self, value: impl Into<String>) -> ParameterBuilder<SetName<S>>where
S::Name: IsUnset,
Required.
Name of the parameter.
- For
ParameterIn::Path
this must in accordance to path templating. - For
ParameterIn::Query
Content-Type
orAuthorization
value will be ignored.
Sourcepub fn parameter_in(
self,
value: impl Into<ParameterIn>,
) -> ParameterBuilder<SetParameterIn<S>>where
S::ParameterIn: IsUnset,
pub fn parameter_in(
self,
value: impl Into<ParameterIn>,
) -> ParameterBuilder<SetParameterIn<S>>where
S::ParameterIn: IsUnset,
Required.
Parameter location.
Sourcepub fn description(
self,
value: impl Into<String>,
) -> ParameterBuilder<SetDescription<S>>where
S::Description: IsUnset,
pub fn description(
self,
value: impl Into<String>,
) -> ParameterBuilder<SetDescription<S>>where
S::Description: IsUnset,
Sourcepub fn maybe_description(
self,
value: Option<impl Into<String>>,
) -> ParameterBuilder<SetDescription<S>>where
S::Description: IsUnset,
pub fn maybe_description(
self,
value: Option<impl Into<String>>,
) -> ParameterBuilder<SetDescription<S>>where
S::Description: IsUnset,
Sourcepub fn required(
self,
value: impl Into<bool>,
) -> ParameterBuilder<SetRequired<S>>where
S::Required: IsUnset,
pub fn required(
self,
value: impl Into<bool>,
) -> ParameterBuilder<SetRequired<S>>where
S::Required: IsUnset,
Required.
Declares whether the parameter is required or not for api.
- For
ParameterIn::Path
this must and will betrue
.
Sourcepub fn deprecated(
self,
value: impl Into<Deprecated>,
) -> ParameterBuilder<SetDeprecated<S>>where
S::Deprecated: IsUnset,
pub fn deprecated(
self,
value: impl Into<Deprecated>,
) -> ParameterBuilder<SetDeprecated<S>>where
S::Deprecated: IsUnset,
Sourcepub fn maybe_deprecated(
self,
value: Option<impl Into<Deprecated>>,
) -> ParameterBuilder<SetDeprecated<S>>where
S::Deprecated: IsUnset,
pub fn maybe_deprecated(
self,
value: Option<impl Into<Deprecated>>,
) -> ParameterBuilder<SetDeprecated<S>>where
S::Deprecated: IsUnset,
Sourcepub fn schema(self, value: impl Into<Schema>) -> ParameterBuilder<SetSchema<S>>where
S::Schema: IsUnset,
pub fn schema(self, value: impl Into<Schema>) -> ParameterBuilder<SetSchema<S>>where
S::Schema: IsUnset,
Optional (Some / Option setters).
Schema of the parameter. Typically Schema::Object
is used.
Sourcepub fn maybe_schema(
self,
value: Option<impl Into<Schema>>,
) -> ParameterBuilder<SetSchema<S>>where
S::Schema: IsUnset,
pub fn maybe_schema(
self,
value: Option<impl Into<Schema>>,
) -> ParameterBuilder<SetSchema<S>>where
S::Schema: IsUnset,
Optional (Some / Option setters).
Schema of the parameter. Typically Schema::Object
is used.
Sourcepub fn style(
self,
value: impl Into<ParameterStyle>,
) -> ParameterBuilder<SetStyle<S>>where
S::Style: IsUnset,
pub fn style(
self,
value: impl Into<ParameterStyle>,
) -> ParameterBuilder<SetStyle<S>>where
S::Style: IsUnset,
Optional (Some / Option setters).
Describes how Parameter
is being serialized depending on Parameter::schema
(type of a content).
Default value is based on ParameterIn
.
Sourcepub fn maybe_style(
self,
value: Option<impl Into<ParameterStyle>>,
) -> ParameterBuilder<SetStyle<S>>where
S::Style: IsUnset,
pub fn maybe_style(
self,
value: Option<impl Into<ParameterStyle>>,
) -> ParameterBuilder<SetStyle<S>>where
S::Style: IsUnset,
Optional (Some / Option setters).
Describes how Parameter
is being serialized depending on Parameter::schema
(type of a content).
Default value is based on ParameterIn
.
Sourcepub fn explode(self, value: impl Into<bool>) -> ParameterBuilder<SetExplode<S>>where
S::Explode: IsUnset,
pub fn explode(self, value: impl Into<bool>) -> ParameterBuilder<SetExplode<S>>where
S::Explode: IsUnset,
Optional (Some / Option setters).
When true
it will generate separate parameter value for each parameter with array
and object
type.
This is also true
by default for ParameterStyle::Form
.
With explode false
:
color=blue,black,brown
With explode true
:
color=blue&color=black&color=brown
Sourcepub fn maybe_explode(
self,
value: Option<impl Into<bool>>,
) -> ParameterBuilder<SetExplode<S>>where
S::Explode: IsUnset,
pub fn maybe_explode(
self,
value: Option<impl Into<bool>>,
) -> ParameterBuilder<SetExplode<S>>where
S::Explode: IsUnset,
Optional (Some / Option setters).
When true
it will generate separate parameter value for each parameter with array
and object
type.
This is also true
by default for ParameterStyle::Form
.
With explode false
:
color=blue,black,brown
With explode true
:
color=blue&color=black&color=brown
Sourcepub fn allow_reserved(
self,
value: impl Into<bool>,
) -> ParameterBuilder<SetAllowReserved<S>>where
S::AllowReserved: IsUnset,
pub fn allow_reserved(
self,
value: impl Into<bool>,
) -> ParameterBuilder<SetAllowReserved<S>>where
S::AllowReserved: IsUnset,
Optional (Some / Option setters).
Defines whether parameter should allow reserved characters defined by
RFC3986 :/?#[]@!$&'()*+,;=
.
This is only applicable with ParameterIn::Query
. Default value is false
.
Sourcepub fn maybe_allow_reserved(
self,
value: Option<impl Into<bool>>,
) -> ParameterBuilder<SetAllowReserved<S>>where
S::AllowReserved: IsUnset,
pub fn maybe_allow_reserved(
self,
value: Option<impl Into<bool>>,
) -> ParameterBuilder<SetAllowReserved<S>>where
S::AllowReserved: IsUnset,
Optional (Some / Option setters).
Defines whether parameter should allow reserved characters defined by
RFC3986 :/?#[]@!$&'()*+,;=
.
This is only applicable with ParameterIn::Query
. Default value is false
.
Sourcepub fn example(self, value: impl Into<Value>) -> ParameterBuilder<SetExample<S>>where
S::Example: IsUnset,
pub fn example(self, value: impl Into<Value>) -> ParameterBuilder<SetExample<S>>where
S::Example: IsUnset,
Optional (Some / Option setters).
Example of Parameter
’s potential value. This examples will override example
within Parameter::schema
if defined.
Sourcepub fn maybe_example(
self,
value: Option<impl Into<Value>>,
) -> ParameterBuilder<SetExample<S>>where
S::Example: IsUnset,
pub fn maybe_example(
self,
value: Option<impl Into<Value>>,
) -> ParameterBuilder<SetExample<S>>where
S::Example: IsUnset,
Optional (Some / Option setters).
Example of Parameter
’s potential value. This examples will override example
within Parameter::schema
if defined.