<commit_before>package ciolite

import "github.com/contextio/contextio-go/cioutil"

// Api functions that support: https://context.io/docs/lite/discovery

// GetDiscoveryParams query values data struct.
// Requires SourceType and Email.
// 	https://context.io/docs/lite/discovery#get
type GetDiscoveryParams struct {
	// Required:
	SourceType string `json:"source_type"`
	Email      string `json:"email"`
}

// GetDiscoveryResponse data struct
// 	https://context.io/docs/lite/discovery#get
type GetDiscoveryResponse struct {
	Email         string        `json:"email,omitempty"`
	Type          string        `json:"type,omitempty"`
	Documentation []interface{} `json:"documentation,omitempty"`

	Found bool `json:"found,omitempty"`

	IMAP GetDiscoveryIMAPResponse `json:"imap,omitempty"`
}

// GetDiscoveryIMAPResponse embedded data struct
// 	https://context.io/docs/lite/discovery#get
type GetDiscoveryIMAPResponse struct {
	Server   string `json:"server,omitempty"`
	Username string `json:"username,omitempty"`

	UseSSL bool `json:"use_ssl,omitempty"`
	OAuth  bool `json:"oauth,omitempty"`

	Port int `json:"port,omitempty"`
}

// GetDiscovery attempts to discover connection settings for a given email address.
// queryValues requires SourceType and Email to be set.
// 	https://context.io/docs/lite/discovery#get
func (cioLite CioLite) GetDiscovery(queryValues GetDiscoveryParams) (GetDiscoveryResponse, error) {

	// Make request
	request := cioutil.ClientRequest{
		Method:      "GET",
		Path:        "/discovery",
		QueryValues: queryValues,<commit_msg>Adding value field for discovery response<commit_after>package ciolite

import "github.com/contextio/contextio-go/cioutil"

// Api functions that support: https://context.io/docs/lite/discovery

// GetDiscoveryParams query values data struct.
// Requires SourceType and Email.
// 	https://context.io/docs/lite/discovery#get
type GetDiscoveryParams struct {
	// Required:
	SourceType string `json:"source_type"`
	Email      string `json:"email"`
}

// GetDiscoveryResponse data struct
// 	https://context.io/docs/lite/discovery#get
type GetDiscoveryResponse struct {
	Email string `json:"email,omitempty"`
	Type  string `json:"type,omitempty"`

	// Value only appears if there is an error message
	Value string `json:"value,omitempty"`

	Documentation []interface{} `json:"documentation,omitempty"`

	Found bool `json:"found,omitempty"`

	IMAP GetDiscoveryIMAPResponse `json:"imap,omitempty"`
}

// GetDiscoveryIMAPResponse embedded data struct
// 	https://context.io/docs/lite/discovery#get
type GetDiscoveryIMAPResponse struct {
	Server   string `json:"server,omitempty"`
	Username string `json:"username,omitempty"`

	UseSSL bool `json:"use_ssl,omitempty"`
	OAuth  bool `json:"oauth,omitempty"`

	Port int `json:"port,omitempty"`
}

// GetDiscovery attempts to discover connection settings for a given email address.
// queryValues requires SourceType and Email to be set.
// 	https://context.io/docs/lite/discovery#get
func (cioLite CioLite) GetDiscovery(queryValues GetDiscoveryParams) (GetDiscoveryResponse, error) {

	// Make request
	request := cioutil.ClientRequest{
		Method:      "GET",
		Path:        "/discovery",
		QueryValues: queryValues,
{'fraction_non_alphanumeric': 0.11695178849144634, 'fraction_numerical': 0.0, 'mean_word_length': 4.692035398230089, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6780467', 'n_tokens_mistral': 969, 'n_tokens_neox': 933, 'n_words': 238}