// Path: src/main/java/org/nameapi/client/lib/NameApiModeFactory.java
// public class NameApiModeFactory {
// 
//     private static final Host DEFAULT_HOST = new Host("api.nameapi.org", 80);
//     private static final NameApiPortUrlFactory DEFAULT_PORT_FACTORY = NameApiPortUrlFactory.versionLatestStable();
// 
// 
//     /**
//      * You can take this and extend for your setup if you need more.
//      *
//      * <p>Example: .with(StdoutLoggingExtension.enabled())</p>
//      *
//      * @param apiKey Your personal api key from registering with us.
//      * @param host for example {@code new Host("api.nameapi.org", 80)}
//      * @param portUrlFactory for example {@code NameApiPortUrlFactory.versionLatestStable()}
//      */
//     @NotNull
//     public static Mode minimal(@NotNull String apiKey, @NotNull Host host, @NotNull RestPortUrlFactory portUrlFactory) {
//         return Mode.create()
//                 .with(RestKeys.REST_PORT_URL_FACTORY, portUrlFactory)
// //                .with(ExceptionTranslationExtension.TRANSLATOR, new CombinedExceptionTranslator(new DefaultClientExceptionTranslator(), new SoapFaultExceptionTranslator()))
//                 .with(Keys.HOST, host)
//                 .with(NameApiKeys.API_KEY, apiKey);
//     }
// 
//     /**
//      * Overloaded method that uses
//      * for host: {@code new Host("api.nameapi.org", 80)}
//      * for port url: {@code NameApiPortUrlFactory.versionLatestStable()}
//      */
//     @NotNull
//     public static Mode minimal(@NotNull String apiKey) {
//         return minimal(apiKey, DEFAULT_HOST, DEFAULT_PORT_FACTORY);
//     }
// 
// 
//     /**
//      * You can take this and extend for your setup if you need more.
//      *
//      * <p>Example: .with(StdoutLoggingExtension.enabled())</p>
//      *
//      * @param apiKey Your personal api key from registering with us.
//      * @param context for example {@code new ContextBuilder().priority(Priority.REALTIME).build()}
//      * @param host for example {@code new Host("api.nameapi.org", 80)}
//      * @param portUrlFactory for example {@code NameApiPortUrlFactory.versionLatestStable()}
//      */
//     @NotNull
//     public static Mode withContext(@NotNull String apiKey, @NotNull Context context, @NotNull Host host, @NotNull RestPortUrlFactory portUrlFactory) {
//         return minimal(apiKey, host, portUrlFactory)
//                 .with(NameApiKeys.CONTEXT, context);
//     }
// 
//     /**
//      * Overloaded method that uses
//      * for host: {@code new Host("api.nameapi.org", 80)}
//      * for port url: {@code NameApiPortUrlFactory.versionLatestStable()}
//      */
//     @NotNull
//     public static Mode withContext(@NotNull String apiKey, @NotNull Context context) {
//         return withContext(apiKey, context, DEFAULT_HOST, DEFAULT_PORT_FACTORY);
//     }
// 
// }
// 
// Path: src/main/java/org/nameapi/client/lib/NameApiPortUrlFactory.java
// public class NameApiPortUrlFactory extends AbstractRestPortUrlFactory {
// 
//     private final String restPrefix;
// 
//     /**
//      * This is updated whenever the "latest stable" server api version changes.
//      *
//      * Currently this is version 5.0.
//      */
//     public static NameApiPortUrlFactory versionLatestStable() {
//         return version5_0();
//     }
// 
//     /**
//      * This is always set to the latest release candidate, that is the version right before it becomes the latest stable.
//      * Such a version does not always exist. After successful testing, it becomes the live version.
//      *
//      * Currently this is version 5.3.
//      */
//     public static NameApiPortUrlFactory versionLatestReleaseCandidate() {
//         return version5_3();
//     }
// 
//     /**
//      * This is always set to the current main development version.
//      * You do not necessarily have access to this.
//      *
//      * Currently this is version 5.3.
//      */
//     public static NameApiPortUrlFactory versionLatestDevelopment() {
//         return version5_3();
//     }
// 
//     public static NameApiPortUrlFactory version5_0() {
//         return new NameApiPortUrlFactory("5.0");
//     }
//     public static NameApiPortUrlFactory version5_3() {
//         return new NameApiPortUrlFactory("5.3");
//     }
// 
//     /**
//      * @param version for example "5.3".
//      */
//     private NameApiPortUrlFactory(@NotNull String version) {
//         this.restPrefix = "/rest/v"+version;
//     }
// 
//     @NotNull @Override
//     public URL createUrl(@NotNull Host host) {
//         return createUrl(host, restPrefix);
//     }
// }


