static void Main(string[] args) { var client = new JSONApiClient("http://www.city.gov/API", "*********", "*************"); var request = new EventGetRequest(); request.ID = 1; request.Fields = 1; var response = client.Execute <EventGetRequest, EventGetResponse>(request); }
/// <summary> /// Retrieves the details of a single event. /// </summary> /// <param name="identity">Unique identifier, beginning with "EV".</param> /// <param name="request">An optional `EventGetRequest` representing the query parameters for this get request.</param> /// <param name="customiseRequestMessage">An optional `RequestSettings` allowing you to configure the request</param> /// <returns>A single event resource</returns> public Task <EventResponse> GetAsync(string identity, EventGetRequest request = null, RequestSettings customiseRequestMessage = null) { request = request ?? new EventGetRequest(); if (identity == null) { throw new ArgumentException(nameof(identity)); } var urlParams = new List <KeyValuePair <string, object> > { new KeyValuePair <string, object>("identity", identity), }; return(_goCardlessClient.ExecuteAsync <EventResponse>("GET", "/events/:identity", urlParams, request, null, null, customiseRequestMessage)); }