From 6c693d2d662ca478763e384877c0b25499de0f3d Mon Sep 17 00:00:00 2001 From: jiashuoz Date: Fri, 11 Sep 2026 11:10:48 -0700 Subject: [PATCH 1/3] feat(sdk)!: catch up to the current AgentDrive contract, `state` filter included The vendored contract was AgentDrive's pre-port snapshot: compatibility policy 1, 34 paths, imported from a repository that has not hosted the file since the 2026-08-29 monorepo port. The live contract is policy 2 with 44 paths, so the SDKs were ten operations behind before this change and the importer could not read the current file at all -- it asserted policy == 1 and pointed `source_repository` / `source_path` at the old coordinates. Three fixes make the import possible, then the regeneration carries everything at once: * `SOURCE_REPOSITORY` / `SOURCE_PATH` now name tokencanopy/tokencanopy and apps/drive/tests/openapi.golden.json, so a provenance record points at a file that exists. * The policy assertion is pinned to `SUPPORTED_POLICY_VERSION = 2` rather than loosened to a floor. A bump is AgentDrive changing the rules its contract is judged by; that is a decision to read, not to absorb. * Regenerated python/typescript/go from the merged contract (tokencanopy/tokencanopy@100aa364) with the pinned generator image. The hand-written facades follow the renamed filter: `drives.list`, `folders.list`, `artifacts.list`, `grants.list` and `shares.list` take `state` where they took `lifecycle`, matching the query parameter the generated clients now send. That rename is a BREAKING change for any caller passing the option; the API rejects the old spelling outright, so an SDK that kept it would only fail later and less clearly. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01AiYiPkSwvRWDfthQUtx11Q --- scripts/import_agentdrive_contract.py | 19 +- sdk/go/README.md | 3 + sdk/go/api/openapi.yaml | 322 +++++++++++++-- sdk/go/api_artifacts.go | 14 +- sdk/go/api_changes.go | 22 ++ sdk/go/api_discovery.go | 2 +- sdk/go/api_drives.go | 20 +- sdk/go/api_folders.go | 14 +- sdk/go/api_grants.go | 12 +- sdk/go/api_navigation.go | 3 + sdk/go/api_shares.go | 12 +- sdk/go/docs/ArtifactsAPI.md | 8 +- sdk/go/docs/ChangesAPI.md | 6 +- sdk/go/docs/DriveUsageOut.md | 44 ++- sdk/go/docs/DrivesAPI.md | 8 +- sdk/go/docs/EffectiveLimitsOut.md | 112 ++++++ sdk/go/docs/FoldersAPI.md | 8 +- sdk/go/docs/GrantCreateIn.md | 2 +- sdk/go/docs/GrantsAPI.md | 8 +- sdk/go/docs/SharesAPI.md | 8 +- sdk/go/docs/UsageMeterOut.md | 164 ++++++++ sdk/go/docs/UsageMetersOut.md | 112 ++++++ sdk/go/model_drive_usage_out.go | 58 ++- sdk/go/model_effective_limits_out.go | 240 ++++++++++++ sdk/go/model_grant_create_in.go | 2 +- sdk/go/model_usage_meter_out.go | 299 ++++++++++++++ sdk/go/model_usage_meters_out.go | 240 ++++++++++++ sdk/openapi.json | 365 ++++++++++++++---- sdk/openapi.provenance.json | 8 +- .../agentdrive_sdk/generated/__init__.py | 6 + .../generated/api/artifacts_api.py | 36 +- .../generated/api/changes_api.py | 23 +- .../generated/api/discovery_api.py | 6 +- .../generated/api/drives_api.py | 42 +- .../generated/api/folders_api.py | 36 +- .../generated/api/grants_api.py | 30 +- .../generated/api/navigation_api.py | 6 +- .../generated/api/shares_api.py | 30 +- .../generated/models/__init__.py | 3 + .../generated/models/change_actor_out.py | 4 +- .../generated/models/drive_usage_out.py | 21 +- .../generated/models/effective_limits_out.py | 91 +++++ .../generated/models/error_response_error.py | 4 +- .../generated/models/grant_create_in.py | 6 +- .../generated/models/grant_out.py | 4 +- .../generated/models/usage_meter_out.py | 109 ++++++ .../generated/models/usage_meters_out.py | 104 +++++ sdk/python/agentdrive_sdk/resources.py | 16 +- sdk/typescript/src/facade/resources.ts | 40 +- .../src/generated/apis/ArtifactsApi.ts | 10 +- .../src/generated/apis/ChangesApi.ts | 17 +- .../src/generated/apis/DiscoveryApi.ts | 4 +- .../src/generated/apis/DrivesApi.ts | 14 +- .../src/generated/apis/FoldersApi.ts | 10 +- .../src/generated/apis/GrantsApi.ts | 6 +- .../src/generated/apis/NavigationApi.ts | 4 +- .../src/generated/apis/SharesApi.ts | 6 +- .../src/generated/models/ChangeActorOut.ts | 1 + .../src/generated/models/DriveUsageOut.ts | 33 ++ .../generated/models/EffectiveLimitsOut.ts | 92 +++++ .../generated/models/ErrorResponseError.ts | 1 + .../src/generated/models/GrantCreateIn.ts | 3 +- .../src/generated/models/GrantOut.ts | 1 + .../src/generated/models/UsageMeterOut.ts | 123 ++++++ .../src/generated/models/UsageMetersOut.ts | 100 +++++ sdk/typescript/src/generated/models/index.ts | 3 + tests/test_import_contract.py | 10 +- 67 files changed, 2838 insertions(+), 352 deletions(-) create mode 100644 sdk/go/docs/EffectiveLimitsOut.md create mode 100644 sdk/go/docs/UsageMeterOut.md create mode 100644 sdk/go/docs/UsageMetersOut.md create mode 100644 sdk/go/model_effective_limits_out.go create mode 100644 sdk/go/model_usage_meter_out.go create mode 100644 sdk/go/model_usage_meters_out.go create mode 100644 sdk/python/agentdrive_sdk/generated/models/effective_limits_out.py create mode 100644 sdk/python/agentdrive_sdk/generated/models/usage_meter_out.py create mode 100644 sdk/python/agentdrive_sdk/generated/models/usage_meters_out.py create mode 100644 sdk/typescript/src/generated/models/EffectiveLimitsOut.ts create mode 100644 sdk/typescript/src/generated/models/UsageMeterOut.ts create mode 100644 sdk/typescript/src/generated/models/UsageMetersOut.ts diff --git a/scripts/import_agentdrive_contract.py b/scripts/import_agentdrive_contract.py index 640ef35..a10e451 100644 --- a/scripts/import_agentdrive_contract.py +++ b/scripts/import_agentdrive_contract.py @@ -12,14 +12,19 @@ "url": "https://drive.tokencanopy.com", "description": "AgentDrive canonical production API", } -SOURCE_REPOSITORY = "https://github.com/tokencanopy/agentdrive" -SOURCE_PATH = "tests/openapi.golden.json" +# AgentDrive's source moved into the tokencanopy monorepo in the 2026-08-29 +# port; the contract it publishes moved with it. The old coordinates named a +# repository that no longer hosts the file, so every provenance record +# written after the port pointed at nothing. +SOURCE_REPOSITORY = "https://github.com/tokencanopy/tokencanopy" +SOURCE_PATH = "apps/drive/tests/openapi.golden.json" GENERATOR_IMAGE = ( Path(__file__).resolve().parents[1] / "sdk/openapi-generator-image.txt" ).read_text(encoding="utf-8").strip() HTTP_METHODS = frozenset( {"get", "put", "post", "delete", "patch", "head", "options", "trace"} ) +SUPPORTED_POLICY_VERSION = 2 class ContractImportError(ValueError): @@ -27,8 +32,14 @@ class ContractImportError(ValueError): def _validate(document: Dict[str, Any]) -> None: - if document.get("x-agentdrive-compatibility-policy") != 1: - raise ContractImportError("source contract lacks compatibility policy version 1") + # Pinned to the policy the importer understands, not to a floor: a bump + # is AgentDrive changing the rules its contract is judged by, which is a + # decision to read before the SDK carries the contract downstream. + if document.get("x-agentdrive-compatibility-policy") != SUPPORTED_POLICY_VERSION: + raise ContractImportError( + "source contract is not compatibility policy version " + f"{SUPPORTED_POLICY_VERSION}" + ) if document.get("servers") != [""]: raise ContractImportError("source contract lacks the deployment-derived server sentinel") diff --git a/sdk/go/README.md b/sdk/go/README.md index c001399..0e6defd 100644 --- a/sdk/go/README.md +++ b/sdk/go/README.md @@ -170,6 +170,7 @@ Class | Method | HTTP request | Description - [DriveUpdateIn](docs/DriveUpdateIn.md) - [DriveUsageOut](docs/DriveUsageOut.md) - [EditabilityOut](docs/EditabilityOut.md) + - [EffectiveLimitsOut](docs/EffectiveLimitsOut.md) - [EntriesInner](docs/EntriesInner.md) - [EntryListOut](docs/EntryListOut.md) - [ErrorResponse](docs/ErrorResponse.md) @@ -219,6 +220,8 @@ Class | Method | HTTP request | Description - [UploadsCreateRequestTarget](docs/UploadsCreateRequestTarget.md) - [UploadsCreateRequestTargetOneOf](docs/UploadsCreateRequestTargetOneOf.md) - [UploadsCreateRequestTargetOneOf1](docs/UploadsCreateRequestTargetOneOf1.md) + - [UsageMeterOut](docs/UsageMeterOut.md) + - [UsageMetersOut](docs/UsageMetersOut.md) - [V0ErrorEnvelope](docs/V0ErrorEnvelope.md) - [ValidationErrorResponse](docs/ValidationErrorResponse.md) - [ValidationErrorResponseError](docs/ValidationErrorResponseError.md) diff --git a/sdk/go/api/openapi.yaml b/sdk/go/api/openapi.yaml index c1b8eac..c6bd364 100644 --- a/sdk/go/api/openapi.yaml +++ b/sdk/go/api/openapi.yaml @@ -31,11 +31,11 @@ paths: - discovery /.well-known/oauth-protected-resource/mcp: get: - description: "Path-inserted protected-resource metadata used by MCP OAuth clients.\ - \ Served by the MCP sidecar when one is configured, because it is the authority\ - \ on the scope bundle its own tools require; otherwise it falls back to the\ - \ resource-root document, since `/v0` and `/mcp` share AgentDrive's canonical\ - \ audience." + description: "Path-inserted protected-resource metadata for the hosted MCP transport.\ + \ It names a DIFFERENT resource from the root document — `/mcp`, with\ + \ the separately maintained MCP scope list — and is served by the MCP sidecar,\ + \ which is the authority on its own tool set. Deployments with no sidecar\ + \ answer 404: there is no `/mcp` resource to describe." operationId: oauth_protected_resource_mcp responses: "200": @@ -139,18 +139,18 @@ paths: description: |- List the actor's workspace drives, newest-first (keyset paginated). - ``lifecycle`` (active|deleted|all) exposes soft-deleted drives so a + ``state`` (active|deleted|all) exposes soft-deleted drives so a manager can read the post-delete revision as the If-Match source for a restore. Unknown query parameters are rejected (§6.3). operationId: drives_list parameters: - explode: true in: query - name: lifecycle + name: state required: false schema: default: active - title: Lifecycle + title: State type: string style: form - explode: true @@ -318,6 +318,7 @@ paths: - drives x-required-scopes: - drives:read + x-stability-level: beta post: description: |- Create a drive with its structural root folder and creator-manager @@ -545,6 +546,7 @@ paths: - drives x-required-scopes: - drives:write + x-stability-level: beta /v0/drives/{drive_id}: delete: description: |- @@ -776,6 +778,7 @@ paths: - drives x-required-scopes: - drives:write + x-stability-level: beta get: description: |- Read one active drive. ETag = quoted revision; matching @@ -967,6 +970,7 @@ paths: - drives x-required-scopes: - drives:read + x-stability-level: beta patch: description: |- Rename / update a drive's metadata. Requires ``Idempotency-Key`` and @@ -1203,12 +1207,13 @@ paths: - drives x-required-scopes: - drives:write + x-stability-level: beta /v0/drives/{drive_id}/artifacts: get: description: |- List the drive's artifacts, newest-first (keyset paginated). - ``lifecycle`` (active|deleted|all) exposes soft-deleted artifacts. + ``state`` (active|deleted|all) exposes soft-deleted artifacts. ``parent_id`` / ``name`` / ``content_type`` / ``label`` are exact-match filters; ``updated_after`` / ``updated_before`` are inclusive bounds. Unknown query parameters are rejected. @@ -1224,11 +1229,11 @@ paths: style: simple - explode: true in: query - name: lifecycle + name: state required: false schema: default: active - title: Lifecycle + title: State type: string style: form - explode: true @@ -1452,6 +1457,7 @@ paths: - artifacts x-required-scopes: - content:read + x-stability-level: beta post: description: |- Create one artifact with inline content — multipart only. @@ -1715,6 +1721,7 @@ paths: - artifacts x-required-scopes: - content:write + x-stability-level: beta /v0/drives/{drive_id}/artifacts/{artifact_id}: delete: description: Soft-delete one artifact (its versions stay). @@ -1952,6 +1959,7 @@ paths: - artifacts x-required-scopes: - content:write + x-stability-level: beta get: description: Read one active artifact. ``If-None-Match`` short-circuits to 304. operationId: artifacts_read @@ -2149,6 +2157,7 @@ paths: - artifacts x-required-scopes: - content:read + x-stability-level: beta patch: description: Rename / move / set metadata or labels. At least one field required. operationId: artifacts_update @@ -2391,6 +2400,7 @@ paths: - artifacts x-required-scopes: - content:write + x-stability-level: beta /v0/drives/{drive_id}/artifacts/{artifact_id}/cells: get: description: |- @@ -2629,6 +2639,7 @@ paths: - sheets x-required-scopes: - content:read + x-stability-level: beta /v0/drives/{drive_id}/artifacts/{artifact_id}/content: get: description: Download the head version's bytes — stream or 307 signed URL. @@ -2838,6 +2849,7 @@ paths: - artifacts x-required-scopes: - content:read + x-stability-level: beta /v0/drives/{drive_id}/artifacts/{artifact_id}/copy: post: description: |- @@ -3097,6 +3109,7 @@ paths: x-required-scopes: - content:read - content:write + x-stability-level: beta /v0/drives/{drive_id}/artifacts/{artifact_id}/restore: post: description: Restore a soft-deleted artifact atomically. @@ -3334,6 +3347,7 @@ paths: - artifacts x-required-scopes: - content:write + x-stability-level: beta /v0/drives/{drive_id}/artifacts/{artifact_id}/sheet-sessions: get: description: |- @@ -3535,6 +3549,7 @@ paths: - sheets x-required-scopes: - content:read + x-stability-level: beta post: description: |- Open an edit session. `If-Match` on the artifact head is required and @@ -3775,6 +3790,7 @@ paths: - sheets x-required-scopes: - content:write + x-stability-level: beta /v0/drives/{drive_id}/artifacts/{artifact_id}/sheet-sessions/{session_id}: delete: description: Abandon a session. Nothing is published and the edits go with it. @@ -4008,6 +4024,7 @@ paths: - sheets x-required-scopes: - content:write + x-stability-level: beta get: description: |- One session. Reads deliberately do NOT extend the lease, so a polling @@ -4203,6 +4220,7 @@ paths: - sheets x-required-scopes: - content:read + x-stability-level: beta /v0/drives/{drive_id}/artifacts/{artifact_id}/sheet-sessions/{session_id}/cells: get: description: |- @@ -4399,6 +4417,7 @@ paths: - sheets x-required-scopes: - content:read + x-stability-level: beta post: description: |- Append range writes to the edit log. @@ -4635,6 +4654,7 @@ paths: - sheets x-required-scopes: - content:write + x-stability-level: beta /v0/drives/{drive_id}/artifacts/{artifact_id}/sheet-sessions/{session_id}/complete: post: description: |- @@ -4888,6 +4908,7 @@ paths: - sheets x-required-scopes: - content:write + x-stability-level: beta /v0/drives/{drive_id}/artifacts/{artifact_id}/sheet-sessions/{session_id}/edits: get: description: |- @@ -5084,6 +5105,7 @@ paths: - sheets x-required-scopes: - content:read + x-stability-level: beta /v0/drives/{drive_id}/artifacts/{artifact_id}/sheets: get: description: |- @@ -5304,6 +5326,7 @@ paths: - sheets x-required-scopes: - content:read + x-stability-level: beta /v0/drives/{drive_id}/artifacts/{artifact_id}/versions: get: description: "List the artifact's version trail, newest first (ordinal DESC)." @@ -5490,6 +5513,7 @@ paths: - versions x-required-scopes: - content:read + x-stability-level: beta post: description: |- Append one immutable version and rotate the artifact head. @@ -5769,6 +5793,7 @@ paths: - versions x-required-scopes: - content:write + x-stability-level: beta /v0/drives/{drive_id}/artifacts/{artifact_id}/versions/{version_id}: get: description: Read one immutable version. @@ -5975,6 +6000,7 @@ paths: - versions x-required-scopes: - content:read + x-stability-level: beta /v0/drives/{drive_id}/artifacts/{artifact_id}/versions/{version_id}/cells: get: description: |- @@ -6220,6 +6246,7 @@ paths: - sheets x-required-scopes: - content:read + x-stability-level: beta /v0/drives/{drive_id}/artifacts/{artifact_id}/versions/{version_id}/content: get: description: Download one version's immutable bytes — stream or 307. @@ -6437,6 +6464,7 @@ paths: - versions x-required-scopes: - content:read + x-stability-level: beta /v0/drives/{drive_id}/artifacts/{artifact_id}/versions/{version_id}/restore: post: description: Restore a historical version as a NEW head version (no byte copy). @@ -6689,6 +6717,7 @@ paths: - versions x-required-scopes: - content:write + x-stability-level: beta /v0/drives/{drive_id}/artifacts/{artifact_id}/versions/{version_id}/sheets: get: description: |- @@ -6916,6 +6945,7 @@ paths: - sheets x-required-scopes: - content:read + x-stability-level: beta /v0/drives/{drive_id}/artifacts/{artifact_id}/viewer-sessions: post: description: |- @@ -7149,6 +7179,19 @@ paths: description: |- Pull one page of changes. Exactly one of ``start`` or ``cursor``. + ``order`` selects the direction of the walk and accompanies ``start``, never + a ``cursor`` — a cursor already carries the direction it was minted for, so + repeating it could only ever contradict it. + + ``oldest`` (the default) is the resumable sync walk: forward from the + position, and a drained cursor re-presented later picks up what committed + since. ``newest`` is a browse walk for a history screen: it captures the + head and walks down toward the retention floor, newest row first. Because + new events land ABOVE a captured head, a drained descending cursor stays + drained — a reader checking for new activity captures the head again. That + is also why ``order=newest`` takes only ``start=now``: ``beginning`` names + the far end of a walk that already ends there. + ``type`` is an optional comma-separated allow-list of exact event-type strings (e.g. ``type=folder.created,artifact.updated`` for content only, or ``type=grant.created,grant.updated,grant.revoked`` for grant events). A @@ -7207,6 +7250,18 @@ paths: title: Type type: string style: form + - explode: true + in: query + name: order + required: false + schema: + enum: + - oldest + - newest + nullable: true + title: Order + type: string + style: form - deprecated: true description: "Deprecated: redundant with the operation's `bearerAuth` security\ \ requirement, which is how a generated client should learn to authenticate.\ @@ -7371,6 +7426,7 @@ paths: - changes x-required-scopes: - changes:read + x-stability-level: beta /v0/drives/{drive_id}/download-capabilities: post: description: |- @@ -7576,9 +7632,14 @@ paths: - downloads x-required-scopes: - content:read + x-stability-level: beta /v0/drives/{drive_id}/entries: get: - description: List one folder's direct children across the shared namespace. + description: |- + List one folder's direct children across the shared namespace. + + ``state`` (active|deleted|all) exposes soft-deleted entries, matching + every other v0 collection. Unknown query parameters are rejected. operationId: entries_list parameters: - explode: false @@ -7827,12 +7888,13 @@ paths: - navigation x-required-scopes: - content:read + x-stability-level: beta /v0/drives/{drive_id}/folders: get: description: |- List the drive's folders, newest-first (keyset paginated). - ``lifecycle`` (active|deleted|all) exposes soft-deleted folders so the + ``state`` (active|deleted|all) exposes soft-deleted folders so the post-delete revision can be read as the If-Match source for a restore. ``parent_id`` / ``name`` are exact-match filters. Unknown query parameters are rejected (§6.3). @@ -7848,11 +7910,11 @@ paths: style: simple - explode: true in: query - name: lifecycle + name: state required: false schema: default: active - title: Lifecycle + title: State type: string style: form - explode: true @@ -8038,6 +8100,7 @@ paths: - folders x-required-scopes: - content:read + x-stability-level: beta post: description: |- Create one folder under `parent_id`; idempotent under the @@ -8273,6 +8336,7 @@ paths: - folders x-required-scopes: - content:write + x-stability-level: beta /v0/drives/{drive_id}/folders/{folder_id}: delete: description: |- @@ -8524,6 +8588,7 @@ paths: - folders x-required-scopes: - content:write + x-stability-level: beta get: description: |- Read one active folder. ETag = quoted revision; matching @@ -8723,6 +8788,7 @@ paths: - folders x-required-scopes: - content:read + x-stability-level: beta patch: description: |- Rename / move / update a folder's metadata. Requires @@ -8968,6 +9034,7 @@ paths: - folders x-required-scopes: - content:write + x-stability-level: beta /v0/drives/{drive_id}/folders/{folder_id}/copy: post: description: |- @@ -9229,6 +9296,7 @@ paths: x-required-scopes: - content:read - content:write + x-stability-level: beta /v0/drives/{drive_id}/folders/{folder_id}/restore: post: description: |- @@ -9469,6 +9537,7 @@ paths: - folders x-required-scopes: - content:write + x-stability-level: beta /v0/drives/{drive_id}/grants: get: description: |- @@ -9508,11 +9577,11 @@ paths: style: simple - explode: true in: query - name: lifecycle + name: state required: false schema: default: active - title: Lifecycle + title: State type: string style: form - explode: true @@ -9707,6 +9776,7 @@ paths: - grants x-required-scopes: - sharing:read + x-stability-level: beta post: description: "Grant one principal a role on a drive, folder, or artifact." operationId: grants_create @@ -9940,6 +10010,7 @@ paths: - grants x-required-scopes: - sharing:write + x-stability-level: beta /v0/drives/{drive_id}/grants/{grant_id}: delete: description: "Revoke a grant (soft, sets revoked_at) under If-Match." @@ -10177,6 +10248,7 @@ paths: - grants x-required-scopes: - sharing:write + x-stability-level: beta get: description: Read one grant in the drive. operationId: grants_read @@ -10374,6 +10446,7 @@ paths: - grants x-required-scopes: - sharing:read + x-stability-level: beta patch: description: Change a grant's role or expiry under If-Match. operationId: grants_update @@ -10616,6 +10689,7 @@ paths: - grants x-required-scopes: - sharing:write + x-stability-level: beta /v0/drives/{drive_id}/lookup: get: description: Resolve a complete root-relative path to one stable resource id. @@ -10793,6 +10867,7 @@ paths: - navigation x-required-scopes: - content:read + x-stability-level: beta /v0/drives/{drive_id}/restore: post: description: |- @@ -11024,6 +11099,7 @@ paths: - drives x-required-scopes: - drives:write + x-stability-level: beta /v0/drives/{drive_id}/search: get: description: |- @@ -11282,6 +11358,7 @@ paths: - search x-required-scopes: - content:read + x-stability-level: beta /v0/drives/{drive_id}/shares: get: description: |- @@ -11306,11 +11383,11 @@ paths: style: simple - explode: true in: query - name: lifecycle + name: state required: false schema: default: active - title: Lifecycle + title: State type: string style: form - explode: true @@ -11496,6 +11573,7 @@ paths: - shares x-required-scopes: - sharing:read + x-stability-level: beta post: description: |- Mint a read-only bearer link. The response carries the plaintext @@ -11731,6 +11809,7 @@ paths: - shares x-required-scopes: - sharing:write + x-stability-level: beta /v0/drives/{drive_id}/shares/{share_id}: delete: description: "Revoke a share (soft, sets revoked_at) under If-Match." @@ -11968,6 +12047,7 @@ paths: - shares x-required-scopes: - sharing:write + x-stability-level: beta get: description: Read one share's management representation (no secret). operationId: shares_read @@ -12165,6 +12245,7 @@ paths: - shares x-required-scopes: - sharing:read + x-stability-level: beta /v0/drives/{drive_id}/shares/{share_id}/rotate: post: description: |- @@ -12404,6 +12485,7 @@ paths: - shares x-required-scopes: - sharing:write + x-stability-level: beta /v0/drives/{drive_id}/uploads: post: description: |- @@ -12711,6 +12793,7 @@ paths: - uploads x-required-scopes: - content:write + x-stability-level: beta /v0/drives/{drive_id}/uploads/{upload_id}: delete: description: |- @@ -12966,6 +13049,7 @@ paths: - uploads x-required-scopes: - content:write + x-stability-level: beta get: description: |- Non-secret recovery state (§5.3). Never a target, coordinate, @@ -13181,6 +13265,7 @@ paths: - uploads x-required-scopes: - content:write + x-stability-level: beta /v0/drives/{drive_id}/uploads/{upload_id}/complete: post: description: |- @@ -13454,12 +13539,13 @@ paths: - uploads x-required-scopes: - content:write + x-stability-level: beta /v0/drives/{drive_id}/usage: get: description: |- - Byte counters for one active drive: storage is the live sum of its - versions' sizes; retrieval reads the counter the content-read slice - maintains (0 until it lands). + Usage counters, current storage and download meters, and the effective + file/share limits for one active drive. The snapshot includes committed + and reserved bytes so clients can show capacity already in flight. operationId: drives_usage parameters: - explode: false @@ -13617,6 +13703,7 @@ paths: - drives x-required-scopes: - usage:read + x-stability-level: beta components: schemas: ArtifactCopyIn: @@ -13995,6 +14082,7 @@ components: enum: - agent - user + - service - system title: Type type: string @@ -14416,17 +14504,60 @@ components: title: DriveUpdateIn type: object DriveUsageOut: + additionalProperties: false example: - storage_bytes: 6 + effective_limits: + share_default_ttl_seconds: 1 + share_max_ttl_seconds: 5 + max_file_bytes: 0 + max_inline_file_bytes: 6 + storage_bytes: 0 + meters: + workspace_storage: + reserved: 0 + scope: workspace + limit: 5 + used: 0 + reset_at: 2000-01-23T04:56:07.000+00:00 + remaining: 0 + workspace_download_day: + reserved: 0 + scope: workspace + limit: 5 + used: 0 + reset_at: 2000-01-23T04:56:07.000+00:00 + remaining: 0 + drive_storage: + reserved: 0 + scope: workspace + limit: 5 + used: 0 + reset_at: 2000-01-23T04:56:07.000+00:00 + remaining: 0 + workspace_download_month: + reserved: 0 + scope: workspace + limit: 5 + used: 0 + reset_at: 2000-01-23T04:56:07.000+00:00 + remaining: 0 retrieval_bytes: 0 properties: + effective_limits: + $ref: "#/components/schemas/EffectiveLimitsOut" + meters: + $ref: "#/components/schemas/UsageMetersOut" retrieval_bytes: + minimum: 0.0 title: Retrieval Bytes type: integer storage_bytes: + minimum: 0.0 title: Storage Bytes type: integer required: + - effective_limits + - meters - retrieval_bytes - storage_bytes title: DriveUsageOut @@ -14450,6 +14581,33 @@ components: - status title: EditabilityOut type: object + EffectiveLimitsOut: + additionalProperties: false + example: + share_default_ttl_seconds: 1 + share_max_ttl_seconds: 5 + max_file_bytes: 0 + max_inline_file_bytes: 6 + properties: + max_file_bytes: + title: Max File Bytes + type: integer + max_inline_file_bytes: + title: Max Inline File Bytes + type: integer + share_default_ttl_seconds: + title: Share Default Ttl Seconds + type: integer + share_max_ttl_seconds: + title: Share Max Ttl Seconds + type: integer + required: + - max_file_bytes + - max_inline_file_bytes + - share_default_ttl_seconds + - share_max_ttl_seconds + title: EffectiveLimitsOut + type: object EntryListOut: example: entries: @@ -14786,15 +14944,16 @@ components: title: Expires At type: string principal_id: - description: "Required for `agent`, `user`, and `workspace`; omitted only\ - \ for `public`. For `agent` and `user` it is checked against that type's\ - \ id prefix (`tcagt_` / `tcusr_`) and a mismatch is `422 VALIDATION_ERROR`.\ - \ The prefix is all AgentDrive asserts: these ids are minted by Hub, so\ - \ their full shape is not AgentDrive's to enforce, and a well-formed id\ - \ naming a principal that does not exist — or belongs to another workspace\ - \ — is accepted here and simply never matches a token. The rule is conditional\ - \ on `principal_type`, so it is enforced at the boundary rather than expressible\ - \ as one JSON Schema `pattern`." + description: "Required for `agent`, `user`, `service`, and `workspace`;\ + \ omitted only for `public`. For `agent`, `user`, and `service` it is\ + \ checked against that type's id prefix (`tcagt_` / `tcusr_` / `tcsvc_`)\ + \ and a mismatch is `422 VALIDATION_ERROR`. The prefix is all AgentDrive\ + \ asserts: these ids are minted by Hub, so their full shape is not AgentDrive's\ + \ to enforce, and a well-formed id naming a principal that does not exist\ + \ — or belongs to another workspace — is accepted here and simply never\ + \ matches a token. The rule is conditional on `principal_type`, so it\ + \ is enforced at the boundary rather than expressible as one JSON Schema\ + \ `pattern`." nullable: true title: Principal Id type: string @@ -14802,6 +14961,7 @@ components: enum: - agent - user + - service - workspace - public title: Principal Type @@ -14914,6 +15074,7 @@ components: enum: - agent - user + - service - workspace - public title: Principal Type @@ -15995,6 +16156,100 @@ components: - transfer title: UploadWithTransferOut type: object + UsageMeterOut: + additionalProperties: false + example: + reserved: 0 + scope: workspace + limit: 5 + used: 0 + reset_at: 2000-01-23T04:56:07.000+00:00 + remaining: 0 + properties: + limit: + title: Limit + type: integer + remaining: + minimum: 0.0 + title: Remaining + type: integer + reserved: + minimum: 0.0 + title: Reserved + type: integer + reset_at: + format: date-time + nullable: true + title: Reset At + type: string + scope: + enum: + - workspace + - drive + - principal + - share + title: Scope + type: string + used: + minimum: 0.0 + title: Used + type: integer + required: + - limit + - remaining + - reserved + - reset_at + - scope + - used + title: UsageMeterOut + type: object + UsageMetersOut: + additionalProperties: false + example: + workspace_storage: + reserved: 0 + scope: workspace + limit: 5 + used: 0 + reset_at: 2000-01-23T04:56:07.000+00:00 + remaining: 0 + workspace_download_day: + reserved: 0 + scope: workspace + limit: 5 + used: 0 + reset_at: 2000-01-23T04:56:07.000+00:00 + remaining: 0 + drive_storage: + reserved: 0 + scope: workspace + limit: 5 + used: 0 + reset_at: 2000-01-23T04:56:07.000+00:00 + remaining: 0 + workspace_download_month: + reserved: 0 + scope: workspace + limit: 5 + used: 0 + reset_at: 2000-01-23T04:56:07.000+00:00 + remaining: 0 + properties: + drive_storage: + $ref: "#/components/schemas/UsageMeterOut" + workspace_download_day: + $ref: "#/components/schemas/UsageMeterOut" + workspace_download_month: + $ref: "#/components/schemas/UsageMeterOut" + workspace_storage: + $ref: "#/components/schemas/UsageMeterOut" + required: + - drive_storage + - workspace_download_day + - workspace_download_month + - workspace_storage + title: UsageMetersOut + type: object V0ErrorEnvelope: example: error: @@ -16551,6 +16806,7 @@ components: - AUTHENTICATION_REQUIRED - AUTH_UNAVAILABLE - BAD_REQUEST + - BANDWIDTH_LIMIT_EXCEEDED - CHANGE_CURSOR_EXPIRED - CHECKSUM_MISMATCH - CONFLICT @@ -16681,4 +16937,4 @@ components: \ (RFC 9728)." scheme: bearer type: http -x-agentdrive-compatibility-policy: 1 +x-agentdrive-compatibility-policy: 2 diff --git a/sdk/go/api_artifacts.go b/sdk/go/api_artifacts.go index 168873c..9ba2e73 100644 --- a/sdk/go/api_artifacts.go +++ b/sdk/go/api_artifacts.go @@ -1076,7 +1076,7 @@ type ApiArtifactsListRequest struct { ctx context.Context ApiService *ArtifactsAPIService driveId string - lifecycle *string + state *string limit *int32 cursor *string parentId *string @@ -1088,8 +1088,8 @@ type ApiArtifactsListRequest struct { authorization *string } -func (r ApiArtifactsListRequest) Lifecycle(lifecycle string) ApiArtifactsListRequest { - r.lifecycle = &lifecycle +func (r ApiArtifactsListRequest) State(state string) ApiArtifactsListRequest { + r.state = &state return r } @@ -1149,7 +1149,7 @@ ArtifactsList List Artifacts List the drive's artifacts, newest-first (keyset paginated). -``lifecycle`` (active|deleted|all) exposes soft-deleted artifacts. +``state`` (active|deleted|all) exposes soft-deleted artifacts. ``parent_id`` / ``name`` / ``content_type`` / ``label`` are exact-match filters; ``updated_after`` / ``updated_before`` are inclusive bounds. Unknown query parameters are rejected. @@ -1188,11 +1188,11 @@ func (a *ArtifactsAPIService) ArtifactsListExecute(r ApiArtifactsListRequest) (* localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.lifecycle != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "lifecycle", r.lifecycle, "form", "") + if r.state != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "state", r.state, "form", "") } else { var defaultValue string = "active" - r.lifecycle = &defaultValue + r.state = &defaultValue } if r.limit != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") diff --git a/sdk/go/api_changes.go b/sdk/go/api_changes.go index b7cfbd8..04e163a 100644 --- a/sdk/go/api_changes.go +++ b/sdk/go/api_changes.go @@ -31,6 +31,7 @@ type ApiChangesListRequest struct { start *string cursor *string type_ *string + order *string authorization *string } @@ -54,6 +55,11 @@ func (r ApiChangesListRequest) Type_(type_ string) ApiChangesListRequest { return r } +func (r ApiChangesListRequest) Order(order string) ApiChangesListRequest { + r.order = &order + return r +} + // Deprecated: redundant with the operation's `bearerAuth` security requirement, which is how a generated client should learn to authenticate. Scheduled for removal. // Deprecated func (r ApiChangesListRequest) Authorization(authorization string) ApiChangesListRequest { @@ -70,6 +76,19 @@ ChangesList List Changes Pull one page of changes. Exactly one of ``start`` or ``cursor``. +``order`` selects the direction of the walk and accompanies ``start``, never +a ``cursor`` — a cursor already carries the direction it was minted for, so +repeating it could only ever contradict it. + +``oldest`` (the default) is the resumable sync walk: forward from the +position, and a drained cursor re-presented later picks up what committed +since. ``newest`` is a browse walk for a history screen: it captures the +head and walks down toward the retention floor, newest row first. Because +new events land ABOVE a captured head, a drained descending cursor stays +drained — a reader checking for new activity captures the head again. That +is also why ``order=newest`` takes only ``start=now``: ``beginning`` names +the far end of a walk that already ends there. + ``type`` is an optional comma-separated allow-list of exact event-type strings (e.g. ``type=folder.created,artifact.updated`` for content only, or ``type=grant.created,grant.updated,grant.revoked`` for grant events). A @@ -126,6 +145,9 @@ func (a *ChangesAPIService) ChangesListExecute(r ApiChangesListRequest) (*Change if r.type_ != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "type", r.type_, "form", "") } + if r.order != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "order", r.order, "form", "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} diff --git a/sdk/go/api_discovery.go b/sdk/go/api_discovery.go index a6c5fc4..9cf18b4 100644 --- a/sdk/go/api_discovery.go +++ b/sdk/go/api_discovery.go @@ -133,7 +133,7 @@ func (r ApiOauthProtectedResourceMcpRequest) Execute() (map[string]interface{}, /* OauthProtectedResourceMcp Protected-resource metadata for the MCP endpoint (RFC 9728) -Path-inserted protected-resource metadata used by MCP OAuth clients. Served by the MCP sidecar when one is configured, because it is the authority on the scope bundle its own tools require; otherwise it falls back to the resource-root document, since `/v0` and `/mcp` share AgentDrive's canonical audience. +Path-inserted protected-resource metadata for the hosted MCP transport. It names a DIFFERENT resource from the root document — `/mcp`, with the separately maintained MCP scope list — and is served by the MCP sidecar, which is the authority on its own tool set. Deployments with no sidecar answer 404: there is no `/mcp` resource to describe. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiOauthProtectedResourceMcpRequest diff --git a/sdk/go/api_drives.go b/sdk/go/api_drives.go index a356b8e..b1125f1 100644 --- a/sdk/go/api_drives.go +++ b/sdk/go/api_drives.go @@ -511,14 +511,14 @@ func (a *DrivesAPIService) DrivesDeleteExecute(r ApiDrivesDeleteRequest) (*Drive type ApiDrivesListRequest struct { ctx context.Context ApiService *DrivesAPIService - lifecycle *string + state *string limit *int32 cursor *string authorization *string } -func (r ApiDrivesListRequest) Lifecycle(lifecycle string) ApiDrivesListRequest { - r.lifecycle = &lifecycle +func (r ApiDrivesListRequest) State(state string) ApiDrivesListRequest { + r.state = &state return r } @@ -548,7 +548,7 @@ DrivesList List Drives List the actor's workspace drives, newest-first (keyset paginated). -``lifecycle`` (active|deleted|all) exposes soft-deleted drives so a +``state`` (active|deleted|all) exposes soft-deleted drives so a manager can read the post-delete revision as the If-Match source for a restore. Unknown query parameters are rejected (§6.3). @@ -583,11 +583,11 @@ func (a *DrivesAPIService) DrivesListExecute(r ApiDrivesListRequest) (*DriveList localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.lifecycle != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "lifecycle", r.lifecycle, "form", "") + if r.state != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "state", r.state, "form", "") } else { var defaultValue string = "active" - r.lifecycle = &defaultValue + r.state = &defaultValue } if r.limit != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") @@ -1448,9 +1448,9 @@ func (r ApiDrivesUsageRequest) Execute() (*DriveUsageOut, *http.Response, error) /* DrivesUsage Drive Usage -Byte counters for one active drive: storage is the live sum of its -versions' sizes; retrieval reads the counter the content-read slice -maintains (0 until it lands). +Usage counters, current storage and download meters, and the effective +file/share limits for one active drive. The snapshot includes committed +and reserved bytes so clients can show capacity already in flight. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param driveId diff --git a/sdk/go/api_folders.go b/sdk/go/api_folders.go index 1cb7bcf..856efad 100644 --- a/sdk/go/api_folders.go +++ b/sdk/go/api_folders.go @@ -800,7 +800,7 @@ type ApiFoldersListRequest struct { ctx context.Context ApiService *FoldersAPIService driveId string - lifecycle *string + state *string limit *int32 cursor *string parentId *string @@ -808,8 +808,8 @@ type ApiFoldersListRequest struct { authorization *string } -func (r ApiFoldersListRequest) Lifecycle(lifecycle string) ApiFoldersListRequest { - r.lifecycle = &lifecycle +func (r ApiFoldersListRequest) State(state string) ApiFoldersListRequest { + r.state = &state return r } @@ -849,7 +849,7 @@ FoldersList List Folders List the drive's folders, newest-first (keyset paginated). -``lifecycle`` (active|deleted|all) exposes soft-deleted folders so the +``state`` (active|deleted|all) exposes soft-deleted folders so the post-delete revision can be read as the If-Match source for a restore. ``parent_id`` / ``name`` are exact-match filters. Unknown query parameters are rejected (§6.3). @@ -888,11 +888,11 @@ func (a *FoldersAPIService) FoldersListExecute(r ApiFoldersListRequest) (*Folder localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.lifecycle != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "lifecycle", r.lifecycle, "form", "") + if r.state != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "state", r.state, "form", "") } else { var defaultValue string = "active" - r.lifecycle = &defaultValue + r.state = &defaultValue } if r.limit != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") diff --git a/sdk/go/api_grants.go b/sdk/go/api_grants.go index 2759516..630db45 100644 --- a/sdk/go/api_grants.go +++ b/sdk/go/api_grants.go @@ -271,7 +271,7 @@ type ApiGrantsListRequest struct { ctx context.Context ApiService *GrantsAPIService driveId string - lifecycle *string + state *string limit *int32 cursor *string resourceType *string @@ -280,8 +280,8 @@ type ApiGrantsListRequest struct { authorization *string } -func (r ApiGrantsListRequest) Lifecycle(lifecycle string) ApiGrantsListRequest { - r.lifecycle = &lifecycle +func (r ApiGrantsListRequest) State(state string) ApiGrantsListRequest { + r.state = &state return r } @@ -383,11 +383,11 @@ func (a *GrantsAPIService) GrantsListExecute(r ApiGrantsListRequest) (*GrantList localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.lifecycle != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "lifecycle", r.lifecycle, "form", "") + if r.state != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "state", r.state, "form", "") } else { var defaultValue string = "active" - r.lifecycle = &defaultValue + r.state = &defaultValue } if r.limit != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") diff --git a/sdk/go/api_navigation.go b/sdk/go/api_navigation.go index 97b910c..357ec0d 100644 --- a/sdk/go/api_navigation.go +++ b/sdk/go/api_navigation.go @@ -107,6 +107,9 @@ EntriesList List Entries List one folder's direct children across the shared namespace. +``state`` (active|deleted|all) exposes soft-deleted entries, matching +every other v0 collection. Unknown query parameters are rejected. + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param driveId @return ApiEntriesListRequest diff --git a/sdk/go/api_shares.go b/sdk/go/api_shares.go index cc760f3..2f7de2e 100644 --- a/sdk/go/api_shares.go +++ b/sdk/go/api_shares.go @@ -272,7 +272,7 @@ type ApiSharesListRequest struct { ctx context.Context ApiService *SharesAPIService driveId string - lifecycle *string + state *string limit *int32 cursor *string resourceType *string @@ -280,8 +280,8 @@ type ApiSharesListRequest struct { authorization *string } -func (r ApiSharesListRequest) Lifecycle(lifecycle string) ApiSharesListRequest { - r.lifecycle = &lifecycle +func (r ApiSharesListRequest) State(state string) ApiSharesListRequest { + r.state = &state return r } @@ -363,11 +363,11 @@ func (a *SharesAPIService) SharesListExecute(r ApiSharesListRequest) (*ShareList localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.lifecycle != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "lifecycle", r.lifecycle, "form", "") + if r.state != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "state", r.state, "form", "") } else { var defaultValue string = "active" - r.lifecycle = &defaultValue + r.state = &defaultValue } if r.limit != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") diff --git a/sdk/go/docs/ArtifactsAPI.md b/sdk/go/docs/ArtifactsAPI.md index b02c137..453e194 100644 --- a/sdk/go/docs/ArtifactsAPI.md +++ b/sdk/go/docs/ArtifactsAPI.md @@ -340,7 +340,7 @@ Name | Type | Description | Notes ## ArtifactsList -> ArtifactListOut ArtifactsList(ctx, driveId).Lifecycle(lifecycle).Limit(limit).Cursor(cursor).ParentId(parentId).Name(name).ContentType(contentType).Label(label).UpdatedAfter(updatedAfter).UpdatedBefore(updatedBefore).Authorization(authorization).Execute() +> ArtifactListOut ArtifactsList(ctx, driveId).State(state).Limit(limit).Cursor(cursor).ParentId(parentId).Name(name).ContentType(contentType).Label(label).UpdatedAfter(updatedAfter).UpdatedBefore(updatedBefore).Authorization(authorization).Execute() List Artifacts @@ -361,7 +361,7 @@ import ( func main() { driveId := "driveId_example" // string | - lifecycle := "lifecycle_example" // string | (optional) (default to "active") + state := "state_example" // string | (optional) (default to "active") limit := int32(56) // int32 | (optional) cursor := "cursor_example" // string | (optional) parentId := "parentId_example" // string | (optional) @@ -374,7 +374,7 @@ func main() { configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ArtifactsAPI.ArtifactsList(context.Background(), driveId).Lifecycle(lifecycle).Limit(limit).Cursor(cursor).ParentId(parentId).Name(name).ContentType(contentType).Label(label).UpdatedAfter(updatedAfter).UpdatedBefore(updatedBefore).Authorization(authorization).Execute() + resp, r, err := apiClient.ArtifactsAPI.ArtifactsList(context.Background(), driveId).State(state).Limit(limit).Cursor(cursor).ParentId(parentId).Name(name).ContentType(contentType).Label(label).UpdatedAfter(updatedAfter).UpdatedBefore(updatedBefore).Authorization(authorization).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ArtifactsAPI.ArtifactsList``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -400,7 +400,7 @@ Other parameters are passed through a pointer to a apiArtifactsListRequest struc Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **lifecycle** | **string** | | [default to "active"] + **state** | **string** | | [default to "active"] **limit** | **int32** | | **cursor** | **string** | | **parentId** | **string** | | diff --git a/sdk/go/docs/ChangesAPI.md b/sdk/go/docs/ChangesAPI.md index 05a05f1..6166f66 100644 --- a/sdk/go/docs/ChangesAPI.md +++ b/sdk/go/docs/ChangesAPI.md @@ -10,7 +10,7 @@ Method | HTTP request | Description ## ChangesList -> ChangePageOut ChangesList(ctx, driveId).Limit(limit).Start(start).Cursor(cursor).Type_(type_).Authorization(authorization).Execute() +> ChangePageOut ChangesList(ctx, driveId).Limit(limit).Start(start).Cursor(cursor).Type_(type_).Order(order).Authorization(authorization).Execute() List Changes @@ -34,11 +34,12 @@ func main() { start := "start_example" // string | (optional) cursor := "cursor_example" // string | (optional) type_ := "type__example" // string | (optional) + order := "order_example" // string | (optional) authorization := "authorization_example" // string | Deprecated: redundant with the operation's `bearerAuth` security requirement, which is how a generated client should learn to authenticate. Scheduled for removal. (optional) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ChangesAPI.ChangesList(context.Background(), driveId).Limit(limit).Start(start).Cursor(cursor).Type_(type_).Authorization(authorization).Execute() + resp, r, err := apiClient.ChangesAPI.ChangesList(context.Background(), driveId).Limit(limit).Start(start).Cursor(cursor).Type_(type_).Order(order).Authorization(authorization).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ChangesAPI.ChangesList``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -68,6 +69,7 @@ Name | Type | Description | Notes **start** | **string** | | **cursor** | **string** | | **type_** | **string** | | + **order** | **string** | | **authorization** | **string** | Deprecated: redundant with the operation's `bearerAuth` security requirement, which is how a generated client should learn to authenticate. Scheduled for removal. | ### Return type diff --git a/sdk/go/docs/DriveUsageOut.md b/sdk/go/docs/DriveUsageOut.md index 431c1dd..66beeb8 100644 --- a/sdk/go/docs/DriveUsageOut.md +++ b/sdk/go/docs/DriveUsageOut.md @@ -4,6 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**EffectiveLimits** | [**EffectiveLimitsOut**](EffectiveLimitsOut.md) | | +**Meters** | [**UsageMetersOut**](UsageMetersOut.md) | | **RetrievalBytes** | **int32** | | **StorageBytes** | **int32** | | @@ -11,7 +13,7 @@ Name | Type | Description | Notes ### NewDriveUsageOut -`func NewDriveUsageOut(retrievalBytes int32, storageBytes int32, ) *DriveUsageOut` +`func NewDriveUsageOut(effectiveLimits EffectiveLimitsOut, meters UsageMetersOut, retrievalBytes int32, storageBytes int32, ) *DriveUsageOut` NewDriveUsageOut instantiates a new DriveUsageOut object This constructor will assign default values to properties that have it defined, @@ -26,6 +28,46 @@ NewDriveUsageOutWithDefaults instantiates a new DriveUsageOut object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set +### GetEffectiveLimits + +`func (o *DriveUsageOut) GetEffectiveLimits() EffectiveLimitsOut` + +GetEffectiveLimits returns the EffectiveLimits field if non-nil, zero value otherwise. + +### GetEffectiveLimitsOk + +`func (o *DriveUsageOut) GetEffectiveLimitsOk() (*EffectiveLimitsOut, bool)` + +GetEffectiveLimitsOk returns a tuple with the EffectiveLimits field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEffectiveLimits + +`func (o *DriveUsageOut) SetEffectiveLimits(v EffectiveLimitsOut)` + +SetEffectiveLimits sets EffectiveLimits field to given value. + + +### GetMeters + +`func (o *DriveUsageOut) GetMeters() UsageMetersOut` + +GetMeters returns the Meters field if non-nil, zero value otherwise. + +### GetMetersOk + +`func (o *DriveUsageOut) GetMetersOk() (*UsageMetersOut, bool)` + +GetMetersOk returns a tuple with the Meters field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMeters + +`func (o *DriveUsageOut) SetMeters(v UsageMetersOut)` + +SetMeters sets Meters field to given value. + + ### GetRetrievalBytes `func (o *DriveUsageOut) GetRetrievalBytes() int32` diff --git a/sdk/go/docs/DrivesAPI.md b/sdk/go/docs/DrivesAPI.md index 9b426fc..6660760 100644 --- a/sdk/go/docs/DrivesAPI.md +++ b/sdk/go/docs/DrivesAPI.md @@ -162,7 +162,7 @@ Name | Type | Description | Notes ## DrivesList -> DriveListOut DrivesList(ctx).Lifecycle(lifecycle).Limit(limit).Cursor(cursor).Authorization(authorization).Execute() +> DriveListOut DrivesList(ctx).State(state).Limit(limit).Cursor(cursor).Authorization(authorization).Execute() List Drives @@ -181,14 +181,14 @@ import ( ) func main() { - lifecycle := "lifecycle_example" // string | (optional) (default to "active") + state := "state_example" // string | (optional) (default to "active") limit := int32(56) // int32 | (optional) cursor := "cursor_example" // string | (optional) authorization := "authorization_example" // string | Deprecated: redundant with the operation's `bearerAuth` security requirement, which is how a generated client should learn to authenticate. Scheduled for removal. (optional) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DrivesAPI.DrivesList(context.Background()).Lifecycle(lifecycle).Limit(limit).Cursor(cursor).Authorization(authorization).Execute() + resp, r, err := apiClient.DrivesAPI.DrivesList(context.Background()).State(state).Limit(limit).Cursor(cursor).Authorization(authorization).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `DrivesAPI.DrivesList``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -209,7 +209,7 @@ Other parameters are passed through a pointer to a apiDrivesListRequest struct v Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **lifecycle** | **string** | | [default to "active"] + **state** | **string** | | [default to "active"] **limit** | **int32** | | **cursor** | **string** | | **authorization** | **string** | Deprecated: redundant with the operation's `bearerAuth` security requirement, which is how a generated client should learn to authenticate. Scheduled for removal. | diff --git a/sdk/go/docs/EffectiveLimitsOut.md b/sdk/go/docs/EffectiveLimitsOut.md new file mode 100644 index 0000000..77593f6 --- /dev/null +++ b/sdk/go/docs/EffectiveLimitsOut.md @@ -0,0 +1,112 @@ +# EffectiveLimitsOut + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MaxFileBytes** | **int32** | | +**MaxInlineFileBytes** | **int32** | | +**ShareDefaultTtlSeconds** | **int32** | | +**ShareMaxTtlSeconds** | **int32** | | + +## Methods + +### NewEffectiveLimitsOut + +`func NewEffectiveLimitsOut(maxFileBytes int32, maxInlineFileBytes int32, shareDefaultTtlSeconds int32, shareMaxTtlSeconds int32, ) *EffectiveLimitsOut` + +NewEffectiveLimitsOut instantiates a new EffectiveLimitsOut object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewEffectiveLimitsOutWithDefaults + +`func NewEffectiveLimitsOutWithDefaults() *EffectiveLimitsOut` + +NewEffectiveLimitsOutWithDefaults instantiates a new EffectiveLimitsOut object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMaxFileBytes + +`func (o *EffectiveLimitsOut) GetMaxFileBytes() int32` + +GetMaxFileBytes returns the MaxFileBytes field if non-nil, zero value otherwise. + +### GetMaxFileBytesOk + +`func (o *EffectiveLimitsOut) GetMaxFileBytesOk() (*int32, bool)` + +GetMaxFileBytesOk returns a tuple with the MaxFileBytes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxFileBytes + +`func (o *EffectiveLimitsOut) SetMaxFileBytes(v int32)` + +SetMaxFileBytes sets MaxFileBytes field to given value. + + +### GetMaxInlineFileBytes + +`func (o *EffectiveLimitsOut) GetMaxInlineFileBytes() int32` + +GetMaxInlineFileBytes returns the MaxInlineFileBytes field if non-nil, zero value otherwise. + +### GetMaxInlineFileBytesOk + +`func (o *EffectiveLimitsOut) GetMaxInlineFileBytesOk() (*int32, bool)` + +GetMaxInlineFileBytesOk returns a tuple with the MaxInlineFileBytes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxInlineFileBytes + +`func (o *EffectiveLimitsOut) SetMaxInlineFileBytes(v int32)` + +SetMaxInlineFileBytes sets MaxInlineFileBytes field to given value. + + +### GetShareDefaultTtlSeconds + +`func (o *EffectiveLimitsOut) GetShareDefaultTtlSeconds() int32` + +GetShareDefaultTtlSeconds returns the ShareDefaultTtlSeconds field if non-nil, zero value otherwise. + +### GetShareDefaultTtlSecondsOk + +`func (o *EffectiveLimitsOut) GetShareDefaultTtlSecondsOk() (*int32, bool)` + +GetShareDefaultTtlSecondsOk returns a tuple with the ShareDefaultTtlSeconds field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShareDefaultTtlSeconds + +`func (o *EffectiveLimitsOut) SetShareDefaultTtlSeconds(v int32)` + +SetShareDefaultTtlSeconds sets ShareDefaultTtlSeconds field to given value. + + +### GetShareMaxTtlSeconds + +`func (o *EffectiveLimitsOut) GetShareMaxTtlSeconds() int32` + +GetShareMaxTtlSeconds returns the ShareMaxTtlSeconds field if non-nil, zero value otherwise. + +### GetShareMaxTtlSecondsOk + +`func (o *EffectiveLimitsOut) GetShareMaxTtlSecondsOk() (*int32, bool)` + +GetShareMaxTtlSecondsOk returns a tuple with the ShareMaxTtlSeconds field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShareMaxTtlSeconds + +`func (o *EffectiveLimitsOut) SetShareMaxTtlSeconds(v int32)` + +SetShareMaxTtlSeconds sets ShareMaxTtlSeconds field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdk/go/docs/FoldersAPI.md b/sdk/go/docs/FoldersAPI.md index 5931ee3..906bada 100644 --- a/sdk/go/docs/FoldersAPI.md +++ b/sdk/go/docs/FoldersAPI.md @@ -254,7 +254,7 @@ Name | Type | Description | Notes ## FoldersList -> FolderListOut FoldersList(ctx, driveId).Lifecycle(lifecycle).Limit(limit).Cursor(cursor).ParentId(parentId).Name(name).Authorization(authorization).Execute() +> FolderListOut FoldersList(ctx, driveId).State(state).Limit(limit).Cursor(cursor).ParentId(parentId).Name(name).Authorization(authorization).Execute() List Folders @@ -274,7 +274,7 @@ import ( func main() { driveId := "driveId_example" // string | - lifecycle := "lifecycle_example" // string | (optional) (default to "active") + state := "state_example" // string | (optional) (default to "active") limit := int32(56) // int32 | (optional) cursor := "cursor_example" // string | (optional) parentId := "parentId_example" // string | (optional) @@ -283,7 +283,7 @@ func main() { configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.FoldersAPI.FoldersList(context.Background(), driveId).Lifecycle(lifecycle).Limit(limit).Cursor(cursor).ParentId(parentId).Name(name).Authorization(authorization).Execute() + resp, r, err := apiClient.FoldersAPI.FoldersList(context.Background(), driveId).State(state).Limit(limit).Cursor(cursor).ParentId(parentId).Name(name).Authorization(authorization).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `FoldersAPI.FoldersList``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -309,7 +309,7 @@ Other parameters are passed through a pointer to a apiFoldersListRequest struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **lifecycle** | **string** | | [default to "active"] + **state** | **string** | | [default to "active"] **limit** | **int32** | | **cursor** | **string** | | **parentId** | **string** | | diff --git a/sdk/go/docs/GrantCreateIn.md b/sdk/go/docs/GrantCreateIn.md index 361f4c6..b6cde99 100644 --- a/sdk/go/docs/GrantCreateIn.md +++ b/sdk/go/docs/GrantCreateIn.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ExpiresAt** | Pointer to **NullableTime** | | [optional] -**PrincipalId** | Pointer to **NullableString** | Required for `agent`, `user`, and `workspace`; omitted only for `public`. For `agent` and `user` it is checked against that type's id prefix (`tcagt_` / `tcusr_`) and a mismatch is `422 VALIDATION_ERROR`. The prefix is all AgentDrive asserts: these ids are minted by Hub, so their full shape is not AgentDrive's to enforce, and a well-formed id naming a principal that does not exist — or belongs to another workspace — is accepted here and simply never matches a token. The rule is conditional on `principal_type`, so it is enforced at the boundary rather than expressible as one JSON Schema `pattern`. | [optional] +**PrincipalId** | Pointer to **NullableString** | Required for `agent`, `user`, `service`, and `workspace`; omitted only for `public`. For `agent`, `user`, and `service` it is checked against that type's id prefix (`tcagt_` / `tcusr_` / `tcsvc_`) and a mismatch is `422 VALIDATION_ERROR`. The prefix is all AgentDrive asserts: these ids are minted by Hub, so their full shape is not AgentDrive's to enforce, and a well-formed id naming a principal that does not exist — or belongs to another workspace — is accepted here and simply never matches a token. The rule is conditional on `principal_type`, so it is enforced at the boundary rather than expressible as one JSON Schema `pattern`. | [optional] **PrincipalType** | **string** | | **ResourceId** | **string** | | **ResourceType** | **string** | | diff --git a/sdk/go/docs/GrantsAPI.md b/sdk/go/docs/GrantsAPI.md index 7af9494..fc6d228 100644 --- a/sdk/go/docs/GrantsAPI.md +++ b/sdk/go/docs/GrantsAPI.md @@ -90,7 +90,7 @@ Name | Type | Description | Notes ## GrantsList -> GrantListOut GrantsList(ctx, driveId).Lifecycle(lifecycle).Limit(limit).Cursor(cursor).ResourceType(resourceType).ResourceId(resourceId).PrincipalType(principalType).Authorization(authorization).Execute() +> GrantListOut GrantsList(ctx, driveId).State(state).Limit(limit).Cursor(cursor).ResourceType(resourceType).ResourceId(resourceId).PrincipalType(principalType).Authorization(authorization).Execute() List Grants @@ -110,7 +110,7 @@ import ( func main() { driveId := "driveId_example" // string | - lifecycle := "lifecycle_example" // string | (optional) (default to "active") + state := "state_example" // string | (optional) (default to "active") limit := int32(56) // int32 | (optional) cursor := "cursor_example" // string | (optional) resourceType := "resourceType_example" // string | (optional) @@ -120,7 +120,7 @@ func main() { configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.GrantsAPI.GrantsList(context.Background(), driveId).Lifecycle(lifecycle).Limit(limit).Cursor(cursor).ResourceType(resourceType).ResourceId(resourceId).PrincipalType(principalType).Authorization(authorization).Execute() + resp, r, err := apiClient.GrantsAPI.GrantsList(context.Background(), driveId).State(state).Limit(limit).Cursor(cursor).ResourceType(resourceType).ResourceId(resourceId).PrincipalType(principalType).Authorization(authorization).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `GrantsAPI.GrantsList``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -146,7 +146,7 @@ Other parameters are passed through a pointer to a apiGrantsListRequest struct v Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **lifecycle** | **string** | | [default to "active"] + **state** | **string** | | [default to "active"] **limit** | **int32** | | **cursor** | **string** | | **resourceType** | **string** | | diff --git a/sdk/go/docs/SharesAPI.md b/sdk/go/docs/SharesAPI.md index e7a02db..edb7f9b 100644 --- a/sdk/go/docs/SharesAPI.md +++ b/sdk/go/docs/SharesAPI.md @@ -90,7 +90,7 @@ Name | Type | Description | Notes ## SharesList -> ShareListOut SharesList(ctx, driveId).Lifecycle(lifecycle).Limit(limit).Cursor(cursor).ResourceType(resourceType).ResourceId(resourceId).Authorization(authorization).Execute() +> ShareListOut SharesList(ctx, driveId).State(state).Limit(limit).Cursor(cursor).ResourceType(resourceType).ResourceId(resourceId).Authorization(authorization).Execute() List Shares @@ -110,7 +110,7 @@ import ( func main() { driveId := "driveId_example" // string | - lifecycle := "lifecycle_example" // string | (optional) (default to "active") + state := "state_example" // string | (optional) (default to "active") limit := int32(56) // int32 | (optional) cursor := "cursor_example" // string | (optional) resourceType := "resourceType_example" // string | (optional) @@ -119,7 +119,7 @@ func main() { configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.SharesAPI.SharesList(context.Background(), driveId).Lifecycle(lifecycle).Limit(limit).Cursor(cursor).ResourceType(resourceType).ResourceId(resourceId).Authorization(authorization).Execute() + resp, r, err := apiClient.SharesAPI.SharesList(context.Background(), driveId).State(state).Limit(limit).Cursor(cursor).ResourceType(resourceType).ResourceId(resourceId).Authorization(authorization).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `SharesAPI.SharesList``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -145,7 +145,7 @@ Other parameters are passed through a pointer to a apiSharesListRequest struct v Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **lifecycle** | **string** | | [default to "active"] + **state** | **string** | | [default to "active"] **limit** | **int32** | | **cursor** | **string** | | **resourceType** | **string** | | diff --git a/sdk/go/docs/UsageMeterOut.md b/sdk/go/docs/UsageMeterOut.md new file mode 100644 index 0000000..831eec9 --- /dev/null +++ b/sdk/go/docs/UsageMeterOut.md @@ -0,0 +1,164 @@ +# UsageMeterOut + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Limit** | **int32** | | +**Remaining** | **int32** | | +**Reserved** | **int32** | | +**ResetAt** | **NullableTime** | | +**Scope** | **string** | | +**Used** | **int32** | | + +## Methods + +### NewUsageMeterOut + +`func NewUsageMeterOut(limit int32, remaining int32, reserved int32, resetAt NullableTime, scope string, used int32, ) *UsageMeterOut` + +NewUsageMeterOut instantiates a new UsageMeterOut object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUsageMeterOutWithDefaults + +`func NewUsageMeterOutWithDefaults() *UsageMeterOut` + +NewUsageMeterOutWithDefaults instantiates a new UsageMeterOut object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetLimit + +`func (o *UsageMeterOut) GetLimit() int32` + +GetLimit returns the Limit field if non-nil, zero value otherwise. + +### GetLimitOk + +`func (o *UsageMeterOut) GetLimitOk() (*int32, bool)` + +GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLimit + +`func (o *UsageMeterOut) SetLimit(v int32)` + +SetLimit sets Limit field to given value. + + +### GetRemaining + +`func (o *UsageMeterOut) GetRemaining() int32` + +GetRemaining returns the Remaining field if non-nil, zero value otherwise. + +### GetRemainingOk + +`func (o *UsageMeterOut) GetRemainingOk() (*int32, bool)` + +GetRemainingOk returns a tuple with the Remaining field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRemaining + +`func (o *UsageMeterOut) SetRemaining(v int32)` + +SetRemaining sets Remaining field to given value. + + +### GetReserved + +`func (o *UsageMeterOut) GetReserved() int32` + +GetReserved returns the Reserved field if non-nil, zero value otherwise. + +### GetReservedOk + +`func (o *UsageMeterOut) GetReservedOk() (*int32, bool)` + +GetReservedOk returns a tuple with the Reserved field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReserved + +`func (o *UsageMeterOut) SetReserved(v int32)` + +SetReserved sets Reserved field to given value. + + +### GetResetAt + +`func (o *UsageMeterOut) GetResetAt() time.Time` + +GetResetAt returns the ResetAt field if non-nil, zero value otherwise. + +### GetResetAtOk + +`func (o *UsageMeterOut) GetResetAtOk() (*time.Time, bool)` + +GetResetAtOk returns a tuple with the ResetAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetResetAt + +`func (o *UsageMeterOut) SetResetAt(v time.Time)` + +SetResetAt sets ResetAt field to given value. + + +### SetResetAtNil + +`func (o *UsageMeterOut) SetResetAtNil(b bool)` + + SetResetAtNil sets the value for ResetAt to be an explicit nil + +### UnsetResetAt +`func (o *UsageMeterOut) UnsetResetAt()` + +UnsetResetAt ensures that no value is present for ResetAt, not even an explicit nil +### GetScope + +`func (o *UsageMeterOut) GetScope() string` + +GetScope returns the Scope field if non-nil, zero value otherwise. + +### GetScopeOk + +`func (o *UsageMeterOut) GetScopeOk() (*string, bool)` + +GetScopeOk returns a tuple with the Scope field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetScope + +`func (o *UsageMeterOut) SetScope(v string)` + +SetScope sets Scope field to given value. + + +### GetUsed + +`func (o *UsageMeterOut) GetUsed() int32` + +GetUsed returns the Used field if non-nil, zero value otherwise. + +### GetUsedOk + +`func (o *UsageMeterOut) GetUsedOk() (*int32, bool)` + +GetUsedOk returns a tuple with the Used field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsed + +`func (o *UsageMeterOut) SetUsed(v int32)` + +SetUsed sets Used field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdk/go/docs/UsageMetersOut.md b/sdk/go/docs/UsageMetersOut.md new file mode 100644 index 0000000..9fc5aa2 --- /dev/null +++ b/sdk/go/docs/UsageMetersOut.md @@ -0,0 +1,112 @@ +# UsageMetersOut + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DriveStorage** | [**UsageMeterOut**](UsageMeterOut.md) | | +**WorkspaceDownloadDay** | [**UsageMeterOut**](UsageMeterOut.md) | | +**WorkspaceDownloadMonth** | [**UsageMeterOut**](UsageMeterOut.md) | | +**WorkspaceStorage** | [**UsageMeterOut**](UsageMeterOut.md) | | + +## Methods + +### NewUsageMetersOut + +`func NewUsageMetersOut(driveStorage UsageMeterOut, workspaceDownloadDay UsageMeterOut, workspaceDownloadMonth UsageMeterOut, workspaceStorage UsageMeterOut, ) *UsageMetersOut` + +NewUsageMetersOut instantiates a new UsageMetersOut object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUsageMetersOutWithDefaults + +`func NewUsageMetersOutWithDefaults() *UsageMetersOut` + +NewUsageMetersOutWithDefaults instantiates a new UsageMetersOut object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDriveStorage + +`func (o *UsageMetersOut) GetDriveStorage() UsageMeterOut` + +GetDriveStorage returns the DriveStorage field if non-nil, zero value otherwise. + +### GetDriveStorageOk + +`func (o *UsageMetersOut) GetDriveStorageOk() (*UsageMeterOut, bool)` + +GetDriveStorageOk returns a tuple with the DriveStorage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDriveStorage + +`func (o *UsageMetersOut) SetDriveStorage(v UsageMeterOut)` + +SetDriveStorage sets DriveStorage field to given value. + + +### GetWorkspaceDownloadDay + +`func (o *UsageMetersOut) GetWorkspaceDownloadDay() UsageMeterOut` + +GetWorkspaceDownloadDay returns the WorkspaceDownloadDay field if non-nil, zero value otherwise. + +### GetWorkspaceDownloadDayOk + +`func (o *UsageMetersOut) GetWorkspaceDownloadDayOk() (*UsageMeterOut, bool)` + +GetWorkspaceDownloadDayOk returns a tuple with the WorkspaceDownloadDay field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWorkspaceDownloadDay + +`func (o *UsageMetersOut) SetWorkspaceDownloadDay(v UsageMeterOut)` + +SetWorkspaceDownloadDay sets WorkspaceDownloadDay field to given value. + + +### GetWorkspaceDownloadMonth + +`func (o *UsageMetersOut) GetWorkspaceDownloadMonth() UsageMeterOut` + +GetWorkspaceDownloadMonth returns the WorkspaceDownloadMonth field if non-nil, zero value otherwise. + +### GetWorkspaceDownloadMonthOk + +`func (o *UsageMetersOut) GetWorkspaceDownloadMonthOk() (*UsageMeterOut, bool)` + +GetWorkspaceDownloadMonthOk returns a tuple with the WorkspaceDownloadMonth field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWorkspaceDownloadMonth + +`func (o *UsageMetersOut) SetWorkspaceDownloadMonth(v UsageMeterOut)` + +SetWorkspaceDownloadMonth sets WorkspaceDownloadMonth field to given value. + + +### GetWorkspaceStorage + +`func (o *UsageMetersOut) GetWorkspaceStorage() UsageMeterOut` + +GetWorkspaceStorage returns the WorkspaceStorage field if non-nil, zero value otherwise. + +### GetWorkspaceStorageOk + +`func (o *UsageMetersOut) GetWorkspaceStorageOk() (*UsageMeterOut, bool)` + +GetWorkspaceStorageOk returns a tuple with the WorkspaceStorage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWorkspaceStorage + +`func (o *UsageMetersOut) SetWorkspaceStorage(v UsageMeterOut)` + +SetWorkspaceStorage sets WorkspaceStorage field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdk/go/model_drive_usage_out.go b/sdk/go/model_drive_usage_out.go index a23b07a..2f346dd 100644 --- a/sdk/go/model_drive_usage_out.go +++ b/sdk/go/model_drive_usage_out.go @@ -21,6 +21,8 @@ var _ MappedNullable = &DriveUsageOut{} // DriveUsageOut struct for DriveUsageOut type DriveUsageOut struct { + EffectiveLimits EffectiveLimitsOut `json:"effective_limits"` + Meters UsageMetersOut `json:"meters"` RetrievalBytes int32 `json:"retrieval_bytes"` StorageBytes int32 `json:"storage_bytes"` } @@ -31,8 +33,10 @@ type _DriveUsageOut DriveUsageOut // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewDriveUsageOut(retrievalBytes int32, storageBytes int32) *DriveUsageOut { +func NewDriveUsageOut(effectiveLimits EffectiveLimitsOut, meters UsageMetersOut, retrievalBytes int32, storageBytes int32) *DriveUsageOut { this := DriveUsageOut{} + this.EffectiveLimits = effectiveLimits + this.Meters = meters this.RetrievalBytes = retrievalBytes this.StorageBytes = storageBytes return &this @@ -46,6 +50,54 @@ func NewDriveUsageOutWithDefaults() *DriveUsageOut { return &this } +// GetEffectiveLimits returns the EffectiveLimits field value +func (o *DriveUsageOut) GetEffectiveLimits() EffectiveLimitsOut { + if o == nil { + var ret EffectiveLimitsOut + return ret + } + + return o.EffectiveLimits +} + +// GetEffectiveLimitsOk returns a tuple with the EffectiveLimits field value +// and a boolean to check if the value has been set. +func (o *DriveUsageOut) GetEffectiveLimitsOk() (*EffectiveLimitsOut, bool) { + if o == nil { + return nil, false + } + return &o.EffectiveLimits, true +} + +// SetEffectiveLimits sets field value +func (o *DriveUsageOut) SetEffectiveLimits(v EffectiveLimitsOut) { + o.EffectiveLimits = v +} + +// GetMeters returns the Meters field value +func (o *DriveUsageOut) GetMeters() UsageMetersOut { + if o == nil { + var ret UsageMetersOut + return ret + } + + return o.Meters +} + +// GetMetersOk returns a tuple with the Meters field value +// and a boolean to check if the value has been set. +func (o *DriveUsageOut) GetMetersOk() (*UsageMetersOut, bool) { + if o == nil { + return nil, false + } + return &o.Meters, true +} + +// SetMeters sets field value +func (o *DriveUsageOut) SetMeters(v UsageMetersOut) { + o.Meters = v +} + // GetRetrievalBytes returns the RetrievalBytes field value func (o *DriveUsageOut) GetRetrievalBytes() int32 { if o == nil { @@ -104,6 +156,8 @@ func (o DriveUsageOut) MarshalJSON() ([]byte, error) { func (o DriveUsageOut) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} + toSerialize["effective_limits"] = o.EffectiveLimits + toSerialize["meters"] = o.Meters toSerialize["retrieval_bytes"] = o.RetrievalBytes toSerialize["storage_bytes"] = o.StorageBytes return toSerialize, nil @@ -114,6 +168,8 @@ func (o *DriveUsageOut) UnmarshalJSON(data []byte) (err error) { // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ + "effective_limits", + "meters", "retrieval_bytes", "storage_bytes", } diff --git a/sdk/go/model_effective_limits_out.go b/sdk/go/model_effective_limits_out.go new file mode 100644 index 0000000..60233ce --- /dev/null +++ b/sdk/go/model_effective_limits_out.go @@ -0,0 +1,240 @@ +/* +AgentDrive + +AgentDrive is an agent-focused artifact store: drive-scoped folders, artifacts, and immutable versions, with local grants, possession-based share links, drive-scoped search, and a cursor-resumable change feed. Bearer-authenticated with Hub-issued product tokens (see /.well-known/oauth-protected-resource); every mutation takes an Idempotency-Key, and existing-state mutations take If-Match. + +API version: +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package agentdrive + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the EffectiveLimitsOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EffectiveLimitsOut{} + +// EffectiveLimitsOut struct for EffectiveLimitsOut +type EffectiveLimitsOut struct { + MaxFileBytes int32 `json:"max_file_bytes"` + MaxInlineFileBytes int32 `json:"max_inline_file_bytes"` + ShareDefaultTtlSeconds int32 `json:"share_default_ttl_seconds"` + ShareMaxTtlSeconds int32 `json:"share_max_ttl_seconds"` +} + +type _EffectiveLimitsOut EffectiveLimitsOut + +// NewEffectiveLimitsOut instantiates a new EffectiveLimitsOut object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEffectiveLimitsOut(maxFileBytes int32, maxInlineFileBytes int32, shareDefaultTtlSeconds int32, shareMaxTtlSeconds int32) *EffectiveLimitsOut { + this := EffectiveLimitsOut{} + this.MaxFileBytes = maxFileBytes + this.MaxInlineFileBytes = maxInlineFileBytes + this.ShareDefaultTtlSeconds = shareDefaultTtlSeconds + this.ShareMaxTtlSeconds = shareMaxTtlSeconds + return &this +} + +// NewEffectiveLimitsOutWithDefaults instantiates a new EffectiveLimitsOut object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEffectiveLimitsOutWithDefaults() *EffectiveLimitsOut { + this := EffectiveLimitsOut{} + return &this +} + +// GetMaxFileBytes returns the MaxFileBytes field value +func (o *EffectiveLimitsOut) GetMaxFileBytes() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.MaxFileBytes +} + +// GetMaxFileBytesOk returns a tuple with the MaxFileBytes field value +// and a boolean to check if the value has been set. +func (o *EffectiveLimitsOut) GetMaxFileBytesOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.MaxFileBytes, true +} + +// SetMaxFileBytes sets field value +func (o *EffectiveLimitsOut) SetMaxFileBytes(v int32) { + o.MaxFileBytes = v +} + +// GetMaxInlineFileBytes returns the MaxInlineFileBytes field value +func (o *EffectiveLimitsOut) GetMaxInlineFileBytes() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.MaxInlineFileBytes +} + +// GetMaxInlineFileBytesOk returns a tuple with the MaxInlineFileBytes field value +// and a boolean to check if the value has been set. +func (o *EffectiveLimitsOut) GetMaxInlineFileBytesOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.MaxInlineFileBytes, true +} + +// SetMaxInlineFileBytes sets field value +func (o *EffectiveLimitsOut) SetMaxInlineFileBytes(v int32) { + o.MaxInlineFileBytes = v +} + +// GetShareDefaultTtlSeconds returns the ShareDefaultTtlSeconds field value +func (o *EffectiveLimitsOut) GetShareDefaultTtlSeconds() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ShareDefaultTtlSeconds +} + +// GetShareDefaultTtlSecondsOk returns a tuple with the ShareDefaultTtlSeconds field value +// and a boolean to check if the value has been set. +func (o *EffectiveLimitsOut) GetShareDefaultTtlSecondsOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ShareDefaultTtlSeconds, true +} + +// SetShareDefaultTtlSeconds sets field value +func (o *EffectiveLimitsOut) SetShareDefaultTtlSeconds(v int32) { + o.ShareDefaultTtlSeconds = v +} + +// GetShareMaxTtlSeconds returns the ShareMaxTtlSeconds field value +func (o *EffectiveLimitsOut) GetShareMaxTtlSeconds() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ShareMaxTtlSeconds +} + +// GetShareMaxTtlSecondsOk returns a tuple with the ShareMaxTtlSeconds field value +// and a boolean to check if the value has been set. +func (o *EffectiveLimitsOut) GetShareMaxTtlSecondsOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ShareMaxTtlSeconds, true +} + +// SetShareMaxTtlSeconds sets field value +func (o *EffectiveLimitsOut) SetShareMaxTtlSeconds(v int32) { + o.ShareMaxTtlSeconds = v +} + +func (o EffectiveLimitsOut) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EffectiveLimitsOut) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["max_file_bytes"] = o.MaxFileBytes + toSerialize["max_inline_file_bytes"] = o.MaxInlineFileBytes + toSerialize["share_default_ttl_seconds"] = o.ShareDefaultTtlSeconds + toSerialize["share_max_ttl_seconds"] = o.ShareMaxTtlSeconds + return toSerialize, nil +} + +func (o *EffectiveLimitsOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "max_file_bytes", + "max_inline_file_bytes", + "share_default_ttl_seconds", + "share_max_ttl_seconds", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEffectiveLimitsOut := _EffectiveLimitsOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEffectiveLimitsOut) + + if err != nil { + return err + } + + *o = EffectiveLimitsOut(varEffectiveLimitsOut) + + return err +} + +type NullableEffectiveLimitsOut struct { + value *EffectiveLimitsOut + isSet bool +} + +func (v NullableEffectiveLimitsOut) Get() *EffectiveLimitsOut { + return v.value +} + +func (v *NullableEffectiveLimitsOut) Set(val *EffectiveLimitsOut) { + v.value = val + v.isSet = true +} + +func (v NullableEffectiveLimitsOut) IsSet() bool { + return v.isSet +} + +func (v *NullableEffectiveLimitsOut) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEffectiveLimitsOut(val *EffectiveLimitsOut) *NullableEffectiveLimitsOut { + return &NullableEffectiveLimitsOut{value: val, isSet: true} +} + +func (v NullableEffectiveLimitsOut) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEffectiveLimitsOut) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/sdk/go/model_grant_create_in.go b/sdk/go/model_grant_create_in.go index 2ca8834..7d71624 100644 --- a/sdk/go/model_grant_create_in.go +++ b/sdk/go/model_grant_create_in.go @@ -23,7 +23,7 @@ var _ MappedNullable = &GrantCreateIn{} // GrantCreateIn POST /v0/drives/{id}/grants body. type GrantCreateIn struct { ExpiresAt NullableTime `json:"expires_at,omitempty"` - // Required for `agent`, `user`, and `workspace`; omitted only for `public`. For `agent` and `user` it is checked against that type's id prefix (`tcagt_` / `tcusr_`) and a mismatch is `422 VALIDATION_ERROR`. The prefix is all AgentDrive asserts: these ids are minted by Hub, so their full shape is not AgentDrive's to enforce, and a well-formed id naming a principal that does not exist — or belongs to another workspace — is accepted here and simply never matches a token. The rule is conditional on `principal_type`, so it is enforced at the boundary rather than expressible as one JSON Schema `pattern`. + // Required for `agent`, `user`, `service`, and `workspace`; omitted only for `public`. For `agent`, `user`, and `service` it is checked against that type's id prefix (`tcagt_` / `tcusr_` / `tcsvc_`) and a mismatch is `422 VALIDATION_ERROR`. The prefix is all AgentDrive asserts: these ids are minted by Hub, so their full shape is not AgentDrive's to enforce, and a well-formed id naming a principal that does not exist — or belongs to another workspace — is accepted here and simply never matches a token. The rule is conditional on `principal_type`, so it is enforced at the boundary rather than expressible as one JSON Schema `pattern`. PrincipalId NullableString `json:"principal_id,omitempty"` PrincipalType string `json:"principal_type"` ResourceId string `json:"resource_id"` diff --git a/sdk/go/model_usage_meter_out.go b/sdk/go/model_usage_meter_out.go new file mode 100644 index 0000000..d8658a6 --- /dev/null +++ b/sdk/go/model_usage_meter_out.go @@ -0,0 +1,299 @@ +/* +AgentDrive + +AgentDrive is an agent-focused artifact store: drive-scoped folders, artifacts, and immutable versions, with local grants, possession-based share links, drive-scoped search, and a cursor-resumable change feed. Bearer-authenticated with Hub-issued product tokens (see /.well-known/oauth-protected-resource); every mutation takes an Idempotency-Key, and existing-state mutations take If-Match. + +API version: +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package agentdrive + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the UsageMeterOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UsageMeterOut{} + +// UsageMeterOut struct for UsageMeterOut +type UsageMeterOut struct { + Limit int32 `json:"limit"` + Remaining int32 `json:"remaining"` + Reserved int32 `json:"reserved"` + ResetAt NullableTime `json:"reset_at"` + Scope string `json:"scope"` + Used int32 `json:"used"` +} + +type _UsageMeterOut UsageMeterOut + +// NewUsageMeterOut instantiates a new UsageMeterOut object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUsageMeterOut(limit int32, remaining int32, reserved int32, resetAt NullableTime, scope string, used int32) *UsageMeterOut { + this := UsageMeterOut{} + this.Limit = limit + this.Remaining = remaining + this.Reserved = reserved + this.ResetAt = resetAt + this.Scope = scope + this.Used = used + return &this +} + +// NewUsageMeterOutWithDefaults instantiates a new UsageMeterOut object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUsageMeterOutWithDefaults() *UsageMeterOut { + this := UsageMeterOut{} + return &this +} + +// GetLimit returns the Limit field value +func (o *UsageMeterOut) GetLimit() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +func (o *UsageMeterOut) GetLimitOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Limit, true +} + +// SetLimit sets field value +func (o *UsageMeterOut) SetLimit(v int32) { + o.Limit = v +} + +// GetRemaining returns the Remaining field value +func (o *UsageMeterOut) GetRemaining() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Remaining +} + +// GetRemainingOk returns a tuple with the Remaining field value +// and a boolean to check if the value has been set. +func (o *UsageMeterOut) GetRemainingOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Remaining, true +} + +// SetRemaining sets field value +func (o *UsageMeterOut) SetRemaining(v int32) { + o.Remaining = v +} + +// GetReserved returns the Reserved field value +func (o *UsageMeterOut) GetReserved() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Reserved +} + +// GetReservedOk returns a tuple with the Reserved field value +// and a boolean to check if the value has been set. +func (o *UsageMeterOut) GetReservedOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Reserved, true +} + +// SetReserved sets field value +func (o *UsageMeterOut) SetReserved(v int32) { + o.Reserved = v +} + +// GetResetAt returns the ResetAt field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *UsageMeterOut) GetResetAt() time.Time { + if o == nil || o.ResetAt.Get() == nil { + var ret time.Time + return ret + } + + return *o.ResetAt.Get() +} + +// GetResetAtOk returns a tuple with the ResetAt field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UsageMeterOut) GetResetAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.ResetAt.Get(), o.ResetAt.IsSet() +} + +// SetResetAt sets field value +func (o *UsageMeterOut) SetResetAt(v time.Time) { + o.ResetAt.Set(&v) +} + +// GetScope returns the Scope field value +func (o *UsageMeterOut) GetScope() string { + if o == nil { + var ret string + return ret + } + + return o.Scope +} + +// GetScopeOk returns a tuple with the Scope field value +// and a boolean to check if the value has been set. +func (o *UsageMeterOut) GetScopeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Scope, true +} + +// SetScope sets field value +func (o *UsageMeterOut) SetScope(v string) { + o.Scope = v +} + +// GetUsed returns the Used field value +func (o *UsageMeterOut) GetUsed() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Used +} + +// GetUsedOk returns a tuple with the Used field value +// and a boolean to check if the value has been set. +func (o *UsageMeterOut) GetUsedOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Used, true +} + +// SetUsed sets field value +func (o *UsageMeterOut) SetUsed(v int32) { + o.Used = v +} + +func (o UsageMeterOut) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UsageMeterOut) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["limit"] = o.Limit + toSerialize["remaining"] = o.Remaining + toSerialize["reserved"] = o.Reserved + toSerialize["reset_at"] = o.ResetAt.Get() + toSerialize["scope"] = o.Scope + toSerialize["used"] = o.Used + return toSerialize, nil +} + +func (o *UsageMeterOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "limit", + "remaining", + "reserved", + "reset_at", + "scope", + "used", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUsageMeterOut := _UsageMeterOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varUsageMeterOut) + + if err != nil { + return err + } + + *o = UsageMeterOut(varUsageMeterOut) + + return err +} + +type NullableUsageMeterOut struct { + value *UsageMeterOut + isSet bool +} + +func (v NullableUsageMeterOut) Get() *UsageMeterOut { + return v.value +} + +func (v *NullableUsageMeterOut) Set(val *UsageMeterOut) { + v.value = val + v.isSet = true +} + +func (v NullableUsageMeterOut) IsSet() bool { + return v.isSet +} + +func (v *NullableUsageMeterOut) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUsageMeterOut(val *UsageMeterOut) *NullableUsageMeterOut { + return &NullableUsageMeterOut{value: val, isSet: true} +} + +func (v NullableUsageMeterOut) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUsageMeterOut) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/sdk/go/model_usage_meters_out.go b/sdk/go/model_usage_meters_out.go new file mode 100644 index 0000000..0131335 --- /dev/null +++ b/sdk/go/model_usage_meters_out.go @@ -0,0 +1,240 @@ +/* +AgentDrive + +AgentDrive is an agent-focused artifact store: drive-scoped folders, artifacts, and immutable versions, with local grants, possession-based share links, drive-scoped search, and a cursor-resumable change feed. Bearer-authenticated with Hub-issued product tokens (see /.well-known/oauth-protected-resource); every mutation takes an Idempotency-Key, and existing-state mutations take If-Match. + +API version: +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package agentdrive + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the UsageMetersOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UsageMetersOut{} + +// UsageMetersOut struct for UsageMetersOut +type UsageMetersOut struct { + DriveStorage UsageMeterOut `json:"drive_storage"` + WorkspaceDownloadDay UsageMeterOut `json:"workspace_download_day"` + WorkspaceDownloadMonth UsageMeterOut `json:"workspace_download_month"` + WorkspaceStorage UsageMeterOut `json:"workspace_storage"` +} + +type _UsageMetersOut UsageMetersOut + +// NewUsageMetersOut instantiates a new UsageMetersOut object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUsageMetersOut(driveStorage UsageMeterOut, workspaceDownloadDay UsageMeterOut, workspaceDownloadMonth UsageMeterOut, workspaceStorage UsageMeterOut) *UsageMetersOut { + this := UsageMetersOut{} + this.DriveStorage = driveStorage + this.WorkspaceDownloadDay = workspaceDownloadDay + this.WorkspaceDownloadMonth = workspaceDownloadMonth + this.WorkspaceStorage = workspaceStorage + return &this +} + +// NewUsageMetersOutWithDefaults instantiates a new UsageMetersOut object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUsageMetersOutWithDefaults() *UsageMetersOut { + this := UsageMetersOut{} + return &this +} + +// GetDriveStorage returns the DriveStorage field value +func (o *UsageMetersOut) GetDriveStorage() UsageMeterOut { + if o == nil { + var ret UsageMeterOut + return ret + } + + return o.DriveStorage +} + +// GetDriveStorageOk returns a tuple with the DriveStorage field value +// and a boolean to check if the value has been set. +func (o *UsageMetersOut) GetDriveStorageOk() (*UsageMeterOut, bool) { + if o == nil { + return nil, false + } + return &o.DriveStorage, true +} + +// SetDriveStorage sets field value +func (o *UsageMetersOut) SetDriveStorage(v UsageMeterOut) { + o.DriveStorage = v +} + +// GetWorkspaceDownloadDay returns the WorkspaceDownloadDay field value +func (o *UsageMetersOut) GetWorkspaceDownloadDay() UsageMeterOut { + if o == nil { + var ret UsageMeterOut + return ret + } + + return o.WorkspaceDownloadDay +} + +// GetWorkspaceDownloadDayOk returns a tuple with the WorkspaceDownloadDay field value +// and a boolean to check if the value has been set. +func (o *UsageMetersOut) GetWorkspaceDownloadDayOk() (*UsageMeterOut, bool) { + if o == nil { + return nil, false + } + return &o.WorkspaceDownloadDay, true +} + +// SetWorkspaceDownloadDay sets field value +func (o *UsageMetersOut) SetWorkspaceDownloadDay(v UsageMeterOut) { + o.WorkspaceDownloadDay = v +} + +// GetWorkspaceDownloadMonth returns the WorkspaceDownloadMonth field value +func (o *UsageMetersOut) GetWorkspaceDownloadMonth() UsageMeterOut { + if o == nil { + var ret UsageMeterOut + return ret + } + + return o.WorkspaceDownloadMonth +} + +// GetWorkspaceDownloadMonthOk returns a tuple with the WorkspaceDownloadMonth field value +// and a boolean to check if the value has been set. +func (o *UsageMetersOut) GetWorkspaceDownloadMonthOk() (*UsageMeterOut, bool) { + if o == nil { + return nil, false + } + return &o.WorkspaceDownloadMonth, true +} + +// SetWorkspaceDownloadMonth sets field value +func (o *UsageMetersOut) SetWorkspaceDownloadMonth(v UsageMeterOut) { + o.WorkspaceDownloadMonth = v +} + +// GetWorkspaceStorage returns the WorkspaceStorage field value +func (o *UsageMetersOut) GetWorkspaceStorage() UsageMeterOut { + if o == nil { + var ret UsageMeterOut + return ret + } + + return o.WorkspaceStorage +} + +// GetWorkspaceStorageOk returns a tuple with the WorkspaceStorage field value +// and a boolean to check if the value has been set. +func (o *UsageMetersOut) GetWorkspaceStorageOk() (*UsageMeterOut, bool) { + if o == nil { + return nil, false + } + return &o.WorkspaceStorage, true +} + +// SetWorkspaceStorage sets field value +func (o *UsageMetersOut) SetWorkspaceStorage(v UsageMeterOut) { + o.WorkspaceStorage = v +} + +func (o UsageMetersOut) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UsageMetersOut) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["drive_storage"] = o.DriveStorage + toSerialize["workspace_download_day"] = o.WorkspaceDownloadDay + toSerialize["workspace_download_month"] = o.WorkspaceDownloadMonth + toSerialize["workspace_storage"] = o.WorkspaceStorage + return toSerialize, nil +} + +func (o *UsageMetersOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "drive_storage", + "workspace_download_day", + "workspace_download_month", + "workspace_storage", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUsageMetersOut := _UsageMetersOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varUsageMetersOut) + + if err != nil { + return err + } + + *o = UsageMetersOut(varUsageMetersOut) + + return err +} + +type NullableUsageMetersOut struct { + value *UsageMetersOut + isSet bool +} + +func (v NullableUsageMetersOut) Get() *UsageMetersOut { + return v.value +} + +func (v *NullableUsageMetersOut) Set(val *UsageMetersOut) { + v.value = val + v.isSet = true +} + +func (v NullableUsageMetersOut) IsSet() bool { + return v.isSet +} + +func (v *NullableUsageMetersOut) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUsageMetersOut(val *UsageMetersOut) *NullableUsageMetersOut { + return &NullableUsageMetersOut{value: val, isSet: true} +} + +func (v NullableUsageMetersOut) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUsageMetersOut) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/sdk/openapi.json b/sdk/openapi.json index 73df969..4875db1 100644 --- a/sdk/openapi.json +++ b/sdk/openapi.json @@ -436,6 +436,7 @@ "enum": [ "agent", "user", + "service", "system" ], "title": "Type", @@ -848,19 +849,30 @@ "type": "object" }, "DriveUsageOut": { + "additionalProperties": false, "properties": { + "effective_limits": { + "$ref": "#/components/schemas/EffectiveLimitsOut" + }, + "meters": { + "$ref": "#/components/schemas/UsageMetersOut" + }, "retrieval_bytes": { + "minimum": 0.0, "title": "Retrieval Bytes", "type": "integer" }, "storage_bytes": { + "minimum": 0.0, "title": "Storage Bytes", "type": "integer" } }, "required": [ "storage_bytes", - "retrieval_bytes" + "retrieval_bytes", + "meters", + "effective_limits" ], "title": "DriveUsageOut", "type": "object" @@ -890,6 +902,39 @@ "title": "EditabilityOut", "type": "object" }, + "EffectiveLimitsOut": { + "additionalProperties": false, + "properties": { + "max_file_bytes": { + "exclusiveMinimum": 0.0, + "title": "Max File Bytes", + "type": "integer" + }, + "max_inline_file_bytes": { + "exclusiveMinimum": 0.0, + "title": "Max Inline File Bytes", + "type": "integer" + }, + "share_default_ttl_seconds": { + "exclusiveMinimum": 0.0, + "title": "Share Default Ttl Seconds", + "type": "integer" + }, + "share_max_ttl_seconds": { + "exclusiveMinimum": 0.0, + "title": "Share Max Ttl Seconds", + "type": "integer" + } + }, + "required": [ + "max_file_bytes", + "max_inline_file_bytes", + "share_default_ttl_seconds", + "share_max_ttl_seconds" + ], + "title": "EffectiveLimitsOut", + "type": "object" + }, "EntryListOut": { "properties": { "entries": { @@ -946,6 +991,7 @@ "AUTHENTICATION_REQUIRED", "AUTH_UNAVAILABLE", "BAD_REQUEST", + "BANDWIDTH_LIMIT_EXCEEDED", "CHANGE_CURSOR_EXPIRED", "CHECKSUM_MISMATCH", "CONFLICT", @@ -1357,13 +1403,14 @@ "type": "null" } ], - "description": "Required for `agent`, `user`, and `workspace`; omitted only for `public`. For `agent` and `user` it is checked against that type's id prefix (`tcagt_` / `tcusr_`) and a mismatch is `422 VALIDATION_ERROR`. The prefix is all AgentDrive asserts: these ids are minted by Hub, so their full shape is not AgentDrive's to enforce, and a well-formed id naming a principal that does not exist \u2014 or belongs to another workspace \u2014 is accepted here and simply never matches a token. The rule is conditional on `principal_type`, so it is enforced at the boundary rather than expressible as one JSON Schema `pattern`.", + "description": "Required for `agent`, `user`, `service`, and `workspace`; omitted only for `public`. For `agent`, `user`, and `service` it is checked against that type's id prefix (`tcagt_` / `tcusr_` / `tcsvc_`) and a mismatch is `422 VALIDATION_ERROR`. The prefix is all AgentDrive asserts: these ids are minted by Hub, so their full shape is not AgentDrive's to enforce, and a well-formed id naming a principal that does not exist \u2014 or belongs to another workspace \u2014 is accepted here and simply never matches a token. The rule is conditional on `principal_type`, so it is enforced at the boundary rather than expressible as one JSON Schema `pattern`.", "title": "Principal Id" }, "principal_type": { "enum": [ "agent", "user", + "service", "workspace", "public" ], @@ -1475,6 +1522,7 @@ "enum": [ "agent", "user", + "service", "workspace", "public" ], @@ -2625,6 +2673,88 @@ "title": "UploadWithTransferOut", "type": "object" }, + "UsageMeterOut": { + "additionalProperties": false, + "properties": { + "limit": { + "exclusiveMinimum": 0.0, + "title": "Limit", + "type": "integer" + }, + "remaining": { + "minimum": 0.0, + "title": "Remaining", + "type": "integer" + }, + "reserved": { + "minimum": 0.0, + "title": "Reserved", + "type": "integer" + }, + "reset_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Reset At" + }, + "scope": { + "enum": [ + "workspace", + "drive", + "principal", + "share" + ], + "title": "Scope", + "type": "string" + }, + "used": { + "minimum": 0.0, + "title": "Used", + "type": "integer" + } + }, + "required": [ + "scope", + "used", + "reserved", + "limit", + "remaining", + "reset_at" + ], + "title": "UsageMeterOut", + "type": "object" + }, + "UsageMetersOut": { + "additionalProperties": false, + "properties": { + "drive_storage": { + "$ref": "#/components/schemas/UsageMeterOut" + }, + "workspace_download_day": { + "$ref": "#/components/schemas/UsageMeterOut" + }, + "workspace_download_month": { + "$ref": "#/components/schemas/UsageMeterOut" + }, + "workspace_storage": { + "$ref": "#/components/schemas/UsageMeterOut" + } + }, + "required": [ + "drive_storage", + "workspace_storage", + "workspace_download_day", + "workspace_download_month" + ], + "title": "UsageMetersOut", + "type": "object" + }, "V0ErrorEnvelope": { "properties": { "error": { @@ -2639,6 +2769,7 @@ "AUTHENTICATION_REQUIRED", "AUTH_UNAVAILABLE", "BAD_REQUEST", + "BANDWIDTH_LIMIT_EXCEEDED", "CHANGE_CURSOR_EXPIRED", "CHECKSUM_MISMATCH", "CONFLICT", @@ -3163,7 +3294,7 @@ }, "/.well-known/oauth-protected-resource/mcp": { "get": { - "description": "Path-inserted protected-resource metadata used by MCP OAuth clients. Served by the MCP sidecar when one is configured, because it is the authority on the scope bundle its own tools require; otherwise it falls back to the resource-root document, since `/v0` and `/mcp` share AgentDrive's canonical audience.", + "description": "Path-inserted protected-resource metadata for the hosted MCP transport. It names a DIFFERENT resource from the root document \u2014 `/mcp`, with the separately maintained MCP scope list \u2014 and is served by the MCP sidecar, which is the authority on its own tool set. Deployments with no sidecar answer 404: there is no `/mcp` resource to describe.", "operationId": "oauth_protected_resource_mcp", "responses": { "200": { @@ -3265,16 +3396,16 @@ }, "/v0/drives": { "get": { - "description": "List the actor's workspace drives, newest-first (keyset paginated).\n\n``lifecycle`` (active|deleted|all) exposes soft-deleted drives so a\nmanager can read the post-delete revision as the If-Match source for a\nrestore. Unknown query parameters are rejected (\u00a76.3).", + "description": "List the actor's workspace drives, newest-first (keyset paginated).\n\n``state`` (active|deleted|all) exposes soft-deleted drives so a\nmanager can read the post-delete revision as the If-Match source for a\nrestore. Unknown query parameters are rejected (\u00a76.3).", "operationId": "drives_list", "parameters": [ { "in": "query", - "name": "lifecycle", + "name": "state", "required": false, "schema": { "default": "active", - "title": "Lifecycle", + "title": "State", "type": "string" } }, @@ -3506,7 +3637,8 @@ ], "x-required-scopes": [ "drives:read" - ] + ], + "x-stability-level": "beta" }, "post": { "description": "Create a drive with its structural root folder and creator-manager\ngrant(s) in one transaction; idempotent under the ``Idempotency-Key``.", @@ -3807,7 +3939,8 @@ ], "x-required-scopes": [ "drives:write" - ] + ], + "x-stability-level": "beta" } }, "/v0/drives/{drive_id}": { @@ -4118,7 +4251,8 @@ ], "x-required-scopes": [ "drives:write" - ] + ], + "x-stability-level": "beta" }, "get": { "description": "Read one active drive. ETag = quoted revision; matching\n``If-None-Match`` \u2192 304. Deleted and cross-workspace drives are 404.", @@ -4368,7 +4502,8 @@ ], "x-required-scopes": [ "drives:read" - ] + ], + "x-stability-level": "beta" }, "patch": { "description": "Rename / update a drive's metadata. Requires ``Idempotency-Key`` and\n``If-Match`` (428 absent, 412 stale); bumps the revision.", @@ -4687,12 +4822,13 @@ ], "x-required-scopes": [ "drives:write" - ] + ], + "x-stability-level": "beta" } }, "/v0/drives/{drive_id}/artifacts": { "get": { - "description": "List the drive's artifacts, newest-first (keyset paginated).\n\n``lifecycle`` (active|deleted|all) exposes soft-deleted artifacts.\n``parent_id`` / ``name`` / ``content_type`` / ``label`` are exact-match\nfilters; ``updated_after`` / ``updated_before`` are inclusive bounds.\nUnknown query parameters are rejected.", + "description": "List the drive's artifacts, newest-first (keyset paginated).\n\n``state`` (active|deleted|all) exposes soft-deleted artifacts.\n``parent_id`` / ``name`` / ``content_type`` / ``label`` are exact-match\nfilters; ``updated_after`` / ``updated_before`` are inclusive bounds.\nUnknown query parameters are rejected.", "operationId": "artifacts_list", "parameters": [ { @@ -4706,11 +4842,11 @@ }, { "in": "query", - "name": "lifecycle", + "name": "state", "required": false, "schema": { "default": "active", - "title": "Lifecycle", + "title": "State", "type": "string" } }, @@ -5040,7 +5176,8 @@ ], "x-required-scopes": [ "content:read" - ] + ], + "x-stability-level": "beta" }, "post": { "description": "Create one artifact with inline content \u2014 multipart only.\n\nMultipart only (415 for a JSON body). Parts: parent_id, name, metadata, content (bytes), content_type, sha256. parent_id, name, and content are required.", @@ -5418,7 +5555,8 @@ ], "x-required-scopes": [ "content:write" - ] + ], + "x-stability-level": "beta" } }, "/v0/drives/{drive_id}/artifacts/{artifact_id}": { @@ -5738,7 +5876,8 @@ ], "x-required-scopes": [ "content:write" - ] + ], + "x-stability-level": "beta" }, "get": { "description": "Read one active artifact. ``If-None-Match`` short-circuits to 304.", @@ -5997,7 +6136,8 @@ ], "x-required-scopes": [ "content:read" - ] + ], + "x-stability-level": "beta" }, "patch": { "description": "Rename / move / set metadata or labels. At least one field required.", @@ -6325,7 +6465,8 @@ ], "x-required-scopes": [ "content:write" - ] + ], + "x-stability-level": "beta" } }, "/v0/drives/{drive_id}/artifacts/{artifact_id}/cells": { @@ -6642,7 +6783,8 @@ ], "x-required-scopes": [ "content:read" - ] + ], + "x-stability-level": "beta" } }, "/v0/drives/{drive_id}/artifacts/{artifact_id}/content": { @@ -6916,7 +7058,8 @@ ], "x-required-scopes": [ "content:read" - ] + ], + "x-stability-level": "beta" } }, "/v0/drives/{drive_id}/artifacts/{artifact_id}/copy": { @@ -7254,7 +7397,8 @@ "x-required-scopes": [ "content:read", "content:write" - ] + ], + "x-stability-level": "beta" } }, "/v0/drives/{drive_id}/artifacts/{artifact_id}/restore": { @@ -7574,7 +7718,8 @@ ], "x-required-scopes": [ "content:write" - ] + ], + "x-stability-level": "beta" } }, "/v0/drives/{drive_id}/artifacts/{artifact_id}/sheet-sessions": { @@ -7844,7 +7989,8 @@ ], "x-required-scopes": [ "content:read" - ] + ], + "x-stability-level": "beta" }, "post": { "description": "Open an edit session. `If-Match` on the artifact head is required and\nis captured for completion.", @@ -8167,7 +8313,8 @@ ], "x-required-scopes": [ "content:write" - ] + ], + "x-stability-level": "beta" } }, "/v0/drives/{drive_id}/artifacts/{artifact_id}/sheet-sessions/{session_id}": { @@ -8484,7 +8631,8 @@ ], "x-required-scopes": [ "content:write" - ] + ], + "x-stability-level": "beta" }, "get": { "description": "One session. Reads deliberately do NOT extend the lease, so a polling\nconsole can never keep a dead agent's session alive.", @@ -8740,7 +8888,8 @@ ], "x-required-scopes": [ "content:read" - ] + ], + "x-stability-level": "beta" } }, "/v0/drives/{drive_id}/artifacts/{artifact_id}/sheet-sessions/{session_id}/cells": { @@ -9003,7 +9152,8 @@ ], "x-required-scopes": [ "content:read" - ] + ], + "x-stability-level": "beta" }, "post": { "description": "Append range writes to the edit log.\n\nNo `If-Match`: the session's captured `base_revision` is the concurrency\nanchor and completion is where it is enforced. `Idempotency-Key` is what\nmakes a retry safe \u2014 without it a retried write landing after a later\noverlapping write would silently resurrect stale values.", @@ -9312,7 +9462,8 @@ ], "x-required-scopes": [ "content:write" - ] + ], + "x-stability-level": "beta" } }, "/v0/drives/{drive_id}/artifacts/{artifact_id}/sheet-sessions/{session_id}/complete": { @@ -9641,7 +9792,8 @@ ], "x-required-scopes": [ "content:write" - ] + ], + "x-stability-level": "beta" } }, "/v0/drives/{drive_id}/artifacts/{artifact_id}/sheet-sessions/{session_id}/edits": { @@ -9904,7 +10056,8 @@ ], "x-required-scopes": [ "content:read" - ] + ], + "x-stability-level": "beta" } }, "/v0/drives/{drive_id}/artifacts/{artifact_id}/sheets": { @@ -10189,7 +10342,8 @@ ], "x-required-scopes": [ "content:read" - ] + ], + "x-stability-level": "beta" } }, "/v0/drives/{drive_id}/artifacts/{artifact_id}/versions": { @@ -10443,7 +10597,8 @@ ], "x-required-scopes": [ "content:read" - ] + ], + "x-stability-level": "beta" }, "post": { "description": "Append one immutable version and rotate the artifact head.\n\nMultipart only (415 for a JSON body). Parts: content (bytes), content_type, sha256. content is required; name, parent_id, and metadata are not accepted here.", @@ -10832,7 +10987,8 @@ ], "x-required-scopes": [ "content:write" - ] + ], + "x-stability-level": "beta" } }, "/v0/drives/{drive_id}/artifacts/{artifact_id}/versions/{version_id}": { @@ -11102,7 +11258,8 @@ ], "x-required-scopes": [ "content:read" - ] + ], + "x-stability-level": "beta" } }, "/v0/drives/{drive_id}/artifacts/{artifact_id}/versions/{version_id}/cells": { @@ -11428,7 +11585,8 @@ ], "x-required-scopes": [ "content:read" - ] + ], + "x-stability-level": "beta" } }, "/v0/drives/{drive_id}/artifacts/{artifact_id}/versions/{version_id}/content": { @@ -11711,7 +11869,8 @@ ], "x-required-scopes": [ "content:read" - ] + ], + "x-stability-level": "beta" } }, "/v0/drives/{drive_id}/artifacts/{artifact_id}/versions/{version_id}/restore": { @@ -12047,7 +12206,8 @@ ], "x-required-scopes": [ "content:write" - ] + ], + "x-stability-level": "beta" } }, "/v0/drives/{drive_id}/artifacts/{artifact_id}/versions/{version_id}/sheets": { @@ -12341,7 +12501,8 @@ ], "x-required-scopes": [ "content:read" - ] + ], + "x-stability-level": "beta" } }, "/v0/drives/{drive_id}/artifacts/{artifact_id}/viewer-sessions": { @@ -12649,7 +12810,7 @@ }, "/v0/drives/{drive_id}/changes": { "get": { - "description": "Pull one page of changes. Exactly one of ``start`` or ``cursor``.\n\n``type`` is an optional comma-separated allow-list of exact event-type\nstrings (e.g. ``type=folder.created,artifact.updated`` for content only, or\n``type=grant.created,grant.updated,grant.revoked`` for grant events). A\ncomma-list \u2014 not a single value or a ``grant.*`` glob \u2014 because the useful\nsync queries (\"content only\", \"all permission events\") are SETS of exact\ntypes, and exact-match keeps the filter's meaning independent of the dotted\nnaming (\u00a76.3: unknown params are rejected; unknown type VALUES 400 here).\nPermission types requested by a non-manager are silently empty (the\nmanager filter still applies), never an existence oracle.", + "description": "Pull one page of changes. Exactly one of ``start`` or ``cursor``.\n\n``order`` selects the direction of the walk and accompanies ``start``, never\na ``cursor`` \u2014 a cursor already carries the direction it was minted for, so\nrepeating it could only ever contradict it.\n\n``oldest`` (the default) is the resumable sync walk: forward from the\nposition, and a drained cursor re-presented later picks up what committed\nsince. ``newest`` is a browse walk for a history screen: it captures the\nhead and walks down toward the retention floor, newest row first. Because\nnew events land ABOVE a captured head, a drained descending cursor stays\ndrained \u2014 a reader checking for new activity captures the head again. That\nis also why ``order=newest`` takes only ``start=now``: ``beginning`` names\nthe far end of a walk that already ends there.\n\n``type`` is an optional comma-separated allow-list of exact event-type\nstrings (e.g. ``type=folder.created,artifact.updated`` for content only, or\n``type=grant.created,grant.updated,grant.revoked`` for grant events). A\ncomma-list \u2014 not a single value or a ``grant.*`` glob \u2014 because the useful\nsync queries (\"content only\", \"all permission events\") are SETS of exact\ntypes, and exact-match keeps the filter's meaning independent of the dotted\nnaming (\u00a76.3: unknown params are rejected; unknown type VALUES 400 here).\nPermission types requested by a non-manager are silently empty (the\nmanager filter still applies), never an existence oracle.", "operationId": "changes_list", "parameters": [ { @@ -12729,6 +12890,26 @@ "title": "Type" } }, + { + "in": "query", + "name": "order", + "required": false, + "schema": { + "anyOf": [ + { + "enum": [ + "oldest", + "newest" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Order" + } + }, { "deprecated": true, "description": "Deprecated: redundant with the operation's `bearerAuth` security requirement, which is how a generated client should learn to authenticate. Scheduled for removal.", @@ -12943,7 +13124,8 @@ ], "x-required-scopes": [ "changes:read" - ] + ], + "x-stability-level": "beta" } }, "/v0/drives/{drive_id}/download-capabilities": { @@ -13258,12 +13440,13 @@ ], "x-required-scopes": [ "content:read" - ] + ], + "x-stability-level": "beta" } }, "/v0/drives/{drive_id}/entries": { "get": { - "description": "List one folder's direct children across the shared namespace.", + "description": "List one folder's direct children across the shared namespace.\n\n``state`` (active|deleted|all) exposes soft-deleted entries, matching\nevery other v0 collection. Unknown query parameters are rejected.", "operationId": "entries_list", "parameters": [ { @@ -13620,12 +13803,13 @@ ], "x-required-scopes": [ "content:read" - ] + ], + "x-stability-level": "beta" } }, "/v0/drives/{drive_id}/folders": { "get": { - "description": "List the drive's folders, newest-first (keyset paginated).\n\n``lifecycle`` (active|deleted|all) exposes soft-deleted folders so the\npost-delete revision can be read as the If-Match source for a restore.\n``parent_id`` / ``name`` are exact-match filters. Unknown query parameters\nare rejected (\u00a76.3).", + "description": "List the drive's folders, newest-first (keyset paginated).\n\n``state`` (active|deleted|all) exposes soft-deleted folders so the\npost-delete revision can be read as the If-Match source for a restore.\n``parent_id`` / ``name`` are exact-match filters. Unknown query parameters\nare rejected (\u00a76.3).", "operationId": "folders_list", "parameters": [ { @@ -13639,11 +13823,11 @@ }, { "in": "query", - "name": "lifecycle", + "name": "state", "required": false, "schema": { "default": "active", - "title": "Lifecycle", + "title": "State", "type": "string" } }, @@ -13907,7 +14091,8 @@ ], "x-required-scopes": [ "content:read" - ] + ], + "x-stability-level": "beta" }, "post": { "description": "Create one folder under `parent_id`; idempotent under the\n``Idempotency-Key``.", @@ -14217,7 +14402,8 @@ ], "x-required-scopes": [ "content:write" - ] + ], + "x-stability-level": "beta" } }, "/v0/drives/{drive_id}/folders/{folder_id}": { @@ -14547,7 +14733,8 @@ ], "x-required-scopes": [ "content:write" - ] + ], + "x-stability-level": "beta" }, "get": { "description": "Read one active folder. ETag = quoted revision; matching\n``If-None-Match`` \u2192 304. Deleted and cross-workspace folders are 404.", @@ -14806,7 +14993,8 @@ ], "x-required-scopes": [ "content:read" - ] + ], + "x-stability-level": "beta" }, "patch": { "description": "Rename / move / update a folder's metadata. Requires\n``Idempotency-Key`` and ``If-Match`` (428 absent, 412 stale); bumps the\nrevision.", @@ -15134,7 +15322,8 @@ ], "x-required-scopes": [ "content:write" - ] + ], + "x-stability-level": "beta" } }, "/v0/drives/{drive_id}/folders/{folder_id}/copy": { @@ -15472,7 +15661,8 @@ "x-required-scopes": [ "content:read", "content:write" - ] + ], + "x-stability-level": "beta" } }, "/v0/drives/{drive_id}/folders/{folder_id}/restore": { @@ -15792,7 +15982,8 @@ ], "x-required-scopes": [ "content:write" - ] + ], + "x-stability-level": "beta" } }, "/v0/drives/{drive_id}/grants": { @@ -15811,11 +16002,11 @@ }, { "in": "query", - "name": "lifecycle", + "name": "state", "required": false, "schema": { "default": "active", - "title": "Lifecycle", + "title": "State", "type": "string" } }, @@ -16095,7 +16286,8 @@ ], "x-required-scopes": [ "sharing:read" - ] + ], + "x-stability-level": "beta" }, "post": { "description": "Grant one principal a role on a drive, folder, or artifact.", @@ -16405,7 +16597,8 @@ ], "x-required-scopes": [ "sharing:write" - ] + ], + "x-stability-level": "beta" } }, "/v0/drives/{drive_id}/grants/{grant_id}": { @@ -16725,7 +16918,8 @@ ], "x-required-scopes": [ "sharing:write" - ] + ], + "x-stability-level": "beta" }, "get": { "description": "Read one grant in the drive.", @@ -16984,7 +17178,8 @@ ], "x-required-scopes": [ "sharing:read" - ] + ], + "x-stability-level": "beta" }, "patch": { "description": "Change a grant's role or expiry under If-Match.", @@ -17312,7 +17507,8 @@ ], "x-required-scopes": [ "sharing:write" - ] + ], + "x-stability-level": "beta" } }, "/v0/drives/{drive_id}/lookup": { @@ -17550,7 +17746,8 @@ ], "x-required-scopes": [ "content:read" - ] + ], + "x-stability-level": "beta" } }, "/v0/drives/{drive_id}/restore": { @@ -17861,7 +18058,8 @@ ], "x-required-scopes": [ "drives:write" - ] + ], + "x-stability-level": "beta" } }, "/v0/drives/{drive_id}/search": { @@ -18213,7 +18411,8 @@ ], "x-required-scopes": [ "content:read" - ] + ], + "x-stability-level": "beta" } }, "/v0/drives/{drive_id}/shares": { @@ -18232,11 +18431,11 @@ }, { "in": "query", - "name": "lifecycle", + "name": "state", "required": false, "schema": { "default": "active", - "title": "Lifecycle", + "title": "State", "type": "string" } }, @@ -18500,7 +18699,8 @@ ], "x-required-scopes": [ "sharing:read" - ] + ], + "x-stability-level": "beta" }, "post": { "description": "Mint a read-only bearer link. The response carries the plaintext\nsecret \u2014 the only response that does.", @@ -18810,7 +19010,8 @@ ], "x-required-scopes": [ "sharing:write" - ] + ], + "x-stability-level": "beta" } }, "/v0/drives/{drive_id}/shares/{share_id}": { @@ -19130,7 +19331,8 @@ ], "x-required-scopes": [ "sharing:write" - ] + ], + "x-stability-level": "beta" }, "get": { "description": "Read one share's management representation (no secret).", @@ -19389,7 +19591,8 @@ ], "x-required-scopes": [ "sharing:read" - ] + ], + "x-stability-level": "beta" } }, "/v0/drives/{drive_id}/shares/{share_id}/rotate": { @@ -19709,7 +19912,8 @@ ], "x-required-scopes": [ "sharing:write" - ] + ], + "x-stability-level": "beta" } }, "/v0/drives/{drive_id}/uploads": { @@ -20214,7 +20418,8 @@ ], "x-required-scopes": [ "content:write" - ] + ], + "x-stability-level": "beta" } }, "/v0/drives/{drive_id}/uploads/{upload_id}": { @@ -20552,7 +20757,8 @@ ], "x-required-scopes": [ "content:write" - ] + ], + "x-stability-level": "beta" }, "get": { "description": "Non-secret recovery state (\u00a75.3). Never a target, coordinate,\nprincipal, reservation, continuation, or provider diagnostic.\n\nIdempotency-Key is not part of this read's contract (manifest idempotency_class: not_required): a supplied key plays no role and creates no idempotency record.", @@ -20829,7 +21035,8 @@ ], "x-required-scopes": [ "content:write" - ] + ], + "x-stability-level": "beta" } }, "/v0/drives/{drive_id}/uploads/{upload_id}/complete": { @@ -21182,12 +21389,13 @@ ], "x-required-scopes": [ "content:write" - ] + ], + "x-stability-level": "beta" } }, "/v0/drives/{drive_id}/usage": { "get": { - "description": "Byte counters for one active drive: storage is the live sum of its\nversions' sizes; retrieval reads the counter the content-read slice\nmaintains (0 until it lands).", + "description": "Usage counters, current storage and download meters, and the effective\nfile/share limits for one active drive. The snapshot includes committed\nand reserved bytes so clients can show capacity already in flight.", "operationId": "drives_usage", "parameters": [ { @@ -21395,7 +21603,8 @@ ], "x-required-scopes": [ "usage:read" - ] + ], + "x-stability-level": "beta" } } }, @@ -21405,5 +21614,5 @@ "url": "https://drive.tokencanopy.com" } ], - "x-agentdrive-compatibility-policy": 1 + "x-agentdrive-compatibility-policy": 2 } diff --git a/sdk/openapi.provenance.json b/sdk/openapi.provenance.json index 79545fd..864edfb 100644 --- a/sdk/openapi.provenance.json +++ b/sdk/openapi.provenance.json @@ -1,7 +1,7 @@ { "generator_image": "openapitools/openapi-generator-cli:v7.16.0@sha256:e56372add5e038753fb91aa1bbb470724ef58382fdfc35082bf1b3e079ce353c", - "source_commit": "42814e4788b7c09f5af3bdf145c2911b70f56967", - "source_path": "tests/openapi.golden.json", - "source_repository": "https://github.com/tokencanopy/agentdrive", - "source_sha256": "07c14b60dd7869c555e9c6fd1ad9db994fb45f5de3a7f8474d9d0453ae9c8422" + "source_commit": "100aa364cd9e71d15d880b8121ba855fec67ef08", + "source_path": "apps/drive/tests/openapi.golden.json", + "source_repository": "https://github.com/tokencanopy/tokencanopy", + "source_sha256": "89ecb2bdc88494633a71d8a6da4159e794e24da4a7aebe75383beec45292a7f9" } diff --git a/sdk/python/agentdrive_sdk/generated/__init__.py b/sdk/python/agentdrive_sdk/generated/__init__.py index bab6563..b830a63 100644 --- a/sdk/python/agentdrive_sdk/generated/__init__.py +++ b/sdk/python/agentdrive_sdk/generated/__init__.py @@ -68,6 +68,7 @@ "DriveUpdateIn", "DriveUsageOut", "EditabilityOut", + "EffectiveLimitsOut", "EntriesInner", "EntryListOut", "ErrorResponse", @@ -117,6 +118,8 @@ "UploadsCreateRequestTarget", "UploadsCreateRequestTargetOneOf", "UploadsCreateRequestTargetOneOf1", + "UsageMeterOut", + "UsageMetersOut", "V0ErrorEnvelope", "ValidationErrorResponse", "ValidationErrorResponseError", @@ -186,6 +189,7 @@ from agentdrive_sdk.generated.models.drive_update_in import DriveUpdateIn as DriveUpdateIn from agentdrive_sdk.generated.models.drive_usage_out import DriveUsageOut as DriveUsageOut from agentdrive_sdk.generated.models.editability_out import EditabilityOut as EditabilityOut +from agentdrive_sdk.generated.models.effective_limits_out import EffectiveLimitsOut as EffectiveLimitsOut from agentdrive_sdk.generated.models.entries_inner import EntriesInner as EntriesInner from agentdrive_sdk.generated.models.entry_list_out import EntryListOut as EntryListOut from agentdrive_sdk.generated.models.error_response import ErrorResponse as ErrorResponse @@ -235,6 +239,8 @@ from agentdrive_sdk.generated.models.uploads_create_request_target import UploadsCreateRequestTarget as UploadsCreateRequestTarget from agentdrive_sdk.generated.models.uploads_create_request_target_one_of import UploadsCreateRequestTargetOneOf as UploadsCreateRequestTargetOneOf from agentdrive_sdk.generated.models.uploads_create_request_target_one_of1 import UploadsCreateRequestTargetOneOf1 as UploadsCreateRequestTargetOneOf1 +from agentdrive_sdk.generated.models.usage_meter_out import UsageMeterOut as UsageMeterOut +from agentdrive_sdk.generated.models.usage_meters_out import UsageMetersOut as UsageMetersOut from agentdrive_sdk.generated.models.v0_error_envelope import V0ErrorEnvelope as V0ErrorEnvelope from agentdrive_sdk.generated.models.validation_error_response import ValidationErrorResponse as ValidationErrorResponse from agentdrive_sdk.generated.models.validation_error_response_error import ValidationErrorResponseError as ValidationErrorResponseError diff --git a/sdk/python/agentdrive_sdk/generated/api/artifacts_api.py b/sdk/python/agentdrive_sdk/generated/api/artifacts_api.py index 99d7bc1..49555b1 100644 --- a/sdk/python/agentdrive_sdk/generated/api/artifacts_api.py +++ b/sdk/python/agentdrive_sdk/generated/api/artifacts_api.py @@ -1541,7 +1541,7 @@ def _artifacts_delete_serialize( def artifacts_list( self, drive_id: StrictStr, - lifecycle: Optional[StrictStr] = None, + state: Optional[StrictStr] = None, limit: Optional[StrictInt] = None, cursor: Optional[StrictStr] = None, parent_id: Optional[StrictStr] = None, @@ -1566,12 +1566,12 @@ def artifacts_list( ) -> ArtifactListOut: """List Artifacts - List the drive's artifacts, newest-first (keyset paginated). ``lifecycle`` (active|deleted|all) exposes soft-deleted artifacts. ``parent_id`` / ``name`` / ``content_type`` / ``label`` are exact-match filters; ``updated_after`` / ``updated_before`` are inclusive bounds. Unknown query parameters are rejected. + List the drive's artifacts, newest-first (keyset paginated). ``state`` (active|deleted|all) exposes soft-deleted artifacts. ``parent_id`` / ``name`` / ``content_type`` / ``label`` are exact-match filters; ``updated_after`` / ``updated_before`` are inclusive bounds. Unknown query parameters are rejected. :param drive_id: (required) :type drive_id: str - :param lifecycle: - :type lifecycle: str + :param state: + :type state: str :param limit: :type limit: int :param cursor: @@ -1614,7 +1614,7 @@ def artifacts_list( _param = self._artifacts_list_serialize( drive_id=drive_id, - lifecycle=lifecycle, + state=state, limit=limit, cursor=cursor, parent_id=parent_id, @@ -1655,7 +1655,7 @@ def artifacts_list( def artifacts_list_with_http_info( self, drive_id: StrictStr, - lifecycle: Optional[StrictStr] = None, + state: Optional[StrictStr] = None, limit: Optional[StrictInt] = None, cursor: Optional[StrictStr] = None, parent_id: Optional[StrictStr] = None, @@ -1680,12 +1680,12 @@ def artifacts_list_with_http_info( ) -> ApiResponse[ArtifactListOut]: """List Artifacts - List the drive's artifacts, newest-first (keyset paginated). ``lifecycle`` (active|deleted|all) exposes soft-deleted artifacts. ``parent_id`` / ``name`` / ``content_type`` / ``label`` are exact-match filters; ``updated_after`` / ``updated_before`` are inclusive bounds. Unknown query parameters are rejected. + List the drive's artifacts, newest-first (keyset paginated). ``state`` (active|deleted|all) exposes soft-deleted artifacts. ``parent_id`` / ``name`` / ``content_type`` / ``label`` are exact-match filters; ``updated_after`` / ``updated_before`` are inclusive bounds. Unknown query parameters are rejected. :param drive_id: (required) :type drive_id: str - :param lifecycle: - :type lifecycle: str + :param state: + :type state: str :param limit: :type limit: int :param cursor: @@ -1728,7 +1728,7 @@ def artifacts_list_with_http_info( _param = self._artifacts_list_serialize( drive_id=drive_id, - lifecycle=lifecycle, + state=state, limit=limit, cursor=cursor, parent_id=parent_id, @@ -1769,7 +1769,7 @@ def artifacts_list_with_http_info( def artifacts_list_without_preload_content( self, drive_id: StrictStr, - lifecycle: Optional[StrictStr] = None, + state: Optional[StrictStr] = None, limit: Optional[StrictInt] = None, cursor: Optional[StrictStr] = None, parent_id: Optional[StrictStr] = None, @@ -1794,12 +1794,12 @@ def artifacts_list_without_preload_content( ) -> RESTResponseType: """List Artifacts - List the drive's artifacts, newest-first (keyset paginated). ``lifecycle`` (active|deleted|all) exposes soft-deleted artifacts. ``parent_id`` / ``name`` / ``content_type`` / ``label`` are exact-match filters; ``updated_after`` / ``updated_before`` are inclusive bounds. Unknown query parameters are rejected. + List the drive's artifacts, newest-first (keyset paginated). ``state`` (active|deleted|all) exposes soft-deleted artifacts. ``parent_id`` / ``name`` / ``content_type`` / ``label`` are exact-match filters; ``updated_after`` / ``updated_before`` are inclusive bounds. Unknown query parameters are rejected. :param drive_id: (required) :type drive_id: str - :param lifecycle: - :type lifecycle: str + :param state: + :type state: str :param limit: :type limit: int :param cursor: @@ -1842,7 +1842,7 @@ def artifacts_list_without_preload_content( _param = self._artifacts_list_serialize( drive_id=drive_id, - lifecycle=lifecycle, + state=state, limit=limit, cursor=cursor, parent_id=parent_id, @@ -1878,7 +1878,7 @@ def artifacts_list_without_preload_content( def _artifacts_list_serialize( self, drive_id, - lifecycle, + state, limit, cursor, parent_id, @@ -1912,9 +1912,9 @@ def _artifacts_list_serialize( if drive_id is not None: _path_params['drive_id'] = drive_id # process the query parameters - if lifecycle is not None: + if state is not None: - _query_params.append(('lifecycle', lifecycle)) + _query_params.append(('state', state)) if limit is not None: diff --git a/sdk/python/agentdrive_sdk/generated/api/changes_api.py b/sdk/python/agentdrive_sdk/generated/api/changes_api.py index 8e9fb5f..45bdb7d 100644 --- a/sdk/python/agentdrive_sdk/generated/api/changes_api.py +++ b/sdk/python/agentdrive_sdk/generated/api/changes_api.py @@ -47,6 +47,7 @@ def changes_list( start: Optional[StrictStr] = None, cursor: Optional[StrictStr] = None, type: Optional[StrictStr] = None, + order: Optional[StrictStr] = None, authorization: Annotated[Optional[StrictStr], Field(description="Deprecated: redundant with the operation's `bearerAuth` security requirement, which is how a generated client should learn to authenticate. Scheduled for removal.")] = None, _request_timeout: Union[ None, @@ -63,7 +64,7 @@ def changes_list( ) -> ChangePageOut: """List Changes - Pull one page of changes. Exactly one of ``start`` or ``cursor``. ``type`` is an optional comma-separated allow-list of exact event-type strings (e.g. ``type=folder.created,artifact.updated`` for content only, or ``type=grant.created,grant.updated,grant.revoked`` for grant events). A comma-list — not a single value or a ``grant.*`` glob — because the useful sync queries (\"content only\", \"all permission events\") are SETS of exact types, and exact-match keeps the filter's meaning independent of the dotted naming (§6.3: unknown params are rejected; unknown type VALUES 400 here). Permission types requested by a non-manager are silently empty (the manager filter still applies), never an existence oracle. + Pull one page of changes. Exactly one of ``start`` or ``cursor``. ``order`` selects the direction of the walk and accompanies ``start``, never a ``cursor`` — a cursor already carries the direction it was minted for, so repeating it could only ever contradict it. ``oldest`` (the default) is the resumable sync walk: forward from the position, and a drained cursor re-presented later picks up what committed since. ``newest`` is a browse walk for a history screen: it captures the head and walks down toward the retention floor, newest row first. Because new events land ABOVE a captured head, a drained descending cursor stays drained — a reader checking for new activity captures the head again. That is also why ``order=newest`` takes only ``start=now``: ``beginning`` names the far end of a walk that already ends there. ``type`` is an optional comma-separated allow-list of exact event-type strings (e.g. ``type=folder.created,artifact.updated`` for content only, or ``type=grant.created,grant.updated,grant.revoked`` for grant events). A comma-list — not a single value or a ``grant.*`` glob — because the useful sync queries (\"content only\", \"all permission events\") are SETS of exact types, and exact-match keeps the filter's meaning independent of the dotted naming (§6.3: unknown params are rejected; unknown type VALUES 400 here). Permission types requested by a non-manager are silently empty (the manager filter still applies), never an existence oracle. :param drive_id: (required) :type drive_id: str @@ -75,6 +76,8 @@ def changes_list( :type cursor: str :param type: :type type: str + :param order: + :type order: str :param authorization: Deprecated: redundant with the operation's `bearerAuth` security requirement, which is how a generated client should learn to authenticate. Scheduled for removal. :type authorization: str :param _request_timeout: timeout setting for this request. If one @@ -105,6 +108,7 @@ def changes_list( start=start, cursor=cursor, type=type, + order=order, authorization=authorization, _request_auth=_request_auth, _content_type=_content_type, @@ -142,6 +146,7 @@ def changes_list_with_http_info( start: Optional[StrictStr] = None, cursor: Optional[StrictStr] = None, type: Optional[StrictStr] = None, + order: Optional[StrictStr] = None, authorization: Annotated[Optional[StrictStr], Field(description="Deprecated: redundant with the operation's `bearerAuth` security requirement, which is how a generated client should learn to authenticate. Scheduled for removal.")] = None, _request_timeout: Union[ None, @@ -158,7 +163,7 @@ def changes_list_with_http_info( ) -> ApiResponse[ChangePageOut]: """List Changes - Pull one page of changes. Exactly one of ``start`` or ``cursor``. ``type`` is an optional comma-separated allow-list of exact event-type strings (e.g. ``type=folder.created,artifact.updated`` for content only, or ``type=grant.created,grant.updated,grant.revoked`` for grant events). A comma-list — not a single value or a ``grant.*`` glob — because the useful sync queries (\"content only\", \"all permission events\") are SETS of exact types, and exact-match keeps the filter's meaning independent of the dotted naming (§6.3: unknown params are rejected; unknown type VALUES 400 here). Permission types requested by a non-manager are silently empty (the manager filter still applies), never an existence oracle. + Pull one page of changes. Exactly one of ``start`` or ``cursor``. ``order`` selects the direction of the walk and accompanies ``start``, never a ``cursor`` — a cursor already carries the direction it was minted for, so repeating it could only ever contradict it. ``oldest`` (the default) is the resumable sync walk: forward from the position, and a drained cursor re-presented later picks up what committed since. ``newest`` is a browse walk for a history screen: it captures the head and walks down toward the retention floor, newest row first. Because new events land ABOVE a captured head, a drained descending cursor stays drained — a reader checking for new activity captures the head again. That is also why ``order=newest`` takes only ``start=now``: ``beginning`` names the far end of a walk that already ends there. ``type`` is an optional comma-separated allow-list of exact event-type strings (e.g. ``type=folder.created,artifact.updated`` for content only, or ``type=grant.created,grant.updated,grant.revoked`` for grant events). A comma-list — not a single value or a ``grant.*`` glob — because the useful sync queries (\"content only\", \"all permission events\") are SETS of exact types, and exact-match keeps the filter's meaning independent of the dotted naming (§6.3: unknown params are rejected; unknown type VALUES 400 here). Permission types requested by a non-manager are silently empty (the manager filter still applies), never an existence oracle. :param drive_id: (required) :type drive_id: str @@ -170,6 +175,8 @@ def changes_list_with_http_info( :type cursor: str :param type: :type type: str + :param order: + :type order: str :param authorization: Deprecated: redundant with the operation's `bearerAuth` security requirement, which is how a generated client should learn to authenticate. Scheduled for removal. :type authorization: str :param _request_timeout: timeout setting for this request. If one @@ -200,6 +207,7 @@ def changes_list_with_http_info( start=start, cursor=cursor, type=type, + order=order, authorization=authorization, _request_auth=_request_auth, _content_type=_content_type, @@ -237,6 +245,7 @@ def changes_list_without_preload_content( start: Optional[StrictStr] = None, cursor: Optional[StrictStr] = None, type: Optional[StrictStr] = None, + order: Optional[StrictStr] = None, authorization: Annotated[Optional[StrictStr], Field(description="Deprecated: redundant with the operation's `bearerAuth` security requirement, which is how a generated client should learn to authenticate. Scheduled for removal.")] = None, _request_timeout: Union[ None, @@ -253,7 +262,7 @@ def changes_list_without_preload_content( ) -> RESTResponseType: """List Changes - Pull one page of changes. Exactly one of ``start`` or ``cursor``. ``type`` is an optional comma-separated allow-list of exact event-type strings (e.g. ``type=folder.created,artifact.updated`` for content only, or ``type=grant.created,grant.updated,grant.revoked`` for grant events). A comma-list — not a single value or a ``grant.*`` glob — because the useful sync queries (\"content only\", \"all permission events\") are SETS of exact types, and exact-match keeps the filter's meaning independent of the dotted naming (§6.3: unknown params are rejected; unknown type VALUES 400 here). Permission types requested by a non-manager are silently empty (the manager filter still applies), never an existence oracle. + Pull one page of changes. Exactly one of ``start`` or ``cursor``. ``order`` selects the direction of the walk and accompanies ``start``, never a ``cursor`` — a cursor already carries the direction it was minted for, so repeating it could only ever contradict it. ``oldest`` (the default) is the resumable sync walk: forward from the position, and a drained cursor re-presented later picks up what committed since. ``newest`` is a browse walk for a history screen: it captures the head and walks down toward the retention floor, newest row first. Because new events land ABOVE a captured head, a drained descending cursor stays drained — a reader checking for new activity captures the head again. That is also why ``order=newest`` takes only ``start=now``: ``beginning`` names the far end of a walk that already ends there. ``type`` is an optional comma-separated allow-list of exact event-type strings (e.g. ``type=folder.created,artifact.updated`` for content only, or ``type=grant.created,grant.updated,grant.revoked`` for grant events). A comma-list — not a single value or a ``grant.*`` glob — because the useful sync queries (\"content only\", \"all permission events\") are SETS of exact types, and exact-match keeps the filter's meaning independent of the dotted naming (§6.3: unknown params are rejected; unknown type VALUES 400 here). Permission types requested by a non-manager are silently empty (the manager filter still applies), never an existence oracle. :param drive_id: (required) :type drive_id: str @@ -265,6 +274,8 @@ def changes_list_without_preload_content( :type cursor: str :param type: :type type: str + :param order: + :type order: str :param authorization: Deprecated: redundant with the operation's `bearerAuth` security requirement, which is how a generated client should learn to authenticate. Scheduled for removal. :type authorization: str :param _request_timeout: timeout setting for this request. If one @@ -295,6 +306,7 @@ def changes_list_without_preload_content( start=start, cursor=cursor, type=type, + order=order, authorization=authorization, _request_auth=_request_auth, _content_type=_content_type, @@ -327,6 +339,7 @@ def _changes_list_serialize( start, cursor, type, + order, authorization, _request_auth, _content_type, @@ -368,6 +381,10 @@ def _changes_list_serialize( _query_params.append(('type', type)) + if order is not None: + + _query_params.append(('order', order)) + # process the header parameters if authorization is not None: _header_params['authorization'] = authorization diff --git a/sdk/python/agentdrive_sdk/generated/api/discovery_api.py b/sdk/python/agentdrive_sdk/generated/api/discovery_api.py index 2b472a5..9c77c7c 100644 --- a/sdk/python/agentdrive_sdk/generated/api/discovery_api.py +++ b/sdk/python/agentdrive_sdk/generated/api/discovery_api.py @@ -299,7 +299,7 @@ def oauth_protected_resource_mcp( ) -> Dict[str, object]: """Protected-resource metadata for the MCP endpoint (RFC 9728) - Path-inserted protected-resource metadata used by MCP OAuth clients. Served by the MCP sidecar when one is configured, because it is the authority on the scope bundle its own tools require; otherwise it falls back to the resource-root document, since `/v0` and `/mcp` share AgentDrive's canonical audience. + Path-inserted protected-resource metadata for the hosted MCP transport. It names a DIFFERENT resource from the root document — `/mcp`, with the separately maintained MCP scope list — and is served by the MCP sidecar, which is the authority on its own tool set. Deployments with no sidecar answer 404: there is no `/mcp` resource to describe. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -362,7 +362,7 @@ def oauth_protected_resource_mcp_with_http_info( ) -> ApiResponse[Dict[str, object]]: """Protected-resource metadata for the MCP endpoint (RFC 9728) - Path-inserted protected-resource metadata used by MCP OAuth clients. Served by the MCP sidecar when one is configured, because it is the authority on the scope bundle its own tools require; otherwise it falls back to the resource-root document, since `/v0` and `/mcp` share AgentDrive's canonical audience. + Path-inserted protected-resource metadata for the hosted MCP transport. It names a DIFFERENT resource from the root document — `/mcp`, with the separately maintained MCP scope list — and is served by the MCP sidecar, which is the authority on its own tool set. Deployments with no sidecar answer 404: there is no `/mcp` resource to describe. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -425,7 +425,7 @@ def oauth_protected_resource_mcp_without_preload_content( ) -> RESTResponseType: """Protected-resource metadata for the MCP endpoint (RFC 9728) - Path-inserted protected-resource metadata used by MCP OAuth clients. Served by the MCP sidecar when one is configured, because it is the authority on the scope bundle its own tools require; otherwise it falls back to the resource-root document, since `/v0` and `/mcp` share AgentDrive's canonical audience. + Path-inserted protected-resource metadata for the hosted MCP transport. It names a DIFFERENT resource from the root document — `/mcp`, with the separately maintained MCP scope list — and is served by the MCP sidecar, which is the authority on its own tool set. Deployments with no sidecar answer 404: there is no `/mcp` resource to describe. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request diff --git a/sdk/python/agentdrive_sdk/generated/api/drives_api.py b/sdk/python/agentdrive_sdk/generated/api/drives_api.py index c35973b..53e0d9a 100644 --- a/sdk/python/agentdrive_sdk/generated/api/drives_api.py +++ b/sdk/python/agentdrive_sdk/generated/api/drives_api.py @@ -716,7 +716,7 @@ def _drives_delete_serialize( @validate_call def drives_list( self, - lifecycle: Optional[StrictStr] = None, + state: Optional[StrictStr] = None, limit: Optional[StrictInt] = None, cursor: Optional[StrictStr] = None, authorization: Annotated[Optional[StrictStr], Field(description="Deprecated: redundant with the operation's `bearerAuth` security requirement, which is how a generated client should learn to authenticate. Scheduled for removal.")] = None, @@ -735,10 +735,10 @@ def drives_list( ) -> DriveListOut: """List Drives - List the actor's workspace drives, newest-first (keyset paginated). ``lifecycle`` (active|deleted|all) exposes soft-deleted drives so a manager can read the post-delete revision as the If-Match source for a restore. Unknown query parameters are rejected (§6.3). + List the actor's workspace drives, newest-first (keyset paginated). ``state`` (active|deleted|all) exposes soft-deleted drives so a manager can read the post-delete revision as the If-Match source for a restore. Unknown query parameters are rejected (§6.3). - :param lifecycle: - :type lifecycle: str + :param state: + :type state: str :param limit: :type limit: int :param cursor: @@ -768,7 +768,7 @@ def drives_list( """ # noqa: E501 _param = self._drives_list_serialize( - lifecycle=lifecycle, + state=state, limit=limit, cursor=cursor, authorization=authorization, @@ -802,7 +802,7 @@ def drives_list( @validate_call def drives_list_with_http_info( self, - lifecycle: Optional[StrictStr] = None, + state: Optional[StrictStr] = None, limit: Optional[StrictInt] = None, cursor: Optional[StrictStr] = None, authorization: Annotated[Optional[StrictStr], Field(description="Deprecated: redundant with the operation's `bearerAuth` security requirement, which is how a generated client should learn to authenticate. Scheduled for removal.")] = None, @@ -821,10 +821,10 @@ def drives_list_with_http_info( ) -> ApiResponse[DriveListOut]: """List Drives - List the actor's workspace drives, newest-first (keyset paginated). ``lifecycle`` (active|deleted|all) exposes soft-deleted drives so a manager can read the post-delete revision as the If-Match source for a restore. Unknown query parameters are rejected (§6.3). + List the actor's workspace drives, newest-first (keyset paginated). ``state`` (active|deleted|all) exposes soft-deleted drives so a manager can read the post-delete revision as the If-Match source for a restore. Unknown query parameters are rejected (§6.3). - :param lifecycle: - :type lifecycle: str + :param state: + :type state: str :param limit: :type limit: int :param cursor: @@ -854,7 +854,7 @@ def drives_list_with_http_info( """ # noqa: E501 _param = self._drives_list_serialize( - lifecycle=lifecycle, + state=state, limit=limit, cursor=cursor, authorization=authorization, @@ -888,7 +888,7 @@ def drives_list_with_http_info( @validate_call def drives_list_without_preload_content( self, - lifecycle: Optional[StrictStr] = None, + state: Optional[StrictStr] = None, limit: Optional[StrictInt] = None, cursor: Optional[StrictStr] = None, authorization: Annotated[Optional[StrictStr], Field(description="Deprecated: redundant with the operation's `bearerAuth` security requirement, which is how a generated client should learn to authenticate. Scheduled for removal.")] = None, @@ -907,10 +907,10 @@ def drives_list_without_preload_content( ) -> RESTResponseType: """List Drives - List the actor's workspace drives, newest-first (keyset paginated). ``lifecycle`` (active|deleted|all) exposes soft-deleted drives so a manager can read the post-delete revision as the If-Match source for a restore. Unknown query parameters are rejected (§6.3). + List the actor's workspace drives, newest-first (keyset paginated). ``state`` (active|deleted|all) exposes soft-deleted drives so a manager can read the post-delete revision as the If-Match source for a restore. Unknown query parameters are rejected (§6.3). - :param lifecycle: - :type lifecycle: str + :param state: + :type state: str :param limit: :type limit: int :param cursor: @@ -940,7 +940,7 @@ def drives_list_without_preload_content( """ # noqa: E501 _param = self._drives_list_serialize( - lifecycle=lifecycle, + state=state, limit=limit, cursor=cursor, authorization=authorization, @@ -969,7 +969,7 @@ def drives_list_without_preload_content( def _drives_list_serialize( self, - lifecycle, + state, limit, cursor, authorization, @@ -995,9 +995,9 @@ def _drives_list_serialize( # process the path parameters # process the query parameters - if lifecycle is not None: + if state is not None: - _query_params.append(('lifecycle', lifecycle)) + _query_params.append(('state', state)) if limit is not None: @@ -2081,7 +2081,7 @@ def drives_usage( ) -> DriveUsageOut: """Drive Usage - Byte counters for one active drive: storage is the live sum of its versions' sizes; retrieval reads the counter the content-read slice maintains (0 until it lands). + Usage counters, current storage and download meters, and the effective file/share limits for one active drive. The snapshot includes committed and reserved bytes so clients can show capacity already in flight. :param drive_id: (required) :type drive_id: str @@ -2159,7 +2159,7 @@ def drives_usage_with_http_info( ) -> ApiResponse[DriveUsageOut]: """Drive Usage - Byte counters for one active drive: storage is the live sum of its versions' sizes; retrieval reads the counter the content-read slice maintains (0 until it lands). + Usage counters, current storage and download meters, and the effective file/share limits for one active drive. The snapshot includes committed and reserved bytes so clients can show capacity already in flight. :param drive_id: (required) :type drive_id: str @@ -2237,7 +2237,7 @@ def drives_usage_without_preload_content( ) -> RESTResponseType: """Drive Usage - Byte counters for one active drive: storage is the live sum of its versions' sizes; retrieval reads the counter the content-read slice maintains (0 until it lands). + Usage counters, current storage and download meters, and the effective file/share limits for one active drive. The snapshot includes committed and reserved bytes so clients can show capacity already in flight. :param drive_id: (required) :type drive_id: str diff --git a/sdk/python/agentdrive_sdk/generated/api/folders_api.py b/sdk/python/agentdrive_sdk/generated/api/folders_api.py index 4846ba9..a5fbe99 100644 --- a/sdk/python/agentdrive_sdk/generated/api/folders_api.py +++ b/sdk/python/agentdrive_sdk/generated/api/folders_api.py @@ -1144,7 +1144,7 @@ def _folders_delete_serialize( def folders_list( self, drive_id: StrictStr, - lifecycle: Optional[StrictStr] = None, + state: Optional[StrictStr] = None, limit: Optional[StrictInt] = None, cursor: Optional[StrictStr] = None, parent_id: Optional[StrictStr] = None, @@ -1165,12 +1165,12 @@ def folders_list( ) -> FolderListOut: """List Folders - List the drive's folders, newest-first (keyset paginated). ``lifecycle`` (active|deleted|all) exposes soft-deleted folders so the post-delete revision can be read as the If-Match source for a restore. ``parent_id`` / ``name`` are exact-match filters. Unknown query parameters are rejected (§6.3). + List the drive's folders, newest-first (keyset paginated). ``state`` (active|deleted|all) exposes soft-deleted folders so the post-delete revision can be read as the If-Match source for a restore. ``parent_id`` / ``name`` are exact-match filters. Unknown query parameters are rejected (§6.3). :param drive_id: (required) :type drive_id: str - :param lifecycle: - :type lifecycle: str + :param state: + :type state: str :param limit: :type limit: int :param cursor: @@ -1205,7 +1205,7 @@ def folders_list( _param = self._folders_list_serialize( drive_id=drive_id, - lifecycle=lifecycle, + state=state, limit=limit, cursor=cursor, parent_id=parent_id, @@ -1242,7 +1242,7 @@ def folders_list( def folders_list_with_http_info( self, drive_id: StrictStr, - lifecycle: Optional[StrictStr] = None, + state: Optional[StrictStr] = None, limit: Optional[StrictInt] = None, cursor: Optional[StrictStr] = None, parent_id: Optional[StrictStr] = None, @@ -1263,12 +1263,12 @@ def folders_list_with_http_info( ) -> ApiResponse[FolderListOut]: """List Folders - List the drive's folders, newest-first (keyset paginated). ``lifecycle`` (active|deleted|all) exposes soft-deleted folders so the post-delete revision can be read as the If-Match source for a restore. ``parent_id`` / ``name`` are exact-match filters. Unknown query parameters are rejected (§6.3). + List the drive's folders, newest-first (keyset paginated). ``state`` (active|deleted|all) exposes soft-deleted folders so the post-delete revision can be read as the If-Match source for a restore. ``parent_id`` / ``name`` are exact-match filters. Unknown query parameters are rejected (§6.3). :param drive_id: (required) :type drive_id: str - :param lifecycle: - :type lifecycle: str + :param state: + :type state: str :param limit: :type limit: int :param cursor: @@ -1303,7 +1303,7 @@ def folders_list_with_http_info( _param = self._folders_list_serialize( drive_id=drive_id, - lifecycle=lifecycle, + state=state, limit=limit, cursor=cursor, parent_id=parent_id, @@ -1340,7 +1340,7 @@ def folders_list_with_http_info( def folders_list_without_preload_content( self, drive_id: StrictStr, - lifecycle: Optional[StrictStr] = None, + state: Optional[StrictStr] = None, limit: Optional[StrictInt] = None, cursor: Optional[StrictStr] = None, parent_id: Optional[StrictStr] = None, @@ -1361,12 +1361,12 @@ def folders_list_without_preload_content( ) -> RESTResponseType: """List Folders - List the drive's folders, newest-first (keyset paginated). ``lifecycle`` (active|deleted|all) exposes soft-deleted folders so the post-delete revision can be read as the If-Match source for a restore. ``parent_id`` / ``name`` are exact-match filters. Unknown query parameters are rejected (§6.3). + List the drive's folders, newest-first (keyset paginated). ``state`` (active|deleted|all) exposes soft-deleted folders so the post-delete revision can be read as the If-Match source for a restore. ``parent_id`` / ``name`` are exact-match filters. Unknown query parameters are rejected (§6.3). :param drive_id: (required) :type drive_id: str - :param lifecycle: - :type lifecycle: str + :param state: + :type state: str :param limit: :type limit: int :param cursor: @@ -1401,7 +1401,7 @@ def folders_list_without_preload_content( _param = self._folders_list_serialize( drive_id=drive_id, - lifecycle=lifecycle, + state=state, limit=limit, cursor=cursor, parent_id=parent_id, @@ -1433,7 +1433,7 @@ def folders_list_without_preload_content( def _folders_list_serialize( self, drive_id, - lifecycle, + state, limit, cursor, parent_id, @@ -1463,9 +1463,9 @@ def _folders_list_serialize( if drive_id is not None: _path_params['drive_id'] = drive_id # process the query parameters - if lifecycle is not None: + if state is not None: - _query_params.append(('lifecycle', lifecycle)) + _query_params.append(('state', state)) if limit is not None: diff --git a/sdk/python/agentdrive_sdk/generated/api/grants_api.py b/sdk/python/agentdrive_sdk/generated/api/grants_api.py index f71dcf3..35683ab 100644 --- a/sdk/python/agentdrive_sdk/generated/api/grants_api.py +++ b/sdk/python/agentdrive_sdk/generated/api/grants_api.py @@ -395,7 +395,7 @@ def _grants_create_serialize( def grants_list( self, drive_id: StrictStr, - lifecycle: Optional[StrictStr] = None, + state: Optional[StrictStr] = None, limit: Optional[StrictInt] = None, cursor: Optional[StrictStr] = None, resource_type: Optional[StrictStr] = None, @@ -421,8 +421,8 @@ def grants_list( :param drive_id: (required) :type drive_id: str - :param lifecycle: - :type lifecycle: str + :param state: + :type state: str :param limit: :type limit: int :param cursor: @@ -459,7 +459,7 @@ def grants_list( _param = self._grants_list_serialize( drive_id=drive_id, - lifecycle=lifecycle, + state=state, limit=limit, cursor=cursor, resource_type=resource_type, @@ -497,7 +497,7 @@ def grants_list( def grants_list_with_http_info( self, drive_id: StrictStr, - lifecycle: Optional[StrictStr] = None, + state: Optional[StrictStr] = None, limit: Optional[StrictInt] = None, cursor: Optional[StrictStr] = None, resource_type: Optional[StrictStr] = None, @@ -523,8 +523,8 @@ def grants_list_with_http_info( :param drive_id: (required) :type drive_id: str - :param lifecycle: - :type lifecycle: str + :param state: + :type state: str :param limit: :type limit: int :param cursor: @@ -561,7 +561,7 @@ def grants_list_with_http_info( _param = self._grants_list_serialize( drive_id=drive_id, - lifecycle=lifecycle, + state=state, limit=limit, cursor=cursor, resource_type=resource_type, @@ -599,7 +599,7 @@ def grants_list_with_http_info( def grants_list_without_preload_content( self, drive_id: StrictStr, - lifecycle: Optional[StrictStr] = None, + state: Optional[StrictStr] = None, limit: Optional[StrictInt] = None, cursor: Optional[StrictStr] = None, resource_type: Optional[StrictStr] = None, @@ -625,8 +625,8 @@ def grants_list_without_preload_content( :param drive_id: (required) :type drive_id: str - :param lifecycle: - :type lifecycle: str + :param state: + :type state: str :param limit: :type limit: int :param cursor: @@ -663,7 +663,7 @@ def grants_list_without_preload_content( _param = self._grants_list_serialize( drive_id=drive_id, - lifecycle=lifecycle, + state=state, limit=limit, cursor=cursor, resource_type=resource_type, @@ -696,7 +696,7 @@ def grants_list_without_preload_content( def _grants_list_serialize( self, drive_id, - lifecycle, + state, limit, cursor, resource_type, @@ -727,9 +727,9 @@ def _grants_list_serialize( if drive_id is not None: _path_params['drive_id'] = drive_id # process the query parameters - if lifecycle is not None: + if state is not None: - _query_params.append(('lifecycle', lifecycle)) + _query_params.append(('state', state)) if limit is not None: diff --git a/sdk/python/agentdrive_sdk/generated/api/navigation_api.py b/sdk/python/agentdrive_sdk/generated/api/navigation_api.py index cf1c280..1eec44e 100644 --- a/sdk/python/agentdrive_sdk/generated/api/navigation_api.py +++ b/sdk/python/agentdrive_sdk/generated/api/navigation_api.py @@ -71,7 +71,7 @@ def entries_list( ) -> EntryListOut: """List Entries - List one folder's direct children across the shared namespace. + List one folder's direct children across the shared namespace. ``state`` (active|deleted|all) exposes soft-deleted entries, matching every other v0 collection. Unknown query parameters are rejected. :param drive_id: (required) :type drive_id: str @@ -189,7 +189,7 @@ def entries_list_with_http_info( ) -> ApiResponse[EntryListOut]: """List Entries - List one folder's direct children across the shared namespace. + List one folder's direct children across the shared namespace. ``state`` (active|deleted|all) exposes soft-deleted entries, matching every other v0 collection. Unknown query parameters are rejected. :param drive_id: (required) :type drive_id: str @@ -307,7 +307,7 @@ def entries_list_without_preload_content( ) -> RESTResponseType: """List Entries - List one folder's direct children across the shared namespace. + List one folder's direct children across the shared namespace. ``state`` (active|deleted|all) exposes soft-deleted entries, matching every other v0 collection. Unknown query parameters are rejected. :param drive_id: (required) :type drive_id: str diff --git a/sdk/python/agentdrive_sdk/generated/api/shares_api.py b/sdk/python/agentdrive_sdk/generated/api/shares_api.py index 4086386..ebadfdd 100644 --- a/sdk/python/agentdrive_sdk/generated/api/shares_api.py +++ b/sdk/python/agentdrive_sdk/generated/api/shares_api.py @@ -395,7 +395,7 @@ def _shares_create_serialize( def shares_list( self, drive_id: StrictStr, - lifecycle: Optional[StrictStr] = None, + state: Optional[StrictStr] = None, limit: Optional[StrictInt] = None, cursor: Optional[StrictStr] = None, resource_type: Optional[StrictStr] = None, @@ -420,8 +420,8 @@ def shares_list( :param drive_id: (required) :type drive_id: str - :param lifecycle: - :type lifecycle: str + :param state: + :type state: str :param limit: :type limit: int :param cursor: @@ -456,7 +456,7 @@ def shares_list( _param = self._shares_list_serialize( drive_id=drive_id, - lifecycle=lifecycle, + state=state, limit=limit, cursor=cursor, resource_type=resource_type, @@ -493,7 +493,7 @@ def shares_list( def shares_list_with_http_info( self, drive_id: StrictStr, - lifecycle: Optional[StrictStr] = None, + state: Optional[StrictStr] = None, limit: Optional[StrictInt] = None, cursor: Optional[StrictStr] = None, resource_type: Optional[StrictStr] = None, @@ -518,8 +518,8 @@ def shares_list_with_http_info( :param drive_id: (required) :type drive_id: str - :param lifecycle: - :type lifecycle: str + :param state: + :type state: str :param limit: :type limit: int :param cursor: @@ -554,7 +554,7 @@ def shares_list_with_http_info( _param = self._shares_list_serialize( drive_id=drive_id, - lifecycle=lifecycle, + state=state, limit=limit, cursor=cursor, resource_type=resource_type, @@ -591,7 +591,7 @@ def shares_list_with_http_info( def shares_list_without_preload_content( self, drive_id: StrictStr, - lifecycle: Optional[StrictStr] = None, + state: Optional[StrictStr] = None, limit: Optional[StrictInt] = None, cursor: Optional[StrictStr] = None, resource_type: Optional[StrictStr] = None, @@ -616,8 +616,8 @@ def shares_list_without_preload_content( :param drive_id: (required) :type drive_id: str - :param lifecycle: - :type lifecycle: str + :param state: + :type state: str :param limit: :type limit: int :param cursor: @@ -652,7 +652,7 @@ def shares_list_without_preload_content( _param = self._shares_list_serialize( drive_id=drive_id, - lifecycle=lifecycle, + state=state, limit=limit, cursor=cursor, resource_type=resource_type, @@ -684,7 +684,7 @@ def shares_list_without_preload_content( def _shares_list_serialize( self, drive_id, - lifecycle, + state, limit, cursor, resource_type, @@ -714,9 +714,9 @@ def _shares_list_serialize( if drive_id is not None: _path_params['drive_id'] = drive_id # process the query parameters - if lifecycle is not None: + if state is not None: - _query_params.append(('lifecycle', lifecycle)) + _query_params.append(('state', state)) if limit is not None: diff --git a/sdk/python/agentdrive_sdk/generated/models/__init__.py b/sdk/python/agentdrive_sdk/generated/models/__init__.py index a6585b5..c97b535 100644 --- a/sdk/python/agentdrive_sdk/generated/models/__init__.py +++ b/sdk/python/agentdrive_sdk/generated/models/__init__.py @@ -38,6 +38,7 @@ from agentdrive_sdk.generated.models.drive_update_in import DriveUpdateIn from agentdrive_sdk.generated.models.drive_usage_out import DriveUsageOut from agentdrive_sdk.generated.models.editability_out import EditabilityOut +from agentdrive_sdk.generated.models.effective_limits_out import EffectiveLimitsOut from agentdrive_sdk.generated.models.entries_inner import EntriesInner from agentdrive_sdk.generated.models.entry_list_out import EntryListOut from agentdrive_sdk.generated.models.error_response import ErrorResponse @@ -87,6 +88,8 @@ from agentdrive_sdk.generated.models.uploads_create_request_target import UploadsCreateRequestTarget from agentdrive_sdk.generated.models.uploads_create_request_target_one_of import UploadsCreateRequestTargetOneOf from agentdrive_sdk.generated.models.uploads_create_request_target_one_of1 import UploadsCreateRequestTargetOneOf1 +from agentdrive_sdk.generated.models.usage_meter_out import UsageMeterOut +from agentdrive_sdk.generated.models.usage_meters_out import UsageMetersOut from agentdrive_sdk.generated.models.v0_error_envelope import V0ErrorEnvelope from agentdrive_sdk.generated.models.validation_error_response import ValidationErrorResponse from agentdrive_sdk.generated.models.validation_error_response_error import ValidationErrorResponseError diff --git a/sdk/python/agentdrive_sdk/generated/models/change_actor_out.py b/sdk/python/agentdrive_sdk/generated/models/change_actor_out.py index 2ca2322..d3db7b4 100644 --- a/sdk/python/agentdrive_sdk/generated/models/change_actor_out.py +++ b/sdk/python/agentdrive_sdk/generated/models/change_actor_out.py @@ -33,8 +33,8 @@ class ChangeActorOut(BaseModel): @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in set(['agent', 'user', 'system']): - raise ValueError("must be one of enum values ('agent', 'user', 'system')") + if value not in set(['agent', 'user', 'service', 'system']): + raise ValueError("must be one of enum values ('agent', 'user', 'service', 'system')") return value model_config = ConfigDict( diff --git a/sdk/python/agentdrive_sdk/generated/models/drive_usage_out.py b/sdk/python/agentdrive_sdk/generated/models/drive_usage_out.py index 866d3d5..5689c80 100644 --- a/sdk/python/agentdrive_sdk/generated/models/drive_usage_out.py +++ b/sdk/python/agentdrive_sdk/generated/models/drive_usage_out.py @@ -17,8 +17,11 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictInt +from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from agentdrive_sdk.generated.models.effective_limits_out import EffectiveLimitsOut +from agentdrive_sdk.generated.models.usage_meters_out import UsageMetersOut from typing import Optional, Set from typing_extensions import Self @@ -26,9 +29,11 @@ class DriveUsageOut(BaseModel): """ DriveUsageOut """ # noqa: E501 - retrieval_bytes: StrictInt - storage_bytes: StrictInt - __properties: ClassVar[List[str]] = ["retrieval_bytes", "storage_bytes"] + effective_limits: EffectiveLimitsOut + meters: UsageMetersOut + retrieval_bytes: Annotated[int, Field(strict=True, ge=0)] + storage_bytes: Annotated[int, Field(strict=True, ge=0)] + __properties: ClassVar[List[str]] = ["effective_limits", "meters", "retrieval_bytes", "storage_bytes"] model_config = ConfigDict( populate_by_name=True, @@ -69,6 +74,12 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of effective_limits + if self.effective_limits: + _dict['effective_limits'] = self.effective_limits.to_dict() + # override the default output from pydantic by calling `to_dict()` of meters + if self.meters: + _dict['meters'] = self.meters.to_dict() return _dict @classmethod @@ -81,6 +92,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ + "effective_limits": EffectiveLimitsOut.from_dict(obj["effective_limits"]) if obj.get("effective_limits") is not None else None, + "meters": UsageMetersOut.from_dict(obj["meters"]) if obj.get("meters") is not None else None, "retrieval_bytes": obj.get("retrieval_bytes"), "storage_bytes": obj.get("storage_bytes") }) diff --git a/sdk/python/agentdrive_sdk/generated/models/effective_limits_out.py b/sdk/python/agentdrive_sdk/generated/models/effective_limits_out.py new file mode 100644 index 0000000..e028fbe --- /dev/null +++ b/sdk/python/agentdrive_sdk/generated/models/effective_limits_out.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + AgentDrive + + AgentDrive is an agent-focused artifact store: drive-scoped folders, artifacts, and immutable versions, with local grants, possession-based share links, drive-scoped search, and a cursor-resumable change feed. Bearer-authenticated with Hub-issued product tokens (see /.well-known/oauth-protected-resource); every mutation takes an Idempotency-Key, and existing-state mutations take If-Match. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class EffectiveLimitsOut(BaseModel): + """ + EffectiveLimitsOut + """ # noqa: E501 + max_file_bytes: StrictInt + max_inline_file_bytes: StrictInt + share_default_ttl_seconds: StrictInt + share_max_ttl_seconds: StrictInt + __properties: ClassVar[List[str]] = ["max_file_bytes", "max_inline_file_bytes", "share_default_ttl_seconds", "share_max_ttl_seconds"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EffectiveLimitsOut from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EffectiveLimitsOut from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "max_file_bytes": obj.get("max_file_bytes"), + "max_inline_file_bytes": obj.get("max_inline_file_bytes"), + "share_default_ttl_seconds": obj.get("share_default_ttl_seconds"), + "share_max_ttl_seconds": obj.get("share_max_ttl_seconds") + }) + return _obj diff --git a/sdk/python/agentdrive_sdk/generated/models/error_response_error.py b/sdk/python/agentdrive_sdk/generated/models/error_response_error.py index 90fc07c..e0b37ba 100644 --- a/sdk/python/agentdrive_sdk/generated/models/error_response_error.py +++ b/sdk/python/agentdrive_sdk/generated/models/error_response_error.py @@ -35,8 +35,8 @@ class ErrorResponseError(BaseModel): @field_validator('code') def code_validate_enum(cls, value): """Validates the enum""" - if value not in set(['ARTIFACT_NOT_FOUND', 'ARTIFACT_PATH_CONFLICT', 'ARTIFACT_TOO_LARGE', 'AUTHENTICATION_REQUIRED', 'AUTH_UNAVAILABLE', 'BAD_REQUEST', 'CHANGE_CURSOR_EXPIRED', 'CHECKSUM_MISMATCH', 'CONFLICT', 'DOWNLOAD_SIGNING_UNAVAILABLE', 'DRIVE_LIMIT_EXCEEDED', 'DRIVE_NOT_FOUND', 'FOLDER_NOT_FOUND', 'FOLDER_PATH_CONFLICT', 'FOLDER_RECURSIVE_REQUIRED', 'GRANT_CONFLICT', 'GRANT_NOT_FOUND', 'GRANT_PERMANENT', 'IDEMPOTENCY_CONFLICT', 'IDEMPOTENCY_IN_PROGRESS', 'IDEMPOTENCY_KEY_REQUIRED', 'INTERNAL_ERROR', 'INVALID_ARGUMENT', 'INVALID_CURSOR', 'INVALID_PARAMETER', 'INVALID_QUERY', 'INVALID_REQUEST', 'METHOD_NOT_ALLOWED', 'NAME_CONFLICT', 'NOT_ACCEPTABLE', 'NOT_AUTHORIZED', 'NOT_FOUND', 'OBJECT_METADATA_MISMATCH', 'OBJECT_SIZE_MISMATCH', 'PAYLOAD_TOO_LARGE', 'PERMISSION_DENIED', 'PRECONDITION_FAILED', 'PRECONDITION_REQUIRED', 'RATE_LIMITED', 'SEARCH_MODE_UNAVAILABLE', 'SHARE_NOT_FOUND', 'SHEET_EDIT_LIMIT_EXCEEDED', 'SHEET_NOT_FOUND', 'SHEET_SESSION_ALREADY_COMPLETED', 'SHEET_SESSION_EXPIRED', 'SHEET_SESSION_NOT_FOUND', 'SUBTREE_TOO_LARGE', 'TRANSFER_DISABLED', 'TRANSFER_LIMIT_EXCEEDED', 'TRANSFER_UNAVAILABLE', 'UNSUPPORTED_MEDIA_TYPE', 'UPLOAD_ALREADY_COMPLETED', 'UPLOAD_BUSY', 'UPLOAD_EXPIRED', 'UPLOAD_INCOMPLETE', 'UPLOAD_NOT_COMPLETABLE', 'VALIDATION_ERROR', 'VERSION_NOT_FOUND', 'VIEWER_DISABLED', 'VIEWER_SESSION_NOT_FOUND', 'WORKBOOK_NOT_EDITABLE', 'WORKBOOK_TOO_LARGE', 'WORKBOOK_UNPARSEABLE']): - raise ValueError("must be one of enum values ('ARTIFACT_NOT_FOUND', 'ARTIFACT_PATH_CONFLICT', 'ARTIFACT_TOO_LARGE', 'AUTHENTICATION_REQUIRED', 'AUTH_UNAVAILABLE', 'BAD_REQUEST', 'CHANGE_CURSOR_EXPIRED', 'CHECKSUM_MISMATCH', 'CONFLICT', 'DOWNLOAD_SIGNING_UNAVAILABLE', 'DRIVE_LIMIT_EXCEEDED', 'DRIVE_NOT_FOUND', 'FOLDER_NOT_FOUND', 'FOLDER_PATH_CONFLICT', 'FOLDER_RECURSIVE_REQUIRED', 'GRANT_CONFLICT', 'GRANT_NOT_FOUND', 'GRANT_PERMANENT', 'IDEMPOTENCY_CONFLICT', 'IDEMPOTENCY_IN_PROGRESS', 'IDEMPOTENCY_KEY_REQUIRED', 'INTERNAL_ERROR', 'INVALID_ARGUMENT', 'INVALID_CURSOR', 'INVALID_PARAMETER', 'INVALID_QUERY', 'INVALID_REQUEST', 'METHOD_NOT_ALLOWED', 'NAME_CONFLICT', 'NOT_ACCEPTABLE', 'NOT_AUTHORIZED', 'NOT_FOUND', 'OBJECT_METADATA_MISMATCH', 'OBJECT_SIZE_MISMATCH', 'PAYLOAD_TOO_LARGE', 'PERMISSION_DENIED', 'PRECONDITION_FAILED', 'PRECONDITION_REQUIRED', 'RATE_LIMITED', 'SEARCH_MODE_UNAVAILABLE', 'SHARE_NOT_FOUND', 'SHEET_EDIT_LIMIT_EXCEEDED', 'SHEET_NOT_FOUND', 'SHEET_SESSION_ALREADY_COMPLETED', 'SHEET_SESSION_EXPIRED', 'SHEET_SESSION_NOT_FOUND', 'SUBTREE_TOO_LARGE', 'TRANSFER_DISABLED', 'TRANSFER_LIMIT_EXCEEDED', 'TRANSFER_UNAVAILABLE', 'UNSUPPORTED_MEDIA_TYPE', 'UPLOAD_ALREADY_COMPLETED', 'UPLOAD_BUSY', 'UPLOAD_EXPIRED', 'UPLOAD_INCOMPLETE', 'UPLOAD_NOT_COMPLETABLE', 'VALIDATION_ERROR', 'VERSION_NOT_FOUND', 'VIEWER_DISABLED', 'VIEWER_SESSION_NOT_FOUND', 'WORKBOOK_NOT_EDITABLE', 'WORKBOOK_TOO_LARGE', 'WORKBOOK_UNPARSEABLE')") + if value not in set(['ARTIFACT_NOT_FOUND', 'ARTIFACT_PATH_CONFLICT', 'ARTIFACT_TOO_LARGE', 'AUTHENTICATION_REQUIRED', 'AUTH_UNAVAILABLE', 'BAD_REQUEST', 'BANDWIDTH_LIMIT_EXCEEDED', 'CHANGE_CURSOR_EXPIRED', 'CHECKSUM_MISMATCH', 'CONFLICT', 'DOWNLOAD_SIGNING_UNAVAILABLE', 'DRIVE_LIMIT_EXCEEDED', 'DRIVE_NOT_FOUND', 'FOLDER_NOT_FOUND', 'FOLDER_PATH_CONFLICT', 'FOLDER_RECURSIVE_REQUIRED', 'GRANT_CONFLICT', 'GRANT_NOT_FOUND', 'GRANT_PERMANENT', 'IDEMPOTENCY_CONFLICT', 'IDEMPOTENCY_IN_PROGRESS', 'IDEMPOTENCY_KEY_REQUIRED', 'INTERNAL_ERROR', 'INVALID_ARGUMENT', 'INVALID_CURSOR', 'INVALID_PARAMETER', 'INVALID_QUERY', 'INVALID_REQUEST', 'METHOD_NOT_ALLOWED', 'NAME_CONFLICT', 'NOT_ACCEPTABLE', 'NOT_AUTHORIZED', 'NOT_FOUND', 'OBJECT_METADATA_MISMATCH', 'OBJECT_SIZE_MISMATCH', 'PAYLOAD_TOO_LARGE', 'PERMISSION_DENIED', 'PRECONDITION_FAILED', 'PRECONDITION_REQUIRED', 'RATE_LIMITED', 'SEARCH_MODE_UNAVAILABLE', 'SHARE_NOT_FOUND', 'SHEET_EDIT_LIMIT_EXCEEDED', 'SHEET_NOT_FOUND', 'SHEET_SESSION_ALREADY_COMPLETED', 'SHEET_SESSION_EXPIRED', 'SHEET_SESSION_NOT_FOUND', 'SUBTREE_TOO_LARGE', 'TRANSFER_DISABLED', 'TRANSFER_LIMIT_EXCEEDED', 'TRANSFER_UNAVAILABLE', 'UNSUPPORTED_MEDIA_TYPE', 'UPLOAD_ALREADY_COMPLETED', 'UPLOAD_BUSY', 'UPLOAD_EXPIRED', 'UPLOAD_INCOMPLETE', 'UPLOAD_NOT_COMPLETABLE', 'VALIDATION_ERROR', 'VERSION_NOT_FOUND', 'VIEWER_DISABLED', 'VIEWER_SESSION_NOT_FOUND', 'WORKBOOK_NOT_EDITABLE', 'WORKBOOK_TOO_LARGE', 'WORKBOOK_UNPARSEABLE']): + raise ValueError("must be one of enum values ('ARTIFACT_NOT_FOUND', 'ARTIFACT_PATH_CONFLICT', 'ARTIFACT_TOO_LARGE', 'AUTHENTICATION_REQUIRED', 'AUTH_UNAVAILABLE', 'BAD_REQUEST', 'BANDWIDTH_LIMIT_EXCEEDED', 'CHANGE_CURSOR_EXPIRED', 'CHECKSUM_MISMATCH', 'CONFLICT', 'DOWNLOAD_SIGNING_UNAVAILABLE', 'DRIVE_LIMIT_EXCEEDED', 'DRIVE_NOT_FOUND', 'FOLDER_NOT_FOUND', 'FOLDER_PATH_CONFLICT', 'FOLDER_RECURSIVE_REQUIRED', 'GRANT_CONFLICT', 'GRANT_NOT_FOUND', 'GRANT_PERMANENT', 'IDEMPOTENCY_CONFLICT', 'IDEMPOTENCY_IN_PROGRESS', 'IDEMPOTENCY_KEY_REQUIRED', 'INTERNAL_ERROR', 'INVALID_ARGUMENT', 'INVALID_CURSOR', 'INVALID_PARAMETER', 'INVALID_QUERY', 'INVALID_REQUEST', 'METHOD_NOT_ALLOWED', 'NAME_CONFLICT', 'NOT_ACCEPTABLE', 'NOT_AUTHORIZED', 'NOT_FOUND', 'OBJECT_METADATA_MISMATCH', 'OBJECT_SIZE_MISMATCH', 'PAYLOAD_TOO_LARGE', 'PERMISSION_DENIED', 'PRECONDITION_FAILED', 'PRECONDITION_REQUIRED', 'RATE_LIMITED', 'SEARCH_MODE_UNAVAILABLE', 'SHARE_NOT_FOUND', 'SHEET_EDIT_LIMIT_EXCEEDED', 'SHEET_NOT_FOUND', 'SHEET_SESSION_ALREADY_COMPLETED', 'SHEET_SESSION_EXPIRED', 'SHEET_SESSION_NOT_FOUND', 'SUBTREE_TOO_LARGE', 'TRANSFER_DISABLED', 'TRANSFER_LIMIT_EXCEEDED', 'TRANSFER_UNAVAILABLE', 'UNSUPPORTED_MEDIA_TYPE', 'UPLOAD_ALREADY_COMPLETED', 'UPLOAD_BUSY', 'UPLOAD_EXPIRED', 'UPLOAD_INCOMPLETE', 'UPLOAD_NOT_COMPLETABLE', 'VALIDATION_ERROR', 'VERSION_NOT_FOUND', 'VIEWER_DISABLED', 'VIEWER_SESSION_NOT_FOUND', 'WORKBOOK_NOT_EDITABLE', 'WORKBOOK_TOO_LARGE', 'WORKBOOK_UNPARSEABLE')") return value model_config = ConfigDict( diff --git a/sdk/python/agentdrive_sdk/generated/models/grant_create_in.py b/sdk/python/agentdrive_sdk/generated/models/grant_create_in.py index 2963c5a..1a6ccc6 100644 --- a/sdk/python/agentdrive_sdk/generated/models/grant_create_in.py +++ b/sdk/python/agentdrive_sdk/generated/models/grant_create_in.py @@ -29,7 +29,7 @@ class GrantCreateIn(BaseModel): POST /v0/drives/{id}/grants body. """ # noqa: E501 expires_at: Optional[datetime] = None - principal_id: Optional[StrictStr] = Field(default=None, description="Required for `agent`, `user`, and `workspace`; omitted only for `public`. For `agent` and `user` it is checked against that type's id prefix (`tcagt_` / `tcusr_`) and a mismatch is `422 VALIDATION_ERROR`. The prefix is all AgentDrive asserts: these ids are minted by Hub, so their full shape is not AgentDrive's to enforce, and a well-formed id naming a principal that does not exist — or belongs to another workspace — is accepted here and simply never matches a token. The rule is conditional on `principal_type`, so it is enforced at the boundary rather than expressible as one JSON Schema `pattern`.") + principal_id: Optional[StrictStr] = Field(default=None, description="Required for `agent`, `user`, `service`, and `workspace`; omitted only for `public`. For `agent`, `user`, and `service` it is checked against that type's id prefix (`tcagt_` / `tcusr_` / `tcsvc_`) and a mismatch is `422 VALIDATION_ERROR`. The prefix is all AgentDrive asserts: these ids are minted by Hub, so their full shape is not AgentDrive's to enforce, and a well-formed id naming a principal that does not exist — or belongs to another workspace — is accepted here and simply never matches a token. The rule is conditional on `principal_type`, so it is enforced at the boundary rather than expressible as one JSON Schema `pattern`.") principal_type: StrictStr resource_id: Annotated[str, Field(min_length=1, strict=True)] resource_type: StrictStr @@ -39,8 +39,8 @@ class GrantCreateIn(BaseModel): @field_validator('principal_type') def principal_type_validate_enum(cls, value): """Validates the enum""" - if value not in set(['agent', 'user', 'workspace', 'public']): - raise ValueError("must be one of enum values ('agent', 'user', 'workspace', 'public')") + if value not in set(['agent', 'user', 'service', 'workspace', 'public']): + raise ValueError("must be one of enum values ('agent', 'user', 'service', 'workspace', 'public')") return value @field_validator('resource_type') diff --git a/sdk/python/agentdrive_sdk/generated/models/grant_out.py b/sdk/python/agentdrive_sdk/generated/models/grant_out.py index e521f50..ffd7561 100644 --- a/sdk/python/agentdrive_sdk/generated/models/grant_out.py +++ b/sdk/python/agentdrive_sdk/generated/models/grant_out.py @@ -59,8 +59,8 @@ def id_validate_regular_expression(cls, value): @field_validator('principal_type') def principal_type_validate_enum(cls, value): """Validates the enum""" - if value not in set(['agent', 'user', 'workspace', 'public']): - raise ValueError("must be one of enum values ('agent', 'user', 'workspace', 'public')") + if value not in set(['agent', 'user', 'service', 'workspace', 'public']): + raise ValueError("must be one of enum values ('agent', 'user', 'service', 'workspace', 'public')") return value @field_validator('resource_type') diff --git a/sdk/python/agentdrive_sdk/generated/models/usage_meter_out.py b/sdk/python/agentdrive_sdk/generated/models/usage_meter_out.py new file mode 100644 index 0000000..a84840b --- /dev/null +++ b/sdk/python/agentdrive_sdk/generated/models/usage_meter_out.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + AgentDrive + + AgentDrive is an agent-focused artifact store: drive-scoped folders, artifacts, and immutable versions, with local grants, possession-based share links, drive-scoped search, and a cursor-resumable change feed. Bearer-authenticated with Hub-issued product tokens (see /.well-known/oauth-protected-resource); every mutation takes an Idempotency-Key, and existing-state mutations take If-Match. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class UsageMeterOut(BaseModel): + """ + UsageMeterOut + """ # noqa: E501 + limit: StrictInt + remaining: Annotated[int, Field(strict=True, ge=0)] + reserved: Annotated[int, Field(strict=True, ge=0)] + reset_at: Optional[datetime] + scope: StrictStr + used: Annotated[int, Field(strict=True, ge=0)] + __properties: ClassVar[List[str]] = ["limit", "remaining", "reserved", "reset_at", "scope", "used"] + + @field_validator('scope') + def scope_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['workspace', 'drive', 'principal', 'share']): + raise ValueError("must be one of enum values ('workspace', 'drive', 'principal', 'share')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UsageMeterOut from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if reset_at (nullable) is None + # and model_fields_set contains the field + if self.reset_at is None and "reset_at" in self.model_fields_set: + _dict['reset_at'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UsageMeterOut from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "limit": obj.get("limit"), + "remaining": obj.get("remaining"), + "reserved": obj.get("reserved"), + "reset_at": obj.get("reset_at"), + "scope": obj.get("scope"), + "used": obj.get("used") + }) + return _obj diff --git a/sdk/python/agentdrive_sdk/generated/models/usage_meters_out.py b/sdk/python/agentdrive_sdk/generated/models/usage_meters_out.py new file mode 100644 index 0000000..089eb18 --- /dev/null +++ b/sdk/python/agentdrive_sdk/generated/models/usage_meters_out.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + AgentDrive + + AgentDrive is an agent-focused artifact store: drive-scoped folders, artifacts, and immutable versions, with local grants, possession-based share links, drive-scoped search, and a cursor-resumable change feed. Bearer-authenticated with Hub-issued product tokens (see /.well-known/oauth-protected-resource); every mutation takes an Idempotency-Key, and existing-state mutations take If-Match. + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from agentdrive_sdk.generated.models.usage_meter_out import UsageMeterOut +from typing import Optional, Set +from typing_extensions import Self + +class UsageMetersOut(BaseModel): + """ + UsageMetersOut + """ # noqa: E501 + drive_storage: UsageMeterOut + workspace_download_day: UsageMeterOut + workspace_download_month: UsageMeterOut + workspace_storage: UsageMeterOut + __properties: ClassVar[List[str]] = ["drive_storage", "workspace_download_day", "workspace_download_month", "workspace_storage"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UsageMetersOut from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of drive_storage + if self.drive_storage: + _dict['drive_storage'] = self.drive_storage.to_dict() + # override the default output from pydantic by calling `to_dict()` of workspace_download_day + if self.workspace_download_day: + _dict['workspace_download_day'] = self.workspace_download_day.to_dict() + # override the default output from pydantic by calling `to_dict()` of workspace_download_month + if self.workspace_download_month: + _dict['workspace_download_month'] = self.workspace_download_month.to_dict() + # override the default output from pydantic by calling `to_dict()` of workspace_storage + if self.workspace_storage: + _dict['workspace_storage'] = self.workspace_storage.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UsageMetersOut from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "drive_storage": UsageMeterOut.from_dict(obj["drive_storage"]) if obj.get("drive_storage") is not None else None, + "workspace_download_day": UsageMeterOut.from_dict(obj["workspace_download_day"]) if obj.get("workspace_download_day") is not None else None, + "workspace_download_month": UsageMeterOut.from_dict(obj["workspace_download_month"]) if obj.get("workspace_download_month") is not None else None, + "workspace_storage": UsageMeterOut.from_dict(obj["workspace_storage"]) if obj.get("workspace_storage") is not None else None + }) + return _obj diff --git a/sdk/python/agentdrive_sdk/resources.py b/sdk/python/agentdrive_sdk/resources.py index cf0a8d9..7495d78 100644 --- a/sdk/python/agentdrive_sdk/resources.py +++ b/sdk/python/agentdrive_sdk/resources.py @@ -88,26 +88,26 @@ class DriveResource(_Resource): def list( self, *, - lifecycle: str = "active", + state: str = "active", limit: int | None = None, cursor: str | None = None, ) -> Any: return self.client._invoke( "drives_list", - {"lifecycle": lifecycle, "limit": limit, "cursor": cursor}, + {"state": state, "limit": limit, "cursor": cursor}, ).data def iter_pages( self, *, - lifecycle: str = "active", + state: str = "active", limit: int | None = None, cursor: str | None = None, max_pages: int | None = None, ) -> CursorPages[Any]: return self.client._pages( lambda next_cursor: _page_from( - self.list(lifecycle=lifecycle, limit=limit, cursor=next_cursor), "items" + self.list(state=state, limit=limit, cursor=next_cursor), "items" ), cursor=cursor, max_pages=max_pages, @@ -258,7 +258,7 @@ def list( self, drive_id: str, *, - lifecycle: str = "active", + state: str = "active", limit: int | None = None, cursor: str | None = None, parent_id: str | None = None, @@ -268,7 +268,7 @@ def list( "folders_list", { "drive_id": drive_id, - "lifecycle": lifecycle, + "state": state, "limit": limit, "cursor": cursor, "parent_id": parent_id, @@ -459,7 +459,7 @@ def list( self, drive_id: str, *, - lifecycle: str = "active", + state: str = "active", limit: int | None = None, cursor: str | None = None, parent_id: str | None = None, @@ -473,7 +473,7 @@ def list( "artifacts_list", { "drive_id": drive_id, - "lifecycle": lifecycle, + "state": state, "limit": limit, "cursor": cursor, "parent_id": parent_id, diff --git a/sdk/typescript/src/facade/resources.ts b/sdk/typescript/src/facade/resources.ts index f95d2d2..be9ded3 100644 --- a/sdk/typescript/src/facade/resources.ts +++ b/sdk/typescript/src/facade/resources.ts @@ -65,18 +65,18 @@ type EntryListOptions = { export class DriveResource { constructor(private readonly client: AgentDriveClient) {} - list(options: PageOptions & { lifecycle?: string } = {}): Promise { - return this.client.invoke('drives_list', () => this.client.generated.drives.drivesList({ lifecycle: options.lifecycle ?? 'active', limit: options.limit, cursor: options.cursor })); + list(options: PageOptions & { state?: string } = {}): Promise { + return this.client.invoke('drives_list', () => this.client.generated.drives.drivesList({ state: options.state ?? 'active', limit: options.limit, cursor: options.cursor })); } - iterPages(options: PageOptions & { lifecycle?: string } = {}): AsyncGenerator, void, undefined> { + iterPages(options: PageOptions & { state?: string } = {}): AsyncGenerator, void, undefined> { return cursorPages(async (cursor) => { const response = await this.list({ ...options, cursor }); return { items: response.items, nextCursor: response.nextCursor, raw: response }; }, options); } - iterItems(options: PageOptions & { lifecycle?: string } = {}): AsyncGenerator { + iterItems(options: PageOptions & { state?: string } = {}): AsyncGenerator { return cursorItems(this.iterPages(options)); } @@ -145,18 +145,18 @@ export class EntryResource { export class FolderResource { constructor(private readonly client: AgentDriveClient) {} - list(driveId: string, options: PageOptions & { lifecycle?: string; parentId?: string; name?: string } = {}) { - return this.client.invoke('folders_list', () => this.client.generated.folders.foldersList({ driveId, lifecycle: options.lifecycle ?? 'active', limit: options.limit, cursor: options.cursor, parentId: options.parentId, name: options.name })); + list(driveId: string, options: PageOptions & { state?: string; parentId?: string; name?: string } = {}) { + return this.client.invoke('folders_list', () => this.client.generated.folders.foldersList({ driveId, state: options.state ?? 'active', limit: options.limit, cursor: options.cursor, parentId: options.parentId, name: options.name })); } - iterPages(driveId: string, options: PageOptions & { lifecycle?: string; parentId?: string; name?: string } = {}): AsyncGenerator, void, undefined> { + iterPages(driveId: string, options: PageOptions & { state?: string; parentId?: string; name?: string } = {}): AsyncGenerator, void, undefined> { return cursorPages(async (cursor) => { const response = await this.list(driveId, { ...options, cursor }); return { items: response.items, nextCursor: response.nextCursor, raw: response }; }, options); } - iterItems(driveId: string, options: PageOptions & { lifecycle?: string; parentId?: string; name?: string } = {}): AsyncGenerator { + iterItems(driveId: string, options: PageOptions & { state?: string; parentId?: string; name?: string } = {}): AsyncGenerator { return cursorItems(this.iterPages(driveId, options)); } @@ -219,18 +219,18 @@ export class FolderResource { export class ArtifactResource { constructor(private readonly client: AgentDriveClient) {} - list(driveId: string, options: PageOptions & { lifecycle?: string; parentId?: string; name?: string; contentType?: string; label?: string; updatedAfter?: Date; updatedBefore?: Date } = {}) { - return this.client.invoke('artifacts_list', () => this.client.generated.artifacts.artifactsList({ driveId, lifecycle: options.lifecycle ?? 'active', limit: options.limit, cursor: options.cursor, parentId: options.parentId, name: options.name, contentType: options.contentType, label: options.label, updatedAfter: options.updatedAfter, updatedBefore: options.updatedBefore })); + list(driveId: string, options: PageOptions & { state?: string; parentId?: string; name?: string; contentType?: string; label?: string; updatedAfter?: Date; updatedBefore?: Date } = {}) { + return this.client.invoke('artifacts_list', () => this.client.generated.artifacts.artifactsList({ driveId, state: options.state ?? 'active', limit: options.limit, cursor: options.cursor, parentId: options.parentId, name: options.name, contentType: options.contentType, label: options.label, updatedAfter: options.updatedAfter, updatedBefore: options.updatedBefore })); } - iterPages(driveId: string, options: PageOptions & { lifecycle?: string; parentId?: string; name?: string; contentType?: string; label?: string; updatedAfter?: Date; updatedBefore?: Date } = {}): AsyncGenerator, void, undefined> { + iterPages(driveId: string, options: PageOptions & { state?: string; parentId?: string; name?: string; contentType?: string; label?: string; updatedAfter?: Date; updatedBefore?: Date } = {}): AsyncGenerator, void, undefined> { return cursorPages(async (cursor) => { const response = await this.list(driveId, { ...options, cursor }); return { items: response.items, nextCursor: response.nextCursor, raw: response }; }, options); } - iterItems(driveId: string, options: PageOptions & { lifecycle?: string; parentId?: string; name?: string; contentType?: string; label?: string; updatedAfter?: Date; updatedBefore?: Date } = {}): AsyncGenerator { + iterItems(driveId: string, options: PageOptions & { state?: string; parentId?: string; name?: string; contentType?: string; label?: string; updatedAfter?: Date; updatedBefore?: Date } = {}): AsyncGenerator { return cursorItems(this.iterPages(driveId, options)); } @@ -412,18 +412,18 @@ export class ChangeResource { export class GrantResource { constructor(private readonly client: AgentDriveClient) {} - list(driveId: string, options: PageOptions & { lifecycle?: string; resourceType?: string; resourceId?: string; principalType?: string } = {}): Promise { - return this.client.invoke('grants_list', () => this.client.generated.grants.grantsList({ driveId, lifecycle: options.lifecycle ?? 'active', limit: options.limit, cursor: options.cursor, resourceType: options.resourceType, resourceId: options.resourceId, principalType: options.principalType })); + list(driveId: string, options: PageOptions & { state?: string; resourceType?: string; resourceId?: string; principalType?: string } = {}): Promise { + return this.client.invoke('grants_list', () => this.client.generated.grants.grantsList({ driveId, state: options.state ?? 'active', limit: options.limit, cursor: options.cursor, resourceType: options.resourceType, resourceId: options.resourceId, principalType: options.principalType })); } - iterPages(driveId: string, options: PageOptions & { lifecycle?: string; resourceType?: string; resourceId?: string; principalType?: string } = {}): AsyncGenerator, void, undefined> { + iterPages(driveId: string, options: PageOptions & { state?: string; resourceType?: string; resourceId?: string; principalType?: string } = {}): AsyncGenerator, void, undefined> { return cursorPages(async (cursor) => { const response = await this.list(driveId, { ...options, cursor }); return { items: response.items, nextCursor: response.nextCursor, raw: response }; }, options); } - iterItems(driveId: string, options: PageOptions & { lifecycle?: string; resourceType?: string; resourceId?: string; principalType?: string } = {}) { + iterItems(driveId: string, options: PageOptions & { state?: string; resourceType?: string; resourceId?: string; principalType?: string } = {}) { return cursorItems(this.iterPages(driveId, options)); } @@ -450,18 +450,18 @@ export class GrantResource { export class ShareResource { constructor(private readonly client: AgentDriveClient) {} - list(driveId: string, options: PageOptions & { lifecycle?: string; resourceType?: string; resourceId?: string } = {}): Promise { - return this.client.invoke('shares_list', () => this.client.generated.shares.sharesList({ driveId, lifecycle: options.lifecycle ?? 'active', limit: options.limit, cursor: options.cursor, resourceType: options.resourceType, resourceId: options.resourceId })); + list(driveId: string, options: PageOptions & { state?: string; resourceType?: string; resourceId?: string } = {}): Promise { + return this.client.invoke('shares_list', () => this.client.generated.shares.sharesList({ driveId, state: options.state ?? 'active', limit: options.limit, cursor: options.cursor, resourceType: options.resourceType, resourceId: options.resourceId })); } - iterPages(driveId: string, options: PageOptions & { lifecycle?: string; resourceType?: string; resourceId?: string } = {}): AsyncGenerator, void, undefined> { + iterPages(driveId: string, options: PageOptions & { state?: string; resourceType?: string; resourceId?: string } = {}): AsyncGenerator, void, undefined> { return cursorPages(async (cursor) => { const response = await this.list(driveId, { ...options, cursor }); return { items: response.items, nextCursor: response.nextCursor, raw: response }; }, options); } - iterItems(driveId: string, options: PageOptions & { lifecycle?: string; resourceType?: string; resourceId?: string } = {}) { + iterItems(driveId: string, options: PageOptions & { state?: string; resourceType?: string; resourceId?: string } = {}) { return cursorItems(this.iterPages(driveId, options)); } diff --git a/sdk/typescript/src/generated/apis/ArtifactsApi.ts b/sdk/typescript/src/generated/apis/ArtifactsApi.ts index d02a537..2f2f8a3 100644 --- a/sdk/typescript/src/generated/apis/ArtifactsApi.ts +++ b/sdk/typescript/src/generated/apis/ArtifactsApi.ts @@ -75,7 +75,7 @@ export interface ArtifactsDeleteRequest { export interface ArtifactsListRequest { driveId: string; - lifecycle?: string; + state?: string; limit?: number | null; cursor?: string | null; parentId?: string | null; @@ -469,7 +469,7 @@ export class ArtifactsApi extends runtime.BaseAPI { } /** - * List the drive\'s artifacts, newest-first (keyset paginated). ``lifecycle`` (active|deleted|all) exposes soft-deleted artifacts. ``parent_id`` / ``name`` / ``content_type`` / ``label`` are exact-match filters; ``updated_after`` / ``updated_before`` are inclusive bounds. Unknown query parameters are rejected. + * List the drive\'s artifacts, newest-first (keyset paginated). ``state`` (active|deleted|all) exposes soft-deleted artifacts. ``parent_id`` / ``name`` / ``content_type`` / ``label`` are exact-match filters; ``updated_after`` / ``updated_before`` are inclusive bounds. Unknown query parameters are rejected. * List Artifacts */ async artifactsListRaw(requestParameters: ArtifactsListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { @@ -482,8 +482,8 @@ export class ArtifactsApi extends runtime.BaseAPI { const queryParameters: any = {}; - if (requestParameters['lifecycle'] != null) { - queryParameters['lifecycle'] = requestParameters['lifecycle']; + if (requestParameters['state'] != null) { + queryParameters['state'] = requestParameters['state']; } if (requestParameters['limit'] != null) { @@ -547,7 +547,7 @@ export class ArtifactsApi extends runtime.BaseAPI { } /** - * List the drive\'s artifacts, newest-first (keyset paginated). ``lifecycle`` (active|deleted|all) exposes soft-deleted artifacts. ``parent_id`` / ``name`` / ``content_type`` / ``label`` are exact-match filters; ``updated_after`` / ``updated_before`` are inclusive bounds. Unknown query parameters are rejected. + * List the drive\'s artifacts, newest-first (keyset paginated). ``state`` (active|deleted|all) exposes soft-deleted artifacts. ``parent_id`` / ``name`` / ``content_type`` / ``label`` are exact-match filters; ``updated_after`` / ``updated_before`` are inclusive bounds. Unknown query parameters are rejected. * List Artifacts */ async artifactsList(requestParameters: ArtifactsListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { diff --git a/sdk/typescript/src/generated/apis/ChangesApi.ts b/sdk/typescript/src/generated/apis/ChangesApi.ts index cb3eb4a..d7e1a79 100644 --- a/sdk/typescript/src/generated/apis/ChangesApi.ts +++ b/sdk/typescript/src/generated/apis/ChangesApi.ts @@ -34,6 +34,7 @@ export interface ChangesListRequest { start?: ChangesListStartEnum; cursor?: string | null; type?: string | null; + order?: ChangesListOrderEnum; authorization?: string | null; } @@ -43,7 +44,7 @@ export interface ChangesListRequest { export class ChangesApi extends runtime.BaseAPI { /** - * Pull one page of changes. Exactly one of ``start`` or ``cursor``. ``type`` is an optional comma-separated allow-list of exact event-type strings (e.g. ``type=folder.created,artifact.updated`` for content only, or ``type=grant.created,grant.updated,grant.revoked`` for grant events). A comma-list — not a single value or a ``grant.*`` glob — because the useful sync queries (\"content only\", \"all permission events\") are SETS of exact types, and exact-match keeps the filter\'s meaning independent of the dotted naming (§6.3: unknown params are rejected; unknown type VALUES 400 here). Permission types requested by a non-manager are silently empty (the manager filter still applies), never an existence oracle. + * Pull one page of changes. Exactly one of ``start`` or ``cursor``. ``order`` selects the direction of the walk and accompanies ``start``, never a ``cursor`` — a cursor already carries the direction it was minted for, so repeating it could only ever contradict it. ``oldest`` (the default) is the resumable sync walk: forward from the position, and a drained cursor re-presented later picks up what committed since. ``newest`` is a browse walk for a history screen: it captures the head and walks down toward the retention floor, newest row first. Because new events land ABOVE a captured head, a drained descending cursor stays drained — a reader checking for new activity captures the head again. That is also why ``order=newest`` takes only ``start=now``: ``beginning`` names the far end of a walk that already ends there. ``type`` is an optional comma-separated allow-list of exact event-type strings (e.g. ``type=folder.created,artifact.updated`` for content only, or ``type=grant.created,grant.updated,grant.revoked`` for grant events). A comma-list — not a single value or a ``grant.*`` glob — because the useful sync queries (\"content only\", \"all permission events\") are SETS of exact types, and exact-match keeps the filter\'s meaning independent of the dotted naming (§6.3: unknown params are rejected; unknown type VALUES 400 here). Permission types requested by a non-manager are silently empty (the manager filter still applies), never an existence oracle. * List Changes */ async changesListRaw(requestParameters: ChangesListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { @@ -72,6 +73,10 @@ export class ChangesApi extends runtime.BaseAPI { queryParameters['type'] = requestParameters['type']; } + if (requestParameters['order'] != null) { + queryParameters['order'] = requestParameters['order']; + } + const headerParameters: runtime.HTTPHeaders = {}; if (requestParameters['authorization'] != null) { @@ -101,7 +106,7 @@ export class ChangesApi extends runtime.BaseAPI { } /** - * Pull one page of changes. Exactly one of ``start`` or ``cursor``. ``type`` is an optional comma-separated allow-list of exact event-type strings (e.g. ``type=folder.created,artifact.updated`` for content only, or ``type=grant.created,grant.updated,grant.revoked`` for grant events). A comma-list — not a single value or a ``grant.*`` glob — because the useful sync queries (\"content only\", \"all permission events\") are SETS of exact types, and exact-match keeps the filter\'s meaning independent of the dotted naming (§6.3: unknown params are rejected; unknown type VALUES 400 here). Permission types requested by a non-manager are silently empty (the manager filter still applies), never an existence oracle. + * Pull one page of changes. Exactly one of ``start`` or ``cursor``. ``order`` selects the direction of the walk and accompanies ``start``, never a ``cursor`` — a cursor already carries the direction it was minted for, so repeating it could only ever contradict it. ``oldest`` (the default) is the resumable sync walk: forward from the position, and a drained cursor re-presented later picks up what committed since. ``newest`` is a browse walk for a history screen: it captures the head and walks down toward the retention floor, newest row first. Because new events land ABOVE a captured head, a drained descending cursor stays drained — a reader checking for new activity captures the head again. That is also why ``order=newest`` takes only ``start=now``: ``beginning`` names the far end of a walk that already ends there. ``type`` is an optional comma-separated allow-list of exact event-type strings (e.g. ``type=folder.created,artifact.updated`` for content only, or ``type=grant.created,grant.updated,grant.revoked`` for grant events). A comma-list — not a single value or a ``grant.*`` glob — because the useful sync queries (\"content only\", \"all permission events\") are SETS of exact types, and exact-match keeps the filter\'s meaning independent of the dotted naming (§6.3: unknown params are rejected; unknown type VALUES 400 here). Permission types requested by a non-manager are silently empty (the manager filter still applies), never an existence oracle. * List Changes */ async changesList(requestParameters: ChangesListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { @@ -119,3 +124,11 @@ export const ChangesListStartEnum = { Beginning: 'beginning' } as const; export type ChangesListStartEnum = typeof ChangesListStartEnum[keyof typeof ChangesListStartEnum]; +/** + * @export + */ +export const ChangesListOrderEnum = { + Oldest: 'oldest', + Newest: 'newest' +} as const; +export type ChangesListOrderEnum = typeof ChangesListOrderEnum[keyof typeof ChangesListOrderEnum]; diff --git a/sdk/typescript/src/generated/apis/DiscoveryApi.ts b/sdk/typescript/src/generated/apis/DiscoveryApi.ts index 7cc1c9c..7bbcedc 100644 --- a/sdk/typescript/src/generated/apis/DiscoveryApi.ts +++ b/sdk/typescript/src/generated/apis/DiscoveryApi.ts @@ -52,7 +52,7 @@ export class DiscoveryApi extends runtime.BaseAPI { } /** - * Path-inserted protected-resource metadata used by MCP OAuth clients. Served by the MCP sidecar when one is configured, because it is the authority on the scope bundle its own tools require; otherwise it falls back to the resource-root document, since `/v0` and `/mcp` share AgentDrive\'s canonical audience. + * Path-inserted protected-resource metadata for the hosted MCP transport. It names a DIFFERENT resource from the root document — `/mcp`, with the separately maintained MCP scope list — and is served by the MCP sidecar, which is the authority on its own tool set. Deployments with no sidecar answer 404: there is no `/mcp` resource to describe. * Protected-resource metadata for the MCP endpoint (RFC 9728) */ async oauthProtectedResourceMcpRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { @@ -74,7 +74,7 @@ export class DiscoveryApi extends runtime.BaseAPI { } /** - * Path-inserted protected-resource metadata used by MCP OAuth clients. Served by the MCP sidecar when one is configured, because it is the authority on the scope bundle its own tools require; otherwise it falls back to the resource-root document, since `/v0` and `/mcp` share AgentDrive\'s canonical audience. + * Path-inserted protected-resource metadata for the hosted MCP transport. It names a DIFFERENT resource from the root document — `/mcp`, with the separately maintained MCP scope list — and is served by the MCP sidecar, which is the authority on its own tool set. Deployments with no sidecar answer 404: there is no `/mcp` resource to describe. * Protected-resource metadata for the MCP endpoint (RFC 9728) */ async oauthProtectedResourceMcp(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: any; }> { diff --git a/sdk/typescript/src/generated/apis/DrivesApi.ts b/sdk/typescript/src/generated/apis/DrivesApi.ts index 522a093..991101b 100644 --- a/sdk/typescript/src/generated/apis/DrivesApi.ts +++ b/sdk/typescript/src/generated/apis/DrivesApi.ts @@ -54,7 +54,7 @@ export interface DrivesDeleteRequest { } export interface DrivesListRequest { - lifecycle?: string; + state?: string; limit?: number | null; cursor?: string | null; authorization?: string | null; @@ -229,14 +229,14 @@ export class DrivesApi extends runtime.BaseAPI { } /** - * List the actor\'s workspace drives, newest-first (keyset paginated). ``lifecycle`` (active|deleted|all) exposes soft-deleted drives so a manager can read the post-delete revision as the If-Match source for a restore. Unknown query parameters are rejected (§6.3). + * List the actor\'s workspace drives, newest-first (keyset paginated). ``state`` (active|deleted|all) exposes soft-deleted drives so a manager can read the post-delete revision as the If-Match source for a restore. Unknown query parameters are rejected (§6.3). * List Drives */ async drivesListRaw(requestParameters: DrivesListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const queryParameters: any = {}; - if (requestParameters['lifecycle'] != null) { - queryParameters['lifecycle'] = requestParameters['lifecycle']; + if (requestParameters['state'] != null) { + queryParameters['state'] = requestParameters['state']; } if (requestParameters['limit'] != null) { @@ -275,7 +275,7 @@ export class DrivesApi extends runtime.BaseAPI { } /** - * List the actor\'s workspace drives, newest-first (keyset paginated). ``lifecycle`` (active|deleted|all) exposes soft-deleted drives so a manager can read the post-delete revision as the If-Match source for a restore. Unknown query parameters are rejected (§6.3). + * List the actor\'s workspace drives, newest-first (keyset paginated). ``state`` (active|deleted|all) exposes soft-deleted drives so a manager can read the post-delete revision as the If-Match source for a restore. Unknown query parameters are rejected (§6.3). * List Drives */ async drivesList(requestParameters: DrivesListRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { @@ -495,7 +495,7 @@ export class DrivesApi extends runtime.BaseAPI { } /** - * Byte counters for one active drive: storage is the live sum of its versions\' sizes; retrieval reads the counter the content-read slice maintains (0 until it lands). + * Usage counters, current storage and download meters, and the effective file/share limits for one active drive. The snapshot includes committed and reserved bytes so clients can show capacity already in flight. * Drive Usage */ async drivesUsageRaw(requestParameters: DrivesUsageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { @@ -537,7 +537,7 @@ export class DrivesApi extends runtime.BaseAPI { } /** - * Byte counters for one active drive: storage is the live sum of its versions\' sizes; retrieval reads the counter the content-read slice maintains (0 until it lands). + * Usage counters, current storage and download meters, and the effective file/share limits for one active drive. The snapshot includes committed and reserved bytes so clients can show capacity already in flight. * Drive Usage */ async drivesUsage(requestParameters: DrivesUsageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { diff --git a/sdk/typescript/src/generated/apis/FoldersApi.ts b/sdk/typescript/src/generated/apis/FoldersApi.ts index b848ecc..573435e 100644 --- a/sdk/typescript/src/generated/apis/FoldersApi.ts +++ b/sdk/typescript/src/generated/apis/FoldersApi.ts @@ -70,7 +70,7 @@ export interface FoldersDeleteRequest { export interface FoldersListRequest { driveId: string; - lifecycle?: string; + state?: string; limit?: number | null; cursor?: string | null; parentId?: string | null; @@ -349,7 +349,7 @@ export class FoldersApi extends runtime.BaseAPI { } /** - * List the drive\'s folders, newest-first (keyset paginated). ``lifecycle`` (active|deleted|all) exposes soft-deleted folders so the post-delete revision can be read as the If-Match source for a restore. ``parent_id`` / ``name`` are exact-match filters. Unknown query parameters are rejected (§6.3). + * List the drive\'s folders, newest-first (keyset paginated). ``state`` (active|deleted|all) exposes soft-deleted folders so the post-delete revision can be read as the If-Match source for a restore. ``parent_id`` / ``name`` are exact-match filters. Unknown query parameters are rejected (§6.3). * List Folders */ async foldersListRaw(requestParameters: FoldersListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { @@ -362,8 +362,8 @@ export class FoldersApi extends runtime.BaseAPI { const queryParameters: any = {}; - if (requestParameters['lifecycle'] != null) { - queryParameters['lifecycle'] = requestParameters['lifecycle']; + if (requestParameters['state'] != null) { + queryParameters['state'] = requestParameters['state']; } if (requestParameters['limit'] != null) { @@ -411,7 +411,7 @@ export class FoldersApi extends runtime.BaseAPI { } /** - * List the drive\'s folders, newest-first (keyset paginated). ``lifecycle`` (active|deleted|all) exposes soft-deleted folders so the post-delete revision can be read as the If-Match source for a restore. ``parent_id`` / ``name`` are exact-match filters. Unknown query parameters are rejected (§6.3). + * List the drive\'s folders, newest-first (keyset paginated). ``state`` (active|deleted|all) exposes soft-deleted folders so the post-delete revision can be read as the If-Match source for a restore. ``parent_id`` / ``name`` are exact-match filters. Unknown query parameters are rejected (§6.3). * List Folders */ async foldersList(requestParameters: FoldersListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { diff --git a/sdk/typescript/src/generated/apis/GrantsApi.ts b/sdk/typescript/src/generated/apis/GrantsApi.ts index 104504b..6ea9cf4 100644 --- a/sdk/typescript/src/generated/apis/GrantsApi.ts +++ b/sdk/typescript/src/generated/apis/GrantsApi.ts @@ -46,7 +46,7 @@ export interface GrantsCreateRequest { export interface GrantsListRequest { driveId: string; - lifecycle?: string; + state?: string; limit?: number | null; cursor?: string | null; resourceType?: string | null; @@ -170,8 +170,8 @@ export class GrantsApi extends runtime.BaseAPI { const queryParameters: any = {}; - if (requestParameters['lifecycle'] != null) { - queryParameters['lifecycle'] = requestParameters['lifecycle']; + if (requestParameters['state'] != null) { + queryParameters['state'] = requestParameters['state']; } if (requestParameters['limit'] != null) { diff --git a/sdk/typescript/src/generated/apis/NavigationApi.ts b/sdk/typescript/src/generated/apis/NavigationApi.ts index 54a5017..e63e7a5 100644 --- a/sdk/typescript/src/generated/apis/NavigationApi.ts +++ b/sdk/typescript/src/generated/apis/NavigationApi.ts @@ -59,7 +59,7 @@ export interface LookupRequest { export class NavigationApi extends runtime.BaseAPI { /** - * List one folder\'s direct children across the shared namespace. + * List one folder\'s direct children across the shared namespace. ``state`` (active|deleted|all) exposes soft-deleted entries, matching every other v0 collection. Unknown query parameters are rejected. * List Entries */ async entriesListRaw(requestParameters: EntriesListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { @@ -148,7 +148,7 @@ export class NavigationApi extends runtime.BaseAPI { } /** - * List one folder\'s direct children across the shared namespace. + * List one folder\'s direct children across the shared namespace. ``state`` (active|deleted|all) exposes soft-deleted entries, matching every other v0 collection. Unknown query parameters are rejected. * List Entries */ async entriesList(requestParameters: EntriesListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { diff --git a/sdk/typescript/src/generated/apis/SharesApi.ts b/sdk/typescript/src/generated/apis/SharesApi.ts index 5710bf8..2d5088b 100644 --- a/sdk/typescript/src/generated/apis/SharesApi.ts +++ b/sdk/typescript/src/generated/apis/SharesApi.ts @@ -46,7 +46,7 @@ export interface SharesCreateRequest { export interface SharesListRequest { driveId: string; - lifecycle?: string; + state?: string; limit?: number | null; cursor?: string | null; resourceType?: string | null; @@ -168,8 +168,8 @@ export class SharesApi extends runtime.BaseAPI { const queryParameters: any = {}; - if (requestParameters['lifecycle'] != null) { - queryParameters['lifecycle'] = requestParameters['lifecycle']; + if (requestParameters['state'] != null) { + queryParameters['state'] = requestParameters['state']; } if (requestParameters['limit'] != null) { diff --git a/sdk/typescript/src/generated/models/ChangeActorOut.ts b/sdk/typescript/src/generated/models/ChangeActorOut.ts index e5e132d..d5d0705 100644 --- a/sdk/typescript/src/generated/models/ChangeActorOut.ts +++ b/sdk/typescript/src/generated/models/ChangeActorOut.ts @@ -40,6 +40,7 @@ export interface ChangeActorOut { export const ChangeActorOutTypeEnum = { Agent: 'agent', User: 'user', + Service: 'service', System: 'system' } as const; export type ChangeActorOutTypeEnum = typeof ChangeActorOutTypeEnum[keyof typeof ChangeActorOutTypeEnum]; diff --git a/sdk/typescript/src/generated/models/DriveUsageOut.ts b/sdk/typescript/src/generated/models/DriveUsageOut.ts index fb8771e..0a16c4d 100644 --- a/sdk/typescript/src/generated/models/DriveUsageOut.ts +++ b/sdk/typescript/src/generated/models/DriveUsageOut.ts @@ -13,12 +13,39 @@ */ import { mapValues } from '../runtime'; +import type { EffectiveLimitsOut } from './EffectiveLimitsOut'; +import { + EffectiveLimitsOutFromJSON, + EffectiveLimitsOutFromJSONTyped, + EffectiveLimitsOutToJSON, + EffectiveLimitsOutToJSONTyped, +} from './EffectiveLimitsOut'; +import type { UsageMetersOut } from './UsageMetersOut'; +import { + UsageMetersOutFromJSON, + UsageMetersOutFromJSONTyped, + UsageMetersOutToJSON, + UsageMetersOutToJSONTyped, +} from './UsageMetersOut'; + /** * * @export * @interface DriveUsageOut */ export interface DriveUsageOut { + /** + * + * @type {EffectiveLimitsOut} + * @memberof DriveUsageOut + */ + effectiveLimits: EffectiveLimitsOut; + /** + * + * @type {UsageMetersOut} + * @memberof DriveUsageOut + */ + meters: UsageMetersOut; /** * * @type {number} @@ -37,6 +64,8 @@ export interface DriveUsageOut { * Check if a given object implements the DriveUsageOut interface. */ export function instanceOfDriveUsageOut(value: object): value is DriveUsageOut { + if (!('effectiveLimits' in value) || value['effectiveLimits'] === undefined) return false; + if (!('meters' in value) || value['meters'] === undefined) return false; if (!('retrievalBytes' in value) || value['retrievalBytes'] === undefined) return false; if (!('storageBytes' in value) || value['storageBytes'] === undefined) return false; return true; @@ -52,6 +81,8 @@ export function DriveUsageOutFromJSONTyped(json: any, ignoreDiscriminator: boole } return { + 'effectiveLimits': EffectiveLimitsOutFromJSON(json['effective_limits']), + 'meters': UsageMetersOutFromJSON(json['meters']), 'retrievalBytes': json['retrieval_bytes'], 'storageBytes': json['storage_bytes'], }; @@ -68,6 +99,8 @@ export function DriveUsageOutToJSONTyped(value?: DriveUsageOut | null, ignoreDis return { + 'effective_limits': EffectiveLimitsOutToJSON(value['effectiveLimits']), + 'meters': UsageMetersOutToJSON(value['meters']), 'retrieval_bytes': value['retrievalBytes'], 'storage_bytes': value['storageBytes'], }; diff --git a/sdk/typescript/src/generated/models/EffectiveLimitsOut.ts b/sdk/typescript/src/generated/models/EffectiveLimitsOut.ts new file mode 100644 index 0000000..15d9f27 --- /dev/null +++ b/sdk/typescript/src/generated/models/EffectiveLimitsOut.ts @@ -0,0 +1,92 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * AgentDrive + * AgentDrive is an agent-focused artifact store: drive-scoped folders, artifacts, and immutable versions, with local grants, possession-based share links, drive-scoped search, and a cursor-resumable change feed. Bearer-authenticated with Hub-issued product tokens (see /.well-known/oauth-protected-resource); every mutation takes an Idempotency-Key, and existing-state mutations take If-Match. + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface EffectiveLimitsOut + */ +export interface EffectiveLimitsOut { + /** + * + * @type {number} + * @memberof EffectiveLimitsOut + */ + maxFileBytes: number; + /** + * + * @type {number} + * @memberof EffectiveLimitsOut + */ + maxInlineFileBytes: number; + /** + * + * @type {number} + * @memberof EffectiveLimitsOut + */ + shareDefaultTtlSeconds: number; + /** + * + * @type {number} + * @memberof EffectiveLimitsOut + */ + shareMaxTtlSeconds: number; +} + +/** + * Check if a given object implements the EffectiveLimitsOut interface. + */ +export function instanceOfEffectiveLimitsOut(value: object): value is EffectiveLimitsOut { + if (!('maxFileBytes' in value) || value['maxFileBytes'] === undefined) return false; + if (!('maxInlineFileBytes' in value) || value['maxInlineFileBytes'] === undefined) return false; + if (!('shareDefaultTtlSeconds' in value) || value['shareDefaultTtlSeconds'] === undefined) return false; + if (!('shareMaxTtlSeconds' in value) || value['shareMaxTtlSeconds'] === undefined) return false; + return true; +} + +export function EffectiveLimitsOutFromJSON(json: any): EffectiveLimitsOut { + return EffectiveLimitsOutFromJSONTyped(json, false); +} + +export function EffectiveLimitsOutFromJSONTyped(json: any, ignoreDiscriminator: boolean): EffectiveLimitsOut { + if (json == null) { + return json; + } + return { + + 'maxFileBytes': json['max_file_bytes'], + 'maxInlineFileBytes': json['max_inline_file_bytes'], + 'shareDefaultTtlSeconds': json['share_default_ttl_seconds'], + 'shareMaxTtlSeconds': json['share_max_ttl_seconds'], + }; +} + +export function EffectiveLimitsOutToJSON(json: any): EffectiveLimitsOut { + return EffectiveLimitsOutToJSONTyped(json, false); +} + +export function EffectiveLimitsOutToJSONTyped(value?: EffectiveLimitsOut | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'max_file_bytes': value['maxFileBytes'], + 'max_inline_file_bytes': value['maxInlineFileBytes'], + 'share_default_ttl_seconds': value['shareDefaultTtlSeconds'], + 'share_max_ttl_seconds': value['shareMaxTtlSeconds'], + }; +} diff --git a/sdk/typescript/src/generated/models/ErrorResponseError.ts b/sdk/typescript/src/generated/models/ErrorResponseError.ts index b41b04b..c7a9a65 100644 --- a/sdk/typescript/src/generated/models/ErrorResponseError.ts +++ b/sdk/typescript/src/generated/models/ErrorResponseError.ts @@ -51,6 +51,7 @@ export const ErrorResponseErrorCodeEnum = { AuthenticationRequired: 'AUTHENTICATION_REQUIRED', AuthUnavailable: 'AUTH_UNAVAILABLE', BadRequest: 'BAD_REQUEST', + BandwidthLimitExceeded: 'BANDWIDTH_LIMIT_EXCEEDED', ChangeCursorExpired: 'CHANGE_CURSOR_EXPIRED', ChecksumMismatch: 'CHECKSUM_MISMATCH', Conflict: 'CONFLICT', diff --git a/sdk/typescript/src/generated/models/GrantCreateIn.ts b/sdk/typescript/src/generated/models/GrantCreateIn.ts index dceae0e..b88161b 100644 --- a/sdk/typescript/src/generated/models/GrantCreateIn.ts +++ b/sdk/typescript/src/generated/models/GrantCreateIn.ts @@ -26,7 +26,7 @@ export interface GrantCreateIn { */ expiresAt?: Date | null; /** - * Required for `agent`, `user`, and `workspace`; omitted only for `public`. For `agent` and `user` it is checked against that type's id prefix (`tcagt_` / `tcusr_`) and a mismatch is `422 VALIDATION_ERROR`. The prefix is all AgentDrive asserts: these ids are minted by Hub, so their full shape is not AgentDrive's to enforce, and a well-formed id naming a principal that does not exist — or belongs to another workspace — is accepted here and simply never matches a token. The rule is conditional on `principal_type`, so it is enforced at the boundary rather than expressible as one JSON Schema `pattern`. + * Required for `agent`, `user`, `service`, and `workspace`; omitted only for `public`. For `agent`, `user`, and `service` it is checked against that type's id prefix (`tcagt_` / `tcusr_` / `tcsvc_`) and a mismatch is `422 VALIDATION_ERROR`. The prefix is all AgentDrive asserts: these ids are minted by Hub, so their full shape is not AgentDrive's to enforce, and a well-formed id naming a principal that does not exist — or belongs to another workspace — is accepted here and simply never matches a token. The rule is conditional on `principal_type`, so it is enforced at the boundary rather than expressible as one JSON Schema `pattern`. * @type {string} * @memberof GrantCreateIn */ @@ -64,6 +64,7 @@ export interface GrantCreateIn { export const GrantCreateInPrincipalTypeEnum = { Agent: 'agent', User: 'user', + Service: 'service', Workspace: 'workspace', Public: 'public' } as const; diff --git a/sdk/typescript/src/generated/models/GrantOut.ts b/sdk/typescript/src/generated/models/GrantOut.ts index 0123d6a..4e16766 100644 --- a/sdk/typescript/src/generated/models/GrantOut.ts +++ b/sdk/typescript/src/generated/models/GrantOut.ts @@ -100,6 +100,7 @@ export interface GrantOut { export const GrantOutPrincipalTypeEnum = { Agent: 'agent', User: 'user', + Service: 'service', Workspace: 'workspace', Public: 'public' } as const; diff --git a/sdk/typescript/src/generated/models/UsageMeterOut.ts b/sdk/typescript/src/generated/models/UsageMeterOut.ts new file mode 100644 index 0000000..0b480c7 --- /dev/null +++ b/sdk/typescript/src/generated/models/UsageMeterOut.ts @@ -0,0 +1,123 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * AgentDrive + * AgentDrive is an agent-focused artifact store: drive-scoped folders, artifacts, and immutable versions, with local grants, possession-based share links, drive-scoped search, and a cursor-resumable change feed. Bearer-authenticated with Hub-issued product tokens (see /.well-known/oauth-protected-resource); every mutation takes an Idempotency-Key, and existing-state mutations take If-Match. + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface UsageMeterOut + */ +export interface UsageMeterOut { + /** + * + * @type {number} + * @memberof UsageMeterOut + */ + limit: number; + /** + * + * @type {number} + * @memberof UsageMeterOut + */ + remaining: number; + /** + * + * @type {number} + * @memberof UsageMeterOut + */ + reserved: number; + /** + * + * @type {Date} + * @memberof UsageMeterOut + */ + resetAt: Date | null; + /** + * + * @type {string} + * @memberof UsageMeterOut + */ + scope: UsageMeterOutScopeEnum; + /** + * + * @type {number} + * @memberof UsageMeterOut + */ + used: number; +} + + +/** + * @export + */ +export const UsageMeterOutScopeEnum = { + Workspace: 'workspace', + Drive: 'drive', + Principal: 'principal', + Share: 'share' +} as const; +export type UsageMeterOutScopeEnum = typeof UsageMeterOutScopeEnum[keyof typeof UsageMeterOutScopeEnum]; + + +/** + * Check if a given object implements the UsageMeterOut interface. + */ +export function instanceOfUsageMeterOut(value: object): value is UsageMeterOut { + if (!('limit' in value) || value['limit'] === undefined) return false; + if (!('remaining' in value) || value['remaining'] === undefined) return false; + if (!('reserved' in value) || value['reserved'] === undefined) return false; + if (!('resetAt' in value) || value['resetAt'] === undefined) return false; + if (!('scope' in value) || value['scope'] === undefined) return false; + if (!('used' in value) || value['used'] === undefined) return false; + return true; +} + +export function UsageMeterOutFromJSON(json: any): UsageMeterOut { + return UsageMeterOutFromJSONTyped(json, false); +} + +export function UsageMeterOutFromJSONTyped(json: any, ignoreDiscriminator: boolean): UsageMeterOut { + if (json == null) { + return json; + } + return { + + 'limit': json['limit'], + 'remaining': json['remaining'], + 'reserved': json['reserved'], + 'resetAt': (json['reset_at'] == null ? null : new Date(json['reset_at'])), + 'scope': json['scope'], + 'used': json['used'], + }; +} + +export function UsageMeterOutToJSON(json: any): UsageMeterOut { + return UsageMeterOutToJSONTyped(json, false); +} + +export function UsageMeterOutToJSONTyped(value?: UsageMeterOut | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'limit': value['limit'], + 'remaining': value['remaining'], + 'reserved': value['reserved'], + 'reset_at': value['resetAt'] == null ? value['resetAt'] : value['resetAt'].toISOString(), + 'scope': value['scope'], + 'used': value['used'], + }; +} diff --git a/sdk/typescript/src/generated/models/UsageMetersOut.ts b/sdk/typescript/src/generated/models/UsageMetersOut.ts new file mode 100644 index 0000000..3273bc4 --- /dev/null +++ b/sdk/typescript/src/generated/models/UsageMetersOut.ts @@ -0,0 +1,100 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * AgentDrive + * AgentDrive is an agent-focused artifact store: drive-scoped folders, artifacts, and immutable versions, with local grants, possession-based share links, drive-scoped search, and a cursor-resumable change feed. Bearer-authenticated with Hub-issued product tokens (see /.well-known/oauth-protected-resource); every mutation takes an Idempotency-Key, and existing-state mutations take If-Match. + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { UsageMeterOut } from './UsageMeterOut'; +import { + UsageMeterOutFromJSON, + UsageMeterOutFromJSONTyped, + UsageMeterOutToJSON, + UsageMeterOutToJSONTyped, +} from './UsageMeterOut'; + +/** + * + * @export + * @interface UsageMetersOut + */ +export interface UsageMetersOut { + /** + * + * @type {UsageMeterOut} + * @memberof UsageMetersOut + */ + driveStorage: UsageMeterOut; + /** + * + * @type {UsageMeterOut} + * @memberof UsageMetersOut + */ + workspaceDownloadDay: UsageMeterOut; + /** + * + * @type {UsageMeterOut} + * @memberof UsageMetersOut + */ + workspaceDownloadMonth: UsageMeterOut; + /** + * + * @type {UsageMeterOut} + * @memberof UsageMetersOut + */ + workspaceStorage: UsageMeterOut; +} + +/** + * Check if a given object implements the UsageMetersOut interface. + */ +export function instanceOfUsageMetersOut(value: object): value is UsageMetersOut { + if (!('driveStorage' in value) || value['driveStorage'] === undefined) return false; + if (!('workspaceDownloadDay' in value) || value['workspaceDownloadDay'] === undefined) return false; + if (!('workspaceDownloadMonth' in value) || value['workspaceDownloadMonth'] === undefined) return false; + if (!('workspaceStorage' in value) || value['workspaceStorage'] === undefined) return false; + return true; +} + +export function UsageMetersOutFromJSON(json: any): UsageMetersOut { + return UsageMetersOutFromJSONTyped(json, false); +} + +export function UsageMetersOutFromJSONTyped(json: any, ignoreDiscriminator: boolean): UsageMetersOut { + if (json == null) { + return json; + } + return { + + 'driveStorage': UsageMeterOutFromJSON(json['drive_storage']), + 'workspaceDownloadDay': UsageMeterOutFromJSON(json['workspace_download_day']), + 'workspaceDownloadMonth': UsageMeterOutFromJSON(json['workspace_download_month']), + 'workspaceStorage': UsageMeterOutFromJSON(json['workspace_storage']), + }; +} + +export function UsageMetersOutToJSON(json: any): UsageMetersOut { + return UsageMetersOutToJSONTyped(json, false); +} + +export function UsageMetersOutToJSONTyped(value?: UsageMetersOut | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'drive_storage': UsageMeterOutToJSON(value['driveStorage']), + 'workspace_download_day': UsageMeterOutToJSON(value['workspaceDownloadDay']), + 'workspace_download_month': UsageMeterOutToJSON(value['workspaceDownloadMonth']), + 'workspace_storage': UsageMeterOutToJSON(value['workspaceStorage']), + }; +} diff --git a/sdk/typescript/src/generated/models/index.ts b/sdk/typescript/src/generated/models/index.ts index ada42c0..bf639ee 100644 --- a/sdk/typescript/src/generated/models/index.ts +++ b/sdk/typescript/src/generated/models/index.ts @@ -25,6 +25,7 @@ export * from './DriveOut'; export * from './DriveUpdateIn'; export * from './DriveUsageOut'; export * from './EditabilityOut'; +export * from './EffectiveLimitsOut'; export * from './EntriesInner'; export * from './EntryListOut'; export * from './ErrorResponse'; @@ -74,6 +75,8 @@ export * from './UploadsCreateRequestContentChecksum'; export * from './UploadsCreateRequestTarget'; export * from './UploadsCreateRequestTargetOneOf'; export * from './UploadsCreateRequestTargetOneOf1'; +export * from './UsageMeterOut'; +export * from './UsageMetersOut'; export * from './V0ErrorEnvelope'; export * from './ValidationErrorResponse'; export * from './ValidationErrorResponseError'; diff --git a/tests/test_import_contract.py b/tests/test_import_contract.py index 31ff9c8..c122d1f 100644 --- a/tests/test_import_contract.py +++ b/tests/test_import_contract.py @@ -5,7 +5,11 @@ import unittest from pathlib import Path -from scripts.import_agentdrive_contract import ContractImportError, import_contract +from scripts.import_agentdrive_contract import ( + SUPPORTED_POLICY_VERSION, + ContractImportError, + import_contract, +) class ImportContractTest(unittest.TestCase): @@ -17,7 +21,7 @@ def _source(self, root: Path) -> Path: "openapi": "3.1.0", "info": {"title": "AgentDrive", "version": ""}, "servers": [""], - "x-agentdrive-compatibility-policy": 1, + "x-agentdrive-compatibility-policy": SUPPORTED_POLICY_VERSION, "components": { "securitySchemes": { "bearerAuth": { @@ -66,7 +70,7 @@ def test_import_replaces_only_deployment_server_and_records_provenance(self): metadata = json.loads(provenance.read_text(encoding="utf-8")) self.assertEqual(metadata["source_commit"], "abc123") self.assertEqual( - metadata["source_path"], "tests/openapi.golden.json" + metadata["source_path"], "apps/drive/tests/openapi.golden.json" ) self.assertIn("source_sha256", metadata) From 0225e2a06ae55ca1cfaccf9adaa5961ea0faa2e1 Mon Sep 17 00:00:00 2001 From: jiashuoz Date: Fri, 11 Sep 2026 11:11:54 -0700 Subject: [PATCH 2/3] chore(sdk): bump both packages to 0.1.0 The facade option rename is breaking and the contract catch-up adds ten operations, so neither is a patch release. The generator does not own these version fields; it reads SDK_VERSION and leaves the committed manifests alone, which is why regeneration after the bump changes nothing. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01AiYiPkSwvRWDfthQUtx11Q --- sdk/python/pyproject.toml | 2 +- sdk/typescript/package-lock.json | 4 ++-- sdk/typescript/package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/python/pyproject.toml b/sdk/python/pyproject.toml index 582b026..1c66a8e 100644 --- a/sdk/python/pyproject.toml +++ b/sdk/python/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "agentdrive_sdk" -version = "0.0.3" +version = "0.1.0" description = "AgentDrive" authors = [ {name = "OpenAPI Generator Community",email = "team@openapitools.org"}, diff --git a/sdk/typescript/package-lock.json b/sdk/typescript/package-lock.json index 2b28aa1..e9bab6a 100644 --- a/sdk/typescript/package-lock.json +++ b/sdk/typescript/package-lock.json @@ -1,12 +1,12 @@ { "name": "@tokencanopy/agentdrive-sdk", - "version": "0.0.3", + "version": "0.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@tokencanopy/agentdrive-sdk", - "version": "0.0.3", + "version": "0.1.0", "devDependencies": { "typescript": "^4.0 || ^5.0" } diff --git a/sdk/typescript/package.json b/sdk/typescript/package.json index 56fa408..e88d0a9 100644 --- a/sdk/typescript/package.json +++ b/sdk/typescript/package.json @@ -1,6 +1,6 @@ { "name": "@tokencanopy/agentdrive-sdk", - "version": "0.0.3", + "version": "0.1.0", "description": "OpenAPI client for @tokencanopy/agentdrive-sdk", "author": "OpenAPI-Generator", "repository": { From 9fceaf0e04f34dad24566932cd7686ac7e7b9f69 Mon Sep 17 00:00:00 2001 From: jiashuoz Date: Fri, 11 Sep 2026 11:22:15 -0700 Subject: [PATCH 3/3] fix(sdk): carry 0.1.0 through every place the version is declared The bump touched the two package manifests and stopped there, but the version lives in six places the contract suite pins together: both manifests, the lockfile, `agentdrive_sdk.__version__`, the Go README, and `generate-sdks.sh`'s own `SDK_VERSION` default. That last one is the load-bearing one -- CI regenerates without setting SDK_VERSION, so a stale default rewrites every generated metadata file back to the old version and the failure surfaces as generated-code drift rather than as the one number that was missed. Regenerating with the new default carries it into the generated clients too. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01AiYiPkSwvRWDfthQUtx11Q --- scripts/generate-sdks.sh | 2 +- sdk/go/README.md | 2 +- sdk/go/configuration.go | 2 +- sdk/python/agentdrive_sdk/__init__.py | 2 +- sdk/python/agentdrive_sdk/generated/__init__.py | 2 +- sdk/python/agentdrive_sdk/generated/api_client.py | 2 +- sdk/python/agentdrive_sdk/generated/configuration.py | 2 +- tests/test_sdk_version.py | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/generate-sdks.sh b/scripts/generate-sdks.sh index 0cf8d33..c6ff70e 100755 --- a/scripts/generate-sdks.sh +++ b/scripts/generate-sdks.sh @@ -9,7 +9,7 @@ ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" SPEC_INPUT="${1:-sdk/openapi.json}" SPEC="$(python3 "$ROOT/scripts/resolve_repo_path.py" "$ROOT" "$SPEC_INPUT")" cd "$ROOT" -VERSION="${SDK_VERSION:-0.0.3}" +VERSION="${SDK_VERSION:-0.1.0}" GIT_HOST="github.com" GIT_USER="tokencanopy" GIT_REPO="agentdrive-sdk" diff --git a/sdk/go/README.md b/sdk/go/README.md index 0e6defd..9650b2d 100644 --- a/sdk/go/README.md +++ b/sdk/go/README.md @@ -6,7 +6,7 @@ AgentDrive is an agent-focused artifact store: drive-scoped folders, artifacts, This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. - API version: <PINNED> -- Package version: 0.0.3 +- Package version: 0.1.0 - Generator version: 7.16.0 - Build package: org.openapitools.codegen.languages.GoClientCodegen diff --git a/sdk/go/configuration.go b/sdk/go/configuration.go index 67fad40..351b3f0 100644 --- a/sdk/go/configuration.go +++ b/sdk/go/configuration.go @@ -89,7 +89,7 @@ type Configuration struct { func NewConfiguration() *Configuration { cfg := &Configuration{ DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/0.0.3/go", + UserAgent: "OpenAPI-Generator/0.1.0/go", Debug: false, Servers: ServerConfigurations{ { diff --git a/sdk/python/agentdrive_sdk/__init__.py b/sdk/python/agentdrive_sdk/__init__.py index 1d40831..f4f7bd9 100644 --- a/sdk/python/agentdrive_sdk/__init__.py +++ b/sdk/python/agentdrive_sdk/__init__.py @@ -86,4 +86,4 @@ "split_parent_path", ] -__version__ = "0.0.3" +__version__ = "0.1.0" diff --git a/sdk/python/agentdrive_sdk/generated/__init__.py b/sdk/python/agentdrive_sdk/generated/__init__.py index b830a63..7a03d43 100644 --- a/sdk/python/agentdrive_sdk/generated/__init__.py +++ b/sdk/python/agentdrive_sdk/generated/__init__.py @@ -14,7 +14,7 @@ """ # noqa: E501 -__version__ = "0.0.3" +__version__ = "0.1.0" # Define package exports __all__ = [ diff --git a/sdk/python/agentdrive_sdk/generated/api_client.py b/sdk/python/agentdrive_sdk/generated/api_client.py index c2fc354..6b678fb 100644 --- a/sdk/python/agentdrive_sdk/generated/api_client.py +++ b/sdk/python/agentdrive_sdk/generated/api_client.py @@ -91,7 +91,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/0.0.3/python' + self.user_agent = 'OpenAPI-Generator/0.1.0/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/sdk/python/agentdrive_sdk/generated/configuration.py b/sdk/python/agentdrive_sdk/generated/configuration.py index 65a086d..705f7db 100644 --- a/sdk/python/agentdrive_sdk/generated/configuration.py +++ b/sdk/python/agentdrive_sdk/generated/configuration.py @@ -511,7 +511,7 @@ def to_debug_report(self) -> str: "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: <PINNED>\n"\ - "SDK Package Version: 0.0.3".\ + "SDK Package Version: 0.1.0".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self) -> List[HostSetting]: diff --git a/tests/test_sdk_version.py b/tests/test_sdk_version.py index 41e34f2..b528c46 100644 --- a/tests/test_sdk_version.py +++ b/tests/test_sdk_version.py @@ -6,7 +6,7 @@ from pathlib import Path -EXPECTED_VERSION = "0.0.3" +EXPECTED_VERSION = "0.1.0" ROOT = Path(__file__).resolve().parents[1]