diff --git a/.github/scripts/README.md b/.github/scripts/README.md deleted file mode 100644 index 5c47b7fa..00000000 --- a/.github/scripts/README.md +++ /dev/null @@ -1,54 +0,0 @@ -# Restructuring Script - -This directory contains a script to restructure the glean package from: - -``` -src/glean/ # All implementation files -``` - -To: - -``` -src/glean/ # Implicit namespace package (no __init__.py) -src/glean/api_client/ # All implementation files moved here -``` - -## Usage - -```bash -python scripts/restructure_to_namespace.py -``` - -This script: - -- Detects Speakeasy regeneration and automatically handles it -- Creates a backup and moves all files -- Uses implicit namespace packages (no `__init__.py` needed) -- Can be run multiple times safely -- Updates all import statements throughout the codebase - -## Speakeasy Integration - -The script automatically detects when Speakeasy has regenerated files: - -1. **First run**: Moves everything to `api_client/` -2. **After Speakeasy regeneration**: Detects new files in `src/glean/`, removes old `api_client/`, and re-runs the transformation -3. **Subsequent runs**: Detects already-transformed structure and skips - -## What the restructuring does - -1. **Creates a backup** of the current `src/glean` directory -2. **Moves all files** from `src/glean/` to `src/glean/api_client/` -3. **Creates an implicit namespace package** (no `__init__.py` - Python 3.3+ feature) -4. **Updates all import statements** in tests, examples, and internal files - -## Workflow Integration - -The repository includes a GitHub Actions workflow (`.github/workflows/patch-speakeasy-pr.yml`) that automatically runs the restructuring script. - -- **Triggers**: Runs on PRs with "Update SDK - Generate" in the title (Speakeasy PRs) or manual dispatch -- **Process**: Automatically runs the restructuring script when Speakeasy regenerates the SDK -- **Auto-commit**: Commits and pushes the restructured files back to the same PR branch - -This means Speakeasy PRs are automatically transformed to the namespace -structure without manual intervention. diff --git a/.github/scripts/restructure_to_namespace.py b/.github/scripts/restructure_to_namespace.py deleted file mode 100755 index 2fba986d..00000000 --- a/.github/scripts/restructure_to_namespace.py +++ /dev/null @@ -1,258 +0,0 @@ -#!/usr/bin/env python3 -""" -Codemod script to restructure the glean package into a namespace structure. - -This script moves all API client code from src/glean to src/glean/api_client, -making glean a namespace package and api_client the actual implementation. - -It also detects if Speakeasy has regenerated files and automatically re-runs -the transformation. -""" - -import shutil -import tempfile -import sys -from pathlib import Path -import re -from typing import List - - -class GleanRestructure: - def __init__(self, project_root: Path): - self.project_root = project_root - self.src_dir = project_root / "src" - self.glean_dir = self.src_dir / "glean" - - def update_imports_in_file(self, file_path: Path) -> bool: - """Update import statements in a Python or Markdown file to use the new structure.""" - try: - with open(file_path, "r", encoding="utf-8") as f: - content = f.read() - - original_content = content - - # Apply the actual import transformations - transformations = [ - # from glean import X, Y, Z -> from glean.api_client import X, Y, Z - ( - r"from glean(?!\.api_client) import\s+", - r"from glean.api_client import ", - ), - # from glean.something import ... -> from glean.api_client.something import ... - (r"from glean\.(?!api_client)([^.\s]+)", r"from glean.api_client.\1"), - # import glean.something -> import glean.api_client.something - ( - r"import glean\.(?!api_client)([^.\s]+)", - r"import glean.api_client.\1", - ), - # String-based module paths in data structures (e.g. `_sub_sdk_map` in `sdks.py`) - (r'"glean\.(?!api_client)([^."]+)"', r'"glean.api_client.\1"'), - (r"'glean\.(?!api_client)([^.']+)'", r"'glean.api_client.\1'"), - ] - - for pattern, replacement in transformations: - content = re.sub(pattern, replacement, content) - - # Only write if content changed - if content != original_content: - with open(file_path, "w", encoding="utf-8") as f: - f.write(content) - print(f"Updated imports in: {file_path}") - return True - - return False - - except Exception as e: - print(f"Error processing {file_path}: {e}") - return False - - def update_imports_in_moved_files(self, api_client_dir: Path): - """Update internal imports within the moved api_client directory.""" - files_to_process = list(api_client_dir.rglob("*.py")) - - for file_path in files_to_process: - self.update_imports_in_file(file_path) - - def get_files_to_move(self) -> List[Path]: - """Get list of files/directories that would be moved.""" - files_to_move = [] - for item in self.glean_dir.iterdir(): - if item.name not in ["api_client", "__pycache__"]: - files_to_move.append(item) - return files_to_move - - def detect_speakeasy_regeneration(self) -> bool: - """ - Detect if Speakeasy has regenerated files after our transformation. - - Returns True if regeneration is detected (i.e., there are files/dirs other than api_client) - """ - api_client_dir = self.glean_dir / "api_client" - - if not api_client_dir.exists(): - # No api_client directory means we haven't run the transformation yet - return False - - # Check if there are any files/directories other than api_client and __pycache__ - other_items = self.get_files_to_move() - return len(other_items) > 0 - - def move_files_to_api_client(self): - """Move files from glean/ to glean/api_client/.""" - api_client_dir = self.glean_dir / "api_client" - api_client_dir.mkdir(exist_ok=True) - - print("Moving files to api_client...") - files_to_move = self.get_files_to_move() - - for item in files_to_move: - dest = api_client_dir / item.name - print(f"Moving {item} -> {dest}") - shutil.move(str(item), str(dest)) - - def update_project_imports(self): - """Update imports in tests, examples, documentation, and other project files.""" - print("Updating imports in tests, examples, and documentation...") - - # Update test files - tests_dir = self.project_root / "tests" - if tests_dir.exists(): - for test_file in tests_dir.rglob("*.py"): - self.update_imports_in_file(test_file) - - # Update example files - examples_dir = self.project_root / "examples" - if examples_dir.exists(): - for example_file in examples_dir.rglob("*.py"): - self.update_imports_in_file(example_file) - - # Update any other Python files in the project root - for py_file in self.project_root.glob("*.py"): - self.update_imports_in_file(py_file) - - # Update markdown files with Python code snippets - self.update_markdown_files() - - def update_markdown_files(self): - """Update Python code snippets in markdown files.""" - print("Updating Python code snippets in markdown files...") - - # Find all markdown files in the project - markdown_files = [] - - # Check docs directory - docs_dir = self.project_root / "docs" - if docs_dir.exists(): - markdown_files.extend(docs_dir.rglob("*.md")) - - # Check root level markdown files - markdown_files.extend(self.project_root.glob("*.md")) - - # Also check other common locations - for dirname in ["examples", "tests"]: - dir_path = self.project_root / dirname - if dir_path.exists(): - markdown_files.extend(dir_path.rglob("*.md")) - - for md_file in markdown_files: - if self.update_imports_in_file(md_file): - print(f"Updated markdown file: {md_file}") - - def perform_restructure(self): - """Perform the actual restructuring of files.""" - # Create a temporary backup - temp_backup = tempfile.mkdtemp(prefix="glean_backup_") - backup_glean = Path(temp_backup) / "glean" - - try: - print(f"Creating backup at: {temp_backup}") - shutil.copytree(self.glean_dir, backup_glean) - except Exception as e: - print(f"Error creating backup: {e}") - sys.exit(1) - - try: - # Move files to api_client - self.move_files_to_api_client() - - # No need to create __init__.py - Python 3.3+ supports implicit namespace packages - # The absence of __init__.py makes src/glean a namespace package automatically - print("Using implicit namespace package (no __init__.py needed)") - - # Update imports in the moved files - api_client_dir = self.glean_dir / "api_client" - print("Updating imports in moved files...") - self.update_imports_in_moved_files(api_client_dir) - - # Update imports in other parts of the project - self.update_project_imports() - - print("\nRestructuring complete!") - print(f"Backup created at: {temp_backup}") - print("New structure:") - print(" src/glean/ (implicit namespace package)") - print(" src/glean/api_client/ (actual implementation)") - - print("\nTo use the restructured package:") - print(" from glean.api_client import Glean") - print(" # or") - print(" import glean.api_client as glean") - - print(f"\nIf anything goes wrong, you can restore from: {temp_backup}") - - except Exception as e: - print(f"Error during restructuring: {e}") - print(f"Restoring from backup: {temp_backup}") - - # Restore from backup - backup_glean = Path(temp_backup) / "glean" - if self.glean_dir.exists(): - shutil.rmtree(self.glean_dir) - shutil.copytree(backup_glean, self.glean_dir) - - sys.exit(1) - - def run(self): - """Main entry point for the restructuring process.""" - if not self.glean_dir.exists(): - print( - "Error: src/glean directory not found. Run this script from the project root." - ) - sys.exit(1) - - print("Checking for Speakeasy regeneration...") - - speakeasy_regenerated = self.detect_speakeasy_regeneration() - api_client_dir = self.glean_dir / "api_client" - - if speakeasy_regenerated: - print( - "🔄 Detected Speakeasy regeneration - files found outside api_client/" - ) - print( - "This means Speakeasy has regenerated the client after our transformation." - ) - print( - "Removing old api_client/ and re-running transformation from scratch..." - ) - if api_client_dir.exists(): - shutil.rmtree(api_client_dir) - print(f"Removed {api_client_dir}") - - print("Starting restructure...") - print(f"Project root: {self.project_root}") - print(f"Source dir: {self.src_dir}") - print(f"Glean dir: {self.glean_dir}") - self.perform_restructure() - - -def main(): - # Get the project root (should be run from project root) - project_root = Path.cwd() - - restructurer = GleanRestructure(project_root) - restructurer.run() - - -if __name__ == "__main__": - main() diff --git a/.github/workflows/patch-speakeasy-pr.yml b/.github/workflows/patch-speakeasy-pr.yml index c0d2f9c8..d4e0a688 100644 --- a/.github/workflows/patch-speakeasy-pr.yml +++ b/.github/workflows/patch-speakeasy-pr.yml @@ -6,7 +6,7 @@ on: workflow_dispatch: jobs: - add-extend-path: + patch: if: github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && contains(github.event.pull_request.title, 'Update SDK - Generate')) runs-on: ubuntu-latest permissions: @@ -19,9 +19,7 @@ jobs: ref: ${{ github.head_ref || github.ref_name }} fetch-depth: 0 - - name: Restructure glean package to namespace structure - run: | - python .github/scripts/restructure_to_namespace.py + - run: echo "Nothing to do! 🎉" - name: Commit and push if files changed run: | diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 81ec3186..e67a13f5 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 3e3290ca-0ee8-4981-b1bc-14536048fa63 management: - docChecksum: 59c6e14049dbd73093349e44990e95cc + docChecksum: adc860b8099788fe237e893e2a1ce2a4 docVersion: 0.9.0 - speakeasyVersion: 1.558.0 - generationVersion: 2.623.2 + speakeasyVersion: 1.561.0 + generationVersion: 2.628.0 releaseVersion: 0.6.5 - configChecksum: bb2b0d325af46323cdd0a355d5cb36cd + configChecksum: 6378ddf91bd99402a13555fcfc9817af repoURL: https://github.com/gleanwork/api-client-python.git installationURL: https://github.com/gleanwork/api-client-python.git published: true @@ -14,8 +14,9 @@ features: python: additionalDependencies: 1.0.0 additionalProperties: 1.0.1 + configurableModuleName: 0.2.0 constsAndDefaults: 1.0.5 - core: 5.19.2 + core: 5.19.3 defaultEnabledRetries: 0.2.0 deprecations: 3.0.2 devContainers: 3.0.0 @@ -640,505 +641,505 @@ generatedFiles: - pylintrc - scripts/prepare_readme.py - scripts/publish.sh - - src/glean/__init__.py - - src/glean/_hooks/__init__.py - - src/glean/_hooks/sdkhooks.py - - src/glean/_hooks/types.py - - src/glean/_version.py - - src/glean/agents.py - - src/glean/announcements.py - - src/glean/answers.py - - src/glean/basesdk.py - - src/glean/client.py - - src/glean/client_activity.py - - src/glean/client_authentication.py - - src/glean/client_chat.py - - src/glean/client_documents.py - - src/glean/client_shortcuts.py - - src/glean/client_verification.py - - src/glean/collections.py - - src/glean/data.py - - src/glean/datasources.py - - src/glean/entities.py - - src/glean/errors/__init__.py - - src/glean/errors/collectionerror.py - - src/glean/errors/gleandataerror.py - - src/glean/errors/gleanerror.py - - src/glean/governance.py - - src/glean/governance_documents.py - - src/glean/httpclient.py - - src/glean/indexing.py - - src/glean/indexing_authentication.py - - src/glean/indexing_datasource.py - - src/glean/indexing_documents.py - - src/glean/indexing_permissions.py - - src/glean/indexing_shortcuts.py - - src/glean/insights.py - - src/glean/messages.py - - src/glean/models/__init__.py - - src/glean/models/activity.py - - src/glean/models/activityevent.py - - src/glean/models/activityeventparams.py - - src/glean/models/addcollectionitemserror.py - - src/glean/models/addcollectionitemsrequest.py - - src/glean/models/addcollectionitemsresponse.py - - src/glean/models/additionalfielddefinition.py - - src/glean/models/agent.py - - src/glean/models/agentconfig.py - - src/glean/models/agentexecutionstatus.py - - src/glean/models/agentrun.py - - src/glean/models/agentruncreate.py - - src/glean/models/agentrunwaitresponse.py - - src/glean/models/agentschemas.py - - src/glean/models/aiappactioncounts.py - - src/glean/models/aiappsinsightsresponse.py - - src/glean/models/aiinsightsresponse.py - - src/glean/models/allowlistoptions.py - - src/glean/models/announcement.py - - src/glean/models/anonymousevent.py - - src/glean/models/answer.py - - src/glean/models/answerboard.py - - src/glean/models/answercreationdata.py - - src/glean/models/answerlike.py - - src/glean/models/answerlikes.py - - src/glean/models/answerresult.py - - src/glean/models/appresult.py - - src/glean/models/authconfig.py - - src/glean/models/authtoken.py - - src/glean/models/autocompleterequest.py - - src/glean/models/autocompleteresponse.py - - src/glean/models/autocompleteresult.py - - src/glean/models/autocompleteresultgroup.py - - src/glean/models/badge.py - - src/glean/models/bulkindexdocumentsrequest.py - - src/glean/models/bulkindexemployeesrequest.py - - src/glean/models/bulkindexgroupsrequest.py - - src/glean/models/bulkindexmembershipsrequest.py - - src/glean/models/bulkindexshortcutsrequest.py - - src/glean/models/bulkindexteamsrequest.py - - src/glean/models/bulkindexusersrequest.py - - src/glean/models/bulkuploadhistoryevent.py - - src/glean/models/calendarattendee.py - - src/glean/models/calendarattendees.py - - src/glean/models/calendarevent.py - - src/glean/models/canonicalizingregextype.py - - src/glean/models/channelinviteinfo.py - - src/glean/models/chat.py - - src/glean/models/chatfile.py - - src/glean/models/chatfilefailurereason.py - - src/glean/models/chatfilemetadata.py - - src/glean/models/chatfilestatus.py - - src/glean/models/chatmessage.py - - src/glean/models/chatmessagecitation.py - - src/glean/models/chatmessagefragment.py - - src/glean/models/chatmetadata.py - - src/glean/models/chatmetadataresult.py - - src/glean/models/chatop.py - - src/glean/models/chatrequest.py - - src/glean/models/chatresponse.py - - src/glean/models/chatrestrictionfilters.py - - src/glean/models/chatresult.py - - src/glean/models/chatstreamop.py - - src/glean/models/chatzerostatesuggestionoptions.py - - src/glean/models/checkdocumentaccessrequest.py - - src/glean/models/checkdocumentaccessresponse.py - - src/glean/models/clustergroup.py - - src/glean/models/clustertypeenum.py - - src/glean/models/code.py - - src/glean/models/codeline.py - - src/glean/models/collection.py - - src/glean/models/collectionerror.py - - src/glean/models/collectionitem.py - - src/glean/models/collectionitemdescriptor.py - - src/glean/models/collectionpinmetadata.py - - src/glean/models/collectionpinnablecategories.py - - src/glean/models/collectionpinnabletargets.py - - src/glean/models/collectionpinnedmetadata.py - - src/glean/models/collectionpintarget.py - - src/glean/models/commentdefinition.py - - src/glean/models/communicationchannel.py - - src/glean/models/company.py - - src/glean/models/conferencedata.py - - src/glean/models/connectortype.py - - src/glean/models/contentdefinition.py - - src/glean/models/contentinsightsresponse.py - - src/glean/models/contenttype.py - - src/glean/models/countinfo.py - - src/glean/models/createannouncementrequest.py - - src/glean/models/createanswerrequest.py - - src/glean/models/createauthtokenresponse.py - - src/glean/models/createcollectionrequest.py - - src/glean/models/createcollectionresponse.py - - src/glean/models/createdlpreportrequest.py - - src/glean/models/createdlpreportresponse.py - - src/glean/models/createshortcutrequest.py - - src/glean/models/createshortcutresponse.py - - src/glean/models/customdatasourceconfig.py - - src/glean/models/customdatavalue.py - - src/glean/models/customentity.py - - src/glean/models/customentitymetadata.py - - src/glean/models/customer.py - - src/glean/models/customermetadata.py - - src/glean/models/customfielddata.py - - src/glean/models/customfieldvalue.py - - src/glean/models/customfieldvaluehyperlink.py - - src/glean/models/customfieldvalueperson.py - - src/glean/models/customfieldvaluestr.py - - src/glean/models/customproperty.py - - src/glean/models/datasourcebulkmembershipdefinition.py - - src/glean/models/datasourcegroupdefinition.py - - src/glean/models/datasourcemembershipdefinition.py - - src/glean/models/datasourceobjecttypedocumentcountentry.py - - src/glean/models/datasourceprofile.py - - src/glean/models/datasourceuserdefinition.py - - src/glean/models/debugdatasourcestatusidentityresponsecomponent.py - - src/glean/models/debugdatasourcestatusresponse.py - - src/glean/models/debugdocumentrequest.py - - src/glean/models/debugdocumentresponse.py - - src/glean/models/debugdocumentsrequest.py - - src/glean/models/debugdocumentsresponse.py - - src/glean/models/debugdocumentsresponseitem.py - - src/glean/models/debuguserrequest.py - - src/glean/models/debuguserresponse.py - - src/glean/models/deleteallchatsop.py - - src/glean/models/deleteannouncementrequest.py - - src/glean/models/deleteanswerrequest.py - - src/glean/models/deletechatfilesop.py - - src/glean/models/deletechatfilesrequest.py - - src/glean/models/deletechatsop.py - - src/glean/models/deletechatsrequest.py - - src/glean/models/deletecollectionitemrequest.py - - src/glean/models/deletecollectionitemresponse.py - - src/glean/models/deletecollectionrequest.py - - src/glean/models/deletedocumentrequest.py - - src/glean/models/deleteemployeerequest.py - - src/glean/models/deletegrouprequest.py - - src/glean/models/deletemembershiprequest.py - - src/glean/models/deleteshortcutrequest.py - - src/glean/models/deleteteamrequest.py - - src/glean/models/deleteuserrequest.py - - src/glean/models/disambiguation.py - - src/glean/models/displayablelistitemuiconfig.py - - src/glean/models/dlpconfig.py - - src/glean/models/dlpfrequency.py - - src/glean/models/dlpperson.py - - src/glean/models/dlppersonmetadata.py - - src/glean/models/dlpreport.py - - src/glean/models/dlpreportstatus.py - - src/glean/models/dlpsimpleresult.py - - src/glean/models/document.py - - src/glean/models/documentcontent.py - - src/glean/models/documentdefinition.py - - src/glean/models/documentinsight.py - - src/glean/models/documentinteractions.py - - src/glean/models/documentinteractionsdefinition.py - - src/glean/models/documentmetadata.py - - src/glean/models/documentorerror_union.py - - src/glean/models/documentpermissionsdefinition.py - - src/glean/models/documentsection.py - - src/glean/models/documentspec_union.py - - src/glean/models/documentstatusresponse.py - - src/glean/models/documentvisibility.py - - src/glean/models/documentvisibilityoverride.py - - src/glean/models/documentvisibilityupdateresult.py - - src/glean/models/downloadpolicycsvop.py - - src/glean/models/downloadreportcsvop.py - - src/glean/models/editanswerrequest.py - - src/glean/models/editcollectionitemrequest.py - - src/glean/models/editcollectionitemresponse.py - - src/glean/models/editcollectionrequest.py - - src/glean/models/editcollectionresponse.py - - src/glean/models/editpinrequest.py - - src/glean/models/employeeinfodefinition.py - - src/glean/models/employeeteaminfo.py - - src/glean/models/entitiessortorder.py - - src/glean/models/entityrelationship.py - - src/glean/models/entitytype.py - - src/glean/models/errormessage.py - - src/glean/models/eventclassification.py - - src/glean/models/eventclassificationname.py - - src/glean/models/eventstrategyname.py - - src/glean/models/externalsharingoptions.py - - src/glean/models/externalshortcut.py - - src/glean/models/extractedqna.py - - src/glean/models/facetbucket.py - - src/glean/models/facetbucketfilter.py - - src/glean/models/facetfilter.py - - src/glean/models/facetfilterset.py - - src/glean/models/facetfiltervalue.py - - src/glean/models/facetresult.py - - src/glean/models/facetvalue.py - - src/glean/models/favoriteinfo.py - - src/glean/models/feedback.py - - src/glean/models/feedbackchatexchange.py - - src/glean/models/feedbackop.py - - src/glean/models/feedentry.py - - src/glean/models/feedrequest.py - - src/glean/models/feedrequestoptions.py - - src/glean/models/feedresponse.py - - src/glean/models/feedresult.py - - src/glean/models/followupaction.py - - src/glean/models/generatedattachment.py - - src/glean/models/generatedattachmentcontent.py - - src/glean/models/generatedqna.py - - src/glean/models/get_rest_api_v1_tools_listop.py - - src/glean/models/getagentop.py - - src/glean/models/getagentschemasop.py - - src/glean/models/getanswererror.py - - src/glean/models/getanswerrequest.py - - src/glean/models/getanswerresponse.py - - src/glean/models/getchatapplicationop.py - - src/glean/models/getchatapplicationrequest.py - - src/glean/models/getchatapplicationresponse.py - - src/glean/models/getchatfilesop.py - - src/glean/models/getchatfilesrequest.py - - src/glean/models/getchatfilesresponse.py - - src/glean/models/getchatop.py - - src/glean/models/getchatrequest.py - - src/glean/models/getchatresponse.py - - src/glean/models/getcollectionrequest.py - - src/glean/models/getcollectionresponse.py - - src/glean/models/getdatasourceconfigrequest.py - - src/glean/models/getdlpreportresponse.py - - src/glean/models/getdocpermissionsrequest.py - - src/glean/models/getdocpermissionsresponse.py - - src/glean/models/getdocumentcountrequest.py - - src/glean/models/getdocumentcountresponse.py - - src/glean/models/getdocumentsbyfacetsrequest.py - - src/glean/models/getdocumentsbyfacetsresponse.py - - src/glean/models/getdocumentsrequest.py - - src/glean/models/getdocumentsresponse.py - - src/glean/models/getdocumentstatusrequest.py - - src/glean/models/getdocumentstatusresponse.py - - src/glean/models/getdocumentvisibilityoverridesresponse.py - - src/glean/models/getdocvisibilityop.py - - src/glean/models/getpinrequest.py - - src/glean/models/getpinresponse.py - - src/glean/models/getpolicyop.py - - src/glean/models/getreportstatusop.py - - src/glean/models/getshortcutrequest_union.py - - src/glean/models/getshortcutresponse.py - - src/glean/models/getusercountrequest.py - - src/glean/models/getusercountresponse.py - - src/glean/models/gleanassistinsightsresponse.py - - src/glean/models/gleandataerror.py - - src/glean/models/grantpermission.py - - src/glean/models/greenlistusersrequest.py - - src/glean/models/group.py - - src/glean/models/grouptype.py - - src/glean/models/hotword.py - - src/glean/models/hotwordproximity.py - - src/glean/models/iconconfig.py - - src/glean/models/indexdocumentrequest.py - - src/glean/models/indexdocumentsrequest.py - - src/glean/models/indexemployeerequest.py - - src/glean/models/indexgrouprequest.py - - src/glean/models/indexingshortcut.py - - src/glean/models/indexmembershiprequest.py - - src/glean/models/indexstatus.py - - src/glean/models/indexteamrequest.py - - src/glean/models/indexuserrequest.py - - src/glean/models/inputoptions.py - - src/glean/models/insightsagentsrequestoptions.py - - src/glean/models/insightsaiapprequestoptions.py - - src/glean/models/insightsrequest.py - - src/glean/models/insightsresponse.py - - src/glean/models/invalidoperatorvalueerror.py - - src/glean/models/inviteinfo.py - - src/glean/models/labeledcountinfo.py - - src/glean/models/listanswersrequest.py - - src/glean/models/listanswersresponse.py - - src/glean/models/listchatsop.py - - src/glean/models/listchatsresponse.py - - src/glean/models/listcollectionsrequest.py - - src/glean/models/listcollectionsresponse.py - - src/glean/models/listdlpreportsresponse.py - - src/glean/models/listentitiesrequest.py - - src/glean/models/listentitiesresponse.py - - src/glean/models/listpinsop.py - - src/glean/models/listpinsresponse.py - - src/glean/models/listpoliciesop.py - - src/glean/models/listshortcutspaginatedrequest.py - - src/glean/models/listshortcutspaginatedresponse.py - - src/glean/models/listverificationsop.py - - src/glean/models/manualfeedbackinfo.py - - src/glean/models/meeting.py - - src/glean/models/message.py - - src/glean/models/messagesrequest.py - - src/glean/models/messagesresponse.py - - src/glean/models/objectdefinition.py - - src/glean/models/objectpermissions.py - - src/glean/models/operatormetadata.py - - src/glean/models/operatorscope.py - - src/glean/models/peoplerequest.py - - src/glean/models/peopleresponse.py - - src/glean/models/period.py - - src/glean/models/permissions.py - - src/glean/models/permissionsgroupintersectiondefinition.py - - src/glean/models/person.py - - src/glean/models/persondistance.py - - src/glean/models/personmetadata.py - - src/glean/models/personobject.py - - src/glean/models/personteam.py - - src/glean/models/persontoteamrelationship.py - - src/glean/models/pindocument.py - - src/glean/models/pinrequest.py - - src/glean/models/possiblevalue.py - - src/glean/models/post_api_index_v1_debug_datasource_documentop.py - - src/glean/models/post_api_index_v1_debug_datasource_documentsop.py - - src/glean/models/post_api_index_v1_debug_datasource_statusop.py - - src/glean/models/post_api_index_v1_debug_datasource_userop.py - - src/glean/models/processalldocumentsrequest.py - - src/glean/models/processallmembershipsrequest.py - - src/glean/models/processinghistoryevent.py - - src/glean/models/prompttemplate.py - - src/glean/models/prompttemplateresult.py - - src/glean/models/propertydefinition.py - - src/glean/models/propertygroup.py - - src/glean/models/queryinsight.py - - src/glean/models/queryinsightsresponse.py - - src/glean/models/querysuggestion.py - - src/glean/models/querysuggestionlist.py - - src/glean/models/quicklink.py - - src/glean/models/reaction.py - - src/glean/models/readpermission.py - - src/glean/models/recommendationsrequest.py - - src/glean/models/recommendationsrequestoptions.py - - src/glean/models/referencerange.py - - src/glean/models/relateddocuments.py - - src/glean/models/relatedobject.py - - src/glean/models/relatedobjectedge.py - - src/glean/models/relatedquestion.py - - src/glean/models/reminder.py - - src/glean/models/reminderrequest.py - - src/glean/models/reportstatusresponse.py - - src/glean/models/restrictionfilters.py - - src/glean/models/resultsdescription.py - - src/glean/models/resultsresponse.py - - src/glean/models/resulttab.py - - src/glean/models/rotatetokenresponse.py - - src/glean/models/scopetype.py - - src/glean/models/searchagentsrequest.py - - src/glean/models/searchagentsresponse.py - - src/glean/models/searchproviderinfo.py - - src/glean/models/searchrequest.py - - src/glean/models/searchrequestinputdetails.py - - src/glean/models/searchrequestoptions.py - - src/glean/models/searchresponse.py - - src/glean/models/searchresponsemetadata.py - - src/glean/models/searchresult.py - - src/glean/models/searchresultprominenceenum.py - - src/glean/models/searchresultsnippet.py - - src/glean/models/searchwarning.py - - src/glean/models/security.py - - src/glean/models/seenfeedbackinfo.py - - src/glean/models/sensitivecontentoptions.py - - src/glean/models/sensitiveexpression.py - - src/glean/models/sensitiveinfotype.py - - src/glean/models/sessioninfo.py - - src/glean/models/share.py - - src/glean/models/sharingoptions.py - - src/glean/models/shortcut.py - - src/glean/models/shortcuterror.py - - src/glean/models/shortcutinsight.py - - src/glean/models/shortcutinsightsresponse.py - - src/glean/models/shortcutmutableproperties.py - - src/glean/models/shortcutspaginationmetadata.py - - src/glean/models/socialnetwork.py - - src/glean/models/socialnetworkdefinition.py - - src/glean/models/sortoptions.py - - src/glean/models/structuredlink.py - - src/glean/models/structuredlocation.py - - src/glean/models/structuredresult.py - - src/glean/models/structuredtext.py - - src/glean/models/structuredtextitem.py - - src/glean/models/structuredtextmutableproperties.py - - src/glean/models/summarizerequest.py - - src/glean/models/summarizeresponse.py - - src/glean/models/summary.py - - src/glean/models/team.py - - src/glean/models/teamemail.py - - src/glean/models/teaminfodefinition.py - - src/glean/models/teammember.py - - src/glean/models/textrange.py - - src/glean/models/thumbnail.py - - src/glean/models/timeinterval.py - - src/glean/models/timepoint.py - - src/glean/models/timerange.py - - src/glean/models/tool.py - - src/glean/models/toolinfo.py - - src/glean/models/toolmetadata.py - - src/glean/models/toolparameter.py - - src/glean/models/toolscallparameter.py - - src/glean/models/toolscallrequest.py - - src/glean/models/toolscallresponse.py - - src/glean/models/toolslistresponse.py - - src/glean/models/ugctype.py - - src/glean/models/unpin.py - - src/glean/models/updateannouncementrequest.py - - src/glean/models/updatedlpconfigrequest.py - - src/glean/models/updatedlpconfigresponse.py - - src/glean/models/updatedlpreportrequest.py - - src/glean/models/updatedlpreportresponse.py - - src/glean/models/updatedocumentvisibilityoverridesrequest.py - - src/glean/models/updatedocumentvisibilityoverridesresponse.py - - src/glean/models/updatepermissionsrequest.py - - src/glean/models/updatepolicyop.py - - src/glean/models/updateshortcutrequest.py - - src/glean/models/updateshortcutresponse.py - - src/glean/models/uploadchatfilesop.py - - src/glean/models/uploadchatfilesrequest.py - - src/glean/models/uploadchatfilesresponse.py - - src/glean/models/uploadshortcutsrequest.py - - src/glean/models/uploadstatusenum.py - - src/glean/models/user.py - - src/glean/models/useractivity.py - - src/glean/models/useractivityinsight.py - - src/glean/models/usergeneratedcontentid.py - - src/glean/models/userinsightsresponse.py - - src/glean/models/userreferencedefinition.py - - src/glean/models/userrole.py - - src/glean/models/userrolespecification.py - - src/glean/models/userstatusresponse.py - - src/glean/models/userviewinfo.py - - src/glean/models/verification.py - - src/glean/models/verificationfeed.py - - src/glean/models/verificationmetadata.py - - src/glean/models/verifyrequest.py - - src/glean/models/viewerinfo.py - - src/glean/models/workflow.py - - src/glean/models/workflowfeedbackinfo.py - - src/glean/models/workflowresult.py - - src/glean/models/writeactionparameter.py - - src/glean/models/writepermission.py - - src/glean/people.py - - src/glean/pins.py - - src/glean/policies.py - - src/glean/py.typed - - src/glean/reports.py - - src/glean/sdk.py - - src/glean/sdkconfiguration.py - - src/glean/search.py - - src/glean/tools.py - - src/glean/types/__init__.py - - src/glean/types/basemodel.py - - src/glean/utils/__init__.py - - src/glean/utils/annotations.py - - src/glean/utils/datetimes.py - - src/glean/utils/enums.py - - src/glean/utils/eventstreaming.py - - src/glean/utils/forms.py - - src/glean/utils/headers.py - - src/glean/utils/logger.py - - src/glean/utils/metadata.py - - src/glean/utils/queryparams.py - - src/glean/utils/requestbodies.py - - src/glean/utils/retries.py - - src/glean/utils/security.py - - src/glean/utils/serializers.py - - src/glean/utils/url.py - - src/glean/utils/values.py - - src/glean/visibilityoverrides.py + - src/glean/api_client/__init__.py + - src/glean/api_client/_hooks/__init__.py + - src/glean/api_client/_hooks/sdkhooks.py + - src/glean/api_client/_hooks/types.py + - src/glean/api_client/_version.py + - src/glean/api_client/agents.py + - src/glean/api_client/announcements.py + - src/glean/api_client/answers.py + - src/glean/api_client/basesdk.py + - src/glean/api_client/client.py + - src/glean/api_client/client_activity.py + - src/glean/api_client/client_authentication.py + - src/glean/api_client/client_chat.py + - src/glean/api_client/client_documents.py + - src/glean/api_client/client_shortcuts.py + - src/glean/api_client/client_verification.py + - src/glean/api_client/collections.py + - src/glean/api_client/data.py + - src/glean/api_client/datasources.py + - src/glean/api_client/entities.py + - src/glean/api_client/errors/__init__.py + - src/glean/api_client/errors/collectionerror.py + - src/glean/api_client/errors/gleandataerror.py + - src/glean/api_client/errors/gleanerror.py + - src/glean/api_client/governance.py + - src/glean/api_client/governance_documents.py + - src/glean/api_client/httpclient.py + - src/glean/api_client/indexing.py + - src/glean/api_client/indexing_authentication.py + - src/glean/api_client/indexing_datasource.py + - src/glean/api_client/indexing_documents.py + - src/glean/api_client/indexing_permissions.py + - src/glean/api_client/indexing_shortcuts.py + - src/glean/api_client/insights.py + - src/glean/api_client/messages.py + - src/glean/api_client/models/__init__.py + - src/glean/api_client/models/activity.py + - src/glean/api_client/models/activityevent.py + - src/glean/api_client/models/activityeventparams.py + - src/glean/api_client/models/addcollectionitemserror.py + - src/glean/api_client/models/addcollectionitemsrequest.py + - src/glean/api_client/models/addcollectionitemsresponse.py + - src/glean/api_client/models/additionalfielddefinition.py + - src/glean/api_client/models/agent.py + - src/glean/api_client/models/agentconfig.py + - src/glean/api_client/models/agentexecutionstatus.py + - src/glean/api_client/models/agentrun.py + - src/glean/api_client/models/agentruncreate.py + - src/glean/api_client/models/agentrunwaitresponse.py + - src/glean/api_client/models/agentschemas.py + - src/glean/api_client/models/aiappactioncounts.py + - src/glean/api_client/models/aiappsinsightsresponse.py + - src/glean/api_client/models/aiinsightsresponse.py + - src/glean/api_client/models/allowlistoptions.py + - src/glean/api_client/models/announcement.py + - src/glean/api_client/models/anonymousevent.py + - src/glean/api_client/models/answer.py + - src/glean/api_client/models/answerboard.py + - src/glean/api_client/models/answercreationdata.py + - src/glean/api_client/models/answerlike.py + - src/glean/api_client/models/answerlikes.py + - src/glean/api_client/models/answerresult.py + - src/glean/api_client/models/appresult.py + - src/glean/api_client/models/authconfig.py + - src/glean/api_client/models/authtoken.py + - src/glean/api_client/models/autocompleterequest.py + - src/glean/api_client/models/autocompleteresponse.py + - src/glean/api_client/models/autocompleteresult.py + - src/glean/api_client/models/autocompleteresultgroup.py + - src/glean/api_client/models/badge.py + - src/glean/api_client/models/bulkindexdocumentsrequest.py + - src/glean/api_client/models/bulkindexemployeesrequest.py + - src/glean/api_client/models/bulkindexgroupsrequest.py + - src/glean/api_client/models/bulkindexmembershipsrequest.py + - src/glean/api_client/models/bulkindexshortcutsrequest.py + - src/glean/api_client/models/bulkindexteamsrequest.py + - src/glean/api_client/models/bulkindexusersrequest.py + - src/glean/api_client/models/bulkuploadhistoryevent.py + - src/glean/api_client/models/calendarattendee.py + - src/glean/api_client/models/calendarattendees.py + - src/glean/api_client/models/calendarevent.py + - src/glean/api_client/models/canonicalizingregextype.py + - src/glean/api_client/models/channelinviteinfo.py + - src/glean/api_client/models/chat.py + - src/glean/api_client/models/chatfile.py + - src/glean/api_client/models/chatfilefailurereason.py + - src/glean/api_client/models/chatfilemetadata.py + - src/glean/api_client/models/chatfilestatus.py + - src/glean/api_client/models/chatmessage.py + - src/glean/api_client/models/chatmessagecitation.py + - src/glean/api_client/models/chatmessagefragment.py + - src/glean/api_client/models/chatmetadata.py + - src/glean/api_client/models/chatmetadataresult.py + - src/glean/api_client/models/chatop.py + - src/glean/api_client/models/chatrequest.py + - src/glean/api_client/models/chatresponse.py + - src/glean/api_client/models/chatrestrictionfilters.py + - src/glean/api_client/models/chatresult.py + - src/glean/api_client/models/chatstreamop.py + - src/glean/api_client/models/chatzerostatesuggestionoptions.py + - src/glean/api_client/models/checkdocumentaccessrequest.py + - src/glean/api_client/models/checkdocumentaccessresponse.py + - src/glean/api_client/models/clustergroup.py + - src/glean/api_client/models/clustertypeenum.py + - src/glean/api_client/models/code.py + - src/glean/api_client/models/codeline.py + - src/glean/api_client/models/collection.py + - src/glean/api_client/models/collectionerror.py + - src/glean/api_client/models/collectionitem.py + - src/glean/api_client/models/collectionitemdescriptor.py + - src/glean/api_client/models/collectionpinmetadata.py + - src/glean/api_client/models/collectionpinnablecategories.py + - src/glean/api_client/models/collectionpinnabletargets.py + - src/glean/api_client/models/collectionpinnedmetadata.py + - src/glean/api_client/models/collectionpintarget.py + - src/glean/api_client/models/commentdefinition.py + - src/glean/api_client/models/communicationchannel.py + - src/glean/api_client/models/company.py + - src/glean/api_client/models/conferencedata.py + - src/glean/api_client/models/connectortype.py + - src/glean/api_client/models/contentdefinition.py + - src/glean/api_client/models/contentinsightsresponse.py + - src/glean/api_client/models/contenttype.py + - src/glean/api_client/models/countinfo.py + - src/glean/api_client/models/createannouncementrequest.py + - src/glean/api_client/models/createanswerrequest.py + - src/glean/api_client/models/createauthtokenresponse.py + - src/glean/api_client/models/createcollectionrequest.py + - src/glean/api_client/models/createcollectionresponse.py + - src/glean/api_client/models/createdlpreportrequest.py + - src/glean/api_client/models/createdlpreportresponse.py + - src/glean/api_client/models/createshortcutrequest.py + - src/glean/api_client/models/createshortcutresponse.py + - src/glean/api_client/models/customdatasourceconfig.py + - src/glean/api_client/models/customdatavalue.py + - src/glean/api_client/models/customentity.py + - src/glean/api_client/models/customentitymetadata.py + - src/glean/api_client/models/customer.py + - src/glean/api_client/models/customermetadata.py + - src/glean/api_client/models/customfielddata.py + - src/glean/api_client/models/customfieldvalue.py + - src/glean/api_client/models/customfieldvaluehyperlink.py + - src/glean/api_client/models/customfieldvalueperson.py + - src/glean/api_client/models/customfieldvaluestr.py + - src/glean/api_client/models/customproperty.py + - src/glean/api_client/models/datasourcebulkmembershipdefinition.py + - src/glean/api_client/models/datasourcegroupdefinition.py + - src/glean/api_client/models/datasourcemembershipdefinition.py + - src/glean/api_client/models/datasourceobjecttypedocumentcountentry.py + - src/glean/api_client/models/datasourceprofile.py + - src/glean/api_client/models/datasourceuserdefinition.py + - src/glean/api_client/models/debugdatasourcestatusidentityresponsecomponent.py + - src/glean/api_client/models/debugdatasourcestatusresponse.py + - src/glean/api_client/models/debugdocumentrequest.py + - src/glean/api_client/models/debugdocumentresponse.py + - src/glean/api_client/models/debugdocumentsrequest.py + - src/glean/api_client/models/debugdocumentsresponse.py + - src/glean/api_client/models/debugdocumentsresponseitem.py + - src/glean/api_client/models/debuguserrequest.py + - src/glean/api_client/models/debuguserresponse.py + - src/glean/api_client/models/deleteallchatsop.py + - src/glean/api_client/models/deleteannouncementrequest.py + - src/glean/api_client/models/deleteanswerrequest.py + - src/glean/api_client/models/deletechatfilesop.py + - src/glean/api_client/models/deletechatfilesrequest.py + - src/glean/api_client/models/deletechatsop.py + - src/glean/api_client/models/deletechatsrequest.py + - src/glean/api_client/models/deletecollectionitemrequest.py + - src/glean/api_client/models/deletecollectionitemresponse.py + - src/glean/api_client/models/deletecollectionrequest.py + - src/glean/api_client/models/deletedocumentrequest.py + - src/glean/api_client/models/deleteemployeerequest.py + - src/glean/api_client/models/deletegrouprequest.py + - src/glean/api_client/models/deletemembershiprequest.py + - src/glean/api_client/models/deleteshortcutrequest.py + - src/glean/api_client/models/deleteteamrequest.py + - src/glean/api_client/models/deleteuserrequest.py + - src/glean/api_client/models/disambiguation.py + - src/glean/api_client/models/displayablelistitemuiconfig.py + - src/glean/api_client/models/dlpconfig.py + - src/glean/api_client/models/dlpfrequency.py + - src/glean/api_client/models/dlpperson.py + - src/glean/api_client/models/dlppersonmetadata.py + - src/glean/api_client/models/dlpreport.py + - src/glean/api_client/models/dlpreportstatus.py + - src/glean/api_client/models/dlpsimpleresult.py + - src/glean/api_client/models/document.py + - src/glean/api_client/models/documentcontent.py + - src/glean/api_client/models/documentdefinition.py + - src/glean/api_client/models/documentinsight.py + - src/glean/api_client/models/documentinteractions.py + - src/glean/api_client/models/documentinteractionsdefinition.py + - src/glean/api_client/models/documentmetadata.py + - src/glean/api_client/models/documentorerror_union.py + - src/glean/api_client/models/documentpermissionsdefinition.py + - src/glean/api_client/models/documentsection.py + - src/glean/api_client/models/documentspec_union.py + - src/glean/api_client/models/documentstatusresponse.py + - src/glean/api_client/models/documentvisibility.py + - src/glean/api_client/models/documentvisibilityoverride.py + - src/glean/api_client/models/documentvisibilityupdateresult.py + - src/glean/api_client/models/downloadpolicycsvop.py + - src/glean/api_client/models/downloadreportcsvop.py + - src/glean/api_client/models/editanswerrequest.py + - src/glean/api_client/models/editcollectionitemrequest.py + - src/glean/api_client/models/editcollectionitemresponse.py + - src/glean/api_client/models/editcollectionrequest.py + - src/glean/api_client/models/editcollectionresponse.py + - src/glean/api_client/models/editpinrequest.py + - src/glean/api_client/models/employeeinfodefinition.py + - src/glean/api_client/models/employeeteaminfo.py + - src/glean/api_client/models/entitiessortorder.py + - src/glean/api_client/models/entityrelationship.py + - src/glean/api_client/models/entitytype.py + - src/glean/api_client/models/errormessage.py + - src/glean/api_client/models/eventclassification.py + - src/glean/api_client/models/eventclassificationname.py + - src/glean/api_client/models/eventstrategyname.py + - src/glean/api_client/models/externalsharingoptions.py + - src/glean/api_client/models/externalshortcut.py + - src/glean/api_client/models/extractedqna.py + - src/glean/api_client/models/facetbucket.py + - src/glean/api_client/models/facetbucketfilter.py + - src/glean/api_client/models/facetfilter.py + - src/glean/api_client/models/facetfilterset.py + - src/glean/api_client/models/facetfiltervalue.py + - src/glean/api_client/models/facetresult.py + - src/glean/api_client/models/facetvalue.py + - src/glean/api_client/models/favoriteinfo.py + - src/glean/api_client/models/feedback.py + - src/glean/api_client/models/feedbackchatexchange.py + - src/glean/api_client/models/feedbackop.py + - src/glean/api_client/models/feedentry.py + - src/glean/api_client/models/feedrequest.py + - src/glean/api_client/models/feedrequestoptions.py + - src/glean/api_client/models/feedresponse.py + - src/glean/api_client/models/feedresult.py + - src/glean/api_client/models/followupaction.py + - src/glean/api_client/models/generatedattachment.py + - src/glean/api_client/models/generatedattachmentcontent.py + - src/glean/api_client/models/generatedqna.py + - src/glean/api_client/models/get_rest_api_v1_tools_listop.py + - src/glean/api_client/models/getagentop.py + - src/glean/api_client/models/getagentschemasop.py + - src/glean/api_client/models/getanswererror.py + - src/glean/api_client/models/getanswerrequest.py + - src/glean/api_client/models/getanswerresponse.py + - src/glean/api_client/models/getchatapplicationop.py + - src/glean/api_client/models/getchatapplicationrequest.py + - src/glean/api_client/models/getchatapplicationresponse.py + - src/glean/api_client/models/getchatfilesop.py + - src/glean/api_client/models/getchatfilesrequest.py + - src/glean/api_client/models/getchatfilesresponse.py + - src/glean/api_client/models/getchatop.py + - src/glean/api_client/models/getchatrequest.py + - src/glean/api_client/models/getchatresponse.py + - src/glean/api_client/models/getcollectionrequest.py + - src/glean/api_client/models/getcollectionresponse.py + - src/glean/api_client/models/getdatasourceconfigrequest.py + - src/glean/api_client/models/getdlpreportresponse.py + - src/glean/api_client/models/getdocpermissionsrequest.py + - src/glean/api_client/models/getdocpermissionsresponse.py + - src/glean/api_client/models/getdocumentcountrequest.py + - src/glean/api_client/models/getdocumentcountresponse.py + - src/glean/api_client/models/getdocumentsbyfacetsrequest.py + - src/glean/api_client/models/getdocumentsbyfacetsresponse.py + - src/glean/api_client/models/getdocumentsrequest.py + - src/glean/api_client/models/getdocumentsresponse.py + - src/glean/api_client/models/getdocumentstatusrequest.py + - src/glean/api_client/models/getdocumentstatusresponse.py + - src/glean/api_client/models/getdocumentvisibilityoverridesresponse.py + - src/glean/api_client/models/getdocvisibilityop.py + - src/glean/api_client/models/getpinrequest.py + - src/glean/api_client/models/getpinresponse.py + - src/glean/api_client/models/getpolicyop.py + - src/glean/api_client/models/getreportstatusop.py + - src/glean/api_client/models/getshortcutrequest_union.py + - src/glean/api_client/models/getshortcutresponse.py + - src/glean/api_client/models/getusercountrequest.py + - src/glean/api_client/models/getusercountresponse.py + - src/glean/api_client/models/gleanassistinsightsresponse.py + - src/glean/api_client/models/gleandataerror.py + - src/glean/api_client/models/grantpermission.py + - src/glean/api_client/models/greenlistusersrequest.py + - src/glean/api_client/models/group.py + - src/glean/api_client/models/grouptype.py + - src/glean/api_client/models/hotword.py + - src/glean/api_client/models/hotwordproximity.py + - src/glean/api_client/models/iconconfig.py + - src/glean/api_client/models/indexdocumentrequest.py + - src/glean/api_client/models/indexdocumentsrequest.py + - src/glean/api_client/models/indexemployeerequest.py + - src/glean/api_client/models/indexgrouprequest.py + - src/glean/api_client/models/indexingshortcut.py + - src/glean/api_client/models/indexmembershiprequest.py + - src/glean/api_client/models/indexstatus.py + - src/glean/api_client/models/indexteamrequest.py + - src/glean/api_client/models/indexuserrequest.py + - src/glean/api_client/models/inputoptions.py + - src/glean/api_client/models/insightsagentsrequestoptions.py + - src/glean/api_client/models/insightsaiapprequestoptions.py + - src/glean/api_client/models/insightsrequest.py + - src/glean/api_client/models/insightsresponse.py + - src/glean/api_client/models/invalidoperatorvalueerror.py + - src/glean/api_client/models/inviteinfo.py + - src/glean/api_client/models/labeledcountinfo.py + - src/glean/api_client/models/listanswersrequest.py + - src/glean/api_client/models/listanswersresponse.py + - src/glean/api_client/models/listchatsop.py + - src/glean/api_client/models/listchatsresponse.py + - src/glean/api_client/models/listcollectionsrequest.py + - src/glean/api_client/models/listcollectionsresponse.py + - src/glean/api_client/models/listdlpreportsresponse.py + - src/glean/api_client/models/listentitiesrequest.py + - src/glean/api_client/models/listentitiesresponse.py + - src/glean/api_client/models/listpinsop.py + - src/glean/api_client/models/listpinsresponse.py + - src/glean/api_client/models/listpoliciesop.py + - src/glean/api_client/models/listshortcutspaginatedrequest.py + - src/glean/api_client/models/listshortcutspaginatedresponse.py + - src/glean/api_client/models/listverificationsop.py + - src/glean/api_client/models/manualfeedbackinfo.py + - src/glean/api_client/models/meeting.py + - src/glean/api_client/models/message.py + - src/glean/api_client/models/messagesrequest.py + - src/glean/api_client/models/messagesresponse.py + - src/glean/api_client/models/objectdefinition.py + - src/glean/api_client/models/objectpermissions.py + - src/glean/api_client/models/operatormetadata.py + - src/glean/api_client/models/operatorscope.py + - src/glean/api_client/models/peoplerequest.py + - src/glean/api_client/models/peopleresponse.py + - src/glean/api_client/models/period.py + - src/glean/api_client/models/permissions.py + - src/glean/api_client/models/permissionsgroupintersectiondefinition.py + - src/glean/api_client/models/person.py + - src/glean/api_client/models/persondistance.py + - src/glean/api_client/models/personmetadata.py + - src/glean/api_client/models/personobject.py + - src/glean/api_client/models/personteam.py + - src/glean/api_client/models/persontoteamrelationship.py + - src/glean/api_client/models/pindocument.py + - src/glean/api_client/models/pinrequest.py + - src/glean/api_client/models/possiblevalue.py + - src/glean/api_client/models/post_api_index_v1_debug_datasource_documentop.py + - src/glean/api_client/models/post_api_index_v1_debug_datasource_documentsop.py + - src/glean/api_client/models/post_api_index_v1_debug_datasource_statusop.py + - src/glean/api_client/models/post_api_index_v1_debug_datasource_userop.py + - src/glean/api_client/models/processalldocumentsrequest.py + - src/glean/api_client/models/processallmembershipsrequest.py + - src/glean/api_client/models/processinghistoryevent.py + - src/glean/api_client/models/prompttemplate.py + - src/glean/api_client/models/prompttemplateresult.py + - src/glean/api_client/models/propertydefinition.py + - src/glean/api_client/models/propertygroup.py + - src/glean/api_client/models/queryinsight.py + - src/glean/api_client/models/queryinsightsresponse.py + - src/glean/api_client/models/querysuggestion.py + - src/glean/api_client/models/querysuggestionlist.py + - src/glean/api_client/models/quicklink.py + - src/glean/api_client/models/reaction.py + - src/glean/api_client/models/readpermission.py + - src/glean/api_client/models/recommendationsrequest.py + - src/glean/api_client/models/recommendationsrequestoptions.py + - src/glean/api_client/models/referencerange.py + - src/glean/api_client/models/relateddocuments.py + - src/glean/api_client/models/relatedobject.py + - src/glean/api_client/models/relatedobjectedge.py + - src/glean/api_client/models/relatedquestion.py + - src/glean/api_client/models/reminder.py + - src/glean/api_client/models/reminderrequest.py + - src/glean/api_client/models/reportstatusresponse.py + - src/glean/api_client/models/restrictionfilters.py + - src/glean/api_client/models/resultsdescription.py + - src/glean/api_client/models/resultsresponse.py + - src/glean/api_client/models/resulttab.py + - src/glean/api_client/models/rotatetokenresponse.py + - src/glean/api_client/models/scopetype.py + - src/glean/api_client/models/searchagentsrequest.py + - src/glean/api_client/models/searchagentsresponse.py + - src/glean/api_client/models/searchproviderinfo.py + - src/glean/api_client/models/searchrequest.py + - src/glean/api_client/models/searchrequestinputdetails.py + - src/glean/api_client/models/searchrequestoptions.py + - src/glean/api_client/models/searchresponse.py + - src/glean/api_client/models/searchresponsemetadata.py + - src/glean/api_client/models/searchresult.py + - src/glean/api_client/models/searchresultprominenceenum.py + - src/glean/api_client/models/searchresultsnippet.py + - src/glean/api_client/models/searchwarning.py + - src/glean/api_client/models/security.py + - src/glean/api_client/models/seenfeedbackinfo.py + - src/glean/api_client/models/sensitivecontentoptions.py + - src/glean/api_client/models/sensitiveexpression.py + - src/glean/api_client/models/sensitiveinfotype.py + - src/glean/api_client/models/sessioninfo.py + - src/glean/api_client/models/share.py + - src/glean/api_client/models/sharingoptions.py + - src/glean/api_client/models/shortcut.py + - src/glean/api_client/models/shortcuterror.py + - src/glean/api_client/models/shortcutinsight.py + - src/glean/api_client/models/shortcutinsightsresponse.py + - src/glean/api_client/models/shortcutmutableproperties.py + - src/glean/api_client/models/shortcutspaginationmetadata.py + - src/glean/api_client/models/socialnetwork.py + - src/glean/api_client/models/socialnetworkdefinition.py + - src/glean/api_client/models/sortoptions.py + - src/glean/api_client/models/structuredlink.py + - src/glean/api_client/models/structuredlocation.py + - src/glean/api_client/models/structuredresult.py + - src/glean/api_client/models/structuredtext.py + - src/glean/api_client/models/structuredtextitem.py + - src/glean/api_client/models/structuredtextmutableproperties.py + - src/glean/api_client/models/summarizerequest.py + - src/glean/api_client/models/summarizeresponse.py + - src/glean/api_client/models/summary.py + - src/glean/api_client/models/team.py + - src/glean/api_client/models/teamemail.py + - src/glean/api_client/models/teaminfodefinition.py + - src/glean/api_client/models/teammember.py + - src/glean/api_client/models/textrange.py + - src/glean/api_client/models/thumbnail.py + - src/glean/api_client/models/timeinterval.py + - src/glean/api_client/models/timepoint.py + - src/glean/api_client/models/timerange.py + - src/glean/api_client/models/tool.py + - src/glean/api_client/models/toolinfo.py + - src/glean/api_client/models/toolmetadata.py + - src/glean/api_client/models/toolparameter.py + - src/glean/api_client/models/toolscallparameter.py + - src/glean/api_client/models/toolscallrequest.py + - src/glean/api_client/models/toolscallresponse.py + - src/glean/api_client/models/toolslistresponse.py + - src/glean/api_client/models/ugctype.py + - src/glean/api_client/models/unpin.py + - src/glean/api_client/models/updateannouncementrequest.py + - src/glean/api_client/models/updatedlpconfigrequest.py + - src/glean/api_client/models/updatedlpconfigresponse.py + - src/glean/api_client/models/updatedlpreportrequest.py + - src/glean/api_client/models/updatedlpreportresponse.py + - src/glean/api_client/models/updatedocumentvisibilityoverridesrequest.py + - src/glean/api_client/models/updatedocumentvisibilityoverridesresponse.py + - src/glean/api_client/models/updatepermissionsrequest.py + - src/glean/api_client/models/updatepolicyop.py + - src/glean/api_client/models/updateshortcutrequest.py + - src/glean/api_client/models/updateshortcutresponse.py + - src/glean/api_client/models/uploadchatfilesop.py + - src/glean/api_client/models/uploadchatfilesrequest.py + - src/glean/api_client/models/uploadchatfilesresponse.py + - src/glean/api_client/models/uploadshortcutsrequest.py + - src/glean/api_client/models/uploadstatusenum.py + - src/glean/api_client/models/user.py + - src/glean/api_client/models/useractivity.py + - src/glean/api_client/models/useractivityinsight.py + - src/glean/api_client/models/usergeneratedcontentid.py + - src/glean/api_client/models/userinsightsresponse.py + - src/glean/api_client/models/userreferencedefinition.py + - src/glean/api_client/models/userrole.py + - src/glean/api_client/models/userrolespecification.py + - src/glean/api_client/models/userstatusresponse.py + - src/glean/api_client/models/userviewinfo.py + - src/glean/api_client/models/verification.py + - src/glean/api_client/models/verificationfeed.py + - src/glean/api_client/models/verificationmetadata.py + - src/glean/api_client/models/verifyrequest.py + - src/glean/api_client/models/viewerinfo.py + - src/glean/api_client/models/workflow.py + - src/glean/api_client/models/workflowfeedbackinfo.py + - src/glean/api_client/models/workflowresult.py + - src/glean/api_client/models/writeactionparameter.py + - src/glean/api_client/models/writepermission.py + - src/glean/api_client/people.py + - src/glean/api_client/pins.py + - src/glean/api_client/policies.py + - src/glean/api_client/py.typed + - src/glean/api_client/reports.py + - src/glean/api_client/sdk.py + - src/glean/api_client/sdkconfiguration.py + - src/glean/api_client/search.py + - src/glean/api_client/tools.py + - src/glean/api_client/types/__init__.py + - src/glean/api_client/types/basemodel.py + - src/glean/api_client/utils/__init__.py + - src/glean/api_client/utils/annotations.py + - src/glean/api_client/utils/datetimes.py + - src/glean/api_client/utils/enums.py + - src/glean/api_client/utils/eventstreaming.py + - src/glean/api_client/utils/forms.py + - src/glean/api_client/utils/headers.py + - src/glean/api_client/utils/logger.py + - src/glean/api_client/utils/metadata.py + - src/glean/api_client/utils/queryparams.py + - src/glean/api_client/utils/requestbodies.py + - src/glean/api_client/utils/retries.py + - src/glean/api_client/utils/security.py + - src/glean/api_client/utils/serializers.py + - src/glean/api_client/utils/url.py + - src/glean/api_client/utils/values.py + - src/glean/api_client/visibilityoverrides.py - tests/__init__.py - tests/mockserver/.gitignore - tests/mockserver/Dockerfile diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 2569f2df..81856314 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -54,7 +54,7 @@ python: inputModelSuffix: input maxMethodParams: 999 methodArguments: infer-optional-args - moduleName: "" + moduleName: glean.api_client outputModelSuffix: output packageName: glean pytestFilterWarnings: [] diff --git a/.speakeasy/glean-merged-spec.yaml b/.speakeasy/glean-merged-spec.yaml index 51c84e23..8a437821 100644 --- a/.speakeasy/glean-merged-spec.yaml +++ b/.speakeasy/glean-merged-spec.yaml @@ -841,7 +841,7 @@ paths: tags: - Agents summary: Search agents - description: "Search for [agents](https://developers.glean.com/agents/agents-api) by agent name. " + description: Search for [agents](https://developers.glean.com/agents/agents-api) by agent name. operationId: searchAgents x-visibility: Preview requestBody: @@ -7554,6 +7554,11 @@ components: $ref: "#/components/schemas/Message" title: Messages description: The messages to pass an input to the agent. + metadata: + type: object + title: Metadata + description: The metadata to pass to the agent. + additionalProperties: true AgentExecutionStatus: description: The status of the run. One of 'error', 'success'. type: string diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 1e5738f1..079acc88 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,12 +1,11 @@ -speakeasyVersion: 1.558.0 +speakeasyVersion: 1.561.0 sources: Glean API: sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:8a528d68d247ecb98ea1d9d49c135154477cbfbab078b6159359a09f64628fba - sourceBlobDigest: sha256:09d1624a9a347738790040f1fcdc5f2eff15461dd39941a1535efb55e2c8939f + sourceRevisionDigest: sha256:def878110682ba33071e9369f2fc13e9ace94ee3de38b09cbcc5ad93fa083bfb + sourceBlobDigest: sha256:eceb178c5d2537e6d21c0461c81f6af1dc245da2c327fdf5305a8191184eff94 tags: - latest - - speakeasy-sdk-regen-1749491200 Glean Client API: sourceNamespace: glean-client-api sourceRevisionDigest: sha256:4edc63ad559e4f2c9fb9ebf5edaaaaa9269f1874d271cfd84b441d6dacac43d2 @@ -17,10 +16,10 @@ targets: glean: source: Glean API sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:8a528d68d247ecb98ea1d9d49c135154477cbfbab078b6159359a09f64628fba - sourceBlobDigest: sha256:09d1624a9a347738790040f1fcdc5f2eff15461dd39941a1535efb55e2c8939f + sourceRevisionDigest: sha256:def878110682ba33071e9369f2fc13e9ace94ee3de38b09cbcc5ad93fa083bfb + sourceBlobDigest: sha256:eceb178c5d2537e6d21c0461c81f6af1dc245da2c327fdf5305a8191184eff94 codeSamplesNamespace: glean-api-specs-python-code-samples - codeSamplesRevisionDigest: sha256:d2defba5ce9f2980f4c7a8ed3cd58df2629ca3a2e7c380959c3028c6f231d6ab + codeSamplesRevisionDigest: sha256:8acf66e50535d8fa865214fd70de55e2f04e299bae90925154b6ebb3bbb936c6 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index e3b54099..d8b11893 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,7 @@ Remember that each namespace requires its own authentication token type as descr * [SDK Example Usage](#sdk-example-usage) * [Authentication](#authentication) * [Available Resources and Operations](#available-resources-and-operations) + * [File uploads](#file-uploads) * [Retries](#retries) * [Error Handling](#error-handling) * [Server Selection](#server-selection) @@ -141,9 +142,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.chat.create(messages=[ + res = glean.client.chat.create(messages=[ { "fragments": [ models.ChatMessageFragment( @@ -170,9 +171,9 @@ async def main(): async with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), - ) as g_client: + ) as glean: - res = await g_client.client.chat.create_async(messages=[ + res = await glean.client.chat.create_async(messages=[ { "fragments": [ models.ChatMessageFragment( @@ -198,9 +199,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.chat.create_stream(messages=[ + res = glean.client.chat.create_stream(messages=[ { "fragments": [ models.ChatMessageFragment( @@ -227,9 +228,9 @@ async def main(): async with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), - ) as g_client: + ) as glean: - res = await g_client.client.chat.create_stream_async(messages=[ + res = await glean.client.chat.create_stream_async(messages=[ { "fragments": [ models.ChatMessageFragment( @@ -266,9 +267,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.client.activity.report(events=[ + glean.client.activity.report(events=[ { "action": models.ActivityEventAction.HISTORICAL_VIEW, "timestamp": parse_datetime("2000-01-23T04:56:07.000Z"), @@ -534,6 +535,38 @@ For more information on obtaining the appropriate token type, please contact you + +## File uploads + +Certain SDK methods accept file objects as part of a request body or multi-part request. It is possible and typically recommended to upload files as a stream rather than reading the entire contents into memory. This avoids excessive memory consumption and potentially crashing with out-of-memory errors when working with very large files. The following example demonstrates how to attach a file stream to a request. + +> [!TIP] +> +> For endpoints that handle file uploads bytes arrays can also be used. However, using streams is recommended for large files. +> + +```python +from glean.api_client import Glean +import os + + +with Glean( + api_token=os.getenv("GLEAN_API_TOKEN", ""), +) as glean: + + res = glean.client.chat.upload_files(files=[ + { + "file_name": "example.file", + "content": open("example.file", "rb"), + }, + ]) + + # Handle response + print(res) + +``` + + ## Retries @@ -548,9 +581,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.client.activity.report(events=[ + glean.client.activity.report(events=[ { "action": models.ActivityEventAction.HISTORICAL_VIEW, "timestamp": parse_datetime("2000-01-23T04:56:07.000Z"), @@ -590,9 +623,9 @@ import os with Glean( retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False), api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.client.activity.report(events=[ + glean.client.activity.report(events=[ { "action": models.ActivityEventAction.HISTORICAL_VIEW, "timestamp": parse_datetime("2000-01-23T04:56:07.000Z"), @@ -728,9 +761,9 @@ import os with Glean( instance="" api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.client.activity.report(events=[ + glean.client.activity.report(events=[ { "action": models.ActivityEventAction.HISTORICAL_VIEW, "timestamp": parse_datetime("2000-01-23T04:56:07.000Z"), @@ -771,9 +804,9 @@ import os with Glean( server_url="https://instance-name-be.glean.com", api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.client.activity.report(events=[ + glean.client.activity.report(events=[ { "action": models.ActivityEventAction.HISTORICAL_VIEW, "timestamp": parse_datetime("2000-01-23T04:56:07.000Z"), @@ -898,7 +931,7 @@ def main(): with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), - ) as g_client: + ) as glean: # Rest of application here... @@ -907,7 +940,7 @@ async def amain(): async with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), - ) as g_client: + ) as glean: # Rest of application here... ``` @@ -923,7 +956,7 @@ from glean.api_client import Glean import logging logging.basicConfig(level=logging.DEBUG) -s = Glean(debug_logger=logging.getLogger("glean")) +s = Glean(debug_logger=logging.getLogger("glean.api_client")) ``` You can also enable a default debug logger by setting an environment variable `GLEAN_DEBUG` to true. diff --git a/USAGE.md b/USAGE.md index 2f889db2..6bd93fa2 100644 --- a/USAGE.md +++ b/USAGE.md @@ -7,9 +7,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.chat.create(messages=[ + res = glean.client.chat.create(messages=[ { "fragments": [ models.ChatMessageFragment( @@ -36,9 +36,9 @@ async def main(): async with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), - ) as g_client: + ) as glean: - res = await g_client.client.chat.create_async(messages=[ + res = await glean.client.chat.create_async(messages=[ { "fragments": [ models.ChatMessageFragment( @@ -62,9 +62,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.chat.create_stream(messages=[ + res = glean.client.chat.create_stream(messages=[ { "fragments": [ models.ChatMessageFragment( @@ -91,9 +91,9 @@ async def main(): async with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), - ) as g_client: + ) as glean: - res = await g_client.client.chat.create_stream_async(messages=[ + res = await glean.client.chat.create_stream_async(messages=[ { "fragments": [ models.ChatMessageFragment( diff --git a/docs/models/agentrun.md b/docs/models/agentrun.md index bc6059df..ba0e0f9a 100644 --- a/docs/models/agentrun.md +++ b/docs/models/agentrun.md @@ -10,4 +10,5 @@ Payload for creating a run. | `agent_id` | *str* | :heavy_check_mark: | The ID of the agent to run. | | `input` | Dict[str, *Any*] | :heavy_minus_sign: | The input to the agent. | | `messages` | List[[models.Message](../models/message.md)] | :heavy_minus_sign: | The messages to pass an input to the agent. | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | The metadata to pass to the agent. | | `status` | [Optional[models.AgentExecutionStatus]](../models/agentexecutionstatus.md) | :heavy_minus_sign: | The status of the run. One of 'error', 'success'. | \ No newline at end of file diff --git a/docs/models/agentruncreate.md b/docs/models/agentruncreate.md index 48c014be..8c52882a 100644 --- a/docs/models/agentruncreate.md +++ b/docs/models/agentruncreate.md @@ -9,4 +9,5 @@ Payload for creating a run. | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | | `agent_id` | *str* | :heavy_check_mark: | The ID of the agent to run. | | `input` | Dict[str, *Any*] | :heavy_minus_sign: | The input to the agent. | -| `messages` | List[[models.Message](../models/message.md)] | :heavy_minus_sign: | The messages to pass an input to the agent. | \ No newline at end of file +| `messages` | List[[models.Message](../models/message.md)] | :heavy_minus_sign: | The messages to pass an input to the agent. | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | The metadata to pass to the agent. | \ No newline at end of file diff --git a/docs/sdks/agents/README.md b/docs/sdks/agents/README.md index 1b881990..224945df 100644 --- a/docs/sdks/agents/README.md +++ b/docs/sdks/agents/README.md @@ -24,9 +24,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.agents.retrieve(agent_id="") + res = glean.client.agents.retrieve(agent_id="") # Handle response print(res) @@ -64,9 +64,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.agents.retrieve_schemas(agent_id="") + res = glean.client.agents.retrieve_schemas(agent_id="") # Handle response print(res) @@ -93,7 +93,7 @@ with Glean( ## list -Search for [agents](https://developers.glean.com/agents/agents-api) by agent name. +Search for [agents](https://developers.glean.com/agents/agents-api) by agent name. ### Example Usage @@ -104,9 +104,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.agents.list(name="HR Policy Agent") + res = glean.client.agents.list(name="HR Policy Agent") # Handle response print(res) @@ -143,9 +143,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.agents.run_stream(agent_id="") + res = glean.client.agents.run_stream(agent_id="") # Handle response print(res) @@ -159,6 +159,7 @@ with Glean( | `agent_id` | *str* | :heavy_check_mark: | The ID of the agent to run. | | `input` | Dict[str, *Any*] | :heavy_minus_sign: | The input to the agent. | | `messages` | List[[models.Message](../../models/message.md)] | :heavy_minus_sign: | The messages to pass an input to the agent. | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | The metadata to pass to the agent. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -184,9 +185,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.agents.run(agent_id="") + res = glean.client.agents.run(agent_id="") # Handle response print(res) @@ -200,6 +201,7 @@ with Glean( | `agent_id` | *str* | :heavy_check_mark: | The ID of the agent to run. | | `input` | Dict[str, *Any*] | :heavy_minus_sign: | The input to the agent. | | `messages` | List[[models.Message](../../models/message.md)] | :heavy_minus_sign: | The messages to pass an input to the agent. | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | The metadata to pass to the agent. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response diff --git a/docs/sdks/announcements/README.md b/docs/sdks/announcements/README.md index 8462996f..79586a81 100644 --- a/docs/sdks/announcements/README.md +++ b/docs/sdks/announcements/README.md @@ -24,9 +24,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.announcements.create(start_time=parse_datetime("2023-05-01T12:02:10.816Z"), end_time=parse_datetime("2024-03-17T14:19:30.278Z"), title="", body={ + res = glean.client.announcements.create(start_time=parse_datetime("2023-05-01T12:02:10.816Z"), end_time=parse_datetime("2024-03-17T14:19:30.278Z"), title="", body={ "text": "From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light.", "structured_list": [ models.StructuredTextItem( @@ -22098,9 +22098,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.client.announcements.delete(id=458809) + glean.client.announcements.delete(id=458809) # Use the SDK ... @@ -22134,9 +22134,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.announcements.update(start_time=parse_datetime("2023-10-24T01:53:24.440Z"), end_time=parse_datetime("2024-10-30T07:24:12.087Z"), title="", id=602589, body={ + res = glean.client.announcements.update(start_time=parse_datetime("2023-10-24T01:53:24.440Z"), end_time=parse_datetime("2024-10-30T07:24:12.087Z"), title="", id=602589, body={ "text": "From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light.", "structured_list": [ models.StructuredTextItem( diff --git a/docs/sdks/answers/README.md b/docs/sdks/answers/README.md index 40f8eff4..9feaaba2 100644 --- a/docs/sdks/answers/README.md +++ b/docs/sdks/answers/README.md @@ -26,9 +26,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.answers.create(data={ + res = glean.client.answers.create(data={ "question": "Why is the sky blue?", "body_text": "From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light.", "audience_filters": [ @@ -1396,9 +1396,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.client.answers.delete(id=3, doc_id="ANSWERS_answer_3") + glean.client.answers.delete(id=3, doc_id="ANSWERS_answer_3") # Use the SDK ... @@ -1433,9 +1433,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.answers.update(id=3, doc_id="ANSWERS_answer_3", question="Why is the sky blue?", body_text="From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light.", audience_filters=[ + res = glean.client.answers.update(id=3, doc_id="ANSWERS_answer_3", question="Why is the sky blue?", body_text="From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light.", audience_filters=[ { "field_name": "type", "values": [ @@ -2397,9 +2397,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.answers.retrieve(id=3, doc_id="ANSWERS_answer_3") + res = glean.client.answers.retrieve(id=3, doc_id="ANSWERS_answer_3") # Handle response print(res) @@ -2437,9 +2437,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.answers.list() + res = glean.client.answers.list() # Handle response print(res) diff --git a/docs/sdks/clientactivity/README.md b/docs/sdks/clientactivity/README.md index 89f0de06..81c4e512 100644 --- a/docs/sdks/clientactivity/README.md +++ b/docs/sdks/clientactivity/README.md @@ -22,9 +22,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.client.activity.report(events=[ + glean.client.activity.report(events=[ { "action": models.ActivityEventAction.HISTORICAL_VIEW, "timestamp": parse_datetime("2000-01-23T04:56:07.000Z"), @@ -79,9 +79,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.client.activity.feedback(feedback1={ + glean.client.activity.feedback(feedback1={ "tracking_tokens": [ "trackingTokens", ], diff --git a/docs/sdks/clientauthentication/README.md b/docs/sdks/clientauthentication/README.md index d5351c52..ec1c1422 100644 --- a/docs/sdks/clientauthentication/README.md +++ b/docs/sdks/clientauthentication/README.md @@ -20,9 +20,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.authentication.create_token() + res = glean.client.authentication.create_token() # Handle response print(res) diff --git a/docs/sdks/clientchat/README.md b/docs/sdks/clientchat/README.md index 58d867d5..6fbaaea6 100644 --- a/docs/sdks/clientchat/README.md +++ b/docs/sdks/clientchat/README.md @@ -29,9 +29,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.chat.create(messages=[ + res = glean.client.chat.create(messages=[ { "fragments": [ models.ChatMessageFragment( @@ -87,9 +87,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.client.chat.delete_all() + glean.client.chat.delete_all() # Use the SDK ... @@ -121,9 +121,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.client.chat.delete(ids=[]) + glean.client.chat.delete(ids=[]) # Use the SDK ... @@ -156,9 +156,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.chat.retrieve(id="") + res = glean.client.chat.retrieve(id="") # Handle response print(res) @@ -196,9 +196,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.chat.list() + res = glean.client.chat.list() # Handle response print(res) @@ -235,9 +235,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.chat.retrieve_application(id="") + res = glean.client.chat.retrieve_application(id="") # Handle response print(res) @@ -275,9 +275,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.chat.upload_files(files=[ + res = glean.client.chat.upload_files(files=[ { "file_name": "example.file", "content": open("example.file", "rb"), @@ -320,9 +320,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.chat.retrieve_files(file_ids=[ + res = glean.client.chat.retrieve_files(file_ids=[ "", ]) @@ -362,9 +362,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.client.chat.delete_files(file_ids=[ + glean.client.chat.delete_files(file_ids=[ "", "", "", @@ -401,9 +401,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.chat.create_stream(messages=[ + res = glean.client.chat.create_stream(messages=[ { "fragments": [ models.ChatMessageFragment( diff --git a/docs/sdks/clientdocuments/README.md b/docs/sdks/clientdocuments/README.md index 2512d0bc..ff980151 100644 --- a/docs/sdks/clientdocuments/README.md +++ b/docs/sdks/clientdocuments/README.md @@ -23,9 +23,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.documents.retrieve_permissions() + res = glean.client.documents.retrieve_permissions() # Handle response print(res) @@ -62,9 +62,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.documents.retrieve() + res = glean.client.documents.retrieve() # Handle response print(res) @@ -101,9 +101,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.documents.retrieve_by_facets(request={ + res = glean.client.documents.retrieve_by_facets(request={ "filter_sets": [ { "filters": [ @@ -177,9 +177,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.documents.summarize(document_specs=[ + res = glean.client.documents.summarize(document_specs=[ {}, {}, {}, diff --git a/docs/sdks/clientshortcuts/README.md b/docs/sdks/clientshortcuts/README.md index 3dd20eb4..dc43b4dc 100644 --- a/docs/sdks/clientshortcuts/README.md +++ b/docs/sdks/clientshortcuts/README.md @@ -26,9 +26,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.shortcuts.create(data={ + res = glean.client.shortcuts.create(data={ "added_roles": [ models.UserRoleSpecification( person=models.Person( @@ -1648,9 +1648,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.client.shortcuts.delete(id=975862) + glean.client.shortcuts.delete(id=975862) # Use the SDK ... @@ -1682,9 +1682,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.shortcuts.retrieve(request={ + res = glean.client.shortcuts.retrieve(request={ "alias": "", }) @@ -1723,9 +1723,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.shortcuts.list(page_size=10, filters=[ + res = glean.client.shortcuts.list(page_size=10, filters=[ { "field_name": "type", "values": [ @@ -1783,9 +1783,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.shortcuts.update(id=268238, added_roles=[ + res = glean.client.shortcuts.update(id=268238, added_roles=[ models.UserRoleSpecification( person=models.Person( name="George Clooney", diff --git a/docs/sdks/clientverification/README.md b/docs/sdks/clientverification/README.md index c177e107..85f9c247 100644 --- a/docs/sdks/clientverification/README.md +++ b/docs/sdks/clientverification/README.md @@ -22,9 +22,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.verification.add_reminder(document_id="") + res = glean.client.verification.add_reminder(document_id="") # Handle response print(res) @@ -64,9 +64,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.verification.list() + res = glean.client.verification.list() # Handle response print(res) @@ -103,9 +103,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.verification.verify(document_id="") + res = glean.client.verification.verify(document_id="") # Handle response print(res) diff --git a/docs/sdks/collections/README.md b/docs/sdks/collections/README.md index 5e0973a5..e034564a 100644 --- a/docs/sdks/collections/README.md +++ b/docs/sdks/collections/README.md @@ -27,9 +27,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.collections.add_items(collection_id=7742.68) + res = glean.client.collections.add_items(collection_id=7742.68) # Handle response print(res) @@ -69,9 +69,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.collections.create(name="", added_roles=[ + res = glean.client.collections.create(name="", added_roles=[ models.UserRoleSpecification( person=models.Person( name="George Clooney", @@ -765,9 +765,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.client.collections.delete(ids=[ + glean.client.collections.delete(ids=[ 930352, 156719, 25102, @@ -805,9 +805,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.collections.delete_item(collection_id=6980.49, item_id="") + res = glean.client.collections.delete_item(collection_id=6980.49, item_id="") # Handle response print(res) @@ -848,9 +848,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.collections.update(name="", id=671264, added_roles=[ + res = glean.client.collections.update(name="", id=671264, added_roles=[ models.UserRoleSpecification( person=models.Person( name="George Clooney", @@ -1944,9 +1944,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.collections.update_item(collection_id=142375, item_id="") + res = glean.client.collections.update_item(collection_id=142375, item_id="") # Handle response print(res) @@ -1987,9 +1987,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.collections.retrieve(id=425335) + res = glean.client.collections.retrieve(id=425335) # Handle response print(res) @@ -2029,9 +2029,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.collections.list() + res = glean.client.collections.list() # Handle response print(res) diff --git a/docs/sdks/datasources/README.md b/docs/sdks/datasources/README.md index aeae6355..e578a760 100644 --- a/docs/sdks/datasources/README.md +++ b/docs/sdks/datasources/README.md @@ -21,9 +21,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.indexing.datasources.add(name="", datasource_category=models.DatasourceCategory.UNCATEGORIZED, url_regex="https://example-company.datasource.com/.*", quicklinks=[ + glean.indexing.datasources.add(name="", datasource_category=models.DatasourceCategory.UNCATEGORIZED, url_regex="https://example-company.datasource.com/.*", quicklinks=[ { "icon_config": { "color": "#343CED", @@ -90,9 +90,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.indexing.datasources.retrieve_config(datasource="") + res = glean.indexing.datasources.retrieve_config(datasource="") # Handle response print(res) diff --git a/docs/sdks/entities/README.md b/docs/sdks/entities/README.md index f57a6979..5792bcaf 100644 --- a/docs/sdks/entities/README.md +++ b/docs/sdks/entities/README.md @@ -21,9 +21,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.entities.list(filter_=[ + res = glean.client.entities.list(filter_=[ { "field_name": "type", "values": [ @@ -82,9 +82,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.entities.read_people(obfuscated_ids=[ + res = glean.client.entities.read_people(obfuscated_ids=[ "abc123", "abc456", ]) diff --git a/docs/sdks/indexingauthentication/README.md b/docs/sdks/indexingauthentication/README.md index 3f977f91..7a689b7c 100644 --- a/docs/sdks/indexingauthentication/README.md +++ b/docs/sdks/indexingauthentication/README.md @@ -20,9 +20,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.indexing.authentication.rotate_token() + res = glean.indexing.authentication.rotate_token() # Handle response print(res) diff --git a/docs/sdks/indexingdatasource/README.md b/docs/sdks/indexingdatasource/README.md index dbc1d80e..c63bcecf 100644 --- a/docs/sdks/indexingdatasource/README.md +++ b/docs/sdks/indexingdatasource/README.md @@ -24,9 +24,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.indexing.datasource.status(datasource="") + res = glean.indexing.datasource.status(datasource="") # Handle response print(res) diff --git a/docs/sdks/indexingdocuments/README.md b/docs/sdks/indexingdocuments/README.md index f90b96f6..7d5a7011 100644 --- a/docs/sdks/indexingdocuments/README.md +++ b/docs/sdks/indexingdocuments/README.md @@ -31,9 +31,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.indexing.documents.add_or_update(document=models.DocumentDefinition( + glean.indexing.documents.add_or_update(document=models.DocumentDefinition( datasource="", )) @@ -68,9 +68,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.indexing.documents.index(datasource="", documents=[]) + glean.indexing.documents.index(datasource="", documents=[]) # Use the SDK ... @@ -104,9 +104,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.indexing.documents.bulk_index(upload_id="", datasource="", documents=[]) + glean.indexing.documents.bulk_index(upload_id="", datasource="", documents=[]) # Use the SDK ... @@ -155,9 +155,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.indexing.documents.process_all() + glean.indexing.documents.process_all() # Use the SDK ... @@ -189,9 +189,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.indexing.documents.delete(datasource="", object_type="", id="") + glean.indexing.documents.delete(datasource="", object_type="", id="") # Use the SDK ... @@ -229,9 +229,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.indexing.documents.debug(datasource="", object_type="Article", doc_id="art123") + res = glean.indexing.documents.debug(datasource="", object_type="Article", doc_id="art123") # Handle response print(res) @@ -273,9 +273,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.indexing.documents.debug_many(datasource="", debug_documents=[ + res = glean.indexing.documents.debug_many(datasource="", debug_documents=[ { "object_type": "Article", "doc_id": "art123", @@ -321,9 +321,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.indexing.documents.check_access(datasource="", object_type="", doc_id="", user_email="") + res = glean.indexing.documents.check_access(datasource="", object_type="", doc_id="", user_email="") # Handle response print(res) @@ -368,9 +368,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.indexing.documents.status(datasource="", object_type="", doc_id="") + res = glean.indexing.documents.status(datasource="", object_type="", doc_id="") # Handle response print(res) @@ -414,9 +414,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.indexing.documents.count(datasource="") + res = glean.indexing.documents.count(datasource="") # Handle response print(res) diff --git a/docs/sdks/indexingpermissions/README.md b/docs/sdks/indexingpermissions/README.md index 942409ab..c0d3e706 100644 --- a/docs/sdks/indexingpermissions/README.md +++ b/docs/sdks/indexingpermissions/README.md @@ -31,9 +31,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.indexing.permissions.update_permissions(datasource="", permissions={}) + glean.indexing.permissions.update_permissions(datasource="", permissions={}) # Use the SDK ... @@ -69,9 +69,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.indexing.permissions.index_user(datasource="", user={ + glean.indexing.permissions.index_user(datasource="", user={ "email": "Art.Schaden@hotmail.com", "name": "", }) @@ -108,9 +108,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.indexing.permissions.bulk_index_users(upload_id="", datasource="", users=[ + glean.indexing.permissions.bulk_index_users(upload_id="", datasource="", users=[ { "email": "Ivory_Cummerata@hotmail.com", "name": "", @@ -161,9 +161,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.indexing.permissions.index_group(datasource="", group={ + glean.indexing.permissions.index_group(datasource="", group={ "name": "", }) @@ -199,9 +199,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.indexing.permissions.bulk_index_groups(upload_id="", datasource="", groups=[ + glean.indexing.permissions.bulk_index_groups(upload_id="", datasource="", groups=[ { "name": "", }, @@ -246,9 +246,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.indexing.permissions.index_membership(datasource="", membership={ + glean.indexing.permissions.index_membership(datasource="", membership={ "group_name": "", }) @@ -284,9 +284,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.indexing.permissions.bulk_index_memberships(upload_id="", datasource="", memberships=[ + glean.indexing.permissions.bulk_index_memberships(upload_id="", datasource="", memberships=[ {}, {}, {}, @@ -329,9 +329,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.indexing.permissions.process_memberships() + glean.indexing.permissions.process_memberships() # Use the SDK ... @@ -363,9 +363,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.indexing.permissions.delete_user(datasource="", email="Ed.Johnston@gmail.com") + glean.indexing.permissions.delete_user(datasource="", email="Ed.Johnston@gmail.com") # Use the SDK ... @@ -399,9 +399,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.indexing.permissions.delete_group(datasource="", group_name="") + glean.indexing.permissions.delete_group(datasource="", group_name="") # Use the SDK ... @@ -435,9 +435,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.indexing.permissions.delete_membership(datasource="", membership={ + glean.indexing.permissions.delete_membership(datasource="", membership={ "group_name": "", }) @@ -473,9 +473,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.indexing.permissions.authorize_beta_users(datasource="", emails=[ + glean.indexing.permissions.authorize_beta_users(datasource="", emails=[ "Neil92@gmail.com", "Alejandrin_Boyer4@hotmail.com", "Shyanne_McLaughlin95@hotmail.com", diff --git a/docs/sdks/indexingshortcuts/README.md b/docs/sdks/indexingshortcuts/README.md index fcfa071f..c0011ba0 100644 --- a/docs/sdks/indexingshortcuts/README.md +++ b/docs/sdks/indexingshortcuts/README.md @@ -21,9 +21,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.indexing.shortcuts.bulk_index(upload_id="", shortcuts=[ + glean.indexing.shortcuts.bulk_index(upload_id="", shortcuts=[ { "input_alias": "", "destination_url": "https://plump-tune-up.biz/", @@ -72,9 +72,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.indexing.shortcuts.upload(upload_id="", shortcuts=[ + glean.indexing.shortcuts.upload(upload_id="", shortcuts=[ { "input_alias": "", "destination_url": "https://majestic-pharmacopoeia.info/", diff --git a/docs/sdks/insights/README.md b/docs/sdks/insights/README.md index 139f7a63..5df88834 100644 --- a/docs/sdks/insights/README.md +++ b/docs/sdks/insights/README.md @@ -20,9 +20,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.insights.retrieve(categories=[ + res = glean.client.insights.retrieve(categories=[ models.InsightsRequestCategory.COLLECTIONS, models.InsightsRequestCategory.SHORTCUTS, models.InsightsRequestCategory.ANNOUNCEMENTS, diff --git a/docs/sdks/messages/README.md b/docs/sdks/messages/README.md index 3491b1ff..22714058 100644 --- a/docs/sdks/messages/README.md +++ b/docs/sdks/messages/README.md @@ -20,9 +20,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.messages.retrieve(id_type=models.IDType.CONVERSATION_ID, id="") + res = glean.client.messages.retrieve(id_type=models.IDType.CONVERSATION_ID, id="") # Handle response print(res) diff --git a/docs/sdks/people/README.md b/docs/sdks/people/README.md index ea830e9b..479370d7 100644 --- a/docs/sdks/people/README.md +++ b/docs/sdks/people/README.md @@ -32,9 +32,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.indexing.people.debug(datasource="", email="u1@foo.com") + res = glean.indexing.people.debug(datasource="", email="u1@foo.com") # Handle response print(res) @@ -77,9 +77,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.indexing.people.count(datasource="") + res = glean.indexing.people.count(datasource="") # Handle response print(res) @@ -116,9 +116,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.indexing.people.index(employee={ + glean.indexing.people.index(employee={ "email": "Jerrold_Hermann@hotmail.com", "department": "", "datasource_profiles": [ @@ -160,9 +160,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.indexing.people.bulk_index(upload_id="", employees=[ + glean.indexing.people.bulk_index(upload_id="", employees=[ { "email": "Robin.Stoltenberg@yahoo.com", "department": "", @@ -231,9 +231,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.indexing.people.process_all_employees_and_teams() + glean.indexing.people.process_all_employees_and_teams() # Use the SDK ... @@ -264,9 +264,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.indexing.people.delete(employee_email="") + glean.indexing.people.delete(employee_email="") # Use the SDK ... @@ -299,9 +299,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.indexing.people.index_team(team={ + glean.indexing.people.index_team(team={ "id": "", "name": "", "datasource_profiles": [ @@ -356,9 +356,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.indexing.people.delete_team(id="") + glean.indexing.people.delete_team(id="") # Use the SDK ... @@ -390,9 +390,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.indexing.people.bulk_index_teams(upload_id="", teams=[ + glean.indexing.people.bulk_index_teams(upload_id="", teams=[ { "id": "", "name": "", diff --git a/docs/sdks/pins/README.md b/docs/sdks/pins/README.md index c2756584..a4366e57 100644 --- a/docs/sdks/pins/README.md +++ b/docs/sdks/pins/README.md @@ -24,9 +24,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.pins.update(audience_filters=[ + res = glean.client.pins.update(audience_filters=[ { "field_name": "type", "values": [ @@ -79,9 +79,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.pins.retrieve() + res = glean.client.pins.retrieve() # Handle response print(res) @@ -118,9 +118,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.pins.list(request={}) + res = glean.client.pins.list(request={}) # Handle response print(res) @@ -157,9 +157,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.pins.create(audience_filters=[ + res = glean.client.pins.create(audience_filters=[ { "field_name": "type", "values": [ @@ -212,9 +212,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - g_client.client.pins.remove() + glean.client.pins.remove() # Use the SDK ... diff --git a/docs/sdks/policies/README.md b/docs/sdks/policies/README.md index e9fd694b..627cad13 100644 --- a/docs/sdks/policies/README.md +++ b/docs/sdks/policies/README.md @@ -24,9 +24,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.governance.data.policies.retrieve(id="") + res = glean.client.governance.data.policies.retrieve(id="") # Handle response print(res) @@ -64,9 +64,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.governance.data.policies.update(id="") + res = glean.client.governance.data.policies.update(id="") # Handle response print(res) @@ -108,9 +108,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.governance.data.policies.list() + res = glean.client.governance.data.policies.list() # Handle response print(res) @@ -148,9 +148,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.governance.data.policies.create() + res = glean.client.governance.data.policies.create() # Handle response print(res) @@ -190,9 +190,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.governance.data.policies.download(id="") + res = glean.client.governance.data.policies.download(id="") # Handle response print(res) diff --git a/docs/sdks/reports/README.md b/docs/sdks/reports/README.md index 1d06c518..974a4a09 100644 --- a/docs/sdks/reports/README.md +++ b/docs/sdks/reports/README.md @@ -22,9 +22,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.governance.data.reports.create() + res = glean.client.governance.data.reports.create() # Handle response print(res) @@ -62,9 +62,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.governance.data.reports.download(id="") + res = glean.client.governance.data.reports.download(id="") # Handle response print(res) @@ -101,9 +101,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.governance.data.reports.status(id="") + res = glean.client.governance.data.reports.status(id="") # Handle response print(res) diff --git a/docs/sdks/search/README.md b/docs/sdks/search/README.md index 8baa44ad..fd4ef8a4 100644 --- a/docs/sdks/search/README.md +++ b/docs/sdks/search/README.md @@ -25,9 +25,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.search.query_as_admin(query="vacation policy", tracking_token="trackingToken", source_document=models.Document( + res = glean.client.search.query_as_admin(query="vacation policy", tracking_token="trackingToken", source_document=models.Document( container_document=models.Document( metadata=models.DocumentMetadata( datasource="datasource", @@ -182,9 +182,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.search.autocomplete(tracking_token="trackingToken", query="what is a que", datasource="GDRIVE", result_size=10, auth_tokens=[ + res = glean.client.search.autocomplete(tracking_token="trackingToken", query="what is a que", datasource="GDRIVE", result_size=10, auth_tokens=[ { "access_token": "123abc", "datasource": "gmail", @@ -236,9 +236,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.search.retrieve_feed(timeout_millis=5000) + res = glean.client.search.retrieve_feed(timeout_millis=5000) # Handle response print(res) @@ -279,9 +279,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.search.recommendations(source_document=models.Document( + res = glean.client.search.recommendations(source_document=models.Document( container_document=models.Document( metadata=models.DocumentMetadata( datasource="datasource", @@ -525,9 +525,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.search.query(query="vacation policy", tracking_token="trackingToken", source_document=models.Document( + res = glean.client.search.query(query="vacation policy", tracking_token="trackingToken", source_document=models.Document( container_document=models.Document( metadata=models.DocumentMetadata( datasource="datasource", diff --git a/docs/sdks/tools/README.md b/docs/sdks/tools/README.md index fb10e54f..4e3321dd 100644 --- a/docs/sdks/tools/README.md +++ b/docs/sdks/tools/README.md @@ -21,9 +21,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.tools.list() + res = glean.client.tools.list() # Handle response print(res) @@ -60,9 +60,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.tools.run(name="", parameters={ + res = glean.client.tools.run(name="", parameters={ "key": { "name": "", "value": "", diff --git a/docs/sdks/visibilityoverrides/README.md b/docs/sdks/visibilityoverrides/README.md index 53216f2e..faa0a4d3 100644 --- a/docs/sdks/visibilityoverrides/README.md +++ b/docs/sdks/visibilityoverrides/README.md @@ -21,9 +21,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.governance.documents.visibilityoverrides.list() + res = glean.client.governance.documents.visibilityoverrides.list() # Handle response print(res) @@ -60,9 +60,9 @@ import os with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as g_client: +) as glean: - res = g_client.client.governance.documents.visibilityoverrides.create() + res = glean.client.governance.documents.visibilityoverrides.create() # Handle response print(res) diff --git a/pyproject.toml b/pyproject.toml index 75725efe..0314dae4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,6 +37,8 @@ pythonpath = ["src"] [tool.mypy] disable_error_code = "misc" +explicit_package_bases = true +mypy_path = "src" [[tool.mypy.overrides]] module = "typing_inspect" diff --git a/speakeasyusagegen/.speakeasy/logs/naming.log b/speakeasyusagegen/.speakeasy/logs/naming.log index 00fd28ff..48fef91d 100644 --- a/speakeasyusagegen/.speakeasy/logs/naming.log +++ b/speakeasyusagegen/.speakeasy/logs/naming.log @@ -610,7 +610,7 @@ GetAgentSchemasResponse (HttpMeta: HTTPMetadata, AgentSchemas: AgentSchemas) SearchAgentsRequest (name: string) SearchAgentsResponse (HttpMeta: HTTPMetadata, SearchAgentsResponse: SearchAgentsResponse) SearchAgentsResponse (agents: array) -AgentRunCreate (agent_id: string, input: map, messages: array) +AgentRunCreate (agent_id: string, input: map, messages: array ...) Message (role: string, content: array) MessageTextBlock (text: string, type: ContentType) ContentType (enum: text) diff --git a/src/glean/api_client/_version.py b/src/glean/api_client/_version.py index 2207320b..f29f093e 100644 --- a/src/glean/api_client/_version.py +++ b/src/glean/api_client/_version.py @@ -5,8 +5,8 @@ __title__: str = "glean" __version__: str = "0.6.5" __openapi_doc_version__: str = "0.9.0" -__gen_version__: str = "2.623.2" -__user_agent__: str = "speakeasy-sdk/python 0.6.5 2.623.2 0.9.0 glean" +__gen_version__: str = "2.628.0" +__user_agent__: str = "speakeasy-sdk/python 0.6.5 2.628.0 0.9.0 glean" try: if __package__ is not None: diff --git a/src/glean/api_client/agents.py b/src/glean/api_client/agents.py index 589fa6c0..34387d76 100644 --- a/src/glean/api_client/agents.py +++ b/src/glean/api_client/agents.py @@ -599,6 +599,7 @@ def run_stream( messages: Optional[ Union[List[models.Message], List[models.MessageTypedDict]] ] = None, + metadata: Optional[Dict[str, Any]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -611,6 +612,7 @@ def run_stream( :param agent_id: The ID of the agent to run. :param input: The input to the agent. :param messages: The messages to pass an input to the agent. + :param metadata: The metadata to pass to the agent. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -630,6 +632,7 @@ def run_stream( agent_id=agent_id, input=input_, messages=utils.get_pydantic_model(messages, Optional[List[models.Message]]), + metadata=metadata, ) req = self._build_request( @@ -706,6 +709,7 @@ async def run_stream_async( messages: Optional[ Union[List[models.Message], List[models.MessageTypedDict]] ] = None, + metadata: Optional[Dict[str, Any]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -718,6 +722,7 @@ async def run_stream_async( :param agent_id: The ID of the agent to run. :param input: The input to the agent. :param messages: The messages to pass an input to the agent. + :param metadata: The metadata to pass to the agent. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -737,6 +742,7 @@ async def run_stream_async( agent_id=agent_id, input=input_, messages=utils.get_pydantic_model(messages, Optional[List[models.Message]]), + metadata=metadata, ) req = self._build_request_async( @@ -813,6 +819,7 @@ def run( messages: Optional[ Union[List[models.Message], List[models.MessageTypedDict]] ] = None, + metadata: Optional[Dict[str, Any]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -825,6 +832,7 @@ def run( :param agent_id: The ID of the agent to run. :param input: The input to the agent. :param messages: The messages to pass an input to the agent. + :param metadata: The metadata to pass to the agent. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -844,6 +852,7 @@ def run( agent_id=agent_id, input=input_, messages=utils.get_pydantic_model(messages, Optional[List[models.Message]]), + metadata=metadata, ) req = self._build_request( @@ -920,6 +929,7 @@ async def run_async( messages: Optional[ Union[List[models.Message], List[models.MessageTypedDict]] ] = None, + metadata: Optional[Dict[str, Any]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -932,6 +942,7 @@ async def run_async( :param agent_id: The ID of the agent to run. :param input: The input to the agent. :param messages: The messages to pass an input to the agent. + :param metadata: The metadata to pass to the agent. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -951,6 +962,7 @@ async def run_async( agent_id=agent_id, input=input_, messages=utils.get_pydantic_model(messages, Optional[List[models.Message]]), + metadata=metadata, ) req = self._build_request_async( diff --git a/src/glean/api_client/basesdk.py b/src/glean/api_client/basesdk.py index b5dddbd2..9f183967 100644 --- a/src/glean/api_client/basesdk.py +++ b/src/glean/api_client/basesdk.py @@ -2,7 +2,11 @@ from .sdkconfiguration import SDKConfiguration from glean.api_client import errors, models, utils -from glean.api_client._hooks import AfterErrorContext, AfterSuccessContext, BeforeRequestContext +from glean.api_client._hooks import ( + AfterErrorContext, + AfterSuccessContext, + BeforeRequestContext, +) from glean.api_client.utils import RetryConfig, SerializedRequestBody, get_body_content import httpx from typing import Callable, List, Mapping, Optional, Tuple diff --git a/src/glean/api_client/models/agentrun.py b/src/glean/api_client/models/agentrun.py index 079b7632..81f3cace 100644 --- a/src/glean/api_client/models/agentrun.py +++ b/src/glean/api_client/models/agentrun.py @@ -17,6 +17,8 @@ class AgentRunTypedDict(TypedDict): r"""The input to the agent.""" messages: NotRequired[List[MessageTypedDict]] r"""The messages to pass an input to the agent.""" + metadata: NotRequired[Dict[str, Any]] + r"""The metadata to pass to the agent.""" status: NotRequired[AgentExecutionStatus] r"""The status of the run. One of 'error', 'success'.""" @@ -33,5 +35,8 @@ class AgentRun(BaseModel): messages: Optional[List[Message]] = None r"""The messages to pass an input to the agent.""" + metadata: Optional[Dict[str, Any]] = None + r"""The metadata to pass to the agent.""" + status: Optional[AgentExecutionStatus] = None r"""The status of the run. One of 'error', 'success'.""" diff --git a/src/glean/api_client/models/agentruncreate.py b/src/glean/api_client/models/agentruncreate.py index 459f5c3b..9af73f1a 100644 --- a/src/glean/api_client/models/agentruncreate.py +++ b/src/glean/api_client/models/agentruncreate.py @@ -16,6 +16,8 @@ class AgentRunCreateTypedDict(TypedDict): r"""The input to the agent.""" messages: NotRequired[List[MessageTypedDict]] r"""The messages to pass an input to the agent.""" + metadata: NotRequired[Dict[str, Any]] + r"""The metadata to pass to the agent.""" class AgentRunCreate(BaseModel): @@ -29,3 +31,6 @@ class AgentRunCreate(BaseModel): messages: Optional[List[Message]] = None r"""The messages to pass an input to the agent.""" + + metadata: Optional[Dict[str, Any]] = None + r"""The metadata to pass to the agent.""" diff --git a/src/glean/api_client/models/uploadchatfilesrequest.py b/src/glean/api_client/models/uploadchatfilesrequest.py index e8aad89e..c169f4ac 100644 --- a/src/glean/api_client/models/uploadchatfilesrequest.py +++ b/src/glean/api_client/models/uploadchatfilesrequest.py @@ -39,5 +39,7 @@ class UploadChatFilesRequestTypedDict(TypedDict): class UploadChatFilesRequest(BaseModel): - files: Annotated[List[File], FieldMetadata(multipart=True)] + files: Annotated[ + List[File], FieldMetadata(multipart=MultipartFormMetadata(file=True)) + ] r"""Raw files to be uploaded for chat in binary format.""" diff --git a/src/glean/api_client/utils/forms.py b/src/glean/api_client/utils/forms.py index 0472aba8..e873495f 100644 --- a/src/glean/api_client/utils/forms.py +++ b/src/glean/api_client/utils/forms.py @@ -86,11 +86,39 @@ def _populate_form( return form +def _extract_file_properties(file_obj: Any) -> Tuple[str, Any, Any]: + """Extract file name, content, and content type from a file object.""" + file_fields: Dict[str, FieldInfo] = file_obj.__class__.model_fields + + file_name = "" + content = None + content_type = None + + for file_field_name in file_fields: + file_field = file_fields[file_field_name] + + file_metadata = find_field_metadata(file_field, MultipartFormMetadata) + if file_metadata is None: + continue + + if file_metadata.content: + content = getattr(file_obj, file_field_name, None) + elif file_field_name == "content_type": + content_type = getattr(file_obj, file_field_name, None) + else: + file_name = getattr(file_obj, file_field_name) + + if file_name == "" or content is None: + raise ValueError("invalid multipart/form-data file") + + return file_name, content, content_type + + def serialize_multipart_form( media_type: str, request: Any -) -> Tuple[str, Dict[str, Any], Dict[str, Any]]: +) -> Tuple[str, Dict[str, Any], List[Tuple[str, Any]]]: form: Dict[str, Any] = {} - files: Dict[str, Any] = {} + files: List[Tuple[str, Any]] = [] if not isinstance(request, BaseModel): raise TypeError("invalid request body type") @@ -112,39 +140,32 @@ def serialize_multipart_form( f_name = field.alias if field.alias else name if field_metadata.file: - file_fields: Dict[str, FieldInfo] = val.__class__.model_fields - - file_name = "" - content = None - content_type = None - - for file_field_name in file_fields: - file_field = file_fields[file_field_name] + if isinstance(val, List): + # Handle array of files + for file_obj in val: + if not _is_set(file_obj): + continue + + file_name, content, content_type = _extract_file_properties(file_obj) - file_metadata = find_field_metadata(file_field, MultipartFormMetadata) - if file_metadata is None: - continue + if content_type is not None: + files.append((f_name + "[]", (file_name, content, content_type))) + else: + files.append((f_name + "[]", (file_name, content))) + else: + # Handle single file + file_name, content, content_type = _extract_file_properties(val) - if file_metadata.content: - content = getattr(val, file_field_name, None) - elif file_field_name == "content_type": - content_type = getattr(val, file_field_name, None) + if content_type is not None: + files.append((f_name, (file_name, content, content_type))) else: - file_name = getattr(val, file_field_name) - - if file_name == "" or content is None: - raise ValueError("invalid multipart/form-data file") - - if content_type is not None: - files[f_name] = (file_name, content, content_type) - else: - files[f_name] = (file_name, content) + files.append((f_name, (file_name, content))) elif field_metadata.json: - files[f_name] = ( + files.append((f_name, ( None, marshal_json(val, request_field_types[name]), "application/json", - ) + ))) else: if isinstance(val, List): values = [] diff --git a/src/glean/api_client/utils/logger.py b/src/glean/api_client/utils/logger.py index 88f05800..6a16fe3e 100644 --- a/src/glean/api_client/utils/logger.py +++ b/src/glean/api_client/utils/logger.py @@ -23,5 +23,5 @@ def get_body_content(req: httpx.Request) -> str: def get_default_logger() -> Logger: if os.getenv("GLEAN_DEBUG"): logging.basicConfig(level=logging.DEBUG) - return logging.getLogger("glean") + return logging.getLogger("glean.api_client") return NoOpLogger() diff --git a/tests/mockserver/internal/handler/pathgetrestapiv1agentsagentid.go b/tests/mockserver/internal/handler/pathgetrestapiv1agentsagentid.go index d91aa327..41615362 100644 --- a/tests/mockserver/internal/handler/pathgetrestapiv1agentsagentid.go +++ b/tests/mockserver/internal/handler/pathgetrestapiv1agentsagentid.go @@ -45,7 +45,7 @@ func testGetAgentGetAgent0(w http.ResponseWriter, req *http.Request) { http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.Agent{ + var respBody *components.Agent = &components.Agent{ AgentID: "", Name: "", Capabilities: components.AgentCapabilities{}, diff --git a/tests/mockserver/internal/handler/pathgetrestapiv1agentsagentidschemas.go b/tests/mockserver/internal/handler/pathgetrestapiv1agentsagentidschemas.go index e0ed13ae..c10d567f 100644 --- a/tests/mockserver/internal/handler/pathgetrestapiv1agentsagentidschemas.go +++ b/tests/mockserver/internal/handler/pathgetrestapiv1agentsagentidschemas.go @@ -45,7 +45,7 @@ func testGetAgentSchemasGetAgentSchemas0(w http.ResponseWriter, req *http.Reques http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.AgentSchemas{ + var respBody *components.AgentSchemas = &components.AgentSchemas{ AgentID: "", InputSchema: components.InputSchema{}, OutputSchema: components.OutputSchema{}, diff --git a/tests/mockserver/internal/handler/pathgetrestapiv1governancedatapolicies.go b/tests/mockserver/internal/handler/pathgetrestapiv1governancedatapolicies.go index b0d10bbd..bbf888e6 100644 --- a/tests/mockserver/internal/handler/pathgetrestapiv1governancedatapolicies.go +++ b/tests/mockserver/internal/handler/pathgetrestapiv1governancedatapolicies.go @@ -45,7 +45,7 @@ func testListpoliciesListpolicies0(w http.ResponseWriter, req *http.Request) { http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.ListDlpReportsResponse{} + var respBody *components.ListDlpReportsResponse = &components.ListDlpReportsResponse{} respBodyBytes, err := utils.MarshalJSON(respBody, "", true) if err != nil { diff --git a/tests/mockserver/internal/handler/pathgetrestapiv1governancedatapoliciesid.go b/tests/mockserver/internal/handler/pathgetrestapiv1governancedatapoliciesid.go index 07d4fea6..102ff17b 100644 --- a/tests/mockserver/internal/handler/pathgetrestapiv1governancedatapoliciesid.go +++ b/tests/mockserver/internal/handler/pathgetrestapiv1governancedatapoliciesid.go @@ -45,7 +45,7 @@ func testGetpolicyGetpolicy0(w http.ResponseWriter, req *http.Request) { http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.GetDlpReportResponse{} + var respBody *components.GetDlpReportResponse = &components.GetDlpReportResponse{} respBodyBytes, err := utils.MarshalJSON(respBody, "", true) if err != nil { diff --git a/tests/mockserver/internal/handler/pathgetrestapiv1toolslist.go b/tests/mockserver/internal/handler/pathgetrestapiv1toolslist.go index a8dc3089..163466cb 100644 --- a/tests/mockserver/internal/handler/pathgetrestapiv1toolslist.go +++ b/tests/mockserver/internal/handler/pathgetrestapiv1toolslist.go @@ -45,7 +45,7 @@ func testGetRestAPIV1ToolsListGetRestAPIV1ToolsList0(w http.ResponseWriter, req http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.ToolsListResponse{} + var respBody *components.ToolsListResponse = &components.ToolsListResponse{} respBodyBytes, err := utils.MarshalJSON(respBody, "", true) if err != nil { diff --git a/tests/mockserver/internal/handler/pathpostapiindexv1checkdocumentaccess.go b/tests/mockserver/internal/handler/pathpostapiindexv1checkdocumentaccess.go index 23ebc538..694a298e 100644 --- a/tests/mockserver/internal/handler/pathpostapiindexv1checkdocumentaccess.go +++ b/tests/mockserver/internal/handler/pathpostapiindexv1checkdocumentaccess.go @@ -50,7 +50,7 @@ func testPostAPIIndexV1CheckdocumentaccessPostAPIIndexV1Checkdocumentaccess0(w h http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.CheckDocumentAccessResponse{} + var respBody *components.CheckDocumentAccessResponse = &components.CheckDocumentAccessResponse{} respBodyBytes, err := utils.MarshalJSON(respBody, "", true) if err != nil { diff --git a/tests/mockserver/internal/handler/pathpostapiindexv1getdatasourceconfig.go b/tests/mockserver/internal/handler/pathpostapiindexv1getdatasourceconfig.go index 1219671c..c7b4ab25 100644 --- a/tests/mockserver/internal/handler/pathpostapiindexv1getdatasourceconfig.go +++ b/tests/mockserver/internal/handler/pathpostapiindexv1getdatasourceconfig.go @@ -51,7 +51,7 @@ func testPostAPIIndexV1GetdatasourceconfigPostAPIIndexV1Getdatasourceconfig0(w h http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.CustomDatasourceConfig{ + var respBody *components.CustomDatasourceConfig = &components.CustomDatasourceConfig{ Name: "", DatasourceCategory: components.DatasourceCategoryUncategorized.ToPointer(), URLRegex: types.String("https://example-company.datasource.com/.*"), diff --git a/tests/mockserver/internal/handler/pathpostapiindexv1getdocumentcount.go b/tests/mockserver/internal/handler/pathpostapiindexv1getdocumentcount.go index 94479655..dbc8be6a 100644 --- a/tests/mockserver/internal/handler/pathpostapiindexv1getdocumentcount.go +++ b/tests/mockserver/internal/handler/pathpostapiindexv1getdocumentcount.go @@ -50,7 +50,7 @@ func testPostAPIIndexV1GetdocumentcountPostAPIIndexV1Getdocumentcount0(w http.Re http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.GetDocumentCountResponse{} + var respBody *components.GetDocumentCountResponse = &components.GetDocumentCountResponse{} respBodyBytes, err := utils.MarshalJSON(respBody, "", true) if err != nil { diff --git a/tests/mockserver/internal/handler/pathpostapiindexv1getdocumentstatus.go b/tests/mockserver/internal/handler/pathpostapiindexv1getdocumentstatus.go index f86dd6f0..d7afbcdc 100644 --- a/tests/mockserver/internal/handler/pathpostapiindexv1getdocumentstatus.go +++ b/tests/mockserver/internal/handler/pathpostapiindexv1getdocumentstatus.go @@ -50,7 +50,7 @@ func testPostAPIIndexV1GetdocumentstatusPostAPIIndexV1Getdocumentstatus0(w http. http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.GetDocumentStatusResponse{} + var respBody *components.GetDocumentStatusResponse = &components.GetDocumentStatusResponse{} respBodyBytes, err := utils.MarshalJSON(respBody, "", true) if err != nil { diff --git a/tests/mockserver/internal/handler/pathpostapiindexv1getusercount.go b/tests/mockserver/internal/handler/pathpostapiindexv1getusercount.go index 9a1b178c..4fcb5e77 100644 --- a/tests/mockserver/internal/handler/pathpostapiindexv1getusercount.go +++ b/tests/mockserver/internal/handler/pathpostapiindexv1getusercount.go @@ -50,7 +50,7 @@ func testPostAPIIndexV1GetusercountPostAPIIndexV1Getusercount0(w http.ResponseWr http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.GetUserCountResponse{} + var respBody *components.GetUserCountResponse = &components.GetUserCountResponse{} respBodyBytes, err := utils.MarshalJSON(respBody, "", true) if err != nil { diff --git a/tests/mockserver/internal/handler/pathpostapiindexv1rotatetoken.go b/tests/mockserver/internal/handler/pathpostapiindexv1rotatetoken.go index df7f30c2..23d1db7a 100644 --- a/tests/mockserver/internal/handler/pathpostapiindexv1rotatetoken.go +++ b/tests/mockserver/internal/handler/pathpostapiindexv1rotatetoken.go @@ -45,7 +45,7 @@ func testPostAPIIndexV1RotatetokenPostAPIIndexV1Rotatetoken0(w http.ResponseWrit http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.RotateTokenResponse{} + var respBody *components.RotateTokenResponse = &components.RotateTokenResponse{} respBodyBytes, err := utils.MarshalJSON(respBody, "", true) if err != nil { diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1addcollectionitems.go b/tests/mockserver/internal/handler/pathpostrestapiv1addcollectionitems.go index 51677417..dab5c26e 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1addcollectionitems.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1addcollectionitems.go @@ -51,7 +51,7 @@ func testAddcollectionitemsAddcollectionitems0(w http.ResponseWriter, req *http. http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.AddCollectionItemsResponse{ + var respBody *components.AddCollectionItemsResponse = &components.AddCollectionItemsResponse{ Collection: &components.Collection{ Name: "", Description: "greedily indeed marten whereas rebel expansion", diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1addverificationreminder.go b/tests/mockserver/internal/handler/pathpostrestapiv1addverificationreminder.go index 81760bb5..8a13e8e1 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1addverificationreminder.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1addverificationreminder.go @@ -51,7 +51,7 @@ func testAddverificationreminderAddverificationreminder0(w http.ResponseWriter, http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.Verification{ + var respBody *components.Verification = &components.Verification{ State: components.StateVerified, Metadata: &components.VerificationMetadata{ LastVerifier: &components.Person{ diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1adminsearch.go b/tests/mockserver/internal/handler/pathpostrestapiv1adminsearch.go index cbe3c2c9..be9f325e 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1adminsearch.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1adminsearch.go @@ -51,7 +51,7 @@ func testAdminsearchAdminsearch0(w http.ResponseWriter, req *http.Request) { http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.SearchResponse{ + var respBody *components.SearchResponse = &components.SearchResponse{ TrackingToken: types.String("trackingToken"), Results: []components.SearchResult{ components.SearchResult{ diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1autocomplete.go b/tests/mockserver/internal/handler/pathpostrestapiv1autocomplete.go index 323d49bb..f5022d6d 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1autocomplete.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1autocomplete.go @@ -51,7 +51,7 @@ func testAutocompleteAutocomplete0(w http.ResponseWriter, req *http.Request) { http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.AutocompleteResponse{ + var respBody *components.AutocompleteResponse = &components.AutocompleteResponse{ TrackingToken: types.String("trackingToken"), Results: []components.AutocompleteResult{ components.AutocompleteResult{ diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1createannouncement.go b/tests/mockserver/internal/handler/pathpostrestapiv1createannouncement.go index e6508355..50d77708 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1createannouncement.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1createannouncement.go @@ -51,7 +51,7 @@ func testCreateannouncementCreateannouncement0(w http.ResponseWriter, req *http. http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.Announcement{ + var respBody *components.Announcement = &components.Announcement{ Body: &components.StructuredText{ Text: "From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light.", StructuredList: []components.StructuredTextItem{ diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1createanswer.go b/tests/mockserver/internal/handler/pathpostrestapiv1createanswer.go index 00ff9e15..43a60a18 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1createanswer.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1createanswer.go @@ -51,7 +51,7 @@ func testCreateanswerCreateanswer0(w http.ResponseWriter, req *http.Request) { http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.Answer{ + var respBody *components.Answer = &components.Answer{ ID: 3, DocID: types.String("ANSWERS_answer_3"), Question: types.String("Why is the sky blue?"), diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1createauthtoken.go b/tests/mockserver/internal/handler/pathpostrestapiv1createauthtoken.go index f2055916..ab9263d4 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1createauthtoken.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1createauthtoken.go @@ -45,7 +45,7 @@ func testCreateauthtokenCreateauthtoken0(w http.ResponseWriter, req *http.Reques http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.CreateAuthTokenResponse{ + var respBody *components.CreateAuthTokenResponse = &components.CreateAuthTokenResponse{ Token: "", ExpirationTime: 207213, } diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1createcollection.go b/tests/mockserver/internal/handler/pathpostrestapiv1createcollection.go index 16f7233c..4f0b0df3 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1createcollection.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1createcollection.go @@ -51,7 +51,7 @@ func testCreatecollectionCreatecollection0(w http.ResponseWriter, req *http.Requ http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.CreateCollectionResponse{ + var respBody *components.CreateCollectionResponse = &components.CreateCollectionResponse{ Name: "", Description: "mentor early miserly stealthily without trick yahoo until planula", AddedRoles: []components.UserRoleSpecification{ diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1createshortcut.go b/tests/mockserver/internal/handler/pathpostrestapiv1createshortcut.go index baf612de..1b2c9b91 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1createshortcut.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1createshortcut.go @@ -50,7 +50,7 @@ func testCreateshortcutCreateshortcut0(w http.ResponseWriter, req *http.Request) http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.CreateShortcutResponse{} + var respBody *components.CreateShortcutResponse = &components.CreateShortcutResponse{} respBodyBytes, err := utils.MarshalJSON(respBody, "", true) if err != nil { diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1deletecollectionitem.go b/tests/mockserver/internal/handler/pathpostrestapiv1deletecollectionitem.go index b4f2f9ad..d97e781c 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1deletecollectionitem.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1deletecollectionitem.go @@ -51,7 +51,7 @@ func testDeletecollectionitemDeletecollectionitem0(w http.ResponseWriter, req *h http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.DeleteCollectionItemResponse{ + var respBody *components.DeleteCollectionItemResponse = &components.DeleteCollectionItemResponse{ Collection: &components.Collection{ Name: "", Description: "up nice seafood", diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1editanswer.go b/tests/mockserver/internal/handler/pathpostrestapiv1editanswer.go index 3e6d8e2a..d84b2456 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1editanswer.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1editanswer.go @@ -51,7 +51,7 @@ func testEditanswerEditanswer0(w http.ResponseWriter, req *http.Request) { http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.Answer{ + var respBody *components.Answer = &components.Answer{ ID: 3, DocID: types.String("ANSWERS_answer_3"), Question: types.String("Why is the sky blue?"), diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1editcollection.go b/tests/mockserver/internal/handler/pathpostrestapiv1editcollection.go index 85035720..c5dfa62d 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1editcollection.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1editcollection.go @@ -51,7 +51,7 @@ func testEditcollectionEditcollection0(w http.ResponseWriter, req *http.Request) http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.EditCollectionResponse{ + var respBody *components.EditCollectionResponse = &components.EditCollectionResponse{ Name: "", Description: "urgently voluntarily scale gut", AddedRoles: []components.UserRoleSpecification{ diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1editcollectionitem.go b/tests/mockserver/internal/handler/pathpostrestapiv1editcollectionitem.go index fef63305..186281db 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1editcollectionitem.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1editcollectionitem.go @@ -51,7 +51,7 @@ func testEditcollectionitemEditcollectionitem0(w http.ResponseWriter, req *http. http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.EditCollectionItemResponse{ + var respBody *components.EditCollectionItemResponse = &components.EditCollectionItemResponse{ Collection: &components.Collection{ Name: "", Description: "where nasalise emphasize jealously appliance", diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1editpin.go b/tests/mockserver/internal/handler/pathpostrestapiv1editpin.go index 6947ec7b..e08ef257 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1editpin.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1editpin.go @@ -51,7 +51,7 @@ func testEditpinEditpin0(w http.ResponseWriter, req *http.Request) { http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.PinDocument{ + var respBody *components.PinDocument = &components.PinDocument{ AudienceFilters: []components.FacetFilter{ components.FacetFilter{ FieldName: types.String("type"), diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1feed.go b/tests/mockserver/internal/handler/pathpostrestapiv1feed.go index 910b74f4..950ad3db 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1feed.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1feed.go @@ -51,7 +51,7 @@ func testFeedFeed0(w http.ResponseWriter, req *http.Request) { http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.FeedResponse{ + var respBody *components.FeedResponse = &components.FeedResponse{ ServerTimestamp: 152670, Results: []components.FeedResult{ components.FeedResult{ diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1getanswer.go b/tests/mockserver/internal/handler/pathpostrestapiv1getanswer.go index 497adcd4..a7e0758e 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1getanswer.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1getanswer.go @@ -51,7 +51,7 @@ func testGetanswerGetanswer0(w http.ResponseWriter, req *http.Request) { http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.GetAnswerResponse{ + var respBody *components.GetAnswerResponse = &components.GetAnswerResponse{ AnswerResult: &components.AnswerResult{ Answer: components.Answer{ ID: 3, diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1getchat.go b/tests/mockserver/internal/handler/pathpostrestapiv1getchat.go index 93343662..6e47d93c 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1getchat.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1getchat.go @@ -51,7 +51,7 @@ func testGetchatGetchat0(w http.ResponseWriter, req *http.Request) { http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.GetChatResponse{ + var respBody *components.GetChatResponse = &components.GetChatResponse{ ChatResult: &components.ChatResult{ Chat: &components.Chat{ ID: types.String("string"), diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1getchatapplication.go b/tests/mockserver/internal/handler/pathpostrestapiv1getchatapplication.go index 73921fbb..c7983c60 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1getchatapplication.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1getchatapplication.go @@ -50,7 +50,7 @@ func testGetchatapplicationGetchatapplication0(w http.ResponseWriter, req *http. http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.GetChatApplicationResponse{} + var respBody *components.GetChatApplicationResponse = &components.GetChatApplicationResponse{} respBodyBytes, err := utils.MarshalJSON(respBody, "", true) if err != nil { diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1getchatfiles.go b/tests/mockserver/internal/handler/pathpostrestapiv1getchatfiles.go index 634da19e..73feb6db 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1getchatfiles.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1getchatfiles.go @@ -51,7 +51,7 @@ func testGetchatfilesGetchatfiles0(w http.ResponseWriter, req *http.Request) { http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.GetChatFilesResponse{ + var respBody *components.GetChatFilesResponse = &components.GetChatFilesResponse{ Files: map[string]components.ChatFile{ "key": components.ChatFile{ ID: types.String("FILE_1234"), diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1getcollection.go b/tests/mockserver/internal/handler/pathpostrestapiv1getcollection.go index 06602a26..d0aa8100 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1getcollection.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1getcollection.go @@ -51,7 +51,7 @@ func testGetcollectionGetcollection0(w http.ResponseWriter, req *http.Request) { http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.GetCollectionResponse{ + var respBody *components.GetCollectionResponse = &components.GetCollectionResponse{ Collection: &components.Collection{ Name: "", Description: "for carefully glorious scrabble ignite aw showboat", diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1getdocpermissions.go b/tests/mockserver/internal/handler/pathpostrestapiv1getdocpermissions.go index 1a9ec320..3d7e842f 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1getdocpermissions.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1getdocpermissions.go @@ -50,7 +50,7 @@ func testGetdocpermissionsGetdocpermissions0(w http.ResponseWriter, req *http.Re http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.GetDocPermissionsResponse{} + var respBody *components.GetDocPermissionsResponse = &components.GetDocPermissionsResponse{} respBodyBytes, err := utils.MarshalJSON(respBody, "", true) if err != nil { diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1getdocuments.go b/tests/mockserver/internal/handler/pathpostrestapiv1getdocuments.go index de33c6ba..453834ab 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1getdocuments.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1getdocuments.go @@ -50,7 +50,7 @@ func testGetdocumentsGetdocuments0(w http.ResponseWriter, req *http.Request) { http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.GetDocumentsResponse{ + var respBody *components.GetDocumentsResponse = &components.GetDocumentsResponse{ Documents: map[string]components.DocumentOrErrorUnion{ "key": components.CreateDocumentOrErrorUnionDocument( components.Document{}, diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1getdocumentsbyfacets.go b/tests/mockserver/internal/handler/pathpostrestapiv1getdocumentsbyfacets.go index 84cb4d74..2548de24 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1getdocumentsbyfacets.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1getdocumentsbyfacets.go @@ -51,7 +51,7 @@ func testGetdocumentsbyfacetsGetdocumentsbyfacets0(w http.ResponseWriter, req *h http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.GetDocumentsByFacetsResponse{ + var respBody *components.GetDocumentsByFacetsResponse = &components.GetDocumentsByFacetsResponse{ Documents: []components.Document{ components.Document{ Metadata: &components.DocumentMetadata{ diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1getpin.go b/tests/mockserver/internal/handler/pathpostrestapiv1getpin.go index 877e3e83..d99e95ec 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1getpin.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1getpin.go @@ -51,7 +51,7 @@ func testGetpinGetpin0(w http.ResponseWriter, req *http.Request) { http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.GetPinResponse{ + var respBody *components.GetPinResponse = &components.GetPinResponse{ Pin: &components.PinDocument{ AudienceFilters: []components.FacetFilter{ components.FacetFilter{ diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1getshortcut.go b/tests/mockserver/internal/handler/pathpostrestapiv1getshortcut.go index 96557d0d..97cd66fe 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1getshortcut.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1getshortcut.go @@ -50,7 +50,7 @@ func testGetshortcutGetshortcut0(w http.ResponseWriter, req *http.Request) { http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.GetShortcutResponse{} + var respBody *components.GetShortcutResponse = &components.GetShortcutResponse{} respBodyBytes, err := utils.MarshalJSON(respBody, "", true) if err != nil { diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1insights.go b/tests/mockserver/internal/handler/pathpostrestapiv1insights.go index 28079887..6f0e3cea 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1insights.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1insights.go @@ -51,7 +51,7 @@ func testInsightsInsights0(w http.ResponseWriter, req *http.Request) { http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.InsightsResponse{ + var respBody *components.InsightsResponse = &components.InsightsResponse{ Users: &components.UserInsightsResponse{ ActivityInsights: []components.UserActivityInsight{ components.UserActivityInsight{ diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1listanswers.go b/tests/mockserver/internal/handler/pathpostrestapiv1listanswers.go index 9c8732d8..6380017d 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1listanswers.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1listanswers.go @@ -51,7 +51,7 @@ func testListanswersListanswers0(w http.ResponseWriter, req *http.Request) { http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.ListAnswersResponse{ + var respBody *components.ListAnswersResponse = &components.ListAnswersResponse{ AnswerResults: []components.AnswerResult{ components.AnswerResult{ Answer: components.Answer{ diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1listchats.go b/tests/mockserver/internal/handler/pathpostrestapiv1listchats.go index 7b862227..2b3865dc 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1listchats.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1listchats.go @@ -46,7 +46,7 @@ func testListchatsListchats0(w http.ResponseWriter, req *http.Request) { http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.ListChatsResponse{ + var respBody *components.ListChatsResponse = &components.ListChatsResponse{ ChatResults: []components.ChatMetadataResult{ components.ChatMetadataResult{ Chat: &components.ChatMetadata{ diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1listcollections.go b/tests/mockserver/internal/handler/pathpostrestapiv1listcollections.go index d44d70da..04b48fcf 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1listcollections.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1listcollections.go @@ -51,7 +51,7 @@ func testListcollectionsListcollections0(w http.ResponseWriter, req *http.Reques http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.ListCollectionsResponse{ + var respBody *components.ListCollectionsResponse = &components.ListCollectionsResponse{ Collections: []components.Collection{ components.Collection{ Name: "", diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1listentities.go b/tests/mockserver/internal/handler/pathpostrestapiv1listentities.go index c44c305a..37ad6f80 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1listentities.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1listentities.go @@ -51,7 +51,7 @@ func testListentitiesListentities0(w http.ResponseWriter, req *http.Request) { http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.ListEntitiesResponse{ + var respBody *components.ListEntitiesResponse = &components.ListEntitiesResponse{ Results: []components.Person{ components.Person{ Name: "George Clooney", diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1listpins.go b/tests/mockserver/internal/handler/pathpostrestapiv1listpins.go index 04774e10..7bb86559 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1listpins.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1listpins.go @@ -51,7 +51,7 @@ func testListpinsListpins0(w http.ResponseWriter, req *http.Request) { http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.ListPinsResponse{ + var respBody *components.ListPinsResponse = &components.ListPinsResponse{ Pins: []components.PinDocument{ components.PinDocument{ AudienceFilters: []components.FacetFilter{ diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1listshortcuts.go b/tests/mockserver/internal/handler/pathpostrestapiv1listshortcuts.go index b04d1fd2..29fd4d6a 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1listshortcuts.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1listshortcuts.go @@ -51,7 +51,7 @@ func testListshortcutsListshortcuts0(w http.ResponseWriter, req *http.Request) { http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.ListShortcutsPaginatedResponse{ + var respBody *components.ListShortcutsPaginatedResponse = &components.ListShortcutsPaginatedResponse{ Shortcuts: []components.Shortcut{ components.Shortcut{ InputAlias: "", diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1listverifications.go b/tests/mockserver/internal/handler/pathpostrestapiv1listverifications.go index f6f86bed..243b58d4 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1listverifications.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1listverifications.go @@ -46,7 +46,7 @@ func testListverificationsListverifications0(w http.ResponseWriter, req *http.Re http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.VerificationFeed{ + var respBody *components.VerificationFeed = &components.VerificationFeed{ Documents: []components.Verification{ components.Verification{ State: components.StateVerified, diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1messages.go b/tests/mockserver/internal/handler/pathpostrestapiv1messages.go index 8b2aa7ac..4d477fa5 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1messages.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1messages.go @@ -51,7 +51,7 @@ func testMessagesMessages0(w http.ResponseWriter, req *http.Request) { http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.MessagesResponse{ + var respBody *components.MessagesResponse = &components.MessagesResponse{ HasMore: false, SearchResponse: &components.SearchResponse{ TrackingToken: types.String("trackingToken"), diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1people.go b/tests/mockserver/internal/handler/pathpostrestapiv1people.go index f86753d5..9b82e330 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1people.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1people.go @@ -51,7 +51,7 @@ func testPeoplePeople0(w http.ResponseWriter, req *http.Request) { http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.PeopleResponse{ + var respBody *components.PeopleResponse = &components.PeopleResponse{ Results: []components.Person{ components.Person{ Name: "George Clooney", diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1pin.go b/tests/mockserver/internal/handler/pathpostrestapiv1pin.go index 09fdba85..6d279e1e 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1pin.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1pin.go @@ -51,7 +51,7 @@ func testPinPin0(w http.ResponseWriter, req *http.Request) { http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.PinDocument{ + var respBody *components.PinDocument = &components.PinDocument{ AudienceFilters: []components.FacetFilter{ components.FacetFilter{ FieldName: types.String("type"), diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1recommendations.go b/tests/mockserver/internal/handler/pathpostrestapiv1recommendations.go index 78289a8e..6eded0b5 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1recommendations.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1recommendations.go @@ -51,7 +51,7 @@ func testRecommendationsRecommendations0(w http.ResponseWriter, req *http.Reques http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.ResultsResponse{ + var respBody *components.ResultsResponse = &components.ResultsResponse{ Results: []components.SearchResult{ components.SearchResult{ Title: types.String("title"), diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1search.go b/tests/mockserver/internal/handler/pathpostrestapiv1search.go index f8bb6d1b..36f7c3f7 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1search.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1search.go @@ -51,7 +51,7 @@ func testSearchSearch0(w http.ResponseWriter, req *http.Request) { http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.SearchResponse{ + var respBody *components.SearchResponse = &components.SearchResponse{ TrackingToken: types.String("trackingToken"), Results: []components.SearchResult{ components.SearchResult{ diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1summarize.go b/tests/mockserver/internal/handler/pathpostrestapiv1summarize.go index f3d4c34a..2184efd6 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1summarize.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1summarize.go @@ -50,7 +50,7 @@ func testSummarizeSummarize0(w http.ResponseWriter, req *http.Request) { http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.SummarizeResponse{} + var respBody *components.SummarizeResponse = &components.SummarizeResponse{} respBodyBytes, err := utils.MarshalJSON(respBody, "", true) if err != nil { diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1toolscall.go b/tests/mockserver/internal/handler/pathpostrestapiv1toolscall.go index 3feb1184..1676df61 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1toolscall.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1toolscall.go @@ -50,7 +50,7 @@ func testPostRestAPIV1ToolsCallPostRestAPIV1ToolsCall0(w http.ResponseWriter, re http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.ToolsCallResponse{} + var respBody *components.ToolsCallResponse = &components.ToolsCallResponse{} respBodyBytes, err := utils.MarshalJSON(respBody, "", true) if err != nil { diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1updateannouncement.go b/tests/mockserver/internal/handler/pathpostrestapiv1updateannouncement.go index 2687efec..16017575 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1updateannouncement.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1updateannouncement.go @@ -51,7 +51,7 @@ func testUpdateannouncementUpdateannouncement0(w http.ResponseWriter, req *http. http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.Announcement{ + var respBody *components.Announcement = &components.Announcement{ Body: &components.StructuredText{ Text: "From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light.", StructuredList: []components.StructuredTextItem{ diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1updateshortcut.go b/tests/mockserver/internal/handler/pathpostrestapiv1updateshortcut.go index 13770a05..835c96f1 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1updateshortcut.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1updateshortcut.go @@ -50,7 +50,7 @@ func testUpdateshortcutUpdateshortcut0(w http.ResponseWriter, req *http.Request) http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.UpdateShortcutResponse{} + var respBody *components.UpdateShortcutResponse = &components.UpdateShortcutResponse{} respBodyBytes, err := utils.MarshalJSON(respBody, "", true) if err != nil { diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1verify.go b/tests/mockserver/internal/handler/pathpostrestapiv1verify.go index 93c9498c..95b10abb 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1verify.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1verify.go @@ -51,7 +51,7 @@ func testVerifyVerify0(w http.ResponseWriter, req *http.Request) { http.Error(w, err.Error(), http.StatusBadRequest) return } - respBody := &components.Verification{ + var respBody *components.Verification = &components.Verification{ State: components.StateDeprecated, Metadata: &components.VerificationMetadata{ LastVerifier: &components.Person{ diff --git a/tests/mockserver/internal/sdk/models/components/agentrun.go b/tests/mockserver/internal/sdk/models/components/agentrun.go index a4ee03e2..23ab5120 100644 --- a/tests/mockserver/internal/sdk/models/components/agentrun.go +++ b/tests/mockserver/internal/sdk/models/components/agentrun.go @@ -10,6 +10,8 @@ type AgentRun struct { Input map[string]any `json:"input,omitempty"` // The messages to pass an input to the agent. Messages []Message `json:"messages,omitempty"` + // The metadata to pass to the agent. + Metadata map[string]any `json:"metadata,omitempty"` // The status of the run. One of 'error', 'success'. Status *AgentExecutionStatus `json:"status,omitempty"` } @@ -35,6 +37,13 @@ func (o *AgentRun) GetMessages() []Message { return o.Messages } +func (o *AgentRun) GetMetadata() map[string]any { + if o == nil { + return nil + } + return o.Metadata +} + func (o *AgentRun) GetStatus() *AgentExecutionStatus { if o == nil { return nil diff --git a/tests/mockserver/internal/sdk/models/components/agentruncreate.go b/tests/mockserver/internal/sdk/models/components/agentruncreate.go index 0124a053..c095a382 100644 --- a/tests/mockserver/internal/sdk/models/components/agentruncreate.go +++ b/tests/mockserver/internal/sdk/models/components/agentruncreate.go @@ -10,6 +10,8 @@ type AgentRunCreate struct { Input map[string]any `json:"input,omitempty"` // The messages to pass an input to the agent. Messages []Message `json:"messages,omitempty"` + // The metadata to pass to the agent. + Metadata map[string]any `json:"metadata,omitempty"` } func (o *AgentRunCreate) GetAgentID() string { @@ -32,3 +34,10 @@ func (o *AgentRunCreate) GetMessages() []Message { } return o.Messages } + +func (o *AgentRunCreate) GetMetadata() map[string]any { + if o == nil { + return nil + } + return o.Metadata +} diff --git a/tests/mockserver/internal/sdk/models/components/customfieldvalue.go b/tests/mockserver/internal/sdk/models/components/customfieldvalue.go index 7797de4b..425834c1 100644 --- a/tests/mockserver/internal/sdk/models/components/customfieldvalue.go +++ b/tests/mockserver/internal/sdk/models/components/customfieldvalue.go @@ -17,9 +17,9 @@ const ( ) type CustomFieldValue struct { - CustomFieldValueStr *CustomFieldValueStr - CustomFieldValueHyperlink *CustomFieldValueHyperlink - CustomFieldValuePerson *CustomFieldValuePerson + CustomFieldValueStr *CustomFieldValueStr `queryParam:"inline"` + CustomFieldValueHyperlink *CustomFieldValueHyperlink `queryParam:"inline"` + CustomFieldValuePerson *CustomFieldValuePerson `queryParam:"inline"` Type CustomFieldValueType } diff --git a/tests/mockserver/internal/sdk/models/components/documentorerrorunion.go b/tests/mockserver/internal/sdk/models/components/documentorerrorunion.go index 9cd9ca11..ab97bff3 100644 --- a/tests/mockserver/internal/sdk/models/components/documentorerrorunion.go +++ b/tests/mockserver/internal/sdk/models/components/documentorerrorunion.go @@ -28,8 +28,8 @@ const ( ) type DocumentOrErrorUnion struct { - Document *Document - DocumentOrError *DocumentOrError + Document *Document `queryParam:"inline"` + DocumentOrError *DocumentOrError `queryParam:"inline"` Type DocumentOrErrorUnionType } diff --git a/tests/mockserver/internal/sdk/models/components/documentspecunion.go b/tests/mockserver/internal/sdk/models/components/documentspecunion.go index 13cf76b7..612a5a45 100644 --- a/tests/mockserver/internal/sdk/models/components/documentspecunion.go +++ b/tests/mockserver/internal/sdk/models/components/documentspecunion.go @@ -105,9 +105,9 @@ const ( ) type DocumentSpecUnion struct { - DocumentSpec1 *DocumentSpec1 - DocumentSpec2 *DocumentSpec2 - DocumentSpec3 *DocumentSpec3 + DocumentSpec1 *DocumentSpec1 `queryParam:"inline"` + DocumentSpec2 *DocumentSpec2 `queryParam:"inline"` + DocumentSpec3 *DocumentSpec3 `queryParam:"inline"` Type DocumentSpecUnionType } diff --git a/tests/mockserver/internal/sdk/models/components/getshortcutrequestunion.go b/tests/mockserver/internal/sdk/models/components/getshortcutrequestunion.go index b85f7dee..b3db7d31 100644 --- a/tests/mockserver/internal/sdk/models/components/getshortcutrequestunion.go +++ b/tests/mockserver/internal/sdk/models/components/getshortcutrequestunion.go @@ -28,8 +28,8 @@ const ( ) type GetShortcutRequestUnion struct { - UserGeneratedContentID *UserGeneratedContentID - GetShortcutRequest *GetShortcutRequest + UserGeneratedContentID *UserGeneratedContentID `queryParam:"inline"` + GetShortcutRequest *GetShortcutRequest `queryParam:"inline"` Type GetShortcutRequestUnionType } diff --git a/tests/mockserver/internal/sdk/models/components/uploadchatfilesrequest.go b/tests/mockserver/internal/sdk/models/components/uploadchatfilesrequest.go index c431ff9e..7c324627 100644 --- a/tests/mockserver/internal/sdk/models/components/uploadchatfilesrequest.go +++ b/tests/mockserver/internal/sdk/models/components/uploadchatfilesrequest.go @@ -27,7 +27,7 @@ func (o *File) GetContent() io.Reader { type UploadChatFilesRequest struct { // Raw files to be uploaded for chat in binary format. - Files []File `multipartForm:"name=files"` + Files []File `multipartForm:"file"` } func (o *UploadChatFilesRequest) GetFiles() []File { diff --git a/tests/test_activities.py b/tests/test_activities.py index 47f6ea74..dc6994d4 100644 --- a/tests/test_activities.py +++ b/tests/test_activities.py @@ -12,10 +12,10 @@ def test_activities_feedback(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - g_client.client.activity.feedback( + glean.client.activity.feedback( feedback1={ "tracking_tokens": [ "trackingTokens", diff --git a/tests/test_agents.py b/tests/test_agents.py index 46af6f6e..b5bc99a7 100644 --- a/tests/test_agents.py +++ b/tests/test_agents.py @@ -34,10 +34,10 @@ def test_agents_get_agent(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.agents.retrieve(agent_id="") + res = glean.client.agents.retrieve(agent_id="") assert res is not None @@ -48,10 +48,10 @@ def test_agents_get_agent_schemas(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.agents.retrieve_schemas(agent_id="") + res = glean.client.agents.retrieve_schemas(agent_id="") assert res is not None diff --git a/tests/test_announcements.py b/tests/test_announcements.py index 09609c85..5ae4d014 100644 --- a/tests/test_announcements.py +++ b/tests/test_announcements.py @@ -15,10 +15,10 @@ def test_announcements_createannouncement(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.announcements.create( + res = glean.client.announcements.create( start_time=parse_datetime("2024-06-17T07:14:55.338Z"), end_time=parse_datetime("2024-11-30T17:06:07.804Z"), title="", @@ -1418,10 +1418,10 @@ def test_announcements_deleteannouncement(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - g_client.client.announcements.delete(id=545907) + glean.client.announcements.delete(id=545907) @pytest.mark.skip( @@ -1487,10 +1487,10 @@ def test_announcements_updateannouncement(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.announcements.update( + res = glean.client.announcements.update( start_time=parse_datetime("2025-07-28T19:04:48.565Z"), end_time=parse_datetime("2024-10-16T10:52:42.015Z"), title="", diff --git a/tests/test_answers.py b/tests/test_answers.py index eb0274f8..2fda366e 100644 --- a/tests/test_answers.py +++ b/tests/test_answers.py @@ -15,10 +15,10 @@ def test_answers_createanswer(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.answers.create( + res = glean.client.answers.create( data={ "question": "Why is the sky blue?", "body_text": "From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light.", @@ -747,10 +747,10 @@ def test_answers_deleteanswer(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - g_client.client.answers.delete(id=3, doc_id="ANSWERS_answer_3") + glean.client.answers.delete(id=3, doc_id="ANSWERS_answer_3") def test_answers_editanswer(): @@ -760,10 +760,10 @@ def test_answers_editanswer(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.answers.update( + res = glean.client.answers.update( id=3, doc_id="ANSWERS_answer_3", question="Why is the sky blue?", @@ -1366,10 +1366,10 @@ def test_answers_getanswer(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.answers.retrieve(id=3, doc_id="ANSWERS_answer_3") + res = glean.client.answers.retrieve(id=3, doc_id="ANSWERS_answer_3") assert res is not None @@ -1380,10 +1380,10 @@ def test_answers_listanswers(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.answers.list() + res = glean.client.answers.list() assert res is not None diff --git a/tests/test_client_activity.py b/tests/test_client_activity.py index e16936d2..200e3cee 100644 --- a/tests/test_client_activity.py +++ b/tests/test_client_activity.py @@ -13,10 +13,10 @@ def test_client_activity_activity(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - g_client.client.activity.report( + glean.client.activity.report( events=[ { "action": models.ActivityEventAction.HISTORICAL_VIEW, diff --git a/tests/test_client_authentication.py b/tests/test_client_authentication.py index b42ddaac..1ea7ec89 100644 --- a/tests/test_client_authentication.py +++ b/tests/test_client_authentication.py @@ -20,8 +20,8 @@ def test_client_authentication_createauthtoken(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.authentication.create_token() + res = glean.client.authentication.create_token() assert res is not None diff --git a/tests/test_client_chat.py b/tests/test_client_chat.py index b2c164b5..91730ad1 100644 --- a/tests/test_client_chat.py +++ b/tests/test_client_chat.py @@ -56,10 +56,10 @@ def test_client_chat_deleteallchats(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - g_client.client.chat.delete_all() + glean.client.chat.delete_all() def test_client_chat_deletechats(): @@ -69,10 +69,10 @@ def test_client_chat_deletechats(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - g_client.client.chat.delete( + glean.client.chat.delete( ids=[ "", "", @@ -87,10 +87,10 @@ def test_client_chat_getchat(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.chat.retrieve(id="") + res = glean.client.chat.retrieve(id="") assert res is not None @@ -101,10 +101,10 @@ def test_client_chat_listchats(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.chat.list() + res = glean.client.chat.list() assert res is not None @@ -115,10 +115,10 @@ def test_client_chat_getchatapplication(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.chat.retrieve_application(id="") + res = glean.client.chat.retrieve_application(id="") assert res is not None @@ -129,10 +129,10 @@ def test_client_chat_getchatfiles(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.chat.retrieve_files( + res = glean.client.chat.retrieve_files( file_ids=[ "", "", @@ -148,10 +148,10 @@ def test_client_chat_deletechatfiles(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - g_client.client.chat.delete_files( + glean.client.chat.delete_files( file_ids=[ "", ] @@ -165,10 +165,10 @@ def test_client_chat_chat_stream_default_example(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.chat.create_stream( + res = glean.client.chat.create_stream( messages=[ { "fragments": [ @@ -190,10 +190,10 @@ def test_client_chat_chat_stream_gpt_agent_example(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.chat.create_stream( + res = glean.client.chat.create_stream( messages=[ { "fragments": [ @@ -218,10 +218,10 @@ def test_client_chat_chat_stream_streaming_example(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.chat.create_stream(messages=[], timeout_millis=30000) + res = glean.client.chat.create_stream(messages=[], timeout_millis=30000) assert res is not None @@ -232,10 +232,10 @@ def test_client_chat_chat_stream_update_response(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.chat.create_stream( + res = glean.client.chat.create_stream( messages=[ { "citations": [ @@ -4844,10 +4844,10 @@ def test_client_chat_chat_stream_citation_response(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.chat.create_stream( + res = glean.client.chat.create_stream( messages=[ { "citations": [ diff --git a/tests/test_client_documents.py b/tests/test_client_documents.py index ef433b02..da0882b2 100644 --- a/tests/test_client_documents.py +++ b/tests/test_client_documents.py @@ -13,10 +13,10 @@ def test_client_documents_getdocpermissions(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.documents.retrieve_permissions() + res = glean.client.documents.retrieve_permissions() assert res is not None @@ -27,10 +27,10 @@ def test_client_documents_getdocuments(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.documents.retrieve() + res = glean.client.documents.retrieve() assert res is not None @@ -41,10 +41,10 @@ def test_client_documents_getdocumentsbyfacets(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.documents.retrieve_by_facets( + res = glean.client.documents.retrieve_by_facets( request={ "filter_sets": [ { diff --git a/tests/test_client_shortcuts.py b/tests/test_client_shortcuts.py index ac6d7306..0c843a65 100644 --- a/tests/test_client_shortcuts.py +++ b/tests/test_client_shortcuts.py @@ -15,10 +15,10 @@ def test_client_shortcuts_createshortcut(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.shortcuts.create( + res = glean.client.shortcuts.create( data={ "added_roles": [ models.UserRoleSpecification( @@ -594,10 +594,10 @@ def test_client_shortcuts_deleteshortcut(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - g_client.client.shortcuts.delete(id=545907) + glean.client.shortcuts.delete(id=545907) def test_client_shortcuts_getshortcut(): @@ -607,10 +607,10 @@ def test_client_shortcuts_getshortcut(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.shortcuts.retrieve( + res = glean.client.shortcuts.retrieve( request={ "alias": "", } @@ -632,10 +632,10 @@ def test_client_shortcuts_listshortcuts(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.shortcuts.list( + res = glean.client.shortcuts.list( page_size=10, filters=[ { @@ -670,10 +670,10 @@ def test_client_shortcuts_updateshortcut(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.shortcuts.update( + res = glean.client.shortcuts.update( id=857478, added_roles=[ models.UserRoleSpecification( diff --git a/tests/test_client_verification.py b/tests/test_client_verification.py index a4495c3e..8de1f3a8 100644 --- a/tests/test_client_verification.py +++ b/tests/test_client_verification.py @@ -12,10 +12,10 @@ def test_client_verification_addverificationreminder(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.verification.add_reminder(document_id="") + res = glean.client.verification.add_reminder(document_id="") assert res is not None @@ -26,10 +26,10 @@ def test_client_verification_listverifications(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.verification.list() + res = glean.client.verification.list() assert res is not None @@ -40,8 +40,8 @@ def test_client_verification_verify(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.verification.verify(document_id="") + res = glean.client.verification.verify(document_id="") assert res is not None diff --git a/tests/test_collections.py b/tests/test_collections.py index 8daacee2..3892dee6 100644 --- a/tests/test_collections.py +++ b/tests/test_collections.py @@ -15,10 +15,10 @@ def test_collections_addcollectionitems(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.collections.add_items(collection_id=6460.15) + res = glean.client.collections.add_items(collection_id=6460.15) assert res is not None @@ -29,10 +29,10 @@ def test_collections_createcollection(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.collections.create( + res = glean.client.collections.create( name="", added_roles=[ models.UserRoleSpecification( @@ -622,10 +622,10 @@ def test_collections_deletecollection(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - g_client.client.collections.delete( + glean.client.collections.delete( ids=[ 698486, 386564, @@ -640,10 +640,10 @@ def test_collections_deletecollectionitem(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.collections.delete_item( + res = glean.client.collections.delete_item( collection_id=1357.59, item_id="" ) assert res is not None @@ -656,10 +656,10 @@ def test_collections_editcollection(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.collections.update( + res = glean.client.collections.update( name="", id=720396, added_roles=[ @@ -1215,12 +1215,10 @@ def test_collections_editcollectionitem(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.collections.update_item( - collection_id=795203, item_id="" - ) + res = glean.client.collections.update_item(collection_id=795203, item_id="") assert res is not None @@ -1238,10 +1236,10 @@ def test_collections_getcollection(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.collections.retrieve(id=700347) + res = glean.client.collections.retrieve(id=700347) assert res is not None @@ -1252,10 +1250,10 @@ def test_collections_listcollections(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.collections.list() + res = glean.client.collections.list() assert res is not None diff --git a/tests/test_datasources.py b/tests/test_datasources.py index 34466393..8aaeb530 100644 --- a/tests/test_datasources.py +++ b/tests/test_datasources.py @@ -12,10 +12,10 @@ def test_datasources_post_api_index_v1_adddatasource(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - g_client.indexing.datasources.add( + glean.indexing.datasources.add( name="", datasource_category=models.DatasourceCategory.UNCATEGORIZED, url_regex="https://example-company.datasource.com/.*", @@ -51,8 +51,8 @@ def test_datasources_post_api_index_v1_getdatasourceconfig(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.indexing.datasources.retrieve_config(datasource="") + res = glean.indexing.datasources.retrieve_config(datasource="") assert res is not None diff --git a/tests/test_entities.py b/tests/test_entities.py index fd34dbdf..c670cd96 100644 --- a/tests/test_entities.py +++ b/tests/test_entities.py @@ -13,10 +13,10 @@ def test_entities_listentities(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.entities.list( + res = glean.client.entities.list( filter_=[ { "field_name": "type", @@ -45,10 +45,10 @@ def test_entities_people(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.entities.read_people( + res = glean.client.entities.read_people( obfuscated_ids=[ "abc123", "abc456", diff --git a/tests/test_indexing_authentication.py b/tests/test_indexing_authentication.py index da2be6ab..ba76ccdf 100644 --- a/tests/test_indexing_authentication.py +++ b/tests/test_indexing_authentication.py @@ -12,8 +12,8 @@ def test_indexing_authentication_post_api_index_v1_rotatetoken(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.indexing.authentication.rotate_token() + res = glean.indexing.authentication.rotate_token() assert res is not None diff --git a/tests/test_indexing_documents.py b/tests/test_indexing_documents.py index 46c3361e..53c2f4b1 100644 --- a/tests/test_indexing_documents.py +++ b/tests/test_indexing_documents.py @@ -12,10 +12,10 @@ def test_indexing_documents_post_api_index_v1_indexdocument(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - g_client.indexing.documents.add_or_update( + glean.indexing.documents.add_or_update( document=models.DocumentDefinition( datasource="", ) @@ -29,10 +29,10 @@ def test_indexing_documents_post_api_index_v1_indexdocuments(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - g_client.indexing.documents.index( + glean.indexing.documents.index( datasource="", documents=[ models.DocumentDefinition( @@ -49,10 +49,10 @@ def test_indexing_documents_post_api_index_v1_bulkindexdocuments(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - g_client.indexing.documents.bulk_index( + glean.indexing.documents.bulk_index( upload_id="", datasource="", documents=[ @@ -70,10 +70,10 @@ def test_indexing_documents_post_api_index_v1_processalldocuments(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - g_client.indexing.documents.process_all() + glean.indexing.documents.process_all() def test_indexing_documents_post_api_index_v1_deletedocument(): @@ -83,9 +83,9 @@ def test_indexing_documents_post_api_index_v1_deletedocument(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - g_client.indexing.documents.delete( + glean.indexing.documents.delete( datasource="", object_type="", id="" ) diff --git a/tests/test_indexing_permissions.py b/tests/test_indexing_permissions.py index 486c9a56..51a750d7 100644 --- a/tests/test_indexing_permissions.py +++ b/tests/test_indexing_permissions.py @@ -12,10 +12,10 @@ def test_indexing_permissions_post_api_index_v1_updatepermissions(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - g_client.indexing.permissions.update_permissions( + glean.indexing.permissions.update_permissions( datasource="", permissions={} ) @@ -27,10 +27,10 @@ def test_indexing_permissions_post_api_index_v1_indexuser(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - g_client.indexing.permissions.index_user( + glean.indexing.permissions.index_user( datasource="", user={ "email": "Elroy38@gmail.com", @@ -46,10 +46,10 @@ def test_indexing_permissions_post_api_index_v1_bulkindexusers(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - g_client.indexing.permissions.bulk_index_users( + glean.indexing.permissions.bulk_index_users( upload_id="", datasource="", users=[ @@ -76,10 +76,10 @@ def test_indexing_permissions_post_api_index_v1_indexgroup(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - g_client.indexing.permissions.index_group( + glean.indexing.permissions.index_group( datasource="", group={ "name": "", @@ -94,10 +94,10 @@ def test_indexing_permissions_post_api_index_v1_bulkindexgroups(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - g_client.indexing.permissions.bulk_index_groups( + glean.indexing.permissions.bulk_index_groups( upload_id="", datasource="", groups=[ @@ -118,10 +118,10 @@ def test_indexing_permissions_post_api_index_v1_indexmembership(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - g_client.indexing.permissions.index_membership( + glean.indexing.permissions.index_membership( datasource="", membership={ "group_name": "", @@ -138,10 +138,10 @@ def test_indexing_permissions_post_api_index_v1_bulkindexmemberships(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - g_client.indexing.permissions.bulk_index_memberships( + glean.indexing.permissions.bulk_index_memberships( upload_id="", datasource="", memberships=[ @@ -161,10 +161,10 @@ def test_indexing_permissions_post_api_index_v1_processallmemberships(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - g_client.indexing.permissions.process_memberships() + glean.indexing.permissions.process_memberships() def test_indexing_permissions_post_api_index_v1_deleteuser(): @@ -174,10 +174,10 @@ def test_indexing_permissions_post_api_index_v1_deleteuser(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - g_client.indexing.permissions.delete_user( + glean.indexing.permissions.delete_user( datasource="", email="Estrella.Robel56@gmail.com" ) @@ -189,10 +189,10 @@ def test_indexing_permissions_post_api_index_v1_deletegroup(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - g_client.indexing.permissions.delete_group( + glean.indexing.permissions.delete_group( datasource="", group_name="" ) @@ -204,10 +204,10 @@ def test_indexing_permissions_post_api_index_v1_deletemembership(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - g_client.indexing.permissions.delete_membership( + glean.indexing.permissions.delete_membership( datasource="", membership={ "group_name": "", @@ -222,10 +222,10 @@ def test_indexing_permissions_post_api_index_v1_betausers(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - g_client.indexing.permissions.authorize_beta_users( + glean.indexing.permissions.authorize_beta_users( datasource="", emails=[ "Margaret94@gmail.com", diff --git a/tests/test_insights.py b/tests/test_insights.py index 43734ebe..301907d8 100644 --- a/tests/test_insights.py +++ b/tests/test_insights.py @@ -12,10 +12,10 @@ def test_insights_insights(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.insights.retrieve( + res = glean.client.insights.retrieve( categories=[ models.InsightsRequestCategory.CONTENT, models.InsightsRequestCategory.CONTENT, diff --git a/tests/test_messages.py b/tests/test_messages.py index 75f65e17..88279ce0 100644 --- a/tests/test_messages.py +++ b/tests/test_messages.py @@ -12,10 +12,10 @@ def test_messages_messages(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.messages.retrieve( + res = glean.client.messages.retrieve( id_type=models.IDType.CONVERSATION_ID, id="", timestamp_millis=558834 ) assert res is not None diff --git a/tests/test_people.py b/tests/test_people.py index de6db47e..c64882ef 100644 --- a/tests/test_people.py +++ b/tests/test_people.py @@ -14,7 +14,7 @@ def test_people_post_api_index_v1_processallemployeesandteams(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - g_client.indexing.people.process_all_employees_and_teams() + glean.indexing.people.process_all_employees_and_teams() diff --git a/tests/test_pins.py b/tests/test_pins.py index 89108fbf..6f6cb1cf 100644 --- a/tests/test_pins.py +++ b/tests/test_pins.py @@ -12,10 +12,10 @@ def test_pins_editpin(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.pins.update( + res = glean.client.pins.update( audience_filters=[ { "field_name": "type", @@ -42,10 +42,10 @@ def test_pins_getpin(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.pins.retrieve() + res = glean.client.pins.retrieve() assert res is not None @@ -56,10 +56,10 @@ def test_pins_listpins(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.pins.list(request={}) + res = glean.client.pins.list(request={}) assert res is not None @@ -70,10 +70,10 @@ def test_pins_pin(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.pins.create( + res = glean.client.pins.create( audience_filters=[ { "field_name": "type", @@ -100,7 +100,7 @@ def test_pins_unpin(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - g_client.client.pins.remove() + glean.client.pins.remove() diff --git a/tests/test_policies.py b/tests/test_policies.py index 26bd810f..60925b97 100644 --- a/tests/test_policies.py +++ b/tests/test_policies.py @@ -13,10 +13,10 @@ def test_policies_getpolicy(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.governance.data.policies.retrieve(id="") + res = glean.client.governance.data.policies.retrieve(id="") assert res is not None @@ -48,8 +48,8 @@ def test_policies_listpolicies(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.governance.data.policies.list() + res = glean.client.governance.data.policies.list() assert res is not None diff --git a/tests/test_search.py b/tests/test_search.py index 154fee57..02cb6dbb 100644 --- a/tests/test_search.py +++ b/tests/test_search.py @@ -15,10 +15,10 @@ def test_search_adminsearch(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.search.query_as_admin( + res = glean.client.search.query_as_admin( query="vacation policy", tracking_token="trackingToken", source_document=models.Document( @@ -143,10 +143,10 @@ def test_search_autocomplete(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.search.autocomplete( + res = glean.client.search.autocomplete( tracking_token="trackingToken", query="San Fra", datasource="GDRIVE", @@ -171,10 +171,10 @@ def test_search_feed(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.search.retrieve_feed(timeout_millis=5000) + res = glean.client.search.retrieve_feed(timeout_millis=5000) assert res is not None @@ -199,10 +199,10 @@ def test_search_recommendations(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.search.recommendations( + res = glean.client.search.recommendations( source_document=models.Document( metadata=models.DocumentMetadata( datasource="datasource", @@ -2097,10 +2097,10 @@ def test_search_search(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.search.query( + res = glean.client.search.query( query="vacation policy", tracking_token="trackingToken", source_document=models.Document( diff --git a/tests/test_summarize.py b/tests/test_summarize.py index d533cc4a..883c2b6f 100644 --- a/tests/test_summarize.py +++ b/tests/test_summarize.py @@ -12,10 +12,10 @@ def test_summarize_summarize(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.documents.summarize( + res = glean.client.documents.summarize( document_specs=[ {}, {}, diff --git a/tests/test_tools.py b/tests/test_tools.py index 57ea1190..1d25eef8 100644 --- a/tests/test_tools.py +++ b/tests/test_tools.py @@ -12,10 +12,10 @@ def test_tools_get_rest_api_v1_tools_list(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.tools.list() + res = glean.client.tools.list() assert res is not None @@ -26,10 +26,10 @@ def test_tools_post_rest_api_v1_tools_call(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.client.tools.run( + res = glean.client.tools.run( name="", parameters={ "key": { diff --git a/tests/test_troubleshooting.py b/tests/test_troubleshooting.py index 6dfd893b..f5051719 100644 --- a/tests/test_troubleshooting.py +++ b/tests/test_troubleshooting.py @@ -20,10 +20,10 @@ def test_troubleshooting_post_api_index_v1_checkdocumentaccess(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.indexing.documents.check_access( + res = glean.indexing.documents.check_access( datasource="", object_type="", doc_id="", @@ -39,10 +39,10 @@ def test_troubleshooting_post_api_index_v1_getdocumentstatus(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.indexing.documents.status( + res = glean.indexing.documents.status( datasource="", object_type="", doc_id="" ) assert res is not None @@ -55,10 +55,10 @@ def test_troubleshooting_post_api_index_v1_getdocumentcount(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.indexing.documents.count(datasource="") + res = glean.indexing.documents.count(datasource="") assert res is not None @@ -69,8 +69,8 @@ def test_troubleshooting_post_api_index_v1_getusercount(): server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), client=test_http_client, api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as g_client: - assert g_client is not None + ) as glean: + assert glean is not None - res = g_client.indexing.people.count(datasource="") + res = glean.indexing.people.count(datasource="") assert res is not None