Skip to content

Commit 99e10f3

Browse files
Update code samples
1 parent 8e0eb1e commit 99e10f3

File tree

7 files changed

+353
-129
lines changed

7 files changed

+353
-129
lines changed

.speakeasy/workflow.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
speakeasyVersion: 1.631.5
1+
speakeasyVersion: 1.625.0
22
sources:
33
glean-api-specs:
44
sourceNamespace: glean-api-specs
@@ -24,8 +24,8 @@ sources:
2424
- 0.9.0
2525
glean-client-merged-code-samples-spec:
2626
sourceNamespace: glean-client-merged-code-samples-spec
27-
sourceRevisionDigest: sha256:1420ed690d295a415b66f5f5c0c823251e35c43c5c32f2e5709ebbaf0b410eb9
28-
sourceBlobDigest: sha256:07783bb16e23520f5662c31c52e60ecd1042e0539b80d0fe1c420e4a68a47bcd
27+
sourceRevisionDigest: sha256:cb37f69544255d57a5b0b0cb20dd8510d786011d534b70f13ddd75c1899967e9
28+
sourceBlobDigest: sha256:3fa7d139354aeee5dcfd6a7e3550e7cfaa0bfadbacd40a14db4463bcc64bb301
2929
tags:
3030
- latest
3131
- main
@@ -39,8 +39,8 @@ sources:
3939
- 0.9.0
4040
glean-index-merged-code-samples-spec:
4141
sourceNamespace: glean-index-merged-code-samples-spec
42-
sourceRevisionDigest: sha256:390a008f5b2414a141656c92723d96bd5c0e35dd0e71ae325a683139a6bbaaca
43-
sourceBlobDigest: sha256:eaec2d89f7dc007f43789b7e09da68594b5923cc73b2ae433e17b86e44d88ee8
42+
sourceRevisionDigest: sha256:2e596f3ace1edd1f136fb502d63bd36670bb9d46fa00d1ce7465e71de7e402b4
43+
sourceBlobDigest: sha256:61a40b5700a87a64362988e8ad9689ab2a18158d4623b62a628edd016f419262
4444
tags:
4545
- latest
4646
- main

final_specs/client_rest.yaml

Lines changed: 83 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -15146,8 +15146,8 @@ paths:
1514615146
post:
1514715147
tags:
1514815148
- Insights
15149-
summary: Read insights
15150-
description: Reads the aggregate information for each user, query, and content.
15149+
summary: Get insights
15150+
description: Gets the aggregate usage insights data displayed in the Insights Dashboards.
1515115151
operationId: insights
1515215152
x-visibility: Public
1515315153
x-codegen-request-body-name: payload
@@ -15157,7 +15157,7 @@ paths:
1515715157
application/json:
1515815158
schema:
1515915159
$ref: "#/components/schemas/InsightsRequest"
15160-
description: Includes request params for insights dashboard data.
15160+
description: Includes request parameters for insights requests.
1516115161
required: true
1516215162
x-exportParamName: InsightsRequest
1516315163
responses:
@@ -15179,7 +15179,7 @@ paths:
1517915179
- lang: python
1518015180
label: Python (API Client)
1518115181
source: |-
15182-
from glean.api_client import Glean, models
15182+
from glean.api_client import Glean
1518315183
import os
1518415184

1518515185

@@ -15188,9 +15188,7 @@ paths:
1518815188
instance=os.getenv("GLEAN_INSTANCE", ""),
1518915189
) as glean:
1519015190

15191-
res = glean.client.insights.retrieve(categories=[
15192-
models.InsightsRequestCategory.COLLECTIONS,
15193-
])
15191+
res = glean.client.insights.retrieve()
1519415192

1519515193
# Handle response
1519615194
print(res)
@@ -15205,13 +15203,7 @@ paths:
1520515203
});
1520615204

