Bruno Coelho 7f6b1306ed
Add swift6 generator (#19621)
* [Swift6] create Swift6 generator

* [Swift6] create Swift6 generator

* Update vapor integration

* Update bitrise stack to Xcode 16

* [Swift6] tryped throws

* [Swift6] tryped throws

* [Swift6] combine deferred and api static method

* [Swift6] update readme

* [Swift6] fix some errors

* [Swift6] fix some errors

* [Swift6] fix some errors

* [Swift6] update docs

* [Swift6] update docs

* Use multiline comments for examples in csharp generator (#19079)

* multi

* gen

* Uncomment File::deleteOnExit (#19624)

* [Core/Rust Server] Check references in additionalProperties correctly when checking freeForm status (#19605)

* Check references in additionalProperties correctly

Handle references in additionalProperties correctly when determining free-form status

* Update samples

* [Rust Server] Handle arrays in forms (#19625)

* [Rust Server] Handle arrays in forms correctly

* [Rust Server] Add tests

* Update samples

* [Swift6] fix CI

* [Swift6] fix CI

* [Swift6] fix CI

* [Swift6] fix CI

---------

Co-authored-by: Liri S <reallyliri@gmail.com>
Co-authored-by: Beppe Catanese <1771700+gcatanese@users.noreply.github.com>
Co-authored-by: Richard Whitehouse <git@richardwhiuk.com>
Co-authored-by: William Cheng <wing328hk@gmail.com>
2024-09-25 16:57:25 +08:00

13 KiB

UserAPI

All URIs are relative to http://petstore.swagger.io:80/v2

Method HTTP request Description
createUser POST /user Create user
createUsersWithArrayInput POST /user/createWithArray Creates list of users with given input array
createUsersWithListInput POST /user/createWithList Creates list of users with given input array
deleteUser DELETE /user/{username} Delete user
getUserByName GET /user/{username} Get user by user name
loginUser GET /user/login Logs user into the system
logoutUser GET /user/logout Logs out current logged in user session
updateUser PUT /user/{username} Updated user

createUser

    open class func createUser( body: User) -> Promise<Void>
    open class func createUser(body: User) -> Observable<Void>

Create user

This can only be done by the logged in user.

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import PetstoreClient

let body = User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123) // User | Created user object

// Create user
UserAPI.createUser(body: body).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}
// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new

Parameters

Name Type Description Notes
body User Created user object

Return type

Void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createUsersWithArrayInput

    open class func createUsersWithArrayInput( body: [User]) -> Promise<Void>
    open class func createUsersWithArrayInput(body: [User]) -> Observable<Void>

Creates list of users with given input array

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import PetstoreClient

let body = [User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123)] // [User] | List of user object

// Creates list of users with given input array
UserAPI.createUsersWithArrayInput(body: body).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}
// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new

Parameters

Name Type Description Notes
body [User] List of user object

Return type

Void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createUsersWithListInput

    open class func createUsersWithListInput( body: [User]) -> Promise<Void>
    open class func createUsersWithListInput(body: [User]) -> Observable<Void>

Creates list of users with given input array

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import PetstoreClient

let body = [User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123)] // [User] | List of user object

// Creates list of users with given input array
UserAPI.createUsersWithListInput(body: body).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}
// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new

Parameters

Name Type Description Notes
body [User] List of user object

Return type

Void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteUser

    open class func deleteUser( username: String) -> Promise<Void>
    open class func deleteUser(username: String) -> Observable<Void>

Delete user

This can only be done by the logged in user.

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import PetstoreClient

let username = "username_example" // String | The name that needs to be deleted

// Delete user
UserAPI.deleteUser(username: username).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}
// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new

Parameters

Name Type Description Notes
username String The name that needs to be deleted

Return type

Void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getUserByName

    open class func getUserByName( username: String) -> Promise<User>
    open class func getUserByName(username: String) -> Observable<User>

Get user by user name

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import PetstoreClient

let username = "username_example" // String | The name that needs to be fetched. Use user1 for testing.

// Get user by user name
UserAPI.getUserByName(username: username).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}
// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new

Parameters

Name Type Description Notes
username String The name that needs to be fetched. Use user1 for testing.

Return type

User

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/xml, application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

loginUser

    open class func loginUser( username: String,  password: String) -> Promise<String>
    open class func loginUser(username: String, password: String) -> Observable<String>

Logs user into the system

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import PetstoreClient

let username = "username_example" // String | The user name for login
let password = "password_example" // String | The password for login in clear text

// Logs user into the system
UserAPI.loginUser(username: username, password: password).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}
// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new

Parameters

Name Type Description Notes
username String The user name for login
password String The password for login in clear text

Return type

String

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/xml, application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

logoutUser

    open class func logoutUser() -> Promise<Void>
    open class func logoutUser() -> Observable<Void>

Logs out current logged in user session

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import PetstoreClient


// Logs out current logged in user session
UserAPI.logoutUser().then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}
// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new

Parameters

This endpoint does not need any parameter.

Return type

Void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateUser

    open class func updateUser( username: String,  body: User) -> Promise<Void>
    open class func updateUser(username: String, body: User) -> Observable<Void>

Updated user

This can only be done by the logged in user.

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import PetstoreClient

let username = "username_example" // String | name that need to be deleted
let body = User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123) // User | Updated user object

// Updated user
UserAPI.updateUser(username: username, body: body).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}
// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new

Parameters

Name Type Description Notes
username String name that need to be deleted
body User Updated user object

Return type

Void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]