// Path: app/src/main/java/info/izumin/android/sunazuri/domain/entity/AuthorizedUser.java
// public class AuthorizedUser {
//     public static final String TAG = AuthorizedUser.class.getSimpleName();
// 
//     public final long id;
//     public final String name;
//     public final String screenName;
//     public final Date createdAt;
//     public final Date updatedAt;
//     public final String icon;
//     public final String email;
// 
//     public final AccessToken token;
// 
//     public AuthorizedUser(long id,
//                           String name,
//                           String screenName,
//                           Date createdAt,
//                           Date updatedAt,
//                           String icon,
//                           String email,
//                           AccessToken token) {
//         this.id = id;
//         this.name = name;
//         this.screenName = screenName;
//         this.createdAt = createdAt;
//         this.updatedAt = updatedAt;
//         this.icon = icon;
//         this.email = email;
//         this.token = token;
//     }
// }
// 
// Path: app/src/main/java/info/izumin/android/sunazuri/domain/repository/OauthRepository.java
// public interface OauthRepository {
//     Single<AuthorizedUser> getToken(String code);
// }


import info.izumin.android.sunazuri.domain.entity.AuthorizedUser;
import info.izumin.android.sunazuri.domain.repository.OauthRepository;
import info.izumin.android.sunazuri.infrastructure.entity.mapper.AuthorizedUserMapper;
import rx.Single;
import javax.inject.Inject;
import javax.inject.Singleton;
package info.izumin.android.sunazuri.infrastructure.repository.source.oauth;



/**
 * Created by izumin on 5/13/2016 AD.
 */
@Singleton
class OauthRepositoryImpl implements OauthRepository {
    public static final String TAG = OauthRepositoryImpl.class.getSimpleName();

    private final OauthDataSourceFactory dataSourceFactory;
    private final AuthorizedUserMapper authorizedUserMapper;

    @Inject
    OauthRepositoryImpl(OauthDataSourceFactory dataSourceFactory,
                        AuthorizedUserMapper authorizedUserMapper) {
        this.dataSourceFactory = dataSourceFactory;
        this.authorizedUserMapper = authorizedUserMapper;
    }

    @Override
// Path: app/src/main/java/info/izumin/android/sunazuri/domain/entity/AuthorizedUser.java
// public class AuthorizedUser {
//     public static final String TAG = AuthorizedUser.class.getSimpleName();
// 
//     public final long id;
//     public final String name;
//     public final String screenName;
//     public final Date createdAt;
//     public final Date updatedAt;
//     public final String icon;
//     public final String email;
// 
//     public final AccessToken token;
// 
//     public AuthorizedUser(long id,
//                           String name,
//                           String screenName,
//                           Date createdAt,
//                           Date updatedAt,
//                           String icon,
//                           String email,
//                           AccessToken token) {
//         this.id = id;
//         this.name = name;
//         this.screenName = screenName;
//         this.createdAt = createdAt;
//         this.updatedAt = updatedAt;
//         this.icon = icon;
//         this.email = email;
//         this.token = token;
//     }
// }
// 
// Path: app/src/main/java/info/izumin/android/sunazuri/domain/repository/OauthRepository.java
// public interface OauthRepository {
//     Single<AuthorizedUser> getToken(String code);
// }


// Path: app/src/main/java/info/izumin/android/sunazuri/infrastructure/repository/source/oauth/OauthRepositoryImpl.java
import info.izumin.android.sunazuri.domain.entity.AuthorizedUser;
import info.izumin.android.sunazuri.domain.repository.OauthRepository;
import info.izumin.android.sunazuri.infrastructure.entity.mapper.AuthorizedUserMapper;
import rx.Single;
import javax.inject.Inject;
import javax.inject.Singleton;

package info.izumin.android.sunazuri.infrastructure.repository.source.oauth;



/**
 * Created by izumin on 5/13/2016 AD.
 */
@Singleton
class OauthRepositoryImpl implements OauthRepository {
    public static final String TAG = OauthRepositoryImpl.class.getSimpleName();

    private final OauthDataSourceFactory dataSourceFactory;
    private final AuthorizedUserMapper authorizedUserMapper;

    @Inject
    OauthRepositoryImpl(OauthDataSourceFactory dataSourceFactory,
                        AuthorizedUserMapper authorizedUserMapper) {
        this.dataSourceFactory = dataSourceFactory;
        this.authorizedUserMapper = authorizedUserMapper;
    }

    @Override
    public Single<AuthorizedUser> getToken(String code) {