Flavors

pt.tecnico.dsi.openstack.nova.services.Flavors
final class Flavors[F[_]](baseUri: Uri, session: Session)(using evidence$1: Concurrent[F], evidence$2: Client[F]) extends PartialCrudService[F], CreateNonIdempotentOperations[F, Flavor, Create], ListOperations[F, Flavor], ReadOperations[F, Flavor], DeleteOperations[F, Flavor]

Attributes

Source
Flavors.scala
Graph
Supertypes
class Service[F]
class Object
trait Matchable
class Any
Show all

Members list

Type members

Inherited types

type /=>[-T, +R] = PartialFunction[T, R]

Attributes

Inherited from:
Service
Source
Service.scala

Value members

Concrete methods

def applyByName(name: String): F[Flavor]

Gets the Flavor with the specified name, assuming it exists.

Gets the Flavor with the specified name, assuming it exists.

Value parameters

name

the name of the Flavor to get.

Attributes

Returns

the Flavor with the given name. If more than one exists the first one. If none exists F will contain an error.

Note

Nova does not allow listing/searching flavors by name. So this method lists all flavors and finds the one named name.

Source
Flavors.scala
def getByName(name: String): F[Option[Flavor]]

Gets the Flavor with the specified name.

Gets the Flavor with the specified name.

Value parameters

name

the name of the Flavor to get.

Attributes

Returns

a Some with the Flavor if it exists. If more than one exists the first one. A None otherwise.

Note

Nova does not allow listing/searching flavors by name. So this method lists all flavors and finds the one named name.

Source
Flavors.scala
override def list(query: Query, extraHeaders: ToRaw*): F[List[Flavor]]

Lists all Flavor(s) using the specified query. If the response is paginated all elements will be returned, be careful as this might take a lot of time and memory.

Lists all Flavor(s) using the specified query. If the response is paginated all elements will be returned, be careful as this might take a lot of time and memory.

Value parameters

extraHeaders

extra headers to pass when making the request. The authToken header is always added.

query

the query to use when performing the request.

Attributes

Definition Classes
Source
Flavors.scala
def listSummary(query: Query): F[List[Summary]]

Lists summary information for all flavors.

Lists summary information for all flavors.

Value parameters

query

extra query params to pass in the request.

Attributes

Source
Flavors.scala
override def stream(query: Query, extraHeaders: ToRaw*): Stream[F, Flavor]

Streams Flavor(s) using the specified query. Automatically fetches more pages if more elements of the stream are consumed.

Streams Flavor(s) using the specified query. Automatically fetches more pages if more elements of the stream are consumed.

Value parameters

extraHeaders

extra headers to pass when making the request. The authToken header is always added.

query

the query to use when performing the request.

Attributes

Definition Classes
Source
Flavors.scala
def streamSummary(query: Query): Stream[F, Summary]

Lists summary information for all flavors.

Lists summary information for all flavors.

Value parameters

query

extra query params to pass in the request.

Attributes

Source
Flavors.scala

Inherited methods

def apply(id: String, extraHeaders: ToRaw*): F[Model]

Gets the domainModel with the specified id, assuming it exists.

Gets the domainModel with the specified id, assuming it exists.

Value parameters

extraHeaders

extra headers to pass when making the request. The authToken header is always added.

id

the id of the domainModel to get. Usually a random UUID.

Attributes

Returns

the domainModel with the given id. If none exists F will contain an error.

Inherited from:
ReadOperations
Source
ReadOperations.scala
def apply(create: Create, extraHeaders: ToRaw*): F[Model]

Allows a simpler syntax to create domainModel(s). For example instead of:

Allows a simpler syntax to create domainModel(s). For example instead of:

  keystone.projects.create(Project.Create(name, domainId = Some(usersDomain.id)))

We can do:

  keystone.projects(Project.Create(name, domainId = Some(usersDomain.id)))

Attributes

Inherited from:
CreateNonIdempotentOperations
Source
CreateNonIdempotentOperations.scala
def create(create: Create, extraHeaders: ToRaw*): F[Model]

Creates a new domainModel with the given create values.

Creates a new domainModel with the given create values.

Value parameters

create

the values to use in the create.

extraHeaders

extra headers to pass when making the request. The authToken header is always added.

Attributes

Returns

the created domainModel

Inherited from:
CreateNonIdempotentOperations
Source
CreateNonIdempotentOperations.scala
protected def defaultOnError[R](request: Request[F], response: Response[F]): F[R]

