code
stringlengths
73
34.1k
label
stringclasses
1 value
public ServiceCall<TrainingDataSet> listTrainingData(ListTrainingDataOptions listTrainingDataOptions) { Validator.notNull(listTrainingDataOptions, "listTrainingDataOptions cannot be null"); String[] pathSegments = { "v1/environments", "collections", "training_data" }; String[] pathParameters = { listTrainin...
java
public ServiceCall<TrainingExampleList> listTrainingExamples( ListTrainingExamplesOptions listTrainingExamplesOptions) { Validator.notNull(listTrainingExamplesOptions, "listTrainingExamplesOptions cannot be null"); String[] pathSegments = { "v1/environments", "collections", "training_data", "examples" }; ...
java
public ServiceCall<TrainingExample> updateTrainingExample(UpdateTrainingExampleOptions updateTrainingExampleOptions) { Validator.notNull(updateTrainingExampleOptions, "updateTrainingExampleOptions cannot be null"); String[] pathSegments = { "v1/environments", "collections", "training_data", "examples" }; St...
java
public ServiceCall<CreateEventResponse> createEvent(CreateEventOptions createEventOptions) { Validator.notNull(createEventOptions, "createEventOptions cannot be null"); String[] pathSegments = { "v1/events" }; RequestBuilder builder = RequestBuilder.post(RequestBuilder.constructHttpUrl(getEndPoint(), pathSe...
java
public ServiceCall<MetricResponse> getMetricsEventRate(GetMetricsEventRateOptions getMetricsEventRateOptions) { String[] pathSegments = { "v1/metrics/event_rate" }; RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments)); builder.query("version", versionDate...
java
public ServiceCall<MetricTokenResponse> getMetricsQueryTokenEvent( GetMetricsQueryTokenEventOptions getMetricsQueryTokenEventOptions) { String[] pathSegments = { "v1/metrics/top_query_tokens_with_event_rate" }; RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getEndPoint(), path...
java
public ServiceCall<LogQueryResponse> queryLog(QueryLogOptions queryLogOptions) { String[] pathSegments = { "v1/logs" }; RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments)); builder.query("version", versionDate); Map<String, String> sdkHeaders = SdkCo...
java
public ServiceCall<Credentials> getCredentials(GetCredentialsOptions getCredentialsOptions) { Validator.notNull(getCredentialsOptions, "getCredentialsOptions cannot be null"); String[] pathSegments = { "v1/environments", "credentials" }; String[] pathParameters = { getCredentialsOptions.environmentId(), get...
java
public ServiceCall<CredentialsList> listCredentials(ListCredentialsOptions listCredentialsOptions) { Validator.notNull(listCredentialsOptions, "listCredentialsOptions cannot be null"); String[] pathSegments = { "v1/environments", "credentials" }; String[] pathParameters = { listCredentialsOptions.environmen...
java
public ServiceCall<Credentials> updateCredentials(UpdateCredentialsOptions updateCredentialsOptions) { Validator.notNull(updateCredentialsOptions, "updateCredentialsOptions cannot be null"); String[] pathSegments = { "v1/environments", "credentials" }; String[] pathParameters = { updateCredentialsOptions.en...
java
public ServiceCall<Gateway> createGateway(CreateGatewayOptions createGatewayOptions) { Validator.notNull(createGatewayOptions, "createGatewayOptions cannot be null"); String[] pathSegments = { "v1/environments", "gateways" }; String[] pathParameters = { createGatewayOptions.environmentId() }; RequestBui...
java
public ServiceCall<Gateway> getGateway(GetGatewayOptions getGatewayOptions) { Validator.notNull(getGatewayOptions, "getGatewayOptions cannot be null"); String[] pathSegments = { "v1/environments", "gateways" }; String[] pathParameters = { getGatewayOptions.environmentId(), getGatewayOptions.gatewayId() }; ...
java
public ServiceCall<GatewayList> listGateways(ListGatewaysOptions listGatewaysOptions) { Validator.notNull(listGatewaysOptions, "listGatewaysOptions cannot be null"); String[] pathSegments = { "v1/environments", "gateways" }; String[] pathParameters = { listGatewaysOptions.environmentId() }; RequestBuild...
java
public ServiceCall<SpeechModel> getModel(GetModelOptions getModelOptions) { Validator.notNull(getModelOptions, "getModelOptions cannot be null"); String[] pathSegments = { "v1/models" }; String[] pathParameters = { getModelOptions.modelId() }; RequestBuilder builder = RequestBuilder.get(RequestBuilder.c...
java
public WebSocket recognizeUsingWebSocket(RecognizeOptions recognizeOptions, RecognizeCallback callback) { Validator.notNull(recognizeOptions, "recognizeOptions cannot be null"); Validator.notNull(recognizeOptions.audio(), "audio cannot be null"); Validator.notNull(callback, "callback cannot be null"); ...
java
public ServiceCall<RecognitionJob> checkJob(CheckJobOptions checkJobOptions) { Validator.notNull(checkJobOptions, "checkJobOptions cannot be null"); String[] pathSegments = { "v1/recognitions" }; String[] pathParameters = { checkJobOptions.id() }; RequestBuilder builder = RequestBuilder.get(RequestBuild...
java
public ServiceCall<RecognitionJobs> checkJobs(CheckJobsOptions checkJobsOptions) { String[] pathSegments = { "v1/recognitions" }; RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments)); Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("speech_to_tex...
java
public ServiceCall<Void> deleteJob(DeleteJobOptions deleteJobOptions) { Validator.notNull(deleteJobOptions, "deleteJobOptions cannot be null"); String[] pathSegments = { "v1/recognitions" }; String[] pathParameters = { deleteJobOptions.id() }; RequestBuilder builder = RequestBuilder.delete(RequestBuilde...
java
public ServiceCall<RegisterStatus> registerCallback(RegisterCallbackOptions registerCallbackOptions) { Validator.notNull(registerCallbackOptions, "registerCallbackOptions cannot be null"); String[] pathSegments = { "v1/register_callback" }; RequestBuilder builder = RequestBuilder.post(RequestBuilder.constru...
java
public ServiceCall<Void> unregisterCallback(UnregisterCallbackOptions unregisterCallbackOptions) { Validator.notNull(unregisterCallbackOptions, "unregisterCallbackOptions cannot be null"); String[] pathSegments = { "v1/unregister_callback" }; RequestBuilder builder = RequestBuilder.post(RequestBuilder.const...
java
public ServiceCall<LanguageModel> createLanguageModel(CreateLanguageModelOptions createLanguageModelOptions) { Validator.notNull(createLanguageModelOptions, "createLanguageModelOptions cannot be null"); String[] pathSegments = { "v1/customizations" }; RequestBuilder builder = RequestBuilder.post(RequestBuil...
java
public ServiceCall<Void> deleteLanguageModel(DeleteLanguageModelOptions deleteLanguageModelOptions) { Validator.notNull(deleteLanguageModelOptions, "deleteLanguageModelOptions cannot be null"); String[] pathSegments = { "v1/customizations" }; String[] pathParameters = { deleteLanguageModelOptions.customizat...
java
public ServiceCall<LanguageModel> getLanguageModel(GetLanguageModelOptions getLanguageModelOptions) { Validator.notNull(getLanguageModelOptions, "getLanguageModelOptions cannot be null"); String[] pathSegments = { "v1/customizations" }; String[] pathParameters = { getLanguageModelOptions.customizationId() }...
java
public ServiceCall<LanguageModels> listLanguageModels(ListLanguageModelsOptions listLanguageModelsOptions) { String[] pathSegments = { "v1/customizations" }; RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments)); Map<String, String> sdkHeaders = SdkCommon....
java
public ServiceCall<Void> trainLanguageModel(TrainLanguageModelOptions trainLanguageModelOptions) { Validator.notNull(trainLanguageModelOptions, "trainLanguageModelOptions cannot be null"); String[] pathSegments = { "v1/customizations", "train" }; String[] pathParameters = { trainLanguageModelOptions.customi...
java
public ServiceCall<Void> addCorpus(AddCorpusOptions addCorpusOptions) { Validator.notNull(addCorpusOptions, "addCorpusOptions cannot be null"); String[] pathSegments = { "v1/customizations", "corpora" }; String[] pathParameters = { addCorpusOptions.customizationId(), addCorpusOptions.corpusName() }; Req...
java
public ServiceCall<Void> deleteCorpus(DeleteCorpusOptions deleteCorpusOptions) { Validator.notNull(deleteCorpusOptions, "deleteCorpusOptions cannot be null"); String[] pathSegments = { "v1/customizations", "corpora" }; String[] pathParameters = { deleteCorpusOptions.customizationId(), deleteCorpusOptions.co...
java
public ServiceCall<Corpus> getCorpus(GetCorpusOptions getCorpusOptions) { Validator.notNull(getCorpusOptions, "getCorpusOptions cannot be null"); String[] pathSegments = { "v1/customizations", "corpora" }; String[] pathParameters = { getCorpusOptions.customizationId(), getCorpusOptions.corpusName() }; R...
java
public ServiceCall<Corpora> listCorpora(ListCorporaOptions listCorporaOptions) { Validator.notNull(listCorporaOptions, "listCorporaOptions cannot be null"); String[] pathSegments = { "v1/customizations", "corpora" }; String[] pathParameters = { listCorporaOptions.customizationId() }; RequestBuilder buil...
java
public ServiceCall<Void> addGrammar(AddGrammarOptions addGrammarOptions) { Validator.notNull(addGrammarOptions, "addGrammarOptions cannot be null"); String[] pathSegments = { "v1/customizations", "grammars" }; String[] pathParameters = { addGrammarOptions.customizationId(), addGrammarOptions.grammarName() }...
java
public ServiceCall<Void> deleteGrammar(DeleteGrammarOptions deleteGrammarOptions) { Validator.notNull(deleteGrammarOptions, "deleteGrammarOptions cannot be null"); String[] pathSegments = { "v1/customizations", "grammars" }; String[] pathParameters = { deleteGrammarOptions.customizationId(), deleteGrammarOp...
java
public ServiceCall<Grammar> getGrammar(GetGrammarOptions getGrammarOptions) { Validator.notNull(getGrammarOptions, "getGrammarOptions cannot be null"); String[] pathSegments = { "v1/customizations", "grammars" }; String[] pathParameters = { getGrammarOptions.customizationId(), getGrammarOptions.grammarName(...
java
public ServiceCall<Grammars> listGrammars(ListGrammarsOptions listGrammarsOptions) { Validator.notNull(listGrammarsOptions, "listGrammarsOptions cannot be null"); String[] pathSegments = { "v1/customizations", "grammars" }; String[] pathParameters = { listGrammarsOptions.customizationId() }; RequestBuil...
java
public ServiceCall<AcousticModel> createAcousticModel(CreateAcousticModelOptions createAcousticModelOptions) { Validator.notNull(createAcousticModelOptions, "createAcousticModelOptions cannot be null"); String[] pathSegments = { "v1/acoustic_customizations" }; RequestBuilder builder = RequestBuilder.post(Re...
java
public ServiceCall<AcousticModel> getAcousticModel(GetAcousticModelOptions getAcousticModelOptions) { Validator.notNull(getAcousticModelOptions, "getAcousticModelOptions cannot be null"); String[] pathSegments = { "v1/acoustic_customizations" }; String[] pathParameters = { getAcousticModelOptions.customizat...
java
public ServiceCall<AcousticModels> listAcousticModels(ListAcousticModelsOptions listAcousticModelsOptions) { String[] pathSegments = { "v1/acoustic_customizations" }; RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments)); Map<String, String> sdkHeaders = S...
java
public ServiceCall<Void> resetAcousticModel(ResetAcousticModelOptions resetAcousticModelOptions) { Validator.notNull(resetAcousticModelOptions, "resetAcousticModelOptions cannot be null"); String[] pathSegments = { "v1/acoustic_customizations", "reset" }; String[] pathParameters = { resetAcousticModelOption...
java
public ServiceCall<Void> trainAcousticModel(TrainAcousticModelOptions trainAcousticModelOptions) { Validator.notNull(trainAcousticModelOptions, "trainAcousticModelOptions cannot be null"); String[] pathSegments = { "v1/acoustic_customizations", "train" }; String[] pathParameters = { trainAcousticModelOption...
java
public ServiceCall<Void> upgradeAcousticModel(UpgradeAcousticModelOptions upgradeAcousticModelOptions) { Validator.notNull(upgradeAcousticModelOptions, "upgradeAcousticModelOptions cannot be null"); String[] pathSegments = { "v1/acoustic_customizations", "upgrade_model" }; String[] pathParameters = { upgrad...
java
public ServiceCall<Void> addAudio(AddAudioOptions addAudioOptions) { Validator.notNull(addAudioOptions, "addAudioOptions cannot be null"); String[] pathSegments = { "v1/acoustic_customizations", "audio" }; String[] pathParameters = { addAudioOptions.customizationId(), addAudioOptions.audioName() }; Requ...
java
public ServiceCall<Void> deleteAudio(DeleteAudioOptions deleteAudioOptions) { Validator.notNull(deleteAudioOptions, "deleteAudioOptions cannot be null"); String[] pathSegments = { "v1/acoustic_customizations", "audio" }; String[] pathParameters = { deleteAudioOptions.customizationId(), deleteAudioOptions.au...
java
public ServiceCall<AudioListing> getAudio(GetAudioOptions getAudioOptions) { Validator.notNull(getAudioOptions, "getAudioOptions cannot be null"); String[] pathSegments = { "v1/acoustic_customizations", "audio" }; String[] pathParameters = { getAudioOptions.customizationId(), getAudioOptions.audioName() }; ...
java
public ServiceCall<AudioResources> listAudio(ListAudioOptions listAudioOptions) { Validator.notNull(listAudioOptions, "listAudioOptions cannot be null"); String[] pathSegments = { "v1/acoustic_customizations", "audio" }; String[] pathParameters = { listAudioOptions.customizationId() }; RequestBuilder bu...
java
public ServiceCall<MessageResponse> message(MessageOptions messageOptions) { Validator.notNull(messageOptions, "messageOptions cannot be null"); String[] pathSegments = { "v1/workspaces", "message" }; String[] pathParameters = { messageOptions.workspaceId() }; RequestBuilder builder = RequestBuilder.pos...
java
public ServiceCall<Workspace> createWorkspace(CreateWorkspaceOptions createWorkspaceOptions) { String[] pathSegments = { "v1/workspaces" }; RequestBuilder builder = RequestBuilder.post(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments)); builder.query("version", versionDate); Map<String, Strin...
java
public ServiceCall<Workspace> getWorkspace(GetWorkspaceOptions getWorkspaceOptions) { Validator.notNull(getWorkspaceOptions, "getWorkspaceOptions cannot be null"); String[] pathSegments = { "v1/workspaces" }; String[] pathParameters = { getWorkspaceOptions.workspaceId() }; RequestBuilder builder = Reque...
java
public ServiceCall<WorkspaceCollection> listWorkspaces(ListWorkspacesOptions listWorkspacesOptions) { String[] pathSegments = { "v1/workspaces" }; RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments)); builder.query("version", versionDate); Map<String,...
java
public ServiceCall<Workspace> updateWorkspace(UpdateWorkspaceOptions updateWorkspaceOptions) { Validator.notNull(updateWorkspaceOptions, "updateWorkspaceOptions cannot be null"); String[] pathSegments = { "v1/workspaces" }; String[] pathParameters = { updateWorkspaceOptions.workspaceId() }; RequestBuild...
java
public ServiceCall<Intent> createIntent(CreateIntentOptions createIntentOptions) { Validator.notNull(createIntentOptions, "createIntentOptions cannot be null"); String[] pathSegments = { "v1/workspaces", "intents" }; String[] pathParameters = { createIntentOptions.workspaceId() }; RequestBuilder builder...
java
public ServiceCall<Intent> getIntent(GetIntentOptions getIntentOptions) { Validator.notNull(getIntentOptions, "getIntentOptions cannot be null"); String[] pathSegments = { "v1/workspaces", "intents" }; String[] pathParameters = { getIntentOptions.workspaceId(), getIntentOptions.intent() }; RequestBuilde...
java
public ServiceCall<IntentCollection> listIntents(ListIntentsOptions listIntentsOptions) { Validator.notNull(listIntentsOptions, "listIntentsOptions cannot be null"); String[] pathSegments = { "v1/workspaces", "intents" }; String[] pathParameters = { listIntentsOptions.workspaceId() }; RequestBuilder bui...
java
public ServiceCall<Intent> updateIntent(UpdateIntentOptions updateIntentOptions) { Validator.notNull(updateIntentOptions, "updateIntentOptions cannot be null"); String[] pathSegments = { "v1/workspaces", "intents" }; String[] pathParameters = { updateIntentOptions.workspaceId(), updateIntentOptions.intent()...
java
public ServiceCall<Example> createExample(CreateExampleOptions createExampleOptions) { Validator.notNull(createExampleOptions, "createExampleOptions cannot be null"); String[] pathSegments = { "v1/workspaces", "intents", "examples" }; String[] pathParameters = { createExampleOptions.workspaceId(), createExa...
java
public ServiceCall<Example> getExample(GetExampleOptions getExampleOptions) { Validator.notNull(getExampleOptions, "getExampleOptions cannot be null"); String[] pathSegments = { "v1/workspaces", "intents", "examples" }; String[] pathParameters = { getExampleOptions.workspaceId(), getExampleOptions.intent(),...
java
public ServiceCall<ExampleCollection> listExamples(ListExamplesOptions listExamplesOptions) { Validator.notNull(listExamplesOptions, "listExamplesOptions cannot be null"); String[] pathSegments = { "v1/workspaces", "intents", "examples" }; String[] pathParameters = { listExamplesOptions.workspaceId(), listE...
java
public ServiceCall<Counterexample> getCounterexample(GetCounterexampleOptions getCounterexampleOptions) { Validator.notNull(getCounterexampleOptions, "getCounterexampleOptions cannot be null"); String[] pathSegments = { "v1/workspaces", "counterexamples" }; String[] pathParameters = { getCounterexampleOptio...
java
public ServiceCall<CounterexampleCollection> listCounterexamples( ListCounterexamplesOptions listCounterexamplesOptions) { Validator.notNull(listCounterexamplesOptions, "listCounterexamplesOptions cannot be null"); String[] pathSegments = { "v1/workspaces", "counterexamples" }; String[] pathParameters...
java
public ServiceCall<Counterexample> updateCounterexample(UpdateCounterexampleOptions updateCounterexampleOptions) { Validator.notNull(updateCounterexampleOptions, "updateCounterexampleOptions cannot be null"); String[] pathSegments = { "v1/workspaces", "counterexamples" }; String[] pathParameters = { updateC...
java
public ServiceCall<Entity> createEntity(CreateEntityOptions createEntityOptions) { Validator.notNull(createEntityOptions, "createEntityOptions cannot be null"); String[] pathSegments = { "v1/workspaces", "entities" }; String[] pathParameters = { createEntityOptions.workspaceId() }; RequestBuilder builde...
java
public ServiceCall<Entity> getEntity(GetEntityOptions getEntityOptions) { Validator.notNull(getEntityOptions, "getEntityOptions cannot be null"); String[] pathSegments = { "v1/workspaces", "entities" }; String[] pathParameters = { getEntityOptions.workspaceId(), getEntityOptions.entity() }; RequestBuild...
java
public ServiceCall<EntityCollection> listEntities(ListEntitiesOptions listEntitiesOptions) { Validator.notNull(listEntitiesOptions, "listEntitiesOptions cannot be null"); String[] pathSegments = { "v1/workspaces", "entities" }; String[] pathParameters = { listEntitiesOptions.workspaceId() }; RequestBuil...
java
public ServiceCall<Entity> updateEntity(UpdateEntityOptions updateEntityOptions) { Validator.notNull(updateEntityOptions, "updateEntityOptions cannot be null"); String[] pathSegments = { "v1/workspaces", "entities" }; String[] pathParameters = { updateEntityOptions.workspaceId(), updateEntityOptions.entity(...
java
public ServiceCall<Value> createValue(CreateValueOptions createValueOptions) { Validator.notNull(createValueOptions, "createValueOptions cannot be null"); String[] pathSegments = { "v1/workspaces", "entities", "values" }; String[] pathParameters = { createValueOptions.workspaceId(), createValueOptions.entit...
java
public ServiceCall<Void> deleteValue(DeleteValueOptions deleteValueOptions) { Validator.notNull(deleteValueOptions, "deleteValueOptions cannot be null"); String[] pathSegments = { "v1/workspaces", "entities", "values" }; String[] pathParameters = { deleteValueOptions.workspaceId(), deleteValueOptions.entity...
java
public ServiceCall<Value> getValue(GetValueOptions getValueOptions) { Validator.notNull(getValueOptions, "getValueOptions cannot be null"); String[] pathSegments = { "v1/workspaces", "entities", "values" }; String[] pathParameters = { getValueOptions.workspaceId(), getValueOptions.entity(), getValueOptions....
java
public ServiceCall<ValueCollection> listValues(ListValuesOptions listValuesOptions) { Validator.notNull(listValuesOptions, "listValuesOptions cannot be null"); String[] pathSegments = { "v1/workspaces", "entities", "values" }; String[] pathParameters = { listValuesOptions.workspaceId(), listValuesOptions.en...
java
public ServiceCall<Value> updateValue(UpdateValueOptions updateValueOptions) { Validator.notNull(updateValueOptions, "updateValueOptions cannot be null"); String[] pathSegments = { "v1/workspaces", "entities", "values" }; String[] pathParameters = { updateValueOptions.workspaceId(), updateValueOptions.entit...
java
public ServiceCall<Synonym> getSynonym(GetSynonymOptions getSynonymOptions) { Validator.notNull(getSynonymOptions, "getSynonymOptions cannot be null"); String[] pathSegments = { "v1/workspaces", "entities", "values", "synonyms" }; String[] pathParameters = { getSynonymOptions.workspaceId(), getSynonymOption...
java
public ServiceCall<SynonymCollection> listSynonyms(ListSynonymsOptions listSynonymsOptions) { Validator.notNull(listSynonymsOptions, "listSynonymsOptions cannot be null"); String[] pathSegments = { "v1/workspaces", "entities", "values", "synonyms" }; String[] pathParameters = { listSynonymsOptions.workspace...
java
public ServiceCall<Synonym> updateSynonym(UpdateSynonymOptions updateSynonymOptions) { Validator.notNull(updateSynonymOptions, "updateSynonymOptions cannot be null"); String[] pathSegments = { "v1/workspaces", "entities", "values", "synonyms" }; String[] pathParameters = { updateSynonymOptions.workspaceId()...
java
public ServiceCall<DialogNode> getDialogNode(GetDialogNodeOptions getDialogNodeOptions) { Validator.notNull(getDialogNodeOptions, "getDialogNodeOptions cannot be null"); String[] pathSegments = { "v1/workspaces", "dialog_nodes" }; String[] pathParameters = { getDialogNodeOptions.workspaceId(), getDialogNode...
java
public ServiceCall<DialogNodeCollection> listDialogNodes(ListDialogNodesOptions listDialogNodesOptions) { Validator.notNull(listDialogNodesOptions, "listDialogNodesOptions cannot be null"); String[] pathSegments = { "v1/workspaces", "dialog_nodes" }; String[] pathParameters = { listDialogNodesOptions.worksp...
java
public ServiceCall<LogCollection> listAllLogs(ListAllLogsOptions listAllLogsOptions) { Validator.notNull(listAllLogsOptions, "listAllLogsOptions cannot be null"); String[] pathSegments = { "v1/logs" }; RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments));...
java
public ServiceCall<LogCollection> listLogs(ListLogsOptions listLogsOptions) { Validator.notNull(listLogsOptions, "listLogsOptions cannot be null"); String[] pathSegments = { "v1/workspaces", "logs" }; String[] pathParameters = { listLogsOptions.workspaceId() }; RequestBuilder builder = RequestBuilder.ge...
java
public ServiceCall<ToneAnalysis> tone(ToneOptions toneOptions) { Validator.notNull(toneOptions, "toneOptions cannot be null"); String[] pathSegments = { "v3/tone" }; RequestBuilder builder = RequestBuilder.post(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments)); builder.query("version", versi...
java
public ServiceCall<UtteranceAnalyses> toneChat(ToneChatOptions toneChatOptions) { Validator.notNull(toneChatOptions, "toneChatOptions cannot be null"); String[] pathSegments = { "v3/tone_chat" }; RequestBuilder builder = RequestBuilder.post(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments)); ...
java
public String getName(String oldName) { if (oldName != null && this.existing.containsKey(oldName)) { return this.existing.get(oldName); } final String name = this.prefix + this.counter; this.counter++; if (oldName != null) { this.existing.put(oldName, na...
java
static boolean isNode(Object v) { // Note: A value is a subject if all of these hold true: // 1. It is an Object. // 2. It is not a @value, @set, or @list. // 3. It has more than 1 key OR any existing key is not @id. if (v instanceof Map && !(((Map) v).containsKey("@value") || ((...
java
static boolean isNodeReference(Object v) { // Note: A value is a subject reference if all of these hold true: // 1. It is an Object. // 2. It has a single key: @id. return (v instanceof Map && ((Map<String, Object>) v).size() == 1 && ((Map<String, Object>) v).containsKey(...
java
static void fillNodesToPrune(Object input, final Map<String, Object> toPrune) { // recurse through arrays if (isArray(input)) { for (final Object i : (List<Object>) input) { fillNodesToPrune(i, toPrune); } } else if (isObject(input)) { // skip ...
java
static boolean isBlankNode(Object v) { // Note: A value is a blank node if all of these hold true: // 1. It is an Object. // 2. If it has an @id key its value begins with '_:'. // 3. It has no keys OR is not a @value, @set, or @list. if (v instanceof Map) { final Map<...
java
static Boolean isList(Object v) { return (v instanceof Map && ((Map<String, Object>) v).containsKey("@list")); }
java
static Boolean isValue(Object v) { return (v instanceof Map && ((Map<String, Object>) v).containsKey("@value")); }
java
public static String removeDotSegments(String path, boolean hasAuthority) { String rval = ""; if (path.indexOf("/") == 0) { rval = "/"; } // RFC 3986 5.2.4 (reworked) final List<String> input = new ArrayList<String>(Arrays.asList(path.split("/"))); if (path....
java
private static void parseAuthority(JsonLdUrl parsed) { // parse authority for unparsed relative network-path reference if (parsed.href.indexOf(":") == -1 && parsed.href.indexOf("//") == 0 && "".equals(parsed.host)) { // must parse authority from pathname parsed.pa...
java
public static void escape(String str, StringBuilder rval) { for (int i = 0; i < str.length(); i++) { final char hi = str.charAt(i); if (hi <= 0x8 || hi == 0xB || hi == 0xC || (hi >= 0xE && hi <= 0x1F) || (hi >= 0x7F && hi <= 0xA0) || // 0xA0 is end of ...
java
public Map<String, Object> getContext() { final Map<String, Object> rval = newMap(); rval.putAll(context); // replace "" with "@vocab" if (rval.containsKey("")) { rval.put("@vocab", rval.remove("")); } return rval; }
java
public void parseContext(Object contextLike) throws JsonLdError { Context context; if (api != null) { context = new Context(api.opts); } else { context = new Context(); } // Context will do our recursive parsing and initial IRI resolution context =...
java
public void addTriple(final String subject, final String predicate, final String object) { addQuad(subject, predicate, object, "@default"); }
java
private Node objectToRDF(Object item) { // convert value object to RDF if (isValue(item)) { final Object value = ((Map<String, Object>) item).get("@value"); final Object datatype = ((Map<String, Object>) item).get("@type"); // convert to XSD datatypes as appropriate ...
java
public DocumentLoader addInjectedDoc(String url, String doc) throws JsonLdError { try { m_injectedDocs.put(url, JsonUtils.fromString(doc)); return this; } catch (final Exception e) { throw new JsonLdError(JsonLdError.Error.LOADING_INJECTED_CONTEXT_FAILED, url, e); ...
java
public RemoteDocument loadDocument(String url) throws JsonLdError { if (m_injectedDocs.containsKey(url)) { try { return new RemoteDocument(url, m_injectedDocs.get(url)); } catch (final Exception e) { throw new JsonLdError(JsonLdError.Error.LOADING_INJECTED...
java
public static String toPrettyString(Object jsonObject) throws JsonGenerationException, IOException { final StringWriter sw = new StringWriter(); writePrettyPrint(sw, jsonObject); return sw.toString(); }
java
public static void write(Writer writer, Object jsonObject) throws JsonGenerationException, IOException { final JsonGenerator jw = JSON_FACTORY.createGenerator(writer); jw.writeObject(jsonObject); }
java
public static void writePrettyPrint(Writer writer, Object jsonObject) throws JsonGenerationException, IOException { final JsonGenerator jw = JSON_FACTORY.createGenerator(writer); jw.useDefaultPrettyPrinter(); jw.writeObject(jsonObject); }
java
public static Map<String, Object> newMap(String key, Object value) { final Map<String, Object> result = newMap(); result.put(key, value); return result; }
java
public static Object fromRDF(Object dataset, JsonLdOptions options) throws JsonLdError { // handle non specified serializer case RDFParser parser = null; if (options.format == null && dataset instanceof String) { // attempt to parse the input as nquads options.format = ...
java
public static Object normalize(Object input, JsonLdOptions options) throws JsonLdError { final JsonLdOptions opts = options.copy(); opts.format = null; final RDFDataset dataset = (RDFDataset) toRDF(input, opts); return new JsonLdApi(options).normalize(dataset); }
java
public Object compactValue(String activeProperty, Map<String, Object> value) { // 1) int numberMembers = value.size(); // 2) if (value.containsKey(JsonLdConsts.INDEX) && JsonLdConsts.INDEX.equals(this.getContainer(activeProperty))) { numberMembers--; }...
java
@SuppressWarnings("unchecked") public Context parse(Object localContext, List<String> remoteContexts) throws JsonLdError { return parse(localContext, remoteContexts, false); }
java