/api/v1/config/certificate/{certificate_id}/generate_csr:
  description: pf::UnifiedApi::Controller::Config::Certificates
  post:
    description: Generate a CSR for a certificate resource
    operationId: api.v1.Config::Certificates.generate_csr
    parameters:
    - in: path
      name: certificate_id
      schema:
        type: string
        enum:
          - http
          - radius
    requestBody:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ConfigCertificateCSR'
    responses:
      '200':
        $ref: '#/components/responses/Message'
      '401':
        $ref: '#/components/responses/Unauthorized'
      '404':
        $ref: '#/components/responses/NotFound'
      '422':
        $ref: '#/components/responses/UnprocessableEntity'
    tags:
      - Config/Certificates

/api/v1/config/certificates/lets_encrypt/test:
  description: pf::UnifiedApi::Controller::Config::Certificates
  get:
    description: Test if a specific domain is available for a Let's Encrypt HTTP challenge through PacketFence
    operationId: api.v1.Config::Certificates.lets_encrypt_test
    parameters:
    - in: query
      name: domain
      schema:
        type: string
    responses:
      '200':
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConfigCertificateReturnValue'
      '401':
        $ref: '#/components/responses/Unauthorized'
      '404':
        $ref: '#/components/responses/NotFound'
      '422':
        $ref: '#/components/responses/UnprocessableEntity'
    tags:
      - Config/Certificates

/api/v1/config/certificate/{certificate_id}/lets_encrypt:
  description: pf::UnifiedApi::Controller::Config::Certificates
  put:
    description: Configure Let's Encrypt for a certificate resource
    operationId: api.v1.Config::Certificates.lets_encrypt_update
    parameters:
    - in: path
      name: certificate_id
      schema:
        type: string
        enum:
          - http
          - radius
    requestBody:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ConfigCertificateLetsEncrypt'
    responses:
      '200':
        $ref: '#/components/responses/Message'
      '401':
        $ref: '#/components/responses/Unauthorized'
      '404':
        $ref: '#/components/responses/NotFound'
      '422':
        $ref: '#/components/responses/UnprocessableEntity'
    tags:
      - Config/Certificates

/api/v1/config/certificate/{certificate_id}:
  description: pf::UnifiedApi::Controller::Config::Certificates
  get:
    description: Get an item
    operationId: api.v1.Config::Certificates.get
    parameters:
    - in: path
      name: certificate_id
      schema:
        type: string
        enum:
          - http
          - radius
    responses:
      '200':
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConfigCertificate'
        description: Item
      '401':
        $ref: '#/components/responses/Unauthorized'
      '404':
        $ref: '#/components/responses/NotFound'
      '422':
        $ref: '#/components/responses/UnprocessableEntity'
    tags:
      - Config/Certificates
  put:
    description: Replace an item
    operationId: api.v1.Config::Certificates.replace
    parameters:
    - in: path
      name: certificate_id
      schema:
        type: string
        enum:
          - http
          - radius
    - in: query
      name: check_chain
      schema:
        type: string
        enum:
          - enabled
          - disabled
    requestBody:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ConfigCertificate'
    responses:
      '200':
        $ref: '#/components/responses/Message'
      '401':
        $ref: '#/components/responses/Unauthorized'
      '404':
        $ref: '#/components/responses/NotFound'
      '422':
        $ref: '#/components/responses/UnprocessableEntity'
      '500':
        $ref: '#/components/responses/ErrorsWithMessage'
    tags:
      - Config/Certificates

/api/v1/config/certificate/{certificate_id}/info:
  description: pf::UnifiedApi::Controller::Config::Certificates
  get:
    description: Get an item
    operationId: api.v1.Config::Certificates.get
    parameters:
    - in: path
      name: certificate_id
      schema:
        type: string
        enum:
          - http
          - radius
    responses:
      '200':
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConfigCertificateInfo'
        description: Item
      '401':
        $ref: '#/components/responses/Unauthorized'
      '404':
        $ref: '#/components/responses/NotFound'
    tags:
      - Config/Certificates