1520715205
async function run() {
15208-
const result = await glean.client.insights.retrieve({
15209-
categories: [
15210-
"COLLECTIONS",
15211-
"SHORTCUTS",
15212-
"ANNOUNCEMENTS",
15213-
],
15214-
});
15206+
const result = await glean.client.insights.retrieve({});
1521515207

1521615208
// Handle the result
1521715209
console.log(result);
@@ -15220,17 +15212,15 @@ paths:
1522015212
run();
1522115213
- lang: go
1522215214
label: Go (API Client)
15223-
source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tapiclientgo \"github.com/gleanwork/api-client-go\"\n\t\"github.com/gleanwork/api-client-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := apiclientgo.New(\n apiclientgo.WithSecurity(os.Getenv(\"GLEAN_API_TOKEN\")),\n apiclientgo.WithInstance(os.Getenv(\"GLEAN_INSTANCE\")),\n )\n\n res, err := s.Client.Insights.Retrieve(ctx, components.InsightsRequest{\n Categories: []components.InsightsRequestCategory{\n components.InsightsRequestCategoryCollections,\n },\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.InsightsResponse != nil {\n // handle response\n }\n}"
15215+
source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tapiclientgo \"github.com/gleanwork/api-client-go\"\n\t\"github.com/gleanwork/api-client-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := apiclientgo.New(\n apiclientgo.WithSecurity(os.Getenv(\"GLEAN_API_TOKEN\")),\n apiclientgo.WithInstance(os.Getenv(\"GLEAN_INSTANCE\")),\n )\n\n res, err := s.Client.Insights.Retrieve(ctx, components.InsightsRequest{})\n if err != nil {\n log.Fatal(err)\n }\n if res.InsightsResponse != nil {\n // handle response\n }\n}"
1522415216
- lang: java
1522515217
label: Java (API Client)
1522615218
source: |-
1522715219
package hello.world;
1522815220

1522915221
import java.lang.Exception;
15230-
import java.util.List;
1523115222
import org.openapis.openapi.Glean;
1523215223
import org.openapis.openapi.models.components.InsightsRequest;
15233-
import org.openapis.openapi.models.components.InsightsRequestCategory;
1523415224
import org.openapis.openapi.models.operations.InsightsResponse;
1523515225

1523615226
public class Application {
@@ -15242,8 +15232,6 @@ paths:
1524215232
.build();
1524315233

1524415234
InsightsRequest req = InsightsRequest.builder()
15245-
.categories(List.of(
15246-
InsightsRequestCategory.COLLECTIONS))
1524715235
.build();
1524815236

1524915237
InsightsResponse res = sdk.client().insights().retrieve()
@@ -20189,6 +20177,7 @@ components:
2018920177
- SEARCH
2019020178
- SIDEBAR
2019120179
- SUMMARY
20180+
- TASKS
2019220181
issue:
2019320182
type: string
2019420183
description: The issue the user indicated in the feedback.
@@ -24472,6 +24461,41 @@ components:
2447224461
cursor:
2447324462
type: string
2447424463
description: Cursor that indicates the start of the next page of results. To be passed in "more" requests for this query.
24464+
InsightsOverviewRequest:
24465+
properties:
24466+
departments:
24467+
type: array
24468+
items:
24469+
type: string
24470+
description: Departments for which Insights are requested.
24471+
dayRange:
24472+
$ref: "#/components/schemas/Period"
24473+
description: Time period for which Insights are requested.
24474+
InsightsAssistantRequest:
24475+
properties:
24476+
departments:
24477+
type: array
24478+
items:
24479+
type: string
24480+
description: Departments for which Insights are requested.
24481+
dayRange:
24482+
$ref: "#/components/schemas/Period"
24483+
description: Time period for which Insights are requested.
24484+
AgentsInsightsV2Request:
24485+
properties:
24486+
agentIds:
24487+
type: array
24488+
items:
24489+
type: string
24490+
description: IDs of the Agents for which Insights should be returned. An empty array signifies all.
24491+
departments:
24492+
type: array
24493+
items:
24494+
type: string
24495+
description: Departments for which Insights are requested.
24496+
dayRange:
24497+
$ref: "#/components/schemas/Period"
24498+
description: Time period for which Insights are requested.
2447524499
InsightsAiAppRequestOptions:
2447624500
type: object
2447724501
properties:
@@ -24488,16 +24512,33 @@ components:
2448824512
items:
2448924513
type: string
2449024514
description: IDs of the Agents for which Insights should be returned. An empty array signifies all.
24491-
DownloadInsightsRequest:
24492-
required:
24493-
- categories
24515+
InsightsRequest:
2449424516
properties:
24517+
overviewRequest:
24518+
$ref: "#/components/schemas/InsightsOverviewRequest"
24519+
x-visibility: Public
24520+
description: If specified, will return data for the Overview section of the Insights Dashboard.
24521+
assistantRequest:
24522+
$ref: "#/components/schemas/InsightsAssistantRequest"
24523+
x-visibility: Public
24524+
description: If specified, will return data for the Assistant section of the Insights Dashboard.
24525+
agentsRequest:
24526+
$ref: "#/components/schemas/AgentsInsightsV2Request"
24527+
x-visibility: Public
24528+
description: If specified, will return data for the Agents section of the Insights Dashboard.
24529+
disablePerUserInsights:
24530+
type: boolean
24531+
description: If true, suppresses the generation of per-user Insights in the response. Default is false.
2449524532
categories:
24533+
deprecated: true
2449624534
type: array
2449724535
items:
2449824536
type: string
2449924537
enum:
2450024538
- AGENTS
24539+
- AGENT_USERS
24540+
- TOP_AGENTS
24541+
- AGENTS_USAGE_BY_DEPARTMENT
2450124542
- AI
2450224543
- AI_APPS
2450324544
- ANNOUNCEMENTS
@@ -24510,34 +24551,31 @@ components:
2451024551
- USERS
2451124552
description: Categories of data requested. Request can include single or multiple types.
2451224553
departments:
24554+
deprecated: true
2451324555
type: array
2451424556
items:
2451524557
type: string
2451624558
description: Departments that the data is requested for. If this is empty, corresponds to whole company.
2451724559
dayRange:
24560+
deprecated: true
2451824561
$ref: "#/components/schemas/Period"
2451924562
aiAppRequestOptions:
24563+
deprecated: true
2452024564
$ref: "#/components/schemas/InsightsAiAppRequestOptions"
2452124565
agentsRequestOptions:
24566+
deprecated: true
2452224567
$ref: "#/components/schemas/InsightsAgentsRequestOptions"
24523-
InsightsRequest:
24524-
allOf:
24525-
- $ref: "#/components/schemas/DownloadInsightsRequest"
24526-
- type: object
24527-
properties:
24528-
assistantActivityTypes:
24529-
type: array
24530-
items:
24531-
type: string
24532-
enum:
24533-
- GLEAN_CHAT
24534-
- AI_SUMMARY
24535-
- AI_ANSWER
24536-
- GLEANBOT_RESPONSE
24537-
description: Types of activity that should count in the definition of an Assistant Active User. Affects only insights for AI category.
24538-
disablePerUserInsights:
24539-
type: boolean
24540-
description: If true, suppresses the generation of per-user Insights in the response. Default is false.
24568+
assistantActivityTypes:
24569+
deprecated: true
24570+
type: array
24571+
items:
24572+
type: string
24573+
enum:
24574+
- GLEAN_CHAT
24575+
- AI_SUMMARY
24576+
- AI_ANSWER
24577+
- GLEANBOT_RESPONSE
24578+
description: Types of activity that should count in the definition of an Assistant Active User. Affects only insights for AI category.
2454124579
LabeledCountInfo:
2454224580
required:
2454324581
- label
@@ -25823,6 +25861,11 @@ components:
2582325861
channelName:
2582425862
type: string
2582525863
description: Name of the channel (applicable for CHANNEL type sections). Used to display in the frontend.
25864+
channelType:
25865+
type: string
25866+
description: |
25867+
Channel visibility/type for CHANNEL sections. For Slack this is typically one of
25868+
PublicChannel, PrivateChannel. Omit if not applicable or unknown.
2582625869
instanceId:
2582725870
type: string
2582825871
description: Instance identifier for the channel or workspace. Used for constructing channel URLs to display in the frontend.

final_specs/indexing.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3736,6 +3736,7 @@ paths:
37363736
- lang: go
37373737
label: Go (API Client)
37383738
source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tapiclientgo \"github.com/gleanwork/api-client-go\"\n\t\"github.com/gleanwork/api-client-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := apiclientgo.New(\n apiclientgo.WithSecurity(os.Getenv(\"GLEAN_API_TOKEN\")),\n apiclientgo.WithInstance(os.Getenv(\"GLEAN_INSTANCE\")),\n )\n\n res, err := s.Indexing.Shortcuts.Upload(ctx, components.UploadShortcutsRequest{\n UploadID: \"<id>\",\n Shortcuts: []components.IndexingShortcut{\n components.IndexingShortcut{\n InputAlias: \"<value>\",\n DestinationURL: \"https://majestic-pharmacopoeia.info/\",\n CreatedBy: \"<value>\",\n },\n },\n })\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
3739+
/api/index/v1/debug/{datasource}/document/events: {}
37393740
components:
37403741
securitySchemes:
37413742
APIToken:
@@ -5142,6 +5143,38 @@ components:
51425143
- NOT_UPLOADED
51435144
- STATUS_UNKNOWN
51445145
example: UPLOADED
5146+
DebugDocumentLifecycleRequest:
5147+
type: object
5148+
description: Describes the request body of the /debug/{datasource}/document/events API call.
5149+
properties:
5150+
objectType:
5151+
type: string
5152+
description: Object type of the document to get lifecycle events for.
5153+
example: Article
5154+
docId:
5155+
type: string
5156+
description: Glean Document ID within the datasource to get lifecycle events for.
5157+
example: art123
5158+
startDate:
5159+
type: string
5160+
description: The start date for events to be fetched. Cannot be more than 30 days (default 7 days) in the past.
5161+
example: "2025-05-01"
5162+
maxEvents:
5163+
type: integer
5164+
description: Max number of events to be fetched. Cannot be more than 100 (default 20).
5165+
example: 50
5166+
required:
5167+
- objectType
5168+
- docId
5169+
DebugDocumentLifecycleResponse:
5170+
type: object
5171+
description: Describes the response body of the /debug/{datasource}/document/events API call
5172+
properties:
5173+
lifeCycleEvents:
5174+
type: array
5175+
description: List of lifecycle events corresponding to the document
5176+
items:
5177+
$ref: "#/components/schemas/LifeCycleEvent"
51455178
PropertyDefinition:
51465179
properties:
51475180
name:

0 commit comments

Comments
 (0)