// Path: src/main/java/com/deswaef/twitch/api/channels/ChannelResource.java
// public class ChannelResource {
// 
//     private ChannelService channelService;
// 
// 
//     public Optional<TwitchChannel> channel(String channelName) {
//         Assert.notNull(channelName, "please enter a channelname");
//         try {
//             return Optional.ofNullable(channelService.channel(channelName));
//         } catch (Exception ex) {
//             return Optional.empty();
//         }
//     }
// 
//     public ChannelResource url(RestAdapter url) {
//         this.channelService = url.create(ChannelService.class);
//         return this;
//     }
// 
// }
// 
// Path: src/main/java/com/deswaef/twitch/api/oauth/AccessTokenResource.java
// public class AccessTokenResource {
// 
//     private AccessTokenService accessTokenService;
// 
//     private AccessTokenRequest requestTemplate;
// 
//     public AccessTokenResource() {
//         super();
//         requestTemplate = new AccessTokenRequest();
//     }
// 
//     public AccessTokenResponse requestToken(String accessCode) {
//         try {
//             return accessTokenService.requestToken(requestTemplate.copy(accessCode));
//         } catch(Exception ex) {
//             return AccessTokenResponse.unknown_issue();
//         }
//     }
// 
//     public AccessTokenResource setClientId(String clientId) {
//         this.requestTemplate.setClient_id(clientId);
//         return this;
//     }
// 
// 
//     public AccessTokenResource setClientSecret(String clientSecret) {
//         this.requestTemplate.setClient_secret(clientSecret);
//         return this;
//     }
// 
//     public AccessTokenResource setRedirectUrl(String redirectUrl) {
//         this.requestTemplate.setRedirect_uri(redirectUrl);
//         return this;
//     }
// 
//     public AccessTokenResource setBaseUrl(RestAdapter restAdaptor) {
//         this.accessTokenService = restAdaptor.create(AccessTokenService.class);
//         return this;
//     }
// }
// 
// Path: src/main/java/com/deswaef/twitch/api/user/UserResource.java
// public class UserResource {
// 
//     private UserService userService;
// 
//     public Optional<User> user(String user) {
//         try {
//             return Optional.ofNullable(userService.user(user));
//         } catch (Exception ex) {
//             return Optional.empty();
//         }
//     }
// 
//     public Optional<User> getAuthenticatedUser(String accessToken) throws UnAuthorizedException{
//         try {
//             return Optional.ofNullable(userService.authenticatedUser(accessToken));
//         } catch (Exception ex) {
//             throw new UnAuthorizedException();
//         }
//     }
// 
// 
//     public UserResource url(RestAdapter restAdapter) {
//         this.userService = restAdapter.create(UserService.class);
//         return this;
//     }
// }
// 
// Path: src/main/java/com/deswaef/twitch/api/streams/StreamResource.java
// public class StreamResource  {
// 
//     private StreamService streamService;
// 
//     /**
//      * returns a list of the current top streams
//      *
//      * @return List of TwitchStream
//      */
//     public List<TwitchStream> streams() {
//         try {
//             return Arrays.asList(
//                     streamService.streams()
//                             .getStreams());
//         } catch (Exception ex) {
//             return new ArrayList<>();
//         }
//     }
// 
//     /**
//      * Returns an Optional of Streamcheck.
//      * If the stream does not exist, the optional is empty.
//      * Otherwise, utility methods in the StreamCheck will tell you if the stream is online or not.
//      *
//      * @param stream String name of the stream
//      * @return Optional of StreamCheck
//      */
//     public Optional<StreamCheck> stream(String stream) {
//         Assert.notNull(stream, "url for stream must not be null");
//         try {
//             return Optional.of(streamService.stream(stream));
//         } catch (Exception exception) {
//             return Optional.empty();
//         }
//     }
// 
//     public StreamResource url(RestAdapter restAdapter) {
//         this.streamService = restAdapter.create(StreamService.class);
//         return this;
//     }
// 
// }


import com.deswaef.twitch.api.channels.ChannelResource;
import com.deswaef.twitch.api.oauth.AccessTokenResource;
import com.deswaef.twitch.api.user.UserResource;
import com.deswaef.twitch.api.streams.StreamResource;
import retrofit.RestAdapter;
package com.deswaef.twitch.configuration;


public class Twitch {

