Initializes an instance of Custom Vision Prediction API client.

@param restClient the REST client to connect to Azure.
@param apiKey the Custom Vision Prediction API key
@return the Custom Vision Prediction API client
8973
public static PredictionEndpoint authenticate(RestClient restClient, final String apiKey) {
        return new PredictionEndpointImpl(restClient).withApiKey(apiKey);
    }
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();
	}
416602
public static OpenAPIConnection openAPIUIConnection(LibertyServer server, boolean secure) {
        return new OpenAPIConnection(server, OPEN_API_UI).secure(secure);
    }
101383
public static JSONObject oauth(String apiKey, String secretKey, AipClientConfiguration config) {
        try {
            AipRequest request = new AipRequest();
            request.setUri(new URI(AipClientConst.OAUTH_URL));
            request.addBody("grant_type", "client_credentials");
            request.addBody("client_id", apiKey);
            request.addBody("client_secret", secretKey);
            request.setConfig(config);
            int statusCode = 500;
            AipResponse response = null;
            // add retry
            int cnt = 0;
            while (statusCode == 500 && cnt < 3) {
                response = AipHttpClient.post(request);
                statusCode = response.getStatus();
                cnt++;
            }
            String res = response.getBodyStr();
            if (res != null && !res.equals("")) {
                return new JSONObject(res);
            } else {
                return Util.getGeneralError(statusCode, "Server response code: " + statusCode);
            }
        } catch (URISyntaxException e) {
            e.printStackTrace();
        }
        return Util.getGeneralError(-1, "unknown error");
    }
820522
@Override
    public ResourceSet<Certificate> read(final TwilioRestClient client) {
        return new ResourceSet<>(this, client, firstPage(client));
    }
388799
@Override
    protected Client instantiateClient(String persistenceUnit)
    {
        return new CouchDBClient(this, httpClient, httpHost, reader, persistenceUnit, externalProperties,
                clientMetadata, kunderaMetadata);
    }
679329
@Override
    public ResourceSet<Credential> read(final TwilioRestClient client) {
        return new ResourceSet<>(this, client, firstPage(client));
    }
135545
@Override
    protected Client instantiateClient(String persistenceUnit)
    {
        ConnectionPool pool = getPoolUsingPolicy();
        return new ThriftClient(this, indexManager, reader, persistenceUnit, pool, externalProperties, kunderaMetadata, timestampGenerator);
    }
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);
        }
    }
1131535
public Rcli<CLIENT> client(String apiVersion) throws CadiException {
		Rcli<CLIENT> client = clients.get(apiVersion);
		if(client==null) {
			client = rclient(initURI(),ss);
			client.apiVersion(apiVersion)
				  .readTimeout(connTimeout);
			clients.put(apiVersion, client);
		} 
		return client;
	}
355337
protected void configureClient(final BaseClient client, final Pac4jBaseClientProperties props) {
        val cname = props.getClientName();
        if (StringUtils.isNotBlank(cname)) {
            client.setName(cname);
        } else {
            val className = client.getClass().getSimpleName();
            val genName = className.concat(RandomStringUtils.randomNumeric(2));
            client.setName(genName);
            LOGGER.warn("Client name for [{}] is set to a generated value of [{}]. "
                + "Consider defining an explicit name for the delegated provider", className, genName);
        }
        val customProperties = client.getCustomProperties();
        customProperties.put(ClientCustomPropertyConstants.CLIENT_CUSTOM_PROPERTY_AUTO_REDIRECT, props.isAutoRedirect());
        if (StringUtils.isNotBlank(props.getPrincipalAttributeId())) {
            customProperties.put(ClientCustomPropertyConstants.CLIENT_CUSTOM_PROPERTY_PRINCIPAL_ATTRIBUTE_ID, props.getPrincipalAttributeId());
        }
    }
435794
public <T extends AbstractGoogleJsonClient.Builder> T fromApiKey(T builder, String apiKey) {
    Preconditions.checkNotNull(builder);
    Preconditions.checkNotNull(apiKey);
    return prepareBuilder(builder, null, new CommonGoogleClientRequestInitializer(apiKey));
  }
801165
function Client (id, apiKey) {
	if (!(this instanceof Client)) {
		return new Client(id, apiKey);
	}

	this.endpoint = 'https://www.googleapis.com';
	this.apiKey = apiKey;
	this.id = id;
}
615262
public JanbaneryToWorkspace connectUsing(String apiKey) {
    DefaultConfiguration conf = new DefaultConfiguration(apiKey);
    return connectUsing(conf);
  }
172397
public static String getApiClient(final Class<?> apiClass, final String fileName, final String defaultClientName) {
		
		InputStream propertiesStream = null;
		
		try {
			propertiesStream = apiClass.getResourceAsStream(fileName);
			
			if (propertiesStream != null) {			
				Properties props = new Properties();
				props.load(propertiesStream);
		
				String name = (String) props.get("api-client.name");
				String version = (String) props.get("api-client.version");

				return name + "-" + version;
			}
		} catch (Throwable t) {
			LOGGER.error("Exception reading {} configuration file", fileName, t);
		} finally {
			if (propertiesStream != null) {
				try {
					propertiesStream.close();
				} catch (Throwable t) {
					LOGGER.info("Exception closing {} configuration file", fileName, t);
				}
			}
		}
		
		return defaultClientName;
	}
762533
public static ApiOvhCore getInstance(String consumerKey) {
		ApiOvhCore core = new ApiOvhCore();
		core._consumerKey = consumerKey;
		return core;
	}
1078824
public static ClientConfiguration createClient(final AuthScope authScope, final Credentials credentials) {
        return createClient(authScope, credentials, emptyList(), emptyList());
    }