"/activity":
    post:
        tags: [Activities]
        operationId: createActivity
        summary: Create an activity
        description: Creates a shared activity (game, co-watch, etc.) owned by the caller.
        security:
            - cloudApiKey: []
              cloudAccessToken: []
        requestBody:
            required: true
            content:
                application/json:
                    schema:
                        type: object
                        required: [type]
                        properties:
                            type: { type: string, description: Activity type identifier. }
                            name: { type: string }
                            description: { type: string }
                            roomId: { type: string }
                            metaData:
                                type: object
                                additionalProperties: true
        responses:
            "200":
                description: Created activity.
                content:
                    application/json:
                        schema: { $ref: "../components/schemas/Activity.yaml" }
            "401": { $ref: "../cloud-api.yaml#/components/responses/Unauthorized" }

"/activity/{activityId}":
    parameters:
        - in: path
          name: activityId
          required: true
          schema: { type: string }
    get:
        tags: [Activities]
        operationId: getActivity
        summary: Fetch an activity
        security:
            - cloudApiKey: []
              cloudAccessToken: []
        responses:
            "200":
                description: Activity record.
                content:
                    application/json:
                        schema: { $ref: "../components/schemas/Activity.yaml" }
            "401": { $ref: "../cloud-api.yaml#/components/responses/Unauthorized" }
            "404":
                description: No activity with this id.
                content:
                    application/json:
                        schema: { $ref: "../cloud-api.yaml#/components/schemas/Error" }
    put:
        tags: [Activities]
        operationId: updateActivity
        summary: Update an activity (owner only)
        security:
            - cloudApiKey: []
              cloudAccessToken: []
        requestBody:
            required: true
            content:
                application/json:
                    schema:
                        type: object
                        properties:
                            name: { type: string }
                            description: { type: string }
                            state: { type: string }
                            metaData:
                                type: object
                                additionalProperties: true
        responses:
            "200":
                description: Updated activity.
                content:
                    application/json:
                        schema: { $ref: "../components/schemas/Activity.yaml" }
            "401": { $ref: "../cloud-api.yaml#/components/responses/Unauthorized" }
            "403":
                description: Caller is not the activity owner.
                content:
                    application/json:
                        schema: { $ref: "../cloud-api.yaml#/components/schemas/Error" }
            "404":
                description: No activity with this id.
                content:
                    application/json:
                        schema: { $ref: "../cloud-api.yaml#/components/schemas/Error" }
    delete:
        tags: [Activities]
        operationId: deleteActivity
        summary: Delete an activity (owner only)
        security:
            - cloudApiKey: []
              cloudAccessToken: []
        responses:
            "200":
                description: Activity deleted.
            "401": { $ref: "../cloud-api.yaml#/components/responses/Unauthorized" }
            "403":
                description: Caller is not the activity owner.
                content:
                    application/json:
                        schema: { $ref: "../cloud-api.yaml#/components/schemas/Error" }
            "404":
                description: No activity with this id.
                content:
                    application/json:
                        schema: { $ref: "../cloud-api.yaml#/components/schemas/Error" }

"/activities":
    get:
        tags: [Activities]
        operationId: getActivities
        summary: List the caller's activities
        security:
            - cloudApiKey: []
              cloudAccessToken: []
        responses:
            "200":
                description: Activities.
                content:
                    application/json:
                        schema:
                            type: array
                            items: { $ref: "../components/schemas/Activity.yaml" }
            "401": { $ref: "../cloud-api.yaml#/components/responses/Unauthorized" }
