Skip to content

Commit

Permalink
Initial commit for cognitive services language, entity search and vis…
Browse files Browse the repository at this point in the history
…ion SDKs. (Azure#1952)
  • Loading branch information
alvadb authored and Martin Sawicki committed Oct 27, 2017
1 parent 603d5c0 commit 3b80833
Show file tree
Hide file tree
Showing 113 changed files with 15,135 additions and 0 deletions.
78 changes: 78 additions & 0 deletions cognitiveservices/azure-entitysearch/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<!--
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.microsoft.azure.cognitiveservices</groupId>
<artifactId>azure-cognitiveservices-entitysearch</artifactId>
<version>0.0.1-beta-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Microsoft Azure SDK for Cognitive Service Entity Search</name>
<description>This package contains Microsoft Cognitive Service Entity Search SDK.</description>
<url>https://github.com/Azure/azure-sdk-cognitiveservices-java</url>
<licenses>
<license>
<name>The MIT License (MIT)</name>
<url>http://opensource.org/licenses/MIT</url>
<distribution>repo</distribution>
</license>
</licenses>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<legal><![CDATA[[INFO] Any downloads listed may be third party software. Microsoft grants you no rights for third party software.]]></legal>
</properties>
<developers>
<developer>
<id>microsoft</id>
<name>Microsoft</name>
</developer>
</developers>
<dependencies>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-client-runtime</artifactId>
<version>1.0.3</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.8</version>
<configuration>
<excludePackageNames>*.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search</excludePackageNames>
<bottom>
<![CDATA[<code>
/**
<br />* Copyright (c) Microsoft Corporation. All rights reserved.
<br />* Licensed under the MIT License. See License.txt in the project root for
<br />* license information.
<br />*/
</code>]]>
</bottom>
</configuration>
</plugin>
</plugins>
</build>
</project>

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/

package com.microsoft.azure.cognitiveservices.entitysearch;

import com.microsoft.rest.RestClient;

/**
* The interface for EntitySearchAPI class.
*/
public interface EntitySearchAPI {
/**
* Gets the REST client.
*
* @return the {@link RestClient} object.
*/
RestClient restClient();

/**
* The default base URL.
*/
String DEFAULT_BASE_URL = "https://api.cognitive.microsoft.com/bing/v7.0";

/**
* Gets the Entities object to access its operations.
* @return the Entities object.
*/
Entities entities();

}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
/**
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/

package com.microsoft.azure.cognitiveservices.entitysearch.implementation;

import com.microsoft.azure.cognitiveservices.entitysearch.EntitySearchAPI;
import com.microsoft.azure.cognitiveservices.entitysearch.Entities;
import com.microsoft.rest.ServiceClient;
import com.microsoft.rest.RestClient;
import okhttp3.OkHttpClient;
import retrofit2.Retrofit;

/**
* Initializes a new instance of the EntitySearchAPI class.
*/
public class EntitySearchAPIImpl extends ServiceClient implements EntitySearchAPI {

/**
* The Entities object to access its operations.
*/
private Entities entities;

/**
* Gets the Entities object to access its operations.
* @return the Entities object.
*/
public Entities entities() {
return this.entities;
}

/**
* Initializes an instance of EntitySearchAPI client.
*/
public EntitySearchAPIImpl() {
this("https://api.cognitive.microsoft.com/bing/v7.0");
}

/**
* Initializes an instance of EntitySearchAPI client.
*
* @param baseUrl the base URL of the host
*/
public EntitySearchAPIImpl(String baseUrl) {
super(baseUrl);
initialize();
}

/**
* Initializes an instance of EntitySearchAPI client.
*
* @param clientBuilder the builder for building an OkHttp client, bundled with user configurations
* @param restBuilder the builder for building an Retrofit client, bundled with user configurations
*/
public EntitySearchAPIImpl(OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) {
this("https://api.cognitive.microsoft.com/bing/v7.0", clientBuilder, restBuilder);
initialize();
}

/**
* Initializes an instance of EntitySearchAPI client.
*
* @param baseUrl the base URL of the host
* @param clientBuilder the builder for building an OkHttp client, bundled with user configurations
* @param restBuilder the builder for building an Retrofit client, bundled with user configurations
*/
public EntitySearchAPIImpl(String baseUrl, OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) {
super(baseUrl, clientBuilder, restBuilder);
initialize();
}

/**
* Initializes an instance of EntitySearchAPI client.
*
* @param restClient the REST client containing pre-configured settings
*/
public EntitySearchAPIImpl(RestClient restClient) {
super(restClient);
initialize();
}

private void initialize() {
this.entities = new EntitiesImpl(retrofit(), this);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.

/**
* This package contains the implementation classes for EntitySearchAPI.
* The Entity Search API lets you send a search query to Bing and get back search results that include entities and places. Place results include restaurants, hotel, or other local businesses. For places, the query can specify the name of the local business or it can ask for a list (for example, restaurants near me). Entity results include persons, places, or things. Place in this context is tourist attractions, states, countries, etc.
*/
package com.microsoft.azure.cognitiveservices.entitysearch.implementation;
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/

package com.microsoft.azure.cognitiveservices.entitysearch.models;

import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonSubTypes;

/**
* The Answer model.
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type")
@JsonTypeName("Answer")
@JsonSubTypes({
@JsonSubTypes.Type(name = "SearchResultsAnswer", value = SearchResultsAnswer.class)
})
public class Answer extends Response {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/**
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/

package com.microsoft.azure.cognitiveservices.entitysearch.models;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
* Defines values for AnswerType.
*/
public enum AnswerType {
/** Enum value Entities. */
ENTITIES("Entities"),

/** Enum value Places. */
PLACES("Places");

/** The actual serialized value for a AnswerType instance. */
private String value;

AnswerType(String value) {
this.value = value;
}

/**
* Parses a serialized value to a AnswerType instance.
*
* @param value the serialized value to parse.
* @return the parsed AnswerType object, or null if unable to parse.
*/
@JsonCreator
public static AnswerType fromString(String value) {
AnswerType[] items = AnswerType.values();
for (AnswerType item : items) {
if (item.toString().equalsIgnoreCase(value)) {
return item;
}
}
return null;
}

@JsonValue
@Override
public String toString() {
return this.value;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/

package com.microsoft.azure.cognitiveservices.entitysearch.models;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonSubTypes;

/**
* The ContractualRulesAttribution model.
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type")
@JsonTypeName("ContractualRules/Attribution")
@JsonSubTypes({
@JsonSubTypes.Type(name = "ContractualRules/LicenseAttribution", value = ContractualRulesLicenseAttribution.class),
@JsonSubTypes.Type(name = "ContractualRules/LinkAttribution", value = ContractualRulesLinkAttribution.class),
@JsonSubTypes.Type(name = "ContractualRules/MediaAttribution", value = ContractualRulesMediaAttribution.class),
@JsonSubTypes.Type(name = "ContractualRules/TextAttribution", value = ContractualRulesTextAttribution.class)
})
public class ContractualRulesAttribution extends ContractualRulesContractualRule {
/**
* A Boolean value that determines whether the contents of the rule must be
* placed in close proximity to the field that the rule applies to. If
* true, the contents must be placed in close proximity. If false, or this
* field does not exist, the contents may be placed at the caller's
* discretion.
*/
@JsonProperty(value = "mustBeCloseToContent", access = JsonProperty.Access.WRITE_ONLY)
private Boolean mustBeCloseToContent;

/**
* Get the mustBeCloseToContent value.
*
* @return the mustBeCloseToContent value
*/
public Boolean mustBeCloseToContent() {
return this.mustBeCloseToContent;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/**
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/

package com.microsoft.azure.cognitiveservices.entitysearch.models;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonSubTypes;

/**
* The ContractualRulesContractualRule model.
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type")
@JsonTypeName("ContractualRules/ContractualRule")
@JsonSubTypes({
@JsonSubTypes.Type(name = "ContractualRules/Attribution", value = ContractualRulesAttribution.class)
})
public class ContractualRulesContractualRule {
/**
* The name of the field that the rule applies to.
*/
@JsonProperty(value = "targetPropertyName", access = JsonProperty.Access.WRITE_ONLY)
private String targetPropertyName;

/**
* Get the targetPropertyName value.
*
* @return the targetPropertyName value
*/
public String targetPropertyName() {
return this.targetPropertyName;
}

}
Loading

0 comments on commit 3b80833

Please sign in to comment.