    private StreamResource streams;
// Path: src/main/java/com/deswaef/twitch/api/channels/ChannelResource.java
// public class ChannelResource {
// 
//     private ChannelService channelService;
// 
// 
//     public Optional<TwitchChannel> channel(String channelName) {
//         Assert.notNull(channelName, "please enter a channelname");
//         try {
//             return Optional.ofNullable(channelService.channel(channelName));
//         } catch (Exception ex) {
//             return Optional.empty();
//         }
//     }
// 
//     public ChannelResource url(RestAdapter url) {
//         this.channelService = url.create(ChannelService.class);
//         return this;
//     }
// 
// }
// 
// Path: src/main/java/com/deswaef/twitch/api/oauth/AccessTokenResource.java
// public class AccessTokenResource {
// 
//     private AccessTokenService accessTokenService;
// 
//     private AccessTokenRequest requestTemplate;
// 
//     public AccessTokenResource() {
//         super();
//         requestTemplate = new AccessTokenRequest();
//     }
// 
//     public AccessTokenResponse requestToken(String accessCode) {
//         try {
//             return accessTokenService.requestToken(requestTemplate.copy(accessCode));
//         } catch(Exception ex) {
//             return AccessTokenResponse.unknown_issue();
//         }
//     }
// 
//     public AccessTokenResource setClientId(String clientId) {
//         this.requestTemplate.setClient_id(clientId);
//         return this;
//     }
// 
// 
//     public AccessTokenResource setClientSecret(String clientSecret) {
//         this.requestTemplate.setClient_secret(clientSecret);
//         return this;
//     }
// 
//     public AccessTokenResource setRedirectUrl(String redirectUrl) {
//         this.requestTemplate.setRedirect_uri(redirectUrl);
//         return this;
//     }
// 
//     public AccessTokenResource setBaseUrl(RestAdapter restAdaptor) {
//         this.accessTokenService = restAdaptor.create(AccessTokenService.class);
//         return this;
//     }
// }
// 
// Path: src/main/java/com/deswaef/twitch/api/user/UserResource.java
// public class UserResource {
// 
//     private UserService userService;
// 
//     public Optional<User> user(String user) {
//         try {
//             return Optional.ofNullable(userService.user(user));
//         } catch (Exception ex) {
//             return Optional.empty();
//         }
//     }
// 
//     public Optional<User> getAuthenticatedUser(String accessToken) throws UnAuthorizedException{
//         try {
//             return Optional.ofNullable(userService.authenticatedUser(accessToken));
//         } catch (Exception ex) {
//             throw new UnAuthorizedException();
//         }
//     }
// 
// 
//     public UserResource url(RestAdapter restAdapter) {
//         this.userService = restAdapter.create(UserService.class);
//         return this;
//     }
// }
// 
// Path: src/main/java/com/deswaef/twitch/api/streams/StreamResource.java
// public class StreamResource  {
// 
//     private StreamService streamService;
// 
//     /**
//      * returns a list of the current top streams
//      *
//      * @return List of TwitchStream
//      */
//     public List<TwitchStream> streams() {
//         try {
//             return Arrays.asList(
//                     streamService.streams()
//                             .getStreams());
//         } catch (Exception ex) {
//             return new ArrayList<>();
//         }
//     }
// 
//     /**
//      * Returns an Optional of Streamcheck.
//      * If the stream does not exist, the optional is empty.
//      * Otherwise, utility methods in the StreamCheck will tell you if the stream is online or not.
//      *
//      * @param stream String name of the stream
//      * @return Optional of StreamCheck
//      */
//     public Optional<StreamCheck> stream(String stream) {
//         Assert.notNull(stream, "url for stream must not be null");
//         try {
//             return Optional.of(streamService.stream(stream));
//         } catch (Exception exception) {
//             return Optional.empty();
//         }
//     }
// 
//     public StreamResource url(RestAdapter restAdapter) {
//         this.streamService = restAdapter.create(StreamService.class);
//         return this;
//     }
// 
// }


// Path: src/main/java/com/deswaef/twitch/configuration/Twitch.java
import com.deswaef.twitch.api.channels.ChannelResource;
import com.deswaef.twitch.api.oauth.AccessTokenResource;
import com.deswaef.twitch.api.user.UserResource;
import com.deswaef.twitch.api.streams.StreamResource;
import retrofit.RestAdapter;

package com.deswaef.twitch.configuration;


public class Twitch {

    private StreamResource streams;
    private ChannelResource channels;