/// <summary> /// Initializes a new instance of the <see cref="DiscoveryApi" /> class. /// </summary> /// <param name="events">The events<see cref="IEventsClient" /></param> /// <param name="venues">The venues<see cref="IVenuesClient" /></param> /// <param name="attractions">The attractions<see cref="IAttractionsClient" /></param> /// <param name="classifications">The classifications<see cref="IClassificationsClient" /></param> public DiscoveryApi( IEventsClient events, IVenuesClient venues, IAttractionsClient attractions, IClassificationsClient classifications) { _events = events; _venues = venues; _attractions = attractions; _classifications = classifications; }
/// <summary> /// The Configure /// </summary> /// <param name="config">The config<see cref="IClientConfig" /></param> /// <returns>The <see cref="IApiClient" /></returns> public IApiClient Configure(IClientConfig config) { var client = new RestClient(config.ApiRootUrl); _events = new EventsClient(client, config); _venues = new VenuesClient(client, config); _attractions = new AttractionsClient(client, config); _classifications = new ClassificationsClient(client, config); return(this); }
/// <summary> /// Initializes a new instance of the <see cref="DiscoveryApi" /> class. /// </summary> /// <param name="events">The events<see cref="IEventsClient" />.</param> /// <param name="venues">The venues<see cref="IVenuesClient" />.</param> /// <param name="attractions">The attractions<see cref="IAttractionsClient" />.</param> /// <param name="classifications">The classifications<see cref="IClassificationsClient" />.</param> /// <param name="suggestions">The suggestions<see cref="IClassificationsClient" />.</param> public DiscoveryApi( IEventsClient events, IVenuesClient venues, IAttractionsClient attractions, IClassificationsClient classifications, ISuggestionsClient suggestions) { _events = new Lazy <IEventsClient>(() => events); _venues = new Lazy <IVenuesClient>(() => venues); _attractions = new Lazy <IAttractionsClient>(() => attractions); _classifications = new Lazy <IClassificationsClient>(() => classifications); _suggestions = new Lazy <ISuggestionsClient>(() => suggestions); }