Synchronized singleton instance method using default URL string
@param apiKey Sailthru API key string
@param apiSecret Sailthru API secret string
@param apiUrl Sailthru API URL
@return singleton instance of SailthruClient
@deprecated
324445
public static synchronized SailthruClient getInstance(String apiKey, String apiSecret, String apiUrl) {
        if (_instance == null) {
            _instance = new SailthruClient(apiKey, apiSecret, apiUrl);
        }
        return _instance;
    }
1039772
public T create(Map<String, Object> hash, MnoHttpClient httpClient) throws AuthenticationException, ApiException, InvalidRequestException {
		String jsonBody = httpClient.post(getCollectionUrl(), GSON.toJson(MnoMapHelper.toUnderscoreHash(hash)));

		Type parsingType = new MnoAccountResponseParameterizedType(entitityClass);
		MnoAccountResponse<T> resp = GSON.fromJson(jsonBody, parsingType);
		resp.validate();

		return resp.getData();
	}
545399
public static PredictionEndpoint authenticate(String baseUrl, final String apiKey) {
        ServiceClientCredentials serviceClientCredentials = new ServiceClientCredentials() {
            @Override
            public void applyCredentialsFilter(OkHttpClient.Builder builder) {
            }
        };
        return authenticate(baseUrl, serviceClientCredentials, apiKey);
    }
977396
public OmdbBuilder setApiKey(final String apiKey) throws OMDBException {
        if (StringUtils.isBlank(apiKey)) {
            throw new OMDBException(ApiExceptionType.AUTH_FAILURE, "Must provide an ApiKey");
        }
        params.add(Param.APIKEY, apiKey);
        return this;
    }
159899
public ApiSuccessResponse mgtMoveToQueue(MgtMoveToQueue mgtMoveToQueue) throws ApiException {
        ApiResponse<ApiSuccessResponse> resp = mgtMoveToQueueWithHttpInfo(mgtMoveToQueue);
        return resp.getData();
    }
1344909
public static void init(final AuthAPI authzAPI, AuthzFacade facade) throws Exception {
		////////
		// Overall APIs
		///////
		authzAPI.route(HttpMethods.GET,"/api",API.API,new Code(facade,"Document API", true) {
			@Override
			public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception {
				Result<Void> r = context.getAPI(trans,resp,authzAPI);
				if(r.isOK()) {
					resp.setStatus(HttpStatus.OK_200);
				} else {
					context.error(trans,resp,r);
				}
			}
		});

		////////
		// Overall Examples
		///////
		authzAPI.route(HttpMethods.GET,"/api/example/*",API.VOID,new Code(facade,"Document API", true) {
			@Override
			public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception {
				String pathInfo = req.getPathInfo();
				int question = pathInfo.lastIndexOf('?');
				
				pathInfo = pathInfo.substring(13, question<0?pathInfo.length():question);// IMPORTANT, this is size of "/api/example/"
				String nameOrContextType=Symm.base64noSplit.decode(pathInfo);
				Result<Void> r = context.getAPIExample(trans,resp,nameOrContextType,
						question>=0 && "optional=true".equalsIgnoreCase(req.getPathInfo().substring(question+1))
						);
				if(r.isOK()) {
					resp.setStatus(HttpStatus.OK_200);
				} else {
					context.error(trans,resp,r);
				}
			}
		});

	}
78250
public static ApiContext create(String clientId, String clientSecret, Mode mode) {
        if (instance == null) {
            synchronized (ApiContext.class) {
                if (instance == null) {
                    instance = new ApiContext(clientId, clientSecret, mode);
                }
            }
        }

        return instance;
    }
211078
protected Client getClientInternal(String apiKey) throws SQLException {
        QueryRunner run = new QueryRunner(ds);
        return run.query("SELECT bean FROM gw_clients WHERE api_key = ?", //$NON-NLS-1$
                Handlers.CLIENT_HANDLER, apiKey);
    }
1367807
def api_url
      @api_url ||= Addressable::URI.new(
        :scheme => scheme, :host => host, :port => port,
        :path => path_with_base("/_api", resource_path)
      ).normalize.to_s
    end
58973
@Override
    public TDClient withApiKey(String newApiKey)
    {
        return new TDClient(config, httpClient, Optional.of(newApiKey));
    }
293915
public function generateAppCredentials($apiKey, $apiSecret)
    {
        $apiKey = urlencode($apiKey);
        $apiSecret = urlencode($apiSecret);
        $credentials = base64_encode("{$apiKey}:{$apiSecret}");

        return $credentials;
    }
447206
private CloseableDataStore createDataStoreWithUrl(URI location, String apiKey, MetricRegistry metricRegistry) {
        // Reuse the same base classes as when using host discovery, ignoring unused fields as needed.
        String ignore = "ignore";
        MultiThreadedServiceFactory<AuthDataStore> secureDataStoreFactory = createDataStoreServiceFactory(ignore, metricRegistry);

        URI baseUri = LocationUtil.getBaseUriForLocation(location);

        Payload payload = new Payload(baseUri, URI.create("http://adminUrl.not.used.but.required"));
        ServiceEndPoint endPoint = new ServiceEndPointBuilder()
                .withId(ignore)
                .withServiceName(ignore)
                .withPayload(payload.toString())
                .build();

        AuthDataStore authDataStore = secureDataStoreFactory.create(endPoint);
        DataStore dataStore = DataStoreAuthenticator.proxied(authDataStore).usingCredentials(apiKey);

        // No operations required when closing the DataStore, so use absent.
        return asCloseableDataStore(dataStore, Optional.<Runnable>absent());
    }
63506
async def async_get_api_key(session, host, port, username=None, password=None, **kwargs):
    """"""
    url = 'http://{host}:{port}/api'.format(host=host, port=str(port))

    auth = None
    if username and password:
        auth = aiohttp.BasicAuth(username, password=password)

    data = b'{"devicetype": "pydeconz"}'
    response = await async_request(session.post, url, auth=auth, data=data)

    api_key = response[0]['success']['username']
    _LOGGER.info("API key: %s", api_key)
    return api_key
329810
private ApiKey apiKey() {
        return new ApiKey(swaggerProperties().getAuthorization().getName(),
                swaggerProperties().getAuthorization().getKeyName(),
                ApiKeyVehicle.HEADER.getValue());
    }
639725
public Request createGetRequest(String url, String apiKey, String accessToken) {
        HttpUrl.Builder httpBuilder = HttpUrl.parse(url).newBuilder();
        return new Request.Builder().url(httpBuilder.build()).header("User-Agent", USER_AGENT).header("X-Kite-Version", "3").header("Authorization", "token "+apiKey+":"+accessToken).build();
    }
810276
@SuppressWarnings("unchecked")
    public ApiKey getApiKey(final String key) {
        final Query query = pm.newQuery(ApiKey.class, "key == :key");
        final List<ApiKey> result = (List<ApiKey>) query.execute(key);
        return Collections.isEmpty(result) ? null : result.get(0);
    }
1152283
public void setApiKey(String apiKey) {
        if (this.jsonHttpClient != null) {
            this.jsonHttpClient.setApiKey(apiKey);
        }
        if (this.restApiClient != null) {
            this.restApiClient.setApiKey(apiKey);
        }
        if (this.swaggerApiClient != null) {
            ApiKeyAuth genieKey = (ApiKeyAuth) this.swaggerApiClient.getAuthentication("GenieKey");
            genieKey.setApiKeyPrefix("GenieKey");
            genieKey.setApiKey(apiKey);
        }
    }