// Path: src/main/java/com/mailosaur/models/Server.java
// public class Server {
//     /**
//      * Unique identifier for the server.
//      */
// 	@Key
//     private String id;
// 
//     /**
//      * The name of the server.
//      */
//     @Key
//     private String name;
// 
//     /**
//      * Users (excluding administrators) who have access to the server (if it is restricted).
//      */
//     @Key
//     private List<String> users;
// 
//     /**
//      * The number of messages currently in the server.
//      */
//     @Key
//     private Integer messages;
// 
//     /**
//      * Gets the unique identifier of the server.
//      *
//      * @return The server ID.
//      */
//     public String id() {
//         return this.id;
//     }
// 
//     /**
//      * Gets the name of the server.
//      *
//      * @return The name of the server.
//      */
//     public String name() {
//         return this.name;
//     }
// 
//     /**
//      * Sets the name of the server.
//      *
//      * @param name The name of the server.
//      * @return the Server object itself.
//      */
//     public Server withName(String name) {
//         this.name = name;
//         return this;
//     }
// 
//     /**
//      * Gets the IDs of users who have access to the server (if it is restricted).
//      *
//      * @return The IDs of users who have access to the server (if it is restricted).
//      */
//     public List<String> users() {
//         return this.users;
//     }
// 
//     /**
//      * Sets the IDs of users who have access to the server (if it is restricted).
//      *
//      * @param users The IDs of users who have access to the server (if it is restricted).
//      * @return the Server object itself.
//      */
//     public Server withUsers(List<String> users) {
//         this.users = users;
//         return this;
//     }
// 
//     /**
//      * Gets the number of messages currently in the server.
//      *
//      * @return The number of messages currently in the server.
//      */
//     public Integer messages() {
//         return this.messages;
//     }
// 
// }
// 
// Path: src/main/java/com/mailosaur/models/ServerCreateOptions.java
// public class ServerCreateOptions {
//     /**
//      * A name used to identify the server.
//      */
//     @Key
//     private String name;
// 
//     /**
//      * Sets a name used to identify the server.
//      *
//      * @param name A name used to identify the server.
//      * @return the ServerCreateOptions object itself.
//      */
//     public ServerCreateOptions withName(String name) {
//         this.name = name;
//         return this;
//     }
// 
// }
// 
// Path: src/main/java/com/mailosaur/models/ServerListResult.java
// public class ServerListResult {
//     /**
//      * The individual servers forming the result. Servers
//      * are returned sorted by creation date, with the most recently-created server
//      * appearing first.
//      */
//     @Key
//     private List<Server> items;
// 
//     /**
//      * Gets the individual servers forming the result.
//      *
//      * @return The individual servers forming the result.
//      */
//     public List<Server> items() {
//         return this.items;
//     }
// }


import java.io.IOException;
import java.util.Random;
import com.google.api.client.json.GenericJson;
import com.mailosaur.models.Server;
import com.mailosaur.models.ServerCreateOptions;
import com.mailosaur.models.ServerListResult;
package com.mailosaur;




public class Servers {
    private MailosaurClient client;
    
    public Servers(MailosaurClient client) {
        this.client = client;
    }

    /**
     * Returns a list of your virtual servers. Servers are returned sorted in alphabetical order.
     *
     * @throws MailosaurException Thrown if Mailosaur responds with an error.
     * @throws IOException Unexpected exception.
     * @return The result of the server listing operation.
     */
    public ServerListResult list() throws IOException, MailosaurException {
        return client.request("GET", "api/servers").parseAs(ServerListResult.class);
    }