Attributes

Inherited from:
Service
Source
Service.scala

Deletes the domainModel with the given id.

Deletes the domainModel with the given id.

Value parameters

extraHeaders

extra headers to pass when making the request. The authToken header is always added.

id

the id of the domainModel to delete. Usually a random UUID.

Attributes

Inherited from:
DeleteOperations
Source
DeleteOperations.scala

Deletes the given domainModel.

Deletes the given domainModel.

Value parameters

extraHeaders

extra headers to pass when making the request. The authToken header is always added.

model

the domainModel to delete.

Attributes

Inherited from:
DeleteOperations
Source
DeleteOperations.scala
protected def delete(uri: Uri, extraHeaders: ToRaw*): F[Unit]

An idempotent delete. If NotFound or Gone are returned this method will succeed.

An idempotent delete. If NotFound or Gone are returned this method will succeed.

Value parameters

extraHeaders

extra headers to be used. The authToken header is always added.

uri

the uri to which the request will be made.

Attributes

Inherited from:
Service
Source
Service.scala
protected def expect[R](wrappedAt: Option[String], method: Method, uri: Uri, extraHeaders: ToRaw*)(using evidence$9: Decoder[R]): F[R]

Invokes method on the specified uri without any body. The response will be parsed to an R.

Invokes method on the specified uri without any body. The response will be parsed to an R.

Value parameters

extraHeaders

extra headers to be used. The authToken header is always added.

method

the method to use, eg: GET, POST, etc.

uri

the uri to which the request will be made.

wrappedAt

whether to decode R at the Json root, or at the field at.

Attributes

Inherited from:
Service
Source
Service.scala

Invokes method on the specified uri passing as body value. The response will be parsed to an R.

Invokes method on the specified uri passing as body value. The response will be parsed to an R.

Value parameters

extraHeaders

extra headers to be used. The authToken header is always added.

method

the method to use, eg: GET, POST, etc.

uri

the uri to which the request will be made.

value

the value to send in the body. This value will be json encoded using wrapped.

wrappedAt

whether to encode B and decode R at the Json root, or at the field at.

Attributes

Inherited from:
Service
Source
Service.scala

Invokes method on the specified uri without any body. The response will be parsed to an Option[R].

Invokes method on the specified uri without any body. The response will be parsed to an Option[R].

Value parameters

extraHeaders

extra headers to be used. The authToken header is always added.

method

the method to use, eg: GET, POST, etc.

uri

the uri to which the request will be made.

wrappedAt

whether to decode R at the Json root, or at the field at.

Attributes

Inherited from:
Service
Source
Service.scala

Invokes method on the specified uri passing as body value. The response will be parsed to an Option[R].

Invokes method on the specified uri passing as body value. The response will be parsed to an Option[R].

Value parameters

extraHeaders

extra headers to be used. The authToken header is always added.

method

the method to use, eg: GET, POST, etc.

uri

the uri to which the request will be made.

value

the value to send in the body. This value will be json encoded using wrapped.

wrappedAt

whether to encode B and decode R at the Json root, or at the field at.

Attributes

Inherited from:
Service
Source
Service.scala

Submits request and decodes the response to a Option[R] on success.

Submits request and decodes the response to a Option[R] on success.

Value parameters

request

the request to execute.

wrappedAt

whether to decode R at the Json root, or at the field at.

Attributes

Inherited from:
Service
Source
Service.scala
protected def expectUnwrapped[R](wrappedAt: Option[String], request: Request[F])(using evidence$3: Decoder[R]): F[R]

Submits request and decodes the response to a R on success.

Submits request and decodes the response to a R on success.

Value parameters

request

the request to execute.

wrappedAt

whether to decode R at the Json root, or at the field at.

Attributes

Inherited from:
Service
Source
Service.scala
def get(id: String, extraHeaders: ToRaw*): F[Option[Model]]

Gets the domainModel with the specified id.

Gets the domainModel with the specified id.

Value parameters

extraHeaders

extra headers to pass when making the request. The authToken header is always added.

id

the id of the domainModel to get. Usually a random UUID.

Attributes

Returns

a Some with the domainModel if it exists. A None otherwise.

Inherited from:
ReadOperations
Source
ReadOperations.scala
protected def get[R](wrappedAt: Option[String], uri: Uri, extraHeaders: ToRaw*)(using evidence$11: Decoder[R]): F[R]

Attributes

