// Path: phial-overlay/src/main/java/com/mindcoders/phial/internal/util/Precondition.java
// public final class Precondition {
//     private Precondition() {
//         //to hide-
//     }
// 
//     public static <T> T notNull(T item, String message) {
//         if (item == null) {
//             throw new IllegalArgumentException(message);
//         }
// 
//         return item;
//     }
// 
//     public static void calledFromTools(View view) {
//         if (!view.isInEditMode()) {
//             throw new IllegalArgumentException("should be called only from AndroidStudioTools");
//         }
//     }
// 
//     public static void notImplemented(String what, Context context) {
//         Toast.makeText(context, what + " is NOT Implemented yet", Toast.LENGTH_SHORT).show();
//     }
// 
//     public static void isTrue(boolean condition, String message) {
//         if (!condition) {
//             throw new IllegalArgumentException(message);
//         }
//     }
// 
//     public static <T> void notEmpty(T[] array, String message) {
//         if (array == null || array.length == 0) {
//             throw new IllegalArgumentException(message);
//         }
//     }
// 
//     public static void notEmpty(int[] array, String message) {
//         if (array == null || array.length == 0) {
//             throw new IllegalArgumentException(message);
//         }
//     }
// }


import com.mindcoders.phial.internal.util.Precondition;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import okhttp3.Credentials;
import okhttp3.OkHttpClient;
package com.mindcoders.phial.jira;




/**
 * Created by rost on 10/29/17.
 */

class JiraShareManager {
    interface ResultCallback {
        void onSuccess(String issueName);

        void onFail(Throwable th);
    }

    private final CredentialStore credentialStore;
    private final OkHttpFactory okHttpFactory;
    private final String baseUrl;
    private final String projectKey;
    private final Map<String, Object> extrtaProperties;
    private final ExecutorService executor = Executors.newSingleThreadExecutor();

    JiraShareManager(CredentialStore credentialStore,
                     OkHttpFactory okHttpFactory,
                     String baseUrl, String projectKey,
                     Map<String, Object> extraProperties) {
        this.credentialStore = credentialStore;
        this.okHttpFactory = okHttpFactory;
        this.baseUrl = baseUrl;
        this.projectKey = projectKey;
        this.extrtaProperties = extraProperties;
    }

    boolean isAuthorized() {
        return credentialStore.hasCredentials();
    }

    void share(File attachment, String message, ResultCallback resultCallback) {
// Path: phial-overlay/src/main/java/com/mindcoders/phial/internal/util/Precondition.java
// public final class Precondition {
//     private Precondition() {
//         //to hide-
//     }
// 
//     public static <T> T notNull(T item, String message) {
//         if (item == null) {
//             throw new IllegalArgumentException(message);
//         }
// 
//         return item;
//     }
// 
//     public static void calledFromTools(View view) {
//         if (!view.isInEditMode()) {
//             throw new IllegalArgumentException("should be called only from AndroidStudioTools");
//         }
//     }
// 
//     public static void notImplemented(String what, Context context) {
//         Toast.makeText(context, what + " is NOT Implemented yet", Toast.LENGTH_SHORT).show();
//     }
// 
//     public static void isTrue(boolean condition, String message) {
//         if (!condition) {
//             throw new IllegalArgumentException(message);
//         }
//     }
// 
//     public static <T> void notEmpty(T[] array, String message) {
//         if (array == null || array.length == 0) {
//             throw new IllegalArgumentException(message);
//         }
//     }
// 
//     public static void notEmpty(int[] array, String message) {
//         if (array == null || array.length == 0) {
//             throw new IllegalArgumentException(message);
//         }
//     }
// }


// Path: phial-jira/src/main/java/com/mindcoders/phial/jira/JiraShareManager.java
import com.mindcoders.phial.internal.util.Precondition;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import okhttp3.Credentials;
import okhttp3.OkHttpClient;

package com.mindcoders.phial.jira;




/**
 * Created by rost on 10/29/17.
 */

class JiraShareManager {
    interface ResultCallback {
        void onSuccess(String issueName);

        void onFail(Throwable th);
    }

    private final CredentialStore credentialStore;
    private final OkHttpFactory okHttpFactory;
    private final String baseUrl;
    private final String projectKey;
    private final Map<String, Object> extrtaProperties;
    private final ExecutorService executor = Executors.newSingleThreadExecutor();

    JiraShareManager(CredentialStore credentialStore,
                     OkHttpFactory okHttpFactory,
                     String baseUrl, String projectKey,
                     Map<String, Object> extraProperties) {
        this.credentialStore = credentialStore;
        this.okHttpFactory = okHttpFactory;
        this.baseUrl = baseUrl;
        this.projectKey = projectKey;
        this.extrtaProperties = extraProperties;
    }

    boolean isAuthorized() {
        return credentialStore.hasCredentials();
    }

    void share(File attachment, String message, ResultCallback resultCallback) {
        Precondition.isTrue(isAuthorized(), "call of share when not authorized");