    /**
     * Creates a new virtual server.
     *
     * @param options Options used to create a new Mailosaur server.
     * @throws MailosaurException Thrown if Mailosaur responds with an error.
     * @throws IOException Unexpected exception.
     * @return Mailosaur virtual SMTP/SMS server.
     */
// Path: src/main/java/com/mailosaur/models/Server.java
// public class Server {
//     /**
//      * Unique identifier for the server.
//      */
// 	@Key
//     private String id;
// 
//     /**
//      * The name of the server.
//      */
//     @Key
//     private String name;
// 
//     /**
//      * Users (excluding administrators) who have access to the server (if it is restricted).
//      */
//     @Key
//     private List<String> users;
// 
//     /**
//      * The number of messages currently in the server.
//      */
//     @Key
//     private Integer messages;
// 
//     /**
//      * Gets the unique identifier of the server.
//      *
//      * @return The server ID.
//      */
//     public String id() {
//         return this.id;
//     }
// 
//     /**
//      * Gets the name of the server.
//      *
//      * @return The name of the server.
//      */
//     public String name() {
//         return this.name;
//     }
// 
//     /**
//      * Sets the name of the server.
//      *
//      * @param name The name of the server.
//      * @return the Server object itself.
//      */
//     public Server withName(String name) {
//         this.name = name;
//         return this;
//     }
// 
//     /**
//      * Gets the IDs of users who have access to the server (if it is restricted).
//      *
//      * @return The IDs of users who have access to the server (if it is restricted).
//      */
//     public List<String> users() {
//         return this.users;
//     }
// 
//     /**
//      * Sets the IDs of users who have access to the server (if it is restricted).
//      *
//      * @param users The IDs of users who have access to the server (if it is restricted).
//      * @return the Server object itself.
//      */
//     public Server withUsers(List<String> users) {
//         this.users = users;
//         return this;
//     }
// 
//     /**
//      * Gets the number of messages currently in the server.
//      *
//      * @return The number of messages currently in the server.
//      */
//     public Integer messages() {
//         return this.messages;
//     }
// 
// }
// 
// Path: src/main/java/com/mailosaur/models/ServerCreateOptions.java
// public class ServerCreateOptions {
//     /**
//      * A name used to identify the server.
//      */
//     @Key
//     private String name;
// 
//     /**
//      * Sets a name used to identify the server.
//      *
//      * @param name A name used to identify the server.
//      * @return the ServerCreateOptions object itself.
//      */
//     public ServerCreateOptions withName(String name) {
//         this.name = name;
//         return this;
//     }
// 
// }
// 
// Path: src/main/java/com/mailosaur/models/ServerListResult.java
// public class ServerListResult {
//     /**
//      * The individual servers forming the result. Servers
//      * are returned sorted by creation date, with the most recently-created server
//      * appearing first.
//      */
//     @Key
//     private List<Server> items;
// 
//     /**
//      * Gets the individual servers forming the result.
//      *
//      * @return The individual servers forming the result.
//      */
//     public List<Server> items() {
//         return this.items;
//     }
// }


// Path: src/main/java/com/mailosaur/Servers.java
import java.io.IOException;
import java.util.Random;
import com.google.api.client.json.GenericJson;
import com.mailosaur.models.Server;
import com.mailosaur.models.ServerCreateOptions;
import com.mailosaur.models.ServerListResult;

package com.mailosaur;




public class Servers {
    private MailosaurClient client;
    
    public Servers(MailosaurClient client) {
        this.client = client;
    }

    /**
     * Returns a list of your virtual servers. Servers are returned sorted in alphabetical order.
     *
     * @throws MailosaurException Thrown if Mailosaur responds with an error.
     * @throws IOException Unexpected exception.
     * @return The result of the server listing operation.
     */
    public ServerListResult list() throws IOException, MailosaurException {
        return client.request("GET", "api/servers").parseAs(ServerListResult.class);
    }

    /**
     * Creates a new virtual server.
     *
     * @param options Options used to create a new Mailosaur server.
     * @throws MailosaurException Thrown if Mailosaur responds with an error.
     * @throws IOException Unexpected exception.
     * @return Mailosaur virtual SMTP/SMS server.
     */
    public Server create(ServerCreateOptions options) throws IOException, MailosaurException {