io.github.stewseo.client.yelpfusion.events.YelpFusionEventsClient Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of yelp-fusion-client Show documentation
Show all versions of yelp-fusion-client Show documentation
java client to build api objects, handle http transport, and parse/deserialize/serialize json to/from json
package io.github.stewseo.client.yelpfusion.events;
import io.github.stewseo.client.ApiClient;
import io.github.stewseo.client._types.ErrorResponse;
import io.github.stewseo.client.transport.JsonEndpoint;
import io.github.stewseo.client.transport.YelpFusionTransport;
import io.github.stewseo.client.util.ObjectBuilder;
import io.github.stewseo.client.transport.TransportOptions;
import javax.annotation.Nullable;
import java.util.function.Function;
public class YelpFusionEventsClient extends ApiClient {
public YelpFusionEventsClient(YelpFusionTransport transport) {
super(transport, null);
}
public YelpFusionEventsClient(YelpFusionTransport transport, @Nullable TransportOptions transportOptions) {
super(transport, transportOptions);
}
@Override
public YelpFusionEventsClient withTransportOptions(@Nullable TransportOptions transportOptions) {
return new YelpFusionEventsClient(this.transport, transportOptions);
}
public EventSearchResponse search(EventSearchRequest request) throws Exception {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint =
(JsonEndpoint) EventSearchRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
public final EventSearchResponse search(
Function> fn)
throws Exception {
return search(fn.apply(new EventSearchRequest.Builder()).build());
}
public FeaturedEventResponse featured(FeaturedEventRequest request) throws Exception {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint =
(JsonEndpoint) FeaturedEventRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
public final FeaturedEventResponse featured(
Function> fn)
throws Exception {
return featured(fn.apply(new FeaturedEventRequest.Builder()).build());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy