Struct OperationBuilder

Source
pub struct OperationBuilder<S: State = Empty> { /* private fields */ }
Expand description

Use builder syntax to set the inputs and finish with build().

Implementations§

Source§

impl<S: State> OperationBuilder<S>

Source

pub fn build(self) -> Operation
where S: IsComplete,

Finish building and return the requested object

Source

pub fn summary( self, value: impl Into<String>, ) -> OperationBuilder<SetSummary<S>>
where S::Summary: IsUnset,

Optional (Some / Option setters).

Short summary what Operation does.

Source

pub fn maybe_summary( self, value: Option<impl Into<String>>, ) -> OperationBuilder<SetSummary<S>>
where S::Summary: IsUnset,

Optional (Some / Option setters).

Short summary what Operation does.

Source

pub fn description( self, value: impl Into<String>, ) -> OperationBuilder<SetDescription<S>>
where S::Description: IsUnset,

Optional (Some / Option setters).

Long explanation of Operation behaviour. Markdown syntax is supported.

Source

pub fn maybe_description( self, value: Option<impl Into<String>>, ) -> OperationBuilder<SetDescription<S>>
where S::Description: IsUnset,

Optional (Some / Option setters).

Long explanation of Operation behaviour. Markdown syntax is supported.

Source

pub fn operation_id( self, value: impl Into<String>, ) -> OperationBuilder<SetOperationId<S>>
where S::OperationId: IsUnset,

Optional (Some / Option setters).

Unique identifier for the API Operation. Most typically this is mapped to handler function name.

Source

pub fn maybe_operation_id( self, value: Option<impl Into<String>>, ) -> OperationBuilder<SetOperationId<S>>
where S::OperationId: IsUnset,

Optional (Some / Option setters).

Unique identifier for the API Operation. Most typically this is mapped to handler function name.

Source

pub fn external_docs( self, value: impl Into<ExternalDocs>, ) -> OperationBuilder<SetExternalDocs<S>>
where S::ExternalDocs: IsUnset,

Optional (Some / Option setters).

Additional external documentation for this operation.

Source

pub fn maybe_external_docs( self, value: Option<impl Into<ExternalDocs>>, ) -> OperationBuilder<SetExternalDocs<S>>
where S::ExternalDocs: IsUnset,

Optional (Some / Option setters).

Additional external documentation for this operation.

Source

pub fn request_body( self, value: impl Into<RequestBody>, ) -> OperationBuilder<SetRequestBody<S>>
where S::RequestBody: IsUnset,

Optional (Some / Option setters).

Optional request body for this Operation.

Source

pub fn maybe_request_body( self, value: Option<impl Into<RequestBody>>, ) -> OperationBuilder<SetRequestBody<S>>
where S::RequestBody: IsUnset,

Optional (Some / Option setters).

Optional request body for this Operation.

Source

pub fn callbacks( self, value: impl Into<String>, ) -> OperationBuilder<SetCallbacks<S>>
where S::Callbacks: IsUnset,

Optional (Some / Option setters).

Source

pub fn maybe_callbacks( self, value: Option<impl Into<String>>, ) -> OperationBuilder<SetCallbacks<S>>
where S::Callbacks: IsUnset,

Optional (Some / Option setters).

Source

pub fn deprecated( self, value: impl Into<Deprecated>, ) -> OperationBuilder<SetDeprecated<S>>
where S::Deprecated: IsUnset,

Optional (Some / Option setters).

Define whether the operation is deprecated or not and thus should be avoided consuming.

Source

pub fn maybe_deprecated( self, value: Option<impl Into<Deprecated>>, ) -> OperationBuilder<SetDeprecated<S>>
where S::Deprecated: IsUnset,

Optional (Some / Option setters).

Define whether the operation is deprecated or not and thus should be avoided consuming.

Source

pub fn extensions( self, value: impl Into<Extensions>, ) -> OperationBuilder<SetExtensions<S>>
where S::Extensions: IsUnset,

Optional (Some / Option setters).

Optional extensions “x-something”.

Source

pub fn maybe_extensions( self, value: Option<impl Into<Extensions>>, ) -> OperationBuilder<SetExtensions<S>>
where S::Extensions: IsUnset,

Optional (Some / Option setters).

Optional extensions “x-something”.

Source§

impl<S: State> OperationBuilder<S>

Source

pub fn tag(self, tag: impl Into<String>) -> Self

Append tag to Operation tags.

Source

pub fn tags<T: Into<String>>(self, tags: impl IntoIterator<Item = T>) -> Self

Append tag to Operation tags.

Source

pub fn parameters<P: Into<Parameter>>( self, parameters: impl IntoIterator<Item = P>, ) -> Self

Add or change parameters of the Operation.

Source

pub fn parameter(self, parameter: impl Into<Parameter>) -> Self

Append parameter to Operation parameters.

Source

pub fn responses<R: Into<RefOr<Response>>, C: Into<String>>( self, responses: impl IntoIterator<Item = (C, R)>, ) -> Self

Add or change responses of the Operation.

Source

pub fn response( self, code: impl Into<String>, response: impl Into<RefOr<Response>>, ) -> Self

Append status code and a Response to the Operation responses map.

  • code must be valid HTTP status code.
  • response is instances of Response.
Source

pub fn security(self, security: impl Into<SecurityRequirement>) -> Self

Append SecurityRequirement to Operation security requirements.

Source

pub fn securities<R: Into<SecurityRequirement>>( self, securities: impl IntoIterator<Item = R>, ) -> Self

Append SecurityRequirement to Operation security requirements.

Source

pub fn servers<E: Into<Server>>( self, servers: impl IntoIterator<Item = E>, ) -> Self

Append Servers to the Operation.

Source

pub fn server(self, server: impl Into<Server>) -> Self

Append a new Server to the Operation servers.

Trait Implementations§

Source§

impl<S: IsComplete> From<OperationBuilder<S>> for Operation

Source§

fn from(builder: OperationBuilder<S>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.