Jim Schubert 25036e48d5
[scala] Support for Set when array has uniqueItems=true (#4926)
* [scala] Set support for unique arrays

This includes and builds upon community contribution for better Set support in Scala.
It makes property + model work as expected with Set and default values
across all Scala generators. Included tests to account for new changes.

This also reverts the community contribution to remove ListBuffer
imports and change the default for array to ListBuffer. Users should use
the instantiation types map to modify the desired array instantiation
type. Any new default should target a new minor release after community
discussion, as it affects all existing SDKs generated with
openapi-generator.

* [scala] Improve default handling of monadic collection type

* [scala] Regenerate samples

* Update ScalaPlayFrameworkServerCodegen.java

Scala Play defaulted to List and should continue to do so.

Co-authored-by: František Kocun <frantisek.kocun@gmail.com>
2020-01-05 09:20:56 -05:00

64 lines
1.8 KiB
Scala

package api
import model.ApiResponse
import model.Pet
import play.api.libs.Files.TemporaryFile
@javax.annotation.Generated(value = Array("org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen"), date = "2020-01-04T23:10:22.106-05:00[America/New_York]")
trait PetApi {
/**
* Add a new pet to the store
* @param body Pet object that needs to be added to the store
*/
def addPet(body: Pet): Unit
/**
* Deletes a pet
* @param petId Pet id to delete
*/
def deletePet(petId: Long, apiKey: Option[String]): Unit
/**
* Finds Pets by status
* Multiple status values can be provided with comma separated strings
* @param status Status values that need to be considered for filter
*/
def findPetsByStatus(status: List[String]): List[Pet]
/**
* Finds Pets by tags
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @param tags Tags to filter by
*/
def findPetsByTags(tags: List[String]): List[Pet]
/**
* Find pet by ID
* Returns a single pet
* @param petId ID of pet to return
*/
def getPetById(petId: Long): Pet
/**
* Update an existing pet
* @param body Pet object that needs to be added to the store
*/
def updatePet(body: Pet): Unit
/**
* Updates a pet in the store with form data
* @param petId ID of pet that needs to be updated
* @param name Updated name of the pet
* @param status Updated status of the pet
*/
def updatePetWithForm(petId: Long, name: Option[String], status: Option[String]): Unit
/**
* uploads an image
* @param petId ID of pet to update
* @param additionalMetadata Additional data to pass to server
* @param file file to upload
*/
def uploadFile(petId: Long, additionalMetadata: Option[String], file: Option[TemporaryFile]): ApiResponse
}