HurriyetSDK$15.smali

.class final Ltr/com/hurriyet/androidsdk/HurriyetSDK$15;
.super Ljava/lang/Object;
.source "HurriyetSDK.java"

# interfaces
.implements Lretrofit2/Callback;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Ltr/com/hurriyet/androidsdk/HurriyetSDK;->getCommentToken(Lretrofit2/Response;Ltr/com/hurriyet/androidsdk/callback/LoginCallback;)Lretrofit2/Call;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x8
    name = null
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Ljava/lang/Object;",
        "Lretrofit2/Callback<",
        "Ltr/com/hurriyet/androidsdk/response/social/GetCommentResponse;",
        ">;"
    }
.end annotation


# instance fields
.field final synthetic val$callback:Ltr/com/hurriyet/androidsdk/callback/LoginCallback;

.field final synthetic val$hurPassRresponse:Lretrofit2/Response;


# direct methods
.method constructor <init>(Lretrofit2/Response;Ltr/com/hurriyet/androidsdk/callback/LoginCallback;)V
    .registers 3

    .line 636
    iput-object p1, p0, Ltr/com/hurriyet/androidsdk/HurriyetSDK$15;->val$hurPassRresponse:Lretrofit2/Response;

    iput-object p2, p0, Ltr/com/hurriyet/androidsdk/HurriyetSDK$15;->val$callback:Ltr/com/hurriyet/androidsdk/callback/LoginCallback;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public onFailure(Lretrofit2/Call;Ljava/lang/Throwable;)V
    .registers 4
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lretrofit2/Call<",
            "Ltr/com/hurriyet/androidsdk/response/social/GetCommentResponse;",
            ">;",
            "Ljava/lang/Throwable;",
            ")V"
        }
    .end annotation

    .line 649
    iget-object p1, p0, Ltr/com/hurriyet/androidsdk/HurriyetSDK$15;->val$callback:Ltr/com/hurriyet/androidsdk/callback/LoginCallback;

    new-instance v0, Ltr/com/hurriyet/androidsdk/model/ErrorResponse;

    invoke-direct {v0}, Ltr/com/hurriyet/androidsdk/model/ErrorResponse;-><init>()V

    invoke-interface {p1, v0}, Ltr/com/hurriyet/androidsdk/callback/LoginCallback;->onError(Ltr/com/hurriyet/androidsdk/model/ErrorResponse;)V

    .line 650
    invoke-virtual {p2}, Ljava/lang/Throwable;->printStackTrace()V

    return-void
.end method

.method public onResponse(Lretrofit2/Call;Lretrofit2/Response;)V
    .registers 3
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lretrofit2/Call<",
            "Ltr/com/hurriyet/androidsdk/response/social/GetCommentResponse;",
            ">;",
            "Lretrofit2/Response<",
            "Ltr/com/hurriyet/androidsdk/response/social/GetCommentResponse;",
            ">;)V"
        }
    .end annotation

    if-eqz p2, :cond_3c

    .line 639
    invoke-virtual {p2}, Lretrofit2/Response;->body()Ljava/lang/Object;

    move-result-object p1

    if-eqz p1, :cond_3c

    invoke-virtual {p2}, Lretrofit2/Response;->body()Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Ltr/com/hurriyet/androidsdk/response/social/GetCommentResponse;

    invoke-virtual {p1}, Ltr/com/hurriyet/androidsdk/response/social/GetCommentResponse;->getCode()I

    move-result p1

    if-nez p1, :cond_3c

    .line 640
    iget-object p1, p0, Ltr/com/hurriyet/androidsdk/HurriyetSDK$15;->val$hurPassRresponse:Lretrofit2/Response;

    invoke-virtual {p1}, Lretrofit2/Response;->body()Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Ltr/com/hurriyet/androidsdk/response/hurpass/LoginResponse;

    iget-object p1, p1, Ltr/com/hurriyet/androidsdk/response/hurpass/LoginResponse;->data:Ltr/com/hurriyet/androidsdk/response/hurpass/LoginData;

    invoke-virtual {p2}, Lretrofit2/Response;->body()Ljava/lang/Object;

    move-result-object p2

    check-cast p2, Ltr/com/hurriyet/androidsdk/response/social/GetCommentResponse;

    invoke-virtual {p2}, Ltr/com/hurriyet/androidsdk/response/social/GetCommentResponse;->getData()Ltr/com/hurriyet/androidsdk/response/social/Data;

    move-result-object p2

    invoke-virtual {p2}, Ltr/com/hurriyet/androidsdk/response/social/Data;->getToken()Ljava/lang/String;

    move-result-object p2

    iput-object p2, p1, Ltr/com/hurriyet/androidsdk/response/hurpass/LoginData;->commentToken:Ljava/lang/String;

    .line 641
    iget-object p1, p0, Ltr/com/hurriyet/androidsdk/HurriyetSDK$15;->val$callback:Ltr/com/hurriyet/androidsdk/callback/LoginCallback;

    iget-object p2, p0, Ltr/com/hurriyet/androidsdk/HurriyetSDK$15;->val$hurPassRresponse:Lretrofit2/Response;

    invoke-virtual {p2}, Lretrofit2/Response;->body()Ljava/lang/Object;

    move-result-object p2

    check-cast p2, Ltr/com/hurriyet/androidsdk/response/hurpass/LoginResponse;

    invoke-interface {p1, p2}, Ltr/com/hurriyet/androidsdk/callback/LoginCallback;->onSuccess(Ltr/com/hurriyet/androidsdk/response/hurpass/LoginResponse;)V

    goto :goto_46

    .line 643
    :cond_3c
    iget-object p1, p0, Ltr/com/hurriyet/androidsdk/HurriyetSDK$15;->val$callback:Ltr/com/hurriyet/androidsdk/callback/LoginCallback;

    new-instance p2, Ltr/com/hurriyet/androidsdk/model/ErrorResponse;

    invoke-direct {p2}, Ltr/com/hurriyet/androidsdk/model/ErrorResponse;-><init>()V

    invoke-interface {p1, p2}, Ltr/com/hurriyet/androidsdk/callback/LoginCallback;->onError(Ltr/com/hurriyet/androidsdk/model/ErrorResponse;)V

    :goto_46
    return-void
.end method