Class GvlClient
Provides functionality to fetch the GVL from the web.
public class GvlClient
Fields
vendorListUrl
protected const string vendorListUrl = "https://vendor-list.consensu.org/v2/vendor-list.json"
Methods
Fetch()
Fetches the GVL from the web.
public VendorList Fetch()
Returns
Bidtellect.Tcf.Models.VendorList: A Global Vendor List object.### Fetch(string) fetches the GVL from the given URL.
public VendorList Fetch(string url)
Returns
Bidtellect.Tcf.Models.VendorList: A Global Vendor List object.
Parameters
Type | Name | Description |
---|---|---|
System.String | url | The URL from which to get the GVL JSON. |
FetchJson(string)
protected string FetchJson(string url)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | url |
ReadPurposeCollection(JObject)
protected PurposeCollection ReadPurposeCollection(JObject purposes)
Returns
Bidtellect.Tcf.Models.Components.VendorList.PurposeCollection
Parameters
Type | Name |
---|---|
Global.JObject | purposes |
ReadPurposeCollection(int[], PurposeCollection)
protected PurposeCollection ReadPurposeCollection(int[] purposeIds, PurposeCollection lookup)
Returns
Bidtellect.Tcf.Models.Components.VendorList.PurposeCollection
Parameters
Type | Name |
---|---|
System.Int32[] | purposeIds |
Bidtellect.Tcf.Models.Components.VendorList.PurposeCollection | lookup |
ReadPurpose(JObject)
protected Purpose ReadPurpose(JObject element)
Returns
Bidtellect.Tcf.Models.Components.VendorList.Purpose
Parameters
Type | Name |
---|---|
Global.JObject | element |
ReadFeatureCollection(JObject)
protected FeatureCollection ReadFeatureCollection(JObject features)
Returns
Bidtellect.Tcf.Models.Components.VendorList.FeatureCollection
Parameters
Type | Name |
---|---|
Global.JObject | features |
ReadFeatureCollection(int[], FeatureCollection)
protected FeatureCollection ReadFeatureCollection(int[] featureIds, FeatureCollection lookup)
Returns
Bidtellect.Tcf.Models.Components.VendorList.FeatureCollection
Parameters
Type | Name |
---|---|
System.Int32[] | featureIds |
Bidtellect.Tcf.Models.Components.VendorList.FeatureCollection | lookup |
ReadFeature(JObject)
protected Feature ReadFeature(JObject element)
Returns
Bidtellect.Tcf.Models.Components.VendorList.Feature
Parameters
Type | Name |
---|---|
Global.JObject | element |
ReadStackCollection(JObject, StackLookup)
protected StackCollection ReadStackCollection(JObject stacks, GvlClient.StackLookup lookup)
Returns
Bidtellect.Tcf.Models.Components.VendorList.StackCollection
Parameters
Type | Name |
---|---|
Global.JObject | stacks |
Bidtellect.Tcf.GvlClient.StackLookup | lookup |
ReadStack(JObject, StackLookup)
protected Stack ReadStack(JObject element, GvlClient.StackLookup lookup)
Returns
Bidtellect.Tcf.Models.Components.VendorList.Stack
Parameters
Type | Name |
---|---|
Global.JObject | element |
Bidtellect.Tcf.GvlClient.StackLookup | lookup |
ReadVendorCollection(JObject, VendorLookup)
protected VendorCollection ReadVendorCollection(JObject vendors, GvlClient.VendorLookup lookup)
Returns
Bidtellect.Tcf.Models.Components.VendorList.VendorCollection
Parameters
Type | Name |
---|---|
Global.JObject | vendors |
Bidtellect.Tcf.GvlClient.VendorLookup | lookup |
ReadVendor(JObject, VendorLookup)
protected Vendor ReadVendor(JObject element, GvlClient.VendorLookup lookup)
Returns
Bidtellect.Tcf.Models.Components.VendorList.Vendor
Parameters
Type | Name |
---|---|
Global.JObject | element |
Bidtellect.Tcf.GvlClient.VendorLookup | lookup |
ReadJsonBoolean(JObject, string, bool)
protected bool ReadJsonBoolean(JObject element, string propertyName, bool defaultValue = false)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
Global.JObject | element |
System.String | propertyName |
System.Boolean | defaultValue |
ReadJsonNumber(JObject, string, int)
protected int ReadJsonNumber(JObject element, string propertyName, int defaultValue = 0)
Returns
System.Int32
Parameters
Type | Name |
---|---|
Global.JObject | element |
System.String | propertyName |
System.Int32 | defaultValue |
ReadJsonString(JObject, string, string)
protected string ReadJsonString(JObject element, string propertyName, string defaultValue = null)
Returns
System.String
Parameters
Type | Name |
---|---|
Global.JObject | element |
System.String | propertyName |
System.String | defaultValue |
ReadJsonArray(JObject, string)
protected JArray ReadJsonArray(JObject element, string propertyName)
Returns
Global.JArray
Parameters
Type | Name |
---|---|
Global.JObject | element |
System.String | propertyName |
ReadIdArray(JObject, string)
protected int[] ReadIdArray(JObject element, string propertyName)
Returns
System.Int32[]
Parameters
Type | Name |
---|---|
Global.JObject | element |
System.String | propertyName |
ReadJsonObject(JObject, string)
protected JObject ReadJsonObject(JObject element, string propertyName)
Returns
Global.JObject
Parameters
Type | Name |
---|---|
Global.JObject | element |
System.String | propertyName |