pub struct EncodingBuilder<S: State = Empty> { /* private fields */ }
Expand description
Use builder syntax to set the inputs and finish with build()
.
Implementations§
Source§impl<S: State> EncodingBuilder<S>
impl<S: State> EncodingBuilder<S>
Sourcepub fn build(self) -> Encodingwhere
S: IsComplete,
pub fn build(self) -> Encodingwhere
S: IsComplete,
Finish building and return the requested object
Sourcepub fn content_type(self, value: String) -> EncodingBuilder<SetContentType<S>>where
S::ContentType: IsUnset,
pub fn content_type(self, value: String) -> EncodingBuilder<SetContentType<S>>where
S::ContentType: IsUnset,
Optional (Some / Option setters).
The Content-Type for encoding a specific property. Default value depends on the property
type: for string with format being binary – application/octet-stream
; for other primitive
types – text/plain
; for object - application/json
; for array – the default is defined
based on the inner type. The value can be a specific media type (e.g. application/json
),
a wildcard media type (e.g. image/*
), or a comma-separated list of the two types.
Sourcepub fn maybe_content_type(
self,
value: Option<String>,
) -> EncodingBuilder<SetContentType<S>>where
S::ContentType: IsUnset,
pub fn maybe_content_type(
self,
value: Option<String>,
) -> EncodingBuilder<SetContentType<S>>where
S::ContentType: IsUnset,
Optional (Some / Option setters).
The Content-Type for encoding a specific property. Default value depends on the property
type: for string with format being binary – application/octet-stream
; for other primitive
types – text/plain
; for object - application/json
; for array – the default is defined
based on the inner type. The value can be a specific media type (e.g. application/json
),
a wildcard media type (e.g. image/*
), or a comma-separated list of the two types.
Sourcepub fn headers(
self,
value: IndexMap<String, Header>,
) -> EncodingBuilder<SetHeaders<S>>where
S::Headers: IsUnset,
pub fn headers(
self,
value: IndexMap<String, Header>,
) -> EncodingBuilder<SetHeaders<S>>where
S::Headers: IsUnset,
Optional (Some / Option setters). Default: <IndexMap<String, Header> as Default>::default()
.
A map allowing additional information to be provided as headers, for example Content-Disposition. Content-Type is described separately and SHALL be ignored in this section. This property SHALL be ignored if the request body media type is not a multipart.
Sourcepub fn maybe_headers(
self,
value: Option<IndexMap<String, Header>>,
) -> EncodingBuilder<SetHeaders<S>>where
S::Headers: IsUnset,
pub fn maybe_headers(
self,
value: Option<IndexMap<String, Header>>,
) -> EncodingBuilder<SetHeaders<S>>where
S::Headers: IsUnset,
Optional (Some / Option setters). Default: <IndexMap<String, Header> as Default>::default()
.
A map allowing additional information to be provided as headers, for example Content-Disposition. Content-Type is described separately and SHALL be ignored in this section. This property SHALL be ignored if the request body media type is not a multipart.
Sourcepub fn style(self, value: ParameterStyle) -> EncodingBuilder<SetStyle<S>>where
S::Style: IsUnset,
pub fn style(self, value: ParameterStyle) -> EncodingBuilder<SetStyle<S>>where
S::Style: IsUnset,
Optional (Some / Option setters).
Describes how a specific property value will be serialized depending on its type. See
Parameter Object for details on the style property. The behavior follows the same values as
query parameters, including default values. This property SHALL be ignored if the request
body media type is not application/x-www-form-urlencoded
.
Sourcepub fn maybe_style(
self,
value: Option<ParameterStyle>,
) -> EncodingBuilder<SetStyle<S>>where
S::Style: IsUnset,
pub fn maybe_style(
self,
value: Option<ParameterStyle>,
) -> EncodingBuilder<SetStyle<S>>where
S::Style: IsUnset,
Optional (Some / Option setters).
Describes how a specific property value will be serialized depending on its type. See
Parameter Object for details on the style property. The behavior follows the same values as
query parameters, including default values. This property SHALL be ignored if the request
body media type is not application/x-www-form-urlencoded
.
Sourcepub fn explode(self, value: bool) -> EncodingBuilder<SetExplode<S>>where
S::Explode: IsUnset,
pub fn explode(self, value: bool) -> EncodingBuilder<SetExplode<S>>where
S::Explode: IsUnset,
Optional (Some / Option setters).
When this is true, property values of type array or object generate separate parameters for
each value of the array, or key-value-pair of the map. For other types of properties this
property has no effect. When style is form, the default value is true. For all other
styles, the default value is false. This property SHALL be ignored if the request body
media type is not application/x-www-form-urlencoded
.
Sourcepub fn maybe_explode(
self,
value: Option<bool>,
) -> EncodingBuilder<SetExplode<S>>where
S::Explode: IsUnset,
pub fn maybe_explode(
self,
value: Option<bool>,
) -> EncodingBuilder<SetExplode<S>>where
S::Explode: IsUnset,
Optional (Some / Option setters).
When this is true, property values of type array or object generate separate parameters for
each value of the array, or key-value-pair of the map. For other types of properties this
property has no effect. When style is form, the default value is true. For all other
styles, the default value is false. This property SHALL be ignored if the request body
media type is not application/x-www-form-urlencoded
.
Sourcepub fn allow_reserved(self, value: bool) -> EncodingBuilder<SetAllowReserved<S>>where
S::AllowReserved: IsUnset,
pub fn allow_reserved(self, value: bool) -> EncodingBuilder<SetAllowReserved<S>>where
S::AllowReserved: IsUnset,
Optional (Some / Option setters).
Determines whether the parameter value SHOULD allow reserved characters, as defined by
RFC3986 :/?#[]@!$&'()*+,;=
to be included without percent-encoding. The default value is
false. This property SHALL be ignored if the request body media type is not
application/x-www-form-urlencoded
.
Sourcepub fn maybe_allow_reserved(
self,
value: Option<bool>,
) -> EncodingBuilder<SetAllowReserved<S>>where
S::AllowReserved: IsUnset,
pub fn maybe_allow_reserved(
self,
value: Option<bool>,
) -> EncodingBuilder<SetAllowReserved<S>>where
S::AllowReserved: IsUnset,
Optional (Some / Option setters).
Determines whether the parameter value SHOULD allow reserved characters, as defined by
RFC3986 :/?#[]@!$&'()*+,;=
to be included without percent-encoding. The default value is
false. This property SHALL be ignored if the request body media type is not
application/x-www-form-urlencoded
.