post:
  operationId: generateCampaignTemplate
  tags:
    - Certification Campaigns
  summary: Generate a Campaign from Template
  # security:
  #   - oauth2: [ORG_ADMIN]
  description: >-
    Generates a new campaign from a campaign template.

    The campaign object contained in the template has special formatting applied to its name and description
    fields in order to determine the generated campaign's name/description. Placeholders in those fields are
    formatted with the current date and time upon generation.

    Placeholders consist of a percent sign followed by a letter indicating what should be inserted; for
    example, "%Y" will insert the current year; a campaign template named "Campaign for %y" would generate a
    campaign called "Campaign for 2020" (assuming the year at generation time is 2020).

    Valid placeholders are the date/time conversion suffix characters supported by [java.util.Formatter](https://docs.oracle.com/javase/8/docs/api/java/util/Formatter.html).

    Requires roles ORG_ADMIN.
  parameters:
    - in: path
      name: id
      schema:
        type: string
      required: true
      description: The ID of the campaign template to use for generation.
  responses:
    '200':
      description: >-
        Indicates a campaign was successfully generated from this template, and returns a reference to the
        new campaign.
      content:
        application/json:
          schema:
            $ref: '../../v3/schemas/CampaignReference.yaml'
    '400':
      $ref: '../../v3/responses/400.yaml'
    '401':
      $ref: '../../v3/responses/401.yaml'
    '403':
      $ref: '../../v3/responses/403.yaml'
    '429':
      $ref: '../../v3/responses/429.yaml'
    '500':
      $ref: '../../v3/responses/500.yaml'