Inherited from:
Service
Source
Service.scala
protected def getOption[R](wrappedAt: Option[String], uri: Uri, extraHeaders: ToRaw*)(using evidence$12: Decoder[R]): F[Option[R]]

Attributes

Inherited from:
Service
Source
Service.scala
def list(pairs: (String, String)*): F[List[Model]]

Lists all domainModel(s) using the specified pairs as the query params. If the response is paginated all elements will be returned, be careful as this might take a lot of time and memory.

Lists all domainModel(s) using the specified pairs as the query params. If the response is paginated all elements will be returned, be careful as this might take a lot of time and memory.

Value parameters

pairs

the pairs of Strings that will be used as the query params.

Attributes

Inherited from:
ListOperations
Source
ListOperations.scala
protected def list[R](wrappedAt: String, uri: Uri, extraHeaders: ToRaw*)(using evidence$25: Decoder[R]): F[List[R]]

Invokes a GET request on the specified uri, expecting to receive a list of elements. If the response is paginated all elements will be returned, be careful as this might take a lot of time and memory.

Invokes a GET request on the specified uri, expecting to receive a list of elements. If the response is paginated all elements will be returned, be careful as this might take a lot of time and memory.

Type parameters

R

the type of the elements returned.

Value parameters

extraHeaders

extra headers to be used. The authToken header is always added.

uri

the uri to which the request will be made. Query params related with pagination will be overwritten after the first request.

wrappedAt

the Json object field where R will be decoded from.

Attributes

Inherited from:
Service
Source
Service.scala
protected def patch[V, R](wrappedAt: Option[String], value: V, uri: Uri, extraHeaders: ToRaw*)(using evidence$15: Encoder[V], evidence$16: Decoder[R]): F[R]

Attributes

Inherited from:
Service
Source
Service.scala
protected def post[V, R](wrappedAt: Option[String], value: V, uri: Uri, extraHeaders: ToRaw*)(using evidence$17: Encoder[V], evidence$18: Decoder[R]): F[R]

Attributes

Inherited from:
Service
Source
Service.scala

Attributes

Inherited from:
Service
Source
Service.scala

Attributes

Inherited from:
Service
Source
Service.scala
protected def put[V, R](wrappedAt: Option[String], value: V, uri: Uri, extraHeaders: ToRaw*)(using evidence$13: Encoder[V], evidence$14: Decoder[R]): F[R]

Attributes

Inherited from:
Service
Source
Service.scala
def stream(pairs: (String, String)*): Stream[F, Model]

Streams domainModel(s) using the specified query. Automatically fetches more pages if more elements of the stream are consumed.

Streams domainModel(s) using the specified query. Automatically fetches more pages if more elements of the stream are consumed.

Value parameters

pairs

the pairs of Strings that will be used as the query params.

Attributes

Inherited from:
ListOperations
Source
ListOperations.scala
protected def stream[R](wrappedAt: String, uri: Uri, extraHeaders: ToRaw*)(using evidence$24: Decoder[R]): Stream[F, R]

Invokes a GET request on the specified uri, expecting the returned json to be paginated. Automatically fetches more pages if more elements of the stream are consumed.

Invokes a GET request on the specified uri, expecting the returned json to be paginated. Automatically fetches more pages if more elements of the stream are consumed.

Type parameters

R

the type of the elements returned.

Value parameters

extraHeaders

extra headers to be used. The authToken header is always added.

uri

the uri to which the request will be made. Query params related with pagination will be overwritten after the first request.

wrappedAt

the Json object field where R will be decoded from.

Attributes

