diff --git a/doc/compiled.json b/doc/compiled.json index 50246a1c..09ec6444 100644 --- a/doc/compiled.json +++ b/doc/compiled.json @@ -21600,7 +21600,7 @@ }, "patch": { "summary": "Update a screenshot", - "description": "Update an existing screenshot.", + "description": "Updates the name or description of an existing screenshot. This endpoint follows the standard REST resource-update lifecycle: send only the fields you want to change and the server applies them to the existing resource.\n\nUse this when you need to rename a screenshot or revise its contextual description without replacing the image file. Updating screenshot markers is also possible through this endpoint by passing marker attributes. The image file itself cannot be changed; to replace it, delete the screenshot and create a new one.\n\nThe name must be unique within the project (case-insensitive). Existing screenshot markers are unaffected unless marker attributes are explicitly passed.\n", "operationId": "screenshot/update", "tags": [ "Screenshots" @@ -21616,6 +21616,47 @@ "$ref": "#/components/parameters/id" } ], + "x-code-samples": [ + { + "lang": "CLI v2", + "source": "phrase screenshots update \\\n--project_id \\\n--id \\\n--data '{\"branch\":\"my-feature-branch\", \"name\": \"A screenshot name\", \"description\": \"A screenshot description\", \"filename\":\"/path/to/my/screenshot.png\"}' \\\n--access_token " + } + ], + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "title": "screenshot/update/parameters", + "properties": { + "branch": { + "description": "specify the branch to use", + "type": "string", + "example": "my-feature-branch" + }, + "name": { + "description": "New display name for the screenshot. Must be non-empty and unique within the project (case-insensitive). Omit to leave the current name unchanged.", + "type": "string", + "minLength": 1, + "example": "home_screen_v2" + }, + "description": { + "description": "Updated description for the screenshot. Omit to leave the current description unchanged.", + "type": "string", + "example": "Updated landing page screenshot" + }, + "filename": { + "description": "Screenshot file", + "type": "string", + "format": "binary", + "example": "/path/to/my/screenshot.png" + } + } + } + } + } + }, "responses": { "200": { "description": "OK", @@ -21645,8 +21686,7 @@ "$ref": "#/components/responses/401" }, "403": { - "$ref": "#/components/responses/403", - "description": "Forbidden. Returned when the access token lacks the `write` scope, when the requesting user is not allowed to update this screenshot, or when the account does not have the Attachable Screenshots feature." + "$ref": "#/components/responses/403" }, "404": { "$ref": "#/components/responses/404" @@ -21658,50 +21698,6 @@ "$ref": "#/components/responses/429" } }, - "x-code-samples": [ - { - "lang": "Curl", - "source": "curl \"https://api.phrase.com/v2/projects/:project_id/screenshots/:id\" \\\n -u USERNAME_OR_ACCESS_TOKEN \\\n -X PATCH \\\n -F branch=my-feature-branch \\\n -F name=A%20screenshot%20name \\\n -F description=A%20screenshot%20description \\\n -F filename=@/path/to/my/screenshot.png" - }, - { - "lang": "CLI v2", - "source": "phrase screenshots update \\\n--project_id \\\n--id \\\n--data '{\"branch\":\"my-feature-branch\", \"name\": \"A screenshot name\", \"description\": \"A screenshot description\", \"filename\":\"/path/to/my/screenshot.png\"}' \\\n--access_token " - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "title": "screenshot/update/parameters", - "properties": { - "branch": { - "description": "specify the branch to use", - "type": "string", - "example": "my-feature-branch" - }, - "name": { - "description": "Name of the screenshot", - "type": "string", - "example": "A screenshot name" - }, - "description": { - "description": "Description of the screenshot", - "type": "string", - "example": "A screenshot description" - }, - "filename": { - "description": "Screenshot file", - "type": "string", - "format": "binary", - "example": "/path/to/my/screenshot.png" - } - } - } - } - } - }, "x-cli-version": "2.5" }, "delete": { diff --git a/paths/screenshots/update.yaml b/paths/screenshots/update.yaml index df4f3e29..77be8c20 100644 --- a/paths/screenshots/update.yaml +++ b/paths/screenshots/update.yaml @@ -1,6 +1,11 @@ --- summary: Update a screenshot -description: Update an existing screenshot. +description: | + Updates the name or description of an existing screenshot. This endpoint follows the standard REST resource-update lifecycle: send only the fields you want to change and the server applies them to the existing resource. + + Use this when you need to rename a screenshot or revise its contextual description without replacing the image file. Updating screenshot markers is also possible through this endpoint by passing marker attributes. The image file itself cannot be changed; to replace it, delete the screenshot and create a new one. + + The name must be unique within the project (case-insensitive). Existing screenshot markers are unaffected unless marker attributes are explicitly passed. operationId: screenshot/update tags: - Screenshots @@ -8,43 +13,7 @@ parameters: - "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" - "$ref": "../../parameters.yaml#/project_id" - "$ref": "../../parameters.yaml#/id" -responses: - '200': - description: OK - content: - application/json: - schema: - "$ref": "../../schemas/screenshot.yaml#/screenshot" - headers: - X-Rate-Limit-Limit: - "$ref": "../../headers.yaml#/X-Rate-Limit-Limit" - X-Rate-Limit-Remaining: - "$ref": "../../headers.yaml#/X-Rate-Limit-Remaining" - X-Rate-Limit-Reset: - "$ref": "../../headers.yaml#/X-Rate-Limit-Reset" - '400': - "$ref": "../../responses.yaml#/400" - '404': - "$ref": "../../responses.yaml#/404" - '401': - "$ref": "../../responses.yaml#/401" - '403': - "$ref": "../../responses.yaml#/403" - description: Forbidden. Returned when the access token lacks the `write` scope, when the requesting user is not allowed to update this screenshot, or when the account does not have the Attachable Screenshots feature. - '422': - "$ref": "../../responses.yaml#/422" - '429': - "$ref": "../../responses.yaml#/429" x-code-samples: -- lang: Curl - source: |- - curl "https://api.phrase.com/v2/projects/:project_id/screenshots/:id" \ - -u USERNAME_OR_ACCESS_TOKEN \ - -X PATCH \ - -F branch=my-feature-branch \ - -F name=A%20screenshot%20name \ - -F description=A%20screenshot%20description \ - -F filename=@/path/to/my/screenshot.png - lang: CLI v2 source: |- phrase screenshots update \ @@ -55,7 +24,7 @@ x-code-samples: requestBody: required: true content: - application/json: + multipart/form-data: schema: type: object title: screenshot/update/parameters @@ -65,16 +34,43 @@ requestBody: type: string example: my-feature-branch name: - description: Name of the screenshot + description: New display name for the screenshot. Must be non-empty and unique within the project (case-insensitive). Omit to leave the current name unchanged. type: string - example: A screenshot name + minLength: 1 + example: home_screen_v2 description: - description: Description of the screenshot + description: Updated description for the screenshot. Omit to leave the current description unchanged. type: string - example: A screenshot description + example: Updated landing page screenshot filename: description: Screenshot file type: string format: binary example: "/path/to/my/screenshot.png" +responses: + '200': + description: OK + content: + application/json: + schema: + "$ref": "../../schemas/screenshot.yaml#/screenshot" + headers: + X-Rate-Limit-Limit: + "$ref": "../../headers.yaml#/X-Rate-Limit-Limit" + X-Rate-Limit-Remaining: + "$ref": "../../headers.yaml#/X-Rate-Limit-Remaining" + X-Rate-Limit-Reset: + "$ref": "../../headers.yaml#/X-Rate-Limit-Reset" + '400': + "$ref": "../../responses.yaml#/400" + '401': + "$ref": "../../responses.yaml#/401" + '403': + "$ref": "../../responses.yaml#/403" + '404': + "$ref": "../../responses.yaml#/404" + '422': + "$ref": "../../responses.yaml#/422" + '429': + "$ref": "../../responses.yaml#/429" x-cli-version: '2.5'