func (request *ApprovalRequest) Valid() bool {
	return request.HTTPResponse.StatusCode == 200
}
Valid returns true if the approval request was valid.
package authy
import (
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net/http"
)
type OneTouchStatus string
var (
	OneTouchStatusApproved OneTouchStatus = "approved"
	OneTouchStatusPending OneTouchStatus = "pending"
	OneTouchStatusDenied OneTouchStatus = "denied"
	OneTouchStatusExpired OneTouchStatus = "expired"
)
type ApprovalRequest struct {
	HTTPResponse *http.Response
	Status   OneTouchStatus `json:"status"`
	UUID     string         `json:"uuid"`
	Notified bool           `json:"notified"`
}
func NewApprovalRequest(response *http.Response) (*ApprovalRequest, error) {
	body, err := ioutil.ReadAll(response.Body)
	if err != nil {
		return nil, err
	}
	jsonResponse := struct {
		Success         bool             `json:"success"`
		ApprovalRequest *ApprovalRequest `json:"approval_request"`
		Message         string           `json:"message"`
	}{}
	err = json.Unmarshal(body, &jsonResponse)
	if err != nil {
		return nil, err
	}
	if !jsonResponse.Success {
		return nil, fmt.Errorf("invalid approval request response: %s", jsonResponse.Message)
	}
	approvalRequest := jsonResponse.ApprovalRequest
	approvalRequest.HTTPResponse = response
	return approvalRequest, nil
}