Update an existing user-generated pin.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.components.*;
import com.glean.api_client.glean_api_client.models.operations.EditpinResponse;
import java.lang.Exception;
import java.util.List;
public class Application {
public static void main(String[] args) throws Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
EditpinResponse res = sdk.client().pins().update()
.editPinRequest(EditPinRequest.builder()
.audienceFilters(List.of(
FacetFilter.builder()
.fieldName("type")
.values(List.of(
FacetFilterValue.builder()
.value("Spreadsheet")
.relationType(RelationType.EQUALS)
.build(),
FacetFilterValue.builder()
.value("Presentation")
.relationType(RelationType.EQUALS)
.build()))
.build()))
.build())
.call();
if (res.pinDocument().isPresent()) {
System.out.println(res.pinDocument().get());
}
}
}
| Parameter |
Type |
Required |
Description |
locale |
Optional<String> |
➖ |
The client's preferred locale in rfc5646 format (e.g. en, ja, pt-BR). If omitted, the Accept-Language will be used. If not present or not supported, defaults to the closest match or en. |
editPinRequest |
EditPinRequest |
✔️ |
Edit pins request |
EditpinResponse
| Error Type |
Status Code |
Content Type |
| models/errors/APIException |
4XX, 5XX |
*/* |
Read pin details given its ID.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.components.GetPinRequest;
import com.glean.api_client.glean_api_client.models.operations.GetpinResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
GetpinResponse res = sdk.client().pins().retrieve()
.getPinRequest(GetPinRequest.builder()
.build())
.call();
if (res.getPinResponse().isPresent()) {
System.out.println(res.getPinResponse().get());
}
}
}
| Parameter |
Type |
Required |
Description |
locale |
Optional<String> |
➖ |
The client's preferred locale in rfc5646 format (e.g. en, ja, pt-BR). If omitted, the Accept-Language will be used. If not present or not supported, defaults to the closest match or en. |
getPinRequest |
GetPinRequest |
✔️ |
Get pin request |
GetpinResponse
| Error Type |
Status Code |
Content Type |
| models/errors/APIException |
4XX, 5XX |
*/* |
Lists all pins.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.operations.ListpinsRequestBody;
import com.glean.api_client.glean_api_client.models.operations.ListpinsResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
ListpinsResponse res = sdk.client().pins().list()
.requestBody(ListpinsRequestBody.builder()
.build())
.call();
if (res.listPinsResponse().isPresent()) {
System.out.println(res.listPinsResponse().get());
}
}
}
| Parameter |
Type |
Required |
Description |
locale |
Optional<String> |
➖ |
The client's preferred locale in rfc5646 format (e.g. en, ja, pt-BR). If omitted, the Accept-Language will be used. If not present or not supported, defaults to the closest match or en. |
requestBody |
ListpinsRequestBody |
✔️ |
List pins request |
ListpinsResponse
| Error Type |
Status Code |
Content Type |
| models/errors/APIException |
4XX, 5XX |
*/* |
Pin a document as a result for a given search query.Pin results that are known to be a good match.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.components.*;
import com.glean.api_client.glean_api_client.models.operations.PinResponse;
import java.lang.Exception;
import java.util.List;
public class Application {
public static void main(String[] args) throws Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
PinResponse res = sdk.client().pins().create()
.pinRequest(PinRequest.builder()
.audienceFilters(List.of(
FacetFilter.builder()
.fieldName("type")
.values(List.of(
FacetFilterValue.builder()
.value("Spreadsheet")
.relationType(RelationType.EQUALS)
.build(),
FacetFilterValue.builder()
.value("Presentation")
.relationType(RelationType.EQUALS)
.build()))
.build()))
.build())
.call();
if (res.pinDocument().isPresent()) {
System.out.println(res.pinDocument().get());
}
}
}
| Parameter |
Type |
Required |
Description |
locale |
Optional<String> |
➖ |
The client's preferred locale in rfc5646 format (e.g. en, ja, pt-BR). If omitted, the Accept-Language will be used. If not present or not supported, defaults to the closest match or en. |
pinRequest |
PinRequest |
✔️ |
Details about the document and query for the pin. |
PinResponse
| Error Type |
Status Code |
Content Type |
| models/errors/APIException |
4XX, 5XX |
*/* |
Unpin a previously pinned result.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.components.Unpin;
import com.glean.api_client.glean_api_client.models.operations.UnpinResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
UnpinResponse res = sdk.client().pins().remove()
.unpin(Unpin.builder()
.build())
.call();
// handle response
}
}
| Parameter |
Type |
Required |
Description |
locale |
Optional<String> |
➖ |
The client's preferred locale in rfc5646 format (e.g. en, ja, pt-BR). If omitted, the Accept-Language will be used. If not present or not supported, defaults to the closest match or en. |
unpin |
Unpin |
✔️ |
Details about the pin being unpinned. |
UnpinResponse
| Error Type |
Status Code |
Content Type |
| models/errors/APIException |
4XX, 5XX |
*/* |