post:
  summary: Set a flag for the project.
  description: |
    For the project, you can set a flag with the provided flag name, status, repository and architecture.
    You can only set the flag if you have the permissions to do so.
  security:
    - basic_authentication: []
  parameters:
    - $ref: '../components/parameters/project_name.yaml'
    - in: query
      name: flag
      required: true
      schema:
        type: string
      description: Name of the flag to be set
      example: access
    - in: query
      name: status
      required: true
      schema:
        type: string
      description: Status of the flag to be set
      example: disable
    - in: query
      name: repository
      schema:
        type: string
      description: Repository for which the flag is to be set
      example: openSUSE_Tumbleweed
    - in: query
      name: arch
      schema:
        type: string
      description: Architecture for which the flag is to be set
      example: x86_64
  responses:
    '200':
      $ref: '../components/responses/succeeded.yaml'
    '400':
      description: |
        Bad Request.

        XML Schema used for body validation: [status.rng](../schema/status.rng)
      content:
        application/xml; charset=utf-8:
          schema:
            $ref: '../components/schemas/api_response.yaml'
          examples:
            missing_parameter_flag:
              value:
                code: missing_parameter
                summary: 'param is missing or the value is empty: flag'
              summary: Missing Parameter flag
            missing_parameter_status:
              value:
                code: missing_parameter
                summary: 'param is missing or the value is empty: status'
              summary: Missing Parameter status
    '401':
      $ref: '../components/responses/unauthorized.yaml'
    '403':
      description: Forbidden
      content:
        application/xml; charset=utf-8:
          schema:
            $ref: '../components/schemas/api_response.yaml'
          example:
            code: cmd_execution_no_permission
            summary: no permission to execute command 'set_flag'.
    '404':
      $ref: '../components/responses/unknown_project.yaml'
  tags:
    - Sources - Projects
