//***** AUTOGENERATED - DO NOT CHANGE! *****//

//***** SEARCHSERVICE *****//
var SearchService = function() {
    this.ajax = new AjaxObj();
    this.ajax.service = "SearchService";
}
SearchService.prototype.GetSearch = function(a) {
    this.ajax.method = "GetSearch";
    this.ajax.parameters = new Object();
    this.ajax.parameters["a"] = AjaxObj.shrink(a, "SearchQuery");
    this.ajax.POST();
}
SearchService.prototype.GetFacetsConfig = function(a) {
    this.ajax.method = "GetFacetsConfig";
    this.ajax.parameters = new Object();
    this.ajax.parameters["a"] = a;
    this.ajax.POST();
}
SearchService.prototype.GetSuggestions = function(a, b) {
    this.ajax.method = "GetSuggestions";
    this.ajax.parameters = new Object();
    this.ajax.parameters["a"] = a;
    this.ajax.parameters["b"] = b;
    this.ajax.POST();
}
//***** OBJECT EXPANDERS AFTER AJAX TRANSPORT *****//
var Expanders = {
    SearchQuery: function(obj) {
        var o = new Object();
        o.QueryText = obj.A; //String
        o.FilterQueries = AjaxObj.expand(obj.B); //List`1(FacetFE)
        o.PageNumber = obj.C; //Nullable`1(Int32)
        o.PageSize = obj.D; //Nullable`1(Int32)
        o.FacetNames = obj.E; //List`1(String)
        o.Sort = obj.F; //String
        o.ContextId = obj.G; //String
        o.ContextLanguage = obj.H; //String
        return o;
    },
    Facet: function(obj) {
        var o = new Object();
        o.FieldName = obj.A; //String
        o.FacetFields = AjaxObj.expand(obj.B); //List`1(FacetFieldFE)
        o.EmptyFacetStyleType = obj.C; //String
        o.FacetType = obj.D; //String
        o.FacetQueries = obj.E; //List`1(String)
        return o;
    },
    FacetField: function(obj) {
        var o = new Object();
        o.FieldName = obj.A; //String
        o.Count = obj.B; //Int32
        o.NiceName = obj.C; //String
        return o;
    },
    SearchResult: function(obj) {
        var o = new Object();
        o.TotalHits = obj.A; //Int32
        o.Count = obj.B; //Int32
        o.ResultSet = AjaxObj.expand(obj.C); //List`1(DocumentFE)
        o.PagingStart = obj.D; //Int32
        o.PagingRows = obj.E; //Int32
        o.Suggestions = obj.F; //String[]
        o.Facets = AjaxObj.expand(obj.G); //List`1(FacetFE)
        return o;
    },
    Document: function(obj) {
        var o = new Object();
        o.Id = obj.A; //String
        o.Fields = AjaxObj.expand(obj.B); //List`1(FieldFE)
        o.Highlights = obj.C; //List`1(String)
        return o;
    },
    Field: function(obj) {
        var o = new Object();
        o.FieldName = obj.A; //String
        o.Value = obj.B; //Object
        o.Type = obj.C; //String
        return o;
    },
    FacetConfig: function(obj) {
        var o = new Object();
        o.DisplayName = obj.A; //String
        o.SearchEngineName = obj.B; //String
        o.AndOperation = obj.C; //Boolean
        o.OrOperation = obj.D; //Boolean
        o.NumberOfTopLevelFacets = obj.E; //Int32
        o.CloseFacetBox = obj.F; //Boolean
        o.EmptyFacetStyleType = obj.G; //String
        return o;
    }
}
//***** OBJECT SHRINKERS BEFORE AJAX TRANSPORT *****//
var Shrinkers = {
    SearchQuery: function(obj) {
        var o = new Object();
        o.A = obj.QueryText; //String
        o.B = AjaxObj.shrink(obj.FilterQueries, "Facet"); //List`1(FacetFE)
        o.C = obj.PageNumber; //Nullable`1(Int32)
        o.D = obj.PageSize; //Nullable`1(Int32)
        o.E = obj.FacetNames; //List`1(String)
        o.F = obj.Sort; //String
        o.G = obj.ContextId; //String
        o.H = obj.ContextLanguage; //String
        return o;
    },
    Facet: function(obj) {
        var o = new Object();
        o.A = obj.FieldName; //String
        o.B = AjaxObj.shrink(obj.FacetFields, "FacetField"); //List`1(FacetFieldFE)
        o.C = obj.EmptyFacetStyleType; //String
        o.D = obj.FacetType; //String
        o.E = obj.FacetQueries; //List`1(String)
        return o;
    },
    FacetField: function(obj) {
        var o = new Object();
        o.A = obj.FieldName; //String
        o.B = obj.Count; //Int32
        o.C = obj.NiceName; //String
        return o;
    },
    SearchResult: function(obj) {
        var o = new Object();
        o.A = obj.TotalHits; //Int32
        o.B = obj.Count; //Int32
        o.C = AjaxObj.shrink(obj.ResultSet, "Document"); //List`1(DocumentFE)
        o.D = obj.PagingStart; //Int32
        o.E = obj.PagingRows; //Int32
        o.F = obj.Suggestions; //String[]
        o.G = AjaxObj.shrink(obj.Facets, "Facet"); //List`1(FacetFE)
        return o;
    },
    Document: function(obj) {
        var o = new Object();
        o.A = obj.Id; //String
        o.B = AjaxObj.shrink(obj.Fields, "Field"); //List`1(FieldFE)
        o.C = obj.Highlights; //List`1(String)
        return o;
    },
    Field: function(obj) {
        var o = new Object();
        o.A = obj.FieldName; //String
        o.B = obj.Value; //Object
        o.C = obj.Type; //String
        return o;
    },
    FacetConfig: function(obj) {
        var o = new Object();
        o.A = obj.DisplayName; //String
        o.B = obj.SearchEngineName; //String
        o.C = obj.AndOperation; //Boolean
        o.D = obj.OrOperation; //Boolean
        o.E = obj.NumberOfTopLevelFacets; //Int32
        o.F = obj.CloseFacetBox; //Boolean
        o.G = obj.EmptyFacetStyleType; //String
        return o;
    }
}