Inherited from:
{ valnext:Option[Uri]=links.collectFirst[Uri](((x$1:Link)=>(x$1:@unchecked)match{ caseLink("next",uri)=> (`uri₂`:Uri) })) Tuple2.apply[List[Link],Option[Uri]](links,next) })).flatMap[DecodingFailure,Tuple2[Option[Uri],List[R]]](((`x$1₂`:Tuple2[List[Link],Option[Uri]])=>(`x$1₂`:@unchecked)match{ caseTuple2(links,next)=> c.downField(wrappedAt).as[List[R]](decodeList[R](evidence$24)).map[Tuple2[Option[Uri],List[R]]](((objectList:List[R])=>Tuple2.apply[Option[Uri],List[R]](`next₂`,objectList))) }))) Stream.unfoldChunkEval[F,Option[Uri],R](Some.apply[Uri](uri))(((`x$1₃`:Option[Uri])=>`x$1₃`match{ caseSome(uri)=> toFunctorOps[F,Tuple2[Option[Uri],List[R]]](client.expect[Tuple2[Option[Uri],List[R]]](Service.this.dsl.http4sClientSyntaxMethod(GET).apply(`uri₃`,extraHeaders.+:[ToRaw](Service.this.subjectTokenHeader):_*))(Service.this.jsonDecoder[Tuple2[Option[Uri],List[R]]](paginatedDecoder)))(F).map[Option[Tuple2[Chunk[R],Option[Uri]]]](((`x$1₄`:Tuple2[Option[Uri],List[R]])=>`x$1₄`match{ caseTuple2(next,entries)=> Some.apply[Tuple2[Chunk[R],Option[Uri]]](Tuple2.apply[Chunk[R],Option[Uri]](Chunk.iterable[R](entries),`next₃`)) })) caseNone=> F.pure[Option[Tuple2[Chunk[R],Option[Uri]]]](None) })) }">Service
Source
Service.scala
protected def unwrapped[R](at: Option[String])(implicit decoder: Decoder[R]): EntityDecoder[F, R]

Creates a Decoder which will decode the response from Json. When at is None R will be decoded directly from the Json root (the normal implementation for most Json REST APIs). Example:

Creates a Decoder which will decode the response from Json. When at is None R will be decoded directly from the Json root (the normal implementation for most Json REST APIs). Example:

{
  "id": "e4d02828-9cac-4765-bf7f-7e210dac7aba",
  "zones": 500,
  "zone_recordsets": 500
}

When at is a Some(x) R will be decoded from the Json object located in the field x. For R to be correctly parsed in this example at should be Some("quota"):

{
  "quota": {
    "id": "e4d02828-9cac-4765-bf7f-7e210dac7aba",
    "zones": 500,
    "zone_recordsets": 500
  }
}

Value parameters

at

whether to decode R at the Json root, or at the field at.

decoder

the circe decoder capable of converting Json to an R.

Attributes

Inherited from:
Service
Source
Service.scala
protected def wrapped[R](at: Option[String])(implicit encoder: Encoder[R]): EntityEncoder[F, R]

Creates an EntityEncoder which will encode R to a Json. When at is None R will be encoded directly (the normal implementation for most Json REST APIs). Example:

Creates an EntityEncoder which will encode R to a Json. When at is None R will be encoded directly (the normal implementation for most Json REST APIs). Example:

{
  "id": "e4d02828-9cac-4765-bf7f-7e210dac7aba",
  "zones": 500,
  "zone_recordsets": 500
}

When at is a Some(x) R will be encoded inside a Json object with a single field named x. In this example at was set to Some("quota"):

{
  "quota": {
    "id": "e4d02828-9cac-4765-bf7f-7e210dac7aba",
    "zones": 500,
    "zone_recordsets": 500
  }
}

Value parameters

at

whether to encode R at the Json root, or at the field at.

encoder

the circe encoder capable of converting an R to Json.

Attributes

Inherited from:
Service
Source
Service.scala

Inherited fields

protected val authToken: AuthToken

Attributes

Inherited from:
Service
Source
Service.scala
protected val dsl: Http4sClientDsl[F]

Attributes

Inherited from:
Service
Source
Service.scala
protected val jsonPrinter: Printer

Attributes

Inherited from:
Service
Source
Service.scala
val name: String

Attributes

Inherited from:
Service
Source
Service.scala

Attributes

Inherited from:
Service
Source
Service.scala
val uri: Uri

The baseUri with the pluraName appended as an extra path element.

The baseUri with the pluraName appended as an extra path element.

Attributes

Inherited from:
Service
Source
Service.scala

Givens

Givens

override given createEncoder: Encoder[Create]

Attributes

Source
Flavors.scala
override given modelDecoder: Decoder[Flavor]

Attributes

Source
Flavors.scala

Implicits

Inherited implicits

implicit val F: Concurrent[F]

Attributes

Inherited from:
Service
Source
Service.scala
implicit protected val client: Client[F]

Attributes

Inherited from:
Service
Source
Service.scala
implicit protected def jsonDecoder[A](using evidence$2: Decoder[A]): EntityDecoder[F, A]

Attributes

Inherited from:
Service
Source
Service.scala
implicit protected def jsonEncoder[A](using evidence$1: Encoder[A]): EntityEncoder[F, A]

Attributes

Inherited from:
Service
Source
Service.scala
implicit protected val void: EntityDecoder[F, Unit]

Attributes

Inherited from:
Service
Source
Service.scala