nori/builder/operation_builder

Builder for constructing Operation objects with a fluent API.

Types

Builder for creating Operation objects.

pub opaque type OperationBuilder

Values

pub fn build(builder: OperationBuilder) -> operation.Operation

Builds the operation.

pub fn deprecated(builder: OperationBuilder) -> OperationBuilder

Marks as deprecated.

pub fn description(
  builder: OperationBuilder,
  d: String,
) -> OperationBuilder

Sets the description.

pub fn external_docs(
  builder: OperationBuilder,
  url: String,
) -> OperationBuilder

Sets external documentation.

pub fn external_docs_with_description(
  builder: OperationBuilder,
  url: String,
  desc: String,
) -> OperationBuilder

Sets external documentation with description.

pub fn json_body(
  builder: OperationBuilder,
  schema: schema.Schema,
) -> OperationBuilder

Sets a JSON request body.

pub fn json_response(
  builder: OperationBuilder,
  status_code: String,
  desc: String,
  schema: schema.Schema,
) -> OperationBuilder

Adds a JSON response.

pub fn json_response_ref(
  builder: OperationBuilder,
  status_code: String,
  desc: String,
  schema_ref: String,
) -> OperationBuilder

Adds a JSON response with a schema reference.

pub fn new() -> OperationBuilder

Creates a new operation builder.

pub fn operation_id(
  builder: OperationBuilder,
  id: String,
) -> OperationBuilder

Sets the operation ID.

pub fn parameter(
  builder: OperationBuilder,
  param: parameter.Parameter,
) -> OperationBuilder

Adds a parameter.

pub fn parameter_ref(
  builder: OperationBuilder,
  ref: String,
) -> OperationBuilder

Adds a parameter reference.

pub fn request_body(
  builder: OperationBuilder,
  body: request_body.RequestBody,
) -> OperationBuilder

Sets the request body.

pub fn request_body_ref(
  builder: OperationBuilder,
  ref: String,
) -> OperationBuilder

Sets the request body reference.

pub fn response(
  builder: OperationBuilder,
  status_code: String,
  resp: response.Response,
) -> OperationBuilder

Adds a response.

pub fn response_ref(
  builder: OperationBuilder,
  status_code: String,
  ref: String,
) -> OperationBuilder

Adds a response reference.

pub fn security(
  builder: OperationBuilder,
  req: dict.Dict(String, List(String)),
) -> OperationBuilder

Adds a security requirement.

pub fn security_scheme(
  builder: OperationBuilder,
  scheme_name: String,
) -> OperationBuilder

Adds a simple security requirement (security scheme with no scopes).

pub fn server(
  builder: OperationBuilder,
  s: server.Server,
) -> OperationBuilder

Adds a server.

pub fn simple_response(
  builder: OperationBuilder,
  status_code: String,
  desc: String,
) -> OperationBuilder

Adds a simple response with just a description.

pub fn summary(
  builder: OperationBuilder,
  s: String,
) -> OperationBuilder

Sets the summary.

pub fn tag(
  builder: OperationBuilder,
  t: String,
) -> OperationBuilder

Adds a tag.

pub fn tags(
  builder: OperationBuilder,
  ts: List(String),
) -> OperationBuilder

Sets multiple tags.

Search Document