MyApp

<back to all web services

UpdatePlayer

Game
import java.math.*;
import java.util.*;
import net.servicestack.client.*;

public class dtos
{

    public static class UpdatePlayer implements IPatchDb<Player>
    {
        public Integer id = null;
        @Validate(Validator="NotEmpty")
        public String firstName = null;

        public String lastName = null;
        public String email = null;
        public ArrayList<Phone> phoneNumbers = null;
        public Integer profileId = null;
        public UUID savedLevelId = null;
        
        public Integer getId() { return id; }
        public UpdatePlayer setId(Integer value) { this.id = value; return this; }
        public String getFirstName() { return firstName; }
        public UpdatePlayer setFirstName(String value) { this.firstName = value; return this; }
        public String getLastName() { return lastName; }
        public UpdatePlayer setLastName(String value) { this.lastName = value; return this; }
        public String getEmail() { return email; }
        public UpdatePlayer setEmail(String value) { this.email = value; return this; }
        public ArrayList<Phone> getPhoneNumbers() { return phoneNumbers; }
        public UpdatePlayer setPhoneNumbers(ArrayList<Phone> value) { this.phoneNumbers = value; return this; }
        public Integer getProfileId() { return profileId; }
        public UpdatePlayer setProfileId(Integer value) { this.profileId = value; return this; }
        public UUID getSavedLevelId() { return savedLevelId; }
        public UpdatePlayer setSavedLevelId(UUID value) { this.savedLevelId = value; return this; }
    }

    public static class Phone
    {
        public PhoneKind kind = null;
        public String number = null;
        public String ext = null;
        
        public PhoneKind getKind() { return kind; }
        public Phone setKind(PhoneKind value) { this.kind = value; return this; }
        public String getNumber() { return number; }
        public Phone setNumber(String value) { this.number = value; return this; }
        public String getExt() { return ext; }
        public Phone setExt(String value) { this.ext = value; return this; }
    }

    public static enum PhoneKind
    {
        Home,
        Mobile,
        Work;
    }

    @DataContract
    public static class IdResponse
    {
        @DataMember(Order=1)
        public String id = null;

        @DataMember(Order=2)
        public ResponseStatus responseStatus = null;
        
        public String getId() { return id; }
        public IdResponse setId(String value) { this.id = value; return this; }
        public ResponseStatus getResponseStatus() { return responseStatus; }
        public IdResponse setResponseStatus(ResponseStatus value) { this.responseStatus = value; return this; }
    }

}

Java UpdatePlayer DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /json/reply/UpdatePlayer HTTP/1.1 
Host: blazor-gallery.servicestack.net 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"id":0,"firstName":"String","lastName":"String","email":"String","phoneNumbers":[{"kind":"Home","number":"String","ext":"String"}],"profileId":0,"savedLevelId":"00000000000000000000000000000000"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"id":"String","responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}