package com.tozny.sdk.realm.methods.email_challenge;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.tozny.sdk.ToznyApiRequest;

import javax.annotation.Nullable;

/**
 * Constructs a Request for invoking the "realm.email_challenge" method.
 */
@JsonAutoDetect(getterVisibility = JsonAutoDetect.Visibility.NONE)
public class EmailChallengeRequest implements ToznyApiRequest {
    @JsonProperty(required=true) private String method = "realm.email_challenge";
    @JsonProperty(required=true) private String destination;
    @JsonProperty private String callback;
    @JsonProperty private String hostname;
    @JsonProperty private Boolean send;

    public EmailChallengeRequest(String destination, @Nullable String callback, @Nullable String hostname, @Nullable Boolean send) {
        this.destination = destination;
        this.callback = callback;
        this.hostname = hostname;

        if (send == null) {
            this.send = true;
        } else {
            this.send = send;
        }
    }

    public String getMethod() {
        return method;
    }

    public String getDestination() {
        return destination;
    }

    @Nullable
    public String getCallback() {
        return callback;
    }

    @Nullable
    public String getHostname() {
        return hostname;
    }

    @Nullable
    public Boolean getSend() {
        return send;
    }
}

@@ -698,23 +698,22 @@
 private 
-Boolean
+String
  send;%0A%0A
@@ -1006,20 +1006,21 @@
 .send = 
-true
+%22yes%22
 ;%0A      
@@ -1054,20 +1054,20 @@
 .send = 
-send
+%22no%22
 ;%0A      
@@ -1435,16 +1435,30 @@
 urn send
+.equals(%22yes%22)
 ;%0A    %7D%0A

Update the 'send' parameter to work with the actual API spec