From 73d45e4ed78ae9b0c3818c15228368052877ff0a Mon Sep 17 00:00:00 2001 From: Jeroen Rinzema Date: Tue, 30 Jun 2026 00:14:07 +0200 Subject: [PATCH] feat: bump spec to v0.1.0-rc.2 (schedule assignment id) Tracks platform release v0.1.0-rc.2. Schedule assignments are now addressable by their own id: set `id` on an upsert to update a specific assignment in place, or omit it to create a new one (the same name can be scheduled multiple times). The returned id can be used to reschedule or delete that instance. Delete now also accepts an `id` to remove a single assignment instead of all by name. - spec/SOURCE.md pinned to v0.1.0-rc.2; spec/client.yaml re-vendored - regenerated src/lunogram/gen/models.py (datamodel-code-generator, py3.12); the scheduled request models gain an optional `id` (and delete `name` is now optional). The facade passes models/dicts through unchanged. --- spec/SOURCE.md | 6 +++--- spec/client.yaml | 33 +++++++++++++++++++++++++++++---- src/lunogram/gen/models.py | 26 +++++++++++++++++++++----- 3 files changed, 53 insertions(+), 12 deletions(-) diff --git a/spec/SOURCE.md b/spec/SOURCE.md index ab87a71..0225a32 100644 --- a/spec/SOURCE.md +++ b/spec/SOURCE.md @@ -7,7 +7,7 @@ platform **release**. It is the single input to the code generator | | | | --- | --- | | Source repo | https://github.com/lunogram/platform | -| Pinned tag | `v0.1.0-rc.1` | +| Pinned tag | `v0.1.0-rc.2` | | Spec asset | `client.yaml` | Every tagged platform release publishes the client OpenAPI spec as a `client.yaml` @@ -18,7 +18,7 @@ checkout or branch pin required. ## Release asset URL ``` -https://github.com/lunogram/platform/releases/download/v0.1.0-rc.1/client.yaml +https://github.com/lunogram/platform/releases/download/v0.1.0-rc.2/client.yaml ``` ## Refreshing the spec @@ -26,7 +26,7 @@ https://github.com/lunogram/platform/releases/download/v0.1.0-rc.1/client.yaml To track a newer release, update the **Pinned tag** above and re-fetch: ```bash -TAG=v0.1.0-rc.1 +TAG=v0.1.0-rc.2 curl -fsSL "https://github.com/lunogram/platform/releases/download/$TAG/client.yaml" -o spec/client.yaml make generate ``` diff --git a/spec/client.yaml b/spec/client.yaml index 5bdf2ca..30dcd5d 100644 --- a/spec/client.yaml +++ b/spec/client.yaml @@ -1646,6 +1646,12 @@ components: required: - name properties: + id: + type: string + format: uuid + nullable: true + example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" + description: The id of the schedule assignment. Omit to create a new assignment (multiple assignments may share the same name per user); supply an existing id to update that assignment in place. The id is returned in the response. name: type: string example: "renewal_date" @@ -1685,6 +1691,12 @@ components: - name - identifier properties: + id: + type: string + format: uuid + nullable: true + example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" + description: The id of the schedule assignment. Omit to create a new assignment (multiple assignments may share the same name per organization); supply an existing id to update that assignment in place. The id is returned in the response. name: type: string example: "contract_renewal" @@ -1721,12 +1733,19 @@ components: DeleteUserScheduledRequest: type: object required: - - name + - identifier properties: + id: + type: string + format: uuid + nullable: true + example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" + description: The id of a specific schedule assignment to delete. When provided, only that instance is removed. Either id or name is required. name: type: string + nullable: true example: "renewal_date" - description: The name of the scheduled resource to delete + description: The name of the scheduled resource to delete. When provided (and id is omitted), every assignment with this name for the user is removed. Either id or name is required. identifier: $ref: "#/components/schemas/UserIdentifier" @@ -1761,13 +1780,19 @@ components: DeleteOrganizationScheduledRequest: type: object required: - - name - identifier properties: + id: + type: string + format: uuid + nullable: true + example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" + description: The id of a specific schedule assignment to delete. When provided, only that instance is removed. Either id or name is required. name: type: string + nullable: true example: "contract_renewal" - description: The name of the scheduled resource to delete + description: The name of the scheduled resource to delete. When provided (and id is omitted), every assignment with this name for the organization is removed. Either id or name is required. identifier: $ref: "#/components/schemas/OrganizationIdentifier" diff --git a/src/lunogram/gen/models.py b/src/lunogram/gen/models.py index c179648..fc3972d 100644 --- a/src/lunogram/gen/models.py +++ b/src/lunogram/gen/models.py @@ -407,6 +407,10 @@ class OrganizationEvent(BaseModel): class UpsertUserScheduledRequest(BaseModel): + id: UUID | None = Field(None, examples=['a1b2c3d4-e5f6-7890-abcd-ef1234567890']) + """ + The id of the schedule assignment. Omit to create a new assignment (multiple assignments may share the same name per user); supply an existing id to update that assignment in place. The id is returned in the response. + """ name: str = Field(..., examples=['renewal_date']) """ The name of the scheduled resource @@ -433,6 +437,10 @@ class UpsertUserScheduledRequest(BaseModel): class UpsertOrganizationScheduledRequest(BaseModel): + id: UUID | None = Field(None, examples=['a1b2c3d4-e5f6-7890-abcd-ef1234567890']) + """ + The id of the schedule assignment. Omit to create a new assignment (multiple assignments may share the same name per organization); supply an existing id to update that assignment in place. The id is returned in the response. + """ name: str = Field(..., examples=['contract_renewal']) """ The name of the scheduled resource @@ -459,11 +467,15 @@ class UpsertOrganizationScheduledRequest(BaseModel): class DeleteUserScheduledRequest(BaseModel): - name: str = Field(..., examples=['renewal_date']) + id: UUID | None = Field(None, examples=['a1b2c3d4-e5f6-7890-abcd-ef1234567890']) """ - The name of the scheduled resource to delete + The id of a specific schedule assignment to delete. When provided, only that instance is removed. Either id or name is required. """ - identifier: UserIdentifier | None = None + name: str | None = Field(None, examples=['renewal_date']) + """ + The name of the scheduled resource to delete. When provided (and id is omitted), every assignment with this name for the user is removed. Either id or name is required. + """ + identifier: UserIdentifier class ScheduledAccepted(BaseModel): @@ -486,9 +498,13 @@ class ScheduledAccepted(BaseModel): class DeleteOrganizationScheduledRequest(BaseModel): - name: str = Field(..., examples=['contract_renewal']) + id: UUID | None = Field(None, examples=['a1b2c3d4-e5f6-7890-abcd-ef1234567890']) + """ + The id of a specific schedule assignment to delete. When provided, only that instance is removed. Either id or name is required. + """ + name: str | None = Field(None, examples=['contract_renewal']) """ - The name of the scheduled resource to delete + The name of the scheduled resource to delete. When provided (and id is omitted), every assignment with this name for the organization is removed. Either id or name is required. """ identifier: OrganizationIdentifier