Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1,607 changes: 805 additions & 802 deletions .speakeasy/gen.lock

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ generation:
requestResponseComponentNamesFeb2024: true
securityFeb2025: true
sharedErrorComponentsApr2025: true
sharedNestedComponentsJan2026: false
auth:
oAuth2ClientCredentialsEnabled: false
oAuth2PasswordEnabled: false
Expand All @@ -31,7 +32,7 @@ generation:
generateNewTests: true
skipResponseBodyAssertions: true
python:
version: 0.11.26
version: 0.11.27
additionalDependencies:
dev: {}
main: {}
Expand Down Expand Up @@ -80,3 +81,4 @@ python:
responseFormat: flat
sseFlatResponse: false
templateVersion: v2
useAsyncHooks: false
4 changes: 2 additions & 2 deletions .speakeasy/glean-merged-spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ openapi: 3.0.0
info:
version: 0.9.0
title: Glean API
x-source-commit-sha: 80a17b90f735e5c9738cb1cf8fa7025e1d0a9361
x-source-commit-sha: 17a84cfc3e3f0e0a3eec1792cf57a65f444d613e
description: |
# Introduction
In addition to the data sources that Glean has built-in support for, Glean also provides a REST API that enables customers to put arbitrary content in the search index. This is useful, for example, for doing permissions-aware search over content in internal tools that reside on-prem as well as for searching over applications that Glean does not currently support first class. In addition these APIs allow the customer to push organization data (people info, organization structure etc) into Glean.
Expand All @@ -22,7 +22,7 @@ info:
These API clients provide type-safe, idiomatic interfaces for working with Glean IndexingAPIs in your language of choice.
x-logo:
url: https://app.glean.com/images/glean-text2.svg
x-open-api-commit-sha: 76c9a769942823963f9ac3400922e023ccf26826
x-open-api-commit-sha: 3bb1859df9ba2cff7a43d5b1c336bb826a766b4c
x-speakeasy-name: 'Glean API'
servers:
- url: https://{instance}-be.glean.com
Expand Down
14 changes: 7 additions & 7 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
speakeasyVersion: 1.685.0
speakeasyVersion: 1.686.0
sources:
Glean API:
sourceNamespace: glean-api-specs
sourceRevisionDigest: sha256:4318ed871de2369be5d6a437fef673ee1bf14ec8861b1de14ddd845c992caafa
sourceBlobDigest: sha256:f61359558ffde96f01bc7ce952217278ff7413501da30c9554c54709d632ec70
sourceRevisionDigest: sha256:fcb56a3a1b355cdff7e63a0b76385f81472ce01a748f25a409b13b70d89436cc
sourceBlobDigest: sha256:01a8dbd2649712ab871b1799b6c76f92f4edb070c675738cac74685c81879a37
tags:
- latest
- speakeasy-sdk-regen-1765586442
- speakeasy-sdk-regen-1768441819
Glean Client API:
sourceNamespace: glean-client-api
sourceRevisionDigest: sha256:4edc63ad559e4f2c9fb9ebf5edaaaaa9269f1874d271cfd84b441d6dacac43d2
Expand All @@ -17,10 +17,10 @@ targets:
glean:
source: Glean API
sourceNamespace: glean-api-specs
sourceRevisionDigest: sha256:4318ed871de2369be5d6a437fef673ee1bf14ec8861b1de14ddd845c992caafa
sourceBlobDigest: sha256:f61359558ffde96f01bc7ce952217278ff7413501da30c9554c54709d632ec70
sourceRevisionDigest: sha256:fcb56a3a1b355cdff7e63a0b76385f81472ce01a748f25a409b13b70d89436cc
sourceBlobDigest: sha256:01a8dbd2649712ab871b1799b6c76f92f4edb070c675738cac74685c81879a37
codeSamplesNamespace: glean-api-specs-python-code-samples
codeSamplesRevisionDigest: sha256:ed0360d9bd610f85a768b928c8f875d2ccedd748f4c54b0c5d244637a74c3d0a
codeSamplesRevisionDigest: sha256:77edd92d12a6f8e9e87bc2578f8369e25dba1060192ba455304996c267701c6a
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -488,4 +488,14 @@ Based on:
### Generated
- [python v0.11.26] .
### Releases
- [PyPI v0.11.26] https://pypi.org/project/glean-api-client/0.11.26 - .
- [PyPI v0.11.26] https://pypi.org/project/glean-api-client/0.11.26 - .

## 2026-01-16 01:51:23
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.686.0 (2.796.1) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v0.11.27] .
### Releases
- [PyPI v0.11.27] https://pypi.org/project/glean-api-client/0.11.27 - .
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

[project]
name = "glean-api-client"
version = "0.11.26"
version = "0.11.27"
description = "Python Client SDK Generated by Speakeasy."
authors = [{ name = "Glean Technologies, Inc." },]
readme = "README-PYPI.md"
Expand Down
6 changes: 3 additions & 3 deletions src/glean/api_client/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import importlib.metadata

__title__: str = "glean-api-client"
__version__: str = "0.11.26"
__version__: str = "0.11.27"
__openapi_doc_version__: str = "0.9.0"
__gen_version__: str = "2.794.1"
__user_agent__: str = "speakeasy-sdk/python 0.11.26 2.794.1 0.9.0 glean-api-client"
__gen_version__: str = "2.796.1"
__user_agent__: str = "speakeasy-sdk/python 0.11.27 2.796.1 0.9.0 glean-api-client"

try:
if __package__ is not None:
Expand Down
26 changes: 20 additions & 6 deletions src/glean/api_client/basesdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
AfterSuccessContext,
BeforeRequestContext,
)
from glean.api_client.utils import RetryConfig, SerializedRequestBody, get_body_content
from glean.api_client.utils import (
RetryConfig,
SerializedRequestBody,
get_body_content,
run_sync_in_thread,
)
import httpx
from typing import Callable, List, Mapping, Optional, Tuple
from urllib.parse import parse_qs, urlparse
Expand Down Expand Up @@ -311,7 +316,10 @@ async def do_request_async(
async def do():
http_res = None
try:
req = hooks.before_request(BeforeRequestContext(hook_ctx), request)
req = await run_sync_in_thread(
hooks.before_request, BeforeRequestContext(hook_ctx), request
)

logger.debug(
"Request:\nMethod: %s\nURL: %s\nHeaders: %s\nBody: %s",
req.method,
Expand All @@ -325,7 +333,10 @@ async def do():

http_res = await client.send(req, stream=stream)
except Exception as e:
_, e = hooks.after_error(AfterErrorContext(hook_ctx), None, e)
_, e = await run_sync_in_thread(
hooks.after_error, AfterErrorContext(hook_ctx), None, e
)

if e is not None:
logger.debug("Request Exception", exc_info=True)
raise e
Expand All @@ -343,9 +354,10 @@ async def do():
)

if utils.match_status_codes(error_status_codes, http_res.status_code):
result, err = hooks.after_error(
AfterErrorContext(hook_ctx), http_res, None
result, err = await run_sync_in_thread(
hooks.after_error, AfterErrorContext(hook_ctx), http_res, None
)

if err is not None:
logger.debug("Request Exception", exc_info=True)
raise err
Expand All @@ -365,6 +377,8 @@ async def do():
http_res = await do()

if not utils.match_status_codes(error_status_codes, http_res.status_code):
http_res = hooks.after_success(AfterSuccessContext(hook_ctx), http_res)
http_res = await run_sync_in_thread(
hooks.after_success, AfterSuccessContext(hook_ctx), http_res
)

return http_res
19 changes: 18 additions & 1 deletion src/glean/api_client/models/activityevent.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
from .activityeventparams import ActivityEventParams, ActivityEventParamsTypedDict
from datetime import datetime
from enum import Enum
from glean.api_client.types import BaseModel
from glean.api_client.types import BaseModel, UNSET_SENTINEL
from pydantic import model_serializer
from typing import Optional
from typing_extensions import NotRequired, TypedDict

Expand Down Expand Up @@ -54,3 +55,19 @@ class ActivityEvent(BaseModel):
r"""Universally unique identifier of the event. To allow for reliable retransmission, only the earliest received event of a given UUID is considered valid by the server and subsequent are ignored."""

params: Optional[ActivityEventParams] = None

@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = set(["id", "params"])
serialized = handler(self)
m = {}

for n, f in type(self).model_fields.items():
k = f.alias or n
val = serialized.get(k)

if val != UNSET_SENTINEL:
if val is not None or k not in optional_fields:
m[k] = val

return m
31 changes: 30 additions & 1 deletion src/glean/api_client/models/activityeventparams.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from glean.api_client.types import BaseModel
from glean.api_client.types import BaseModel, UNSET_SENTINEL
import pydantic
from pydantic import model_serializer
from typing import Optional
from typing_extensions import Annotated, NotRequired, TypedDict

Expand Down Expand Up @@ -59,3 +60,31 @@ class ActivityEventParams(BaseModel):

truncated: Optional[bool] = None
r"""Indicates that the parameters are incomplete and more parameters may be sent with the same action+timestamp+URL in the future. This is used for sending the duration when a `VIEW` is finished."""

@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = set(
[
"bodyContent",
"datasourceInstance",
"datasource",
"instanceOnlyName",
"duration",
"query",
"referrer",
"title",
"truncated",
]
)
serialized = handler(self)
m = {}

for n, f in type(self).model_fields.items():
k = f.alias or n
val = serialized.get(k)

if val != UNSET_SENTINEL:
if val is not None or k not in optional_fields:
m[k] = val

return m
19 changes: 18 additions & 1 deletion src/glean/api_client/models/addcollectionitemserror.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

from __future__ import annotations
from enum import Enum
from glean.api_client.types import BaseModel
from glean.api_client.types import BaseModel, UNSET_SENTINEL
import pydantic
from pydantic import model_serializer
from typing import Optional
from typing_extensions import Annotated, NotRequired, TypedDict

Expand All @@ -20,3 +21,19 @@ class AddCollectionItemsError(BaseModel):
error_type: Annotated[
Optional[AddCollectionItemsErrorErrorType], pydantic.Field(alias="errorType")
] = None

@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = set(["errorType"])
serialized = handler(self)
m = {}

for n, f in type(self).model_fields.items():
k = f.alias or n
val = serialized.get(k)

if val != UNSET_SENTINEL:
if val is not None or k not in optional_fields:
m[k] = val

return m
19 changes: 18 additions & 1 deletion src/glean/api_client/models/addcollectionitemsrequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
CollectionItemDescriptor,
CollectionItemDescriptorTypedDict,
)
from glean.api_client.types import BaseModel
from glean.api_client.types import BaseModel, UNSET_SENTINEL
import pydantic
from pydantic import model_serializer
from typing import List, Optional
from typing_extensions import Annotated, NotRequired, TypedDict

Expand All @@ -29,3 +30,19 @@ class AddCollectionItemsRequest(BaseModel):
pydantic.Field(alias="addedCollectionItemDescriptors"),
] = None
r"""The CollectionItemDescriptors of the items being added."""

@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = set(["addedCollectionItemDescriptors"])
serialized = handler(self)
m = {}

for n, f in type(self).model_fields.items():
k = f.alias or n
val = serialized.get(k)

if val != UNSET_SENTINEL:
if val is not None or k not in optional_fields:
m[k] = val

return m
19 changes: 18 additions & 1 deletion src/glean/api_client/models/addcollectionitemsresponse.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
AddCollectionItemsErrorTypedDict,
)
from .collection import Collection, CollectionTypedDict
from glean.api_client.types import BaseModel
from glean.api_client.types import BaseModel, UNSET_SENTINEL
from pydantic import model_serializer
from typing import Optional
from typing_extensions import NotRequired, TypedDict

Expand All @@ -20,3 +21,19 @@ class AddCollectionItemsResponse(BaseModel):
collection: Optional[Collection] = None

error: Optional[AddCollectionItemsError] = None

@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = set(["collection", "error"])
serialized = handler(self)
m = {}

for n, f in type(self).model_fields.items():
k = f.alias or n
val = serialized.get(k)

if val != UNSET_SENTINEL:
if val is not None or k not in optional_fields:
m[k] = val

return m
19 changes: 18 additions & 1 deletion src/glean/api_client/models/additionalfielddefinition.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from glean.api_client.types import BaseModel
from glean.api_client.types import BaseModel, UNSET_SENTINEL
from pydantic import model_serializer
from typing import List, Optional
from typing_extensions import NotRequired, TypedDict

Expand Down Expand Up @@ -63,3 +64,19 @@ class AdditionalFieldDefinition(BaseModel):
Example: ```\"languages\": [{\"lang\":\"English\",\"lang\":\"Spanish\",...}]```. In this case, the key \"lang\" will be ignored and can even be passed in as an empty string.

"""

@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = set(["key", "value"])
serialized = handler(self)
m = {}

for n, f in type(self).model_fields.items():
k = f.alias or n
val = serialized.get(k)

if val != UNSET_SENTINEL:
if val is not None or k not in optional_fields:
m[k] = val

return m
Loading