get:
  operationId: getCampaignTemplateSchedule
  tags:
    - Certification Campaigns
  summary: Gets a Campaign Template's Schedule
  description: >-
    Gets the schedule for a campaign template. Returns a 404 if there is no schedule set.
  parameters:
    - in: path
      name: id
      schema:
        type: string
      required: true
      description: The ID of the campaign template whose schedule is being fetched.
  responses:
    '200':
      description: >-
        The current schedule for the campaign template. See the PUT endpoint documentation for
        more examples.
      content:
        application/json:
          schema:
            $ref: '../schemas/Schedule.yaml'
    '401':
      $ref: '../../v3/responses/401.yaml'
    '403':
      $ref: '../../v3/responses/403.yaml'
    '404':
      $ref: '../../v3/responses/404.yaml'
    '429':
      $ref: '../../v3/responses/429.yaml'
    '500':
      $ref: '../../v3/responses/500.yaml'
put:
  operationId: setCampaignTemplateSchedule
  tags:
    - Certification Campaigns
  summary: Sets a Campaign Template's Schedule
  description: >-
    Sets the schedule for a campaign template. If a schedule already exists, it will be overwritten with
    the new one.
  parameters:
    - in: path
      name: id
      schema:
        type: string
      required: true
      description: The ID of the campaign template being scheduled.
  requestBody:
    content:
      application/json:
        schema:
          $ref: '../schemas/Schedule.yaml'
        examples:
          'Monthly':
            description: Runs on the 15th and last day of the month, at 5PM.
            value:
              type: MONTHLY
              hours:
                type: LIST
                values:
                  - "17"
              days:
                type: LIST
                values:
                  - "15"
          'Once a year':
            description: Runs every January 1st at midnight.
            value:
              type: ANNUALLY
              hours:
                type: LIST
                values:
                  - "0"
              days:
                type: LIST
                values:
                  - "--01-01"
          'Quarterly':
            description: Runs once a quarter (every 3 months) on the first of the month at 1AM.
            value:
              type: ANNUALLY
              hours:
                type: LIST
                values:
                  - "1"
              days:
                type: LIST
                values:
                  - "1"
              months:
                type: LIST
                values:
                  - "1"
                interval: 3
          'Yearly on Specific Days':
            description: Runs on March 12 and December 5 at 1AM, every year.
            value:
              type: ANNUALLY
              hours:
                type: LIST
                values:
                  - "1"
              days:
                type: LIST
                values:
                  - "--03-12"
                  - "--12-05"
          'On a Specific Date':
            description: Runs at 1AM on February 18th, 2020
            value:
              type: CALENDAR
              hours:
                type: LIST
                values:
                  - "1"
              days:
                type: LIST
                values:
                  - "2020-02-18"
  responses:
    '204':
      $ref: '../../v3/responses/204.yaml'
    '401':
      $ref: '../../v3/responses/401.yaml'
    '403':
      $ref: '../../v3/responses/403.yaml'
    '400':
      $ref: '../../v3/responses/400.yaml'
    '404':
      $ref: '../../v3/responses/404.yaml'
    '429':
      $ref: '../../v3/responses/429.yaml'
    '500':
      $ref: '../../v3/responses/500.yaml'
delete:
  operationId: deleteCampaignTemplateSchedule
  tags:
    - Certification Campaigns
  summary: Deletes a Campaign Template's Schedule
  description: >-
    Deletes the schedule for a campaign template. Returns a 404 if there is no schedule set.
  parameters:
    - in: path
      name: id
      schema:
        type: string
      required: true
      description: The ID of the campaign template whose schedule is being deleted.
  responses:
    '204':
      $ref: '../../v3/responses/204.yaml'
    '401':
      $ref: '../../v3/responses/401.yaml'
    '403':
      $ref: '../../v3/responses/403.yaml'
    '404':
      $ref: '../../v3/responses/404.yaml'
    '429':
      $ref: '../../v3/responses/429.yaml'
    '500':
      $ref: '../../v3/responses/500.yaml'