import com.optimaize.anythingworks.common.host.Host;
import com.optimaize.command4j.Mode;
import com.optimaize.command4j.ext.extensions.logging.stdoutlogging.StdoutLoggingExtension;
import org.jetbrains.annotations.NotNull;
import org.nameapi.client.lib.NameApiModeFactory;
import org.nameapi.client.lib.NameApiPortUrlFactory;
import org.nameapi.ontology5.input.context.Context;
import org.nameapi.ontology5.input.context.ContextBuilder;
import org.nameapi.ontology5.input.context.Priority;
package org.nameapi.client.services;


/**
 * @author Fabian Kessler
 */
public class FunctionalTestsNameApiModeFactory extends NameApiModeFactory {

    //Developer: set your api key here. It looks something like this:
    //private static final String API_KEY = "32d21gc5071d7463ef6064c07ea98cb2-user1";
    private static final String API_KEY = null;

    private static final Mode unitTestMode = withContext(API_KEY, makeContext(),
            //the default and live server is "api.nameapi.org"
            //we're using the latest release candidate with latest features here:
// Path: src/main/java/org/nameapi/client/lib/NameApiModeFactory.java
// public class NameApiModeFactory {
// 
//     private static final Host DEFAULT_HOST = new Host("api.nameapi.org", 80);
//     private static final NameApiPortUrlFactory DEFAULT_PORT_FACTORY = NameApiPortUrlFactory.versionLatestStable();
// 
// 
//     /**
//      * You can take this and extend for your setup if you need more.
//      *
//      * <p>Example: .with(StdoutLoggingExtension.enabled())</p>
//      *
//      * @param apiKey Your personal api key from registering with us.
//      * @param host for example {@code new Host("api.nameapi.org", 80)}
//      * @param portUrlFactory for example {@code NameApiPortUrlFactory.versionLatestStable()}
//      */
//     @NotNull
//     public static Mode minimal(@NotNull String apiKey, @NotNull Host host, @NotNull RestPortUrlFactory portUrlFactory) {
//         return Mode.create()
//                 .with(RestKeys.REST_PORT_URL_FACTORY, portUrlFactory)
// //                .with(ExceptionTranslationExtension.TRANSLATOR, new CombinedExceptionTranslator(new DefaultClientExceptionTranslator(), new SoapFaultExceptionTranslator()))
//                 .with(Keys.HOST, host)
//                 .with(NameApiKeys.API_KEY, apiKey);
//     }
// 
//     /**
//      * Overloaded method that uses
//      * for host: {@code new Host("api.nameapi.org", 80)}
//      * for port url: {@code NameApiPortUrlFactory.versionLatestStable()}
//      */
//     @NotNull
//     public static Mode minimal(@NotNull String apiKey) {
//         return minimal(apiKey, DEFAULT_HOST, DEFAULT_PORT_FACTORY);
//     }
// 
// 
//     /**
//      * You can take this and extend for your setup if you need more.
//      *
//      * <p>Example: .with(StdoutLoggingExtension.enabled())</p>
//      *
//      * @param apiKey Your personal api key from registering with us.
//      * @param context for example {@code new ContextBuilder().priority(Priority.REALTIME).build()}
//      * @param host for example {@code new Host("api.nameapi.org", 80)}
//      * @param portUrlFactory for example {@code NameApiPortUrlFactory.versionLatestStable()}
//      */
//     @NotNull
//     public static Mode withContext(@NotNull String apiKey, @NotNull Context context, @NotNull Host host, @NotNull RestPortUrlFactory portUrlFactory) {
//         return minimal(apiKey, host, portUrlFactory)
//                 .with(NameApiKeys.CONTEXT, context);
//     }
// 
//     /**
//      * Overloaded method that uses
//      * for host: {@code new Host("api.nameapi.org", 80)}
//      * for port url: {@code NameApiPortUrlFactory.versionLatestStable()}
//      */
//     @NotNull
//     public static Mode withContext(@NotNull String apiKey, @NotNull Context context) {
//         return withContext(apiKey, context, DEFAULT_HOST, DEFAULT_PORT_FACTORY);
//     }
// 
// }
// 
// Path: src/main/java/org/nameapi/client/lib/NameApiPortUrlFactory.java
// public class NameApiPortUrlFactory extends AbstractRestPortUrlFactory {
// 
//     private final String restPrefix;
// 
//     /**
//      * This is updated whenever the "latest stable" server api version changes.
//      *
//      * Currently this is version 5.0.
//      */
//     public static NameApiPortUrlFactory versionLatestStable() {
//         return version5_0();
//     }
// 
//     /**
//      * This is always set to the latest release candidate, that is the version right before it becomes the latest stable.
//      * Such a version does not always exist. After successful testing, it becomes the live version.
//      *
//      * Currently this is version 5.3.
//      */
//     public static NameApiPortUrlFactory versionLatestReleaseCandidate() {
//         return version5_3();
//     }
// 
//     /**
//      * This is always set to the current main development version.
//      * You do not necessarily have access to this.
//      *
//      * Currently this is version 5.3.
//      */
//     public static NameApiPortUrlFactory versionLatestDevelopment() {
//         return version5_3();
//     }
// 
//     public static NameApiPortUrlFactory version5_0() {
//         return new NameApiPortUrlFactory("5.0");
//     }
//     public static NameApiPortUrlFactory version5_3() {
//         return new NameApiPortUrlFactory("5.3");
//     }
// 
//     /**
//      * @param version for example "5.3".
//      */
//     private NameApiPortUrlFactory(@NotNull String version) {
//         this.restPrefix = "/rest/v"+version;
//     }
// 
//     @NotNull @Override
//     public URL createUrl(@NotNull Host host) {
//         return createUrl(host, restPrefix);
//     }
// }


// Path: src/test/functional/java/org/nameapi/client/services/FunctionalTestsNameApiModeFactory.java
import com.optimaize.anythingworks.common.host.Host;
import com.optimaize.command4j.Mode;
import com.optimaize.command4j.ext.extensions.logging.stdoutlogging.StdoutLoggingExtension;
import org.jetbrains.annotations.NotNull;
import org.nameapi.client.lib.NameApiModeFactory;
import org.nameapi.client.lib.NameApiPortUrlFactory;
import org.nameapi.ontology5.input.context.Context;
import org.nameapi.ontology5.input.context.ContextBuilder;
import org.nameapi.ontology5.input.context.Priority;

package org.nameapi.client.services;


/**
 * @author Fabian Kessler
 */
public class FunctionalTestsNameApiModeFactory extends NameApiModeFactory {

    //Developer: set your api key here. It looks something like this:
    //private static final String API_KEY = "32d21gc5071d7463ef6064c07ea98cb2-user1";
    private static final String API_KEY = null;

    private static final Mode unitTestMode = withContext(API_KEY, makeContext(),
            //the default and live server is "api.nameapi.org"
            //we're using the latest release candidate with latest features here:
            new Host("rc50-api.nameapi.org", 80), NameApiPortUrlFactory.versionLatestStable())