pub struct ContentBuilder<S: State = Empty> { /* private fields */ }
Expand description
Use builder syntax to set the inputs and finish with build()
.
Implementations§
Source§impl<S: State> ContentBuilder<S>
impl<S: State> ContentBuilder<S>
Sourcepub fn build(self) -> Contentwhere
S: IsComplete,
pub fn build(self) -> Contentwhere
S: IsComplete,
Finish building and return the requested object
Sourcepub fn schema(self, value: impl Into<Schema>) -> ContentBuilder<SetSchema<S>>where
S::Schema: IsUnset,
pub fn schema(self, value: impl Into<Schema>) -> ContentBuilder<SetSchema<S>>where
S::Schema: IsUnset,
Sourcepub fn maybe_schema(
self,
value: Option<impl Into<Schema>>,
) -> ContentBuilder<SetSchema<S>>where
S::Schema: IsUnset,
pub fn maybe_schema(
self,
value: Option<impl Into<Schema>>,
) -> ContentBuilder<SetSchema<S>>where
S::Schema: IsUnset,
Sourcepub fn example(self, value: impl Into<Value>) -> ContentBuilder<SetExample<S>>where
S::Example: IsUnset,
pub fn example(self, value: impl Into<Value>) -> ContentBuilder<SetExample<S>>where
S::Example: IsUnset,
Sourcepub fn maybe_example(
self,
value: Option<impl Into<Value>>,
) -> ContentBuilder<SetExample<S>>where
S::Example: IsUnset,
pub fn maybe_example(
self,
value: Option<impl Into<Value>>,
) -> ContentBuilder<SetExample<S>>where
S::Example: IsUnset,
Sourcepub fn examples(
self,
value: impl Into<IndexMap<String, RefOr<Example>>>,
) -> ContentBuilder<SetExamples<S>>where
S::Examples: IsUnset,
pub fn examples(
self,
value: impl Into<IndexMap<String, RefOr<Example>>>,
) -> ContentBuilder<SetExamples<S>>where
S::Examples: IsUnset,
Optional (Some / Option setters). Default: <IndexMap<String, RefOr<Example>> as Default>::default()
.
Examples of the request body or response body. Content::examples
should match to
media type and specified schema if present. Content::examples
and
Content::example
are mutually exclusive. If both are defined examples
will
override value in example
.
Sourcepub fn maybe_examples(
self,
value: Option<impl Into<IndexMap<String, RefOr<Example>>>>,
) -> ContentBuilder<SetExamples<S>>where
S::Examples: IsUnset,
pub fn maybe_examples(
self,
value: Option<impl Into<IndexMap<String, RefOr<Example>>>>,
) -> ContentBuilder<SetExamples<S>>where
S::Examples: IsUnset,
Optional (Some / Option setters). Default: <IndexMap<String, RefOr<Example>> as Default>::default()
.
Examples of the request body or response body. Content::examples
should match to
media type and specified schema if present. Content::examples
and
Content::example
are mutually exclusive. If both are defined examples
will
override value in example
.
Sourcepub fn encoding(
self,
value: impl Into<IndexMap<String, Encoding>>,
) -> ContentBuilder<SetEncoding<S>>where
S::Encoding: IsUnset,
pub fn encoding(
self,
value: impl Into<IndexMap<String, Encoding>>,
) -> ContentBuilder<SetEncoding<S>>where
S::Encoding: IsUnset,
Optional (Some / Option setters). Default: <IndexMap<String, Encoding> as Default>::default()
.
A map between a property name and its encoding information.
The key, being the property name, MUST exist in the Content::schema
as a property, with
schema
being a Schema::Object
and this object containing the same property key in
Object::properties
.
The encoding object SHALL only apply to request_body
objects when the media type is
multipart or application/x-www-form-urlencoded
.
Sourcepub fn maybe_encoding(
self,
value: Option<impl Into<IndexMap<String, Encoding>>>,
) -> ContentBuilder<SetEncoding<S>>where
S::Encoding: IsUnset,
pub fn maybe_encoding(
self,
value: Option<impl Into<IndexMap<String, Encoding>>>,
) -> ContentBuilder<SetEncoding<S>>where
S::Encoding: IsUnset,
Optional (Some / Option setters). Default: <IndexMap<String, Encoding> as Default>::default()
.
A map between a property name and its encoding information.
The key, being the property name, MUST exist in the Content::schema
as a property, with
schema
being a Schema::Object
and this object containing the same property key in
Object::properties
.
The encoding object SHALL only apply to request_body
objects when the media type is
multipart or application/x-www-form-urlencoded
.