swagger: "2.0"
info:
  description: "Dit is de publieke alleen-lezen interface van 6FM RES (Radio Extranet Systeem)."
  version: "1.0.0"
  title: "6FM RES"
  # termsOfService: "http://swagger.io/terms/"
  contact:
    email: "mischa.spelt@6fm.nl"
  #license:
  #  name: "Apache 2.0"
  #  url: "http://www.apache.org/licenses/LICENSE-2.0.html"
host: "api.6fm.nl"
basePath: "/"
tags:
- name: "nieuws"
  description: "Nieuwsberichten"
  #externalDocs:
  #  description: "Find out more"
  #  url: "http://swagger.io"
#- name: "store"
  #description: "Access to Petstore orders"
#- name: "user"
  #description: "Operations about user"
  #externalDocs:
  #  description: "Find out more about our store"
  #  url: "http://swagger.io"
schemes:
- "http"
paths:
  '/nieuws/overzicht':
    get:
      tags:
      - "nieuws"
      summary: "Overzicht van nieuwsberichten"
      description: "Geeft een overzicht van de 15 meest recente nieuwsberichten. Equivalent aan /nieuws/overzicht/15/1."
      produces:
      - "application/json"
      responses:
        200:
            description: "Success"
            schema:
              type: "object"
              properties:
                page: 
                  type: "integer"
                count: 
                  type: "integer"
                news:
                  type: "array"
                  items: 
                    $ref: "#/definitions/NewsItem"
  '/nieuws/overzicht/{aantal}':
    get:
      tags:
      - "nieuws"
      summary: "Overzicht van nieuwsberichten"
      description: "Geeft een overzicht van de {aantal} meest recente nieuwsberichten. Equivalent aan /nieuws/overzicht/{aantal}/1."
      produces:
      - "application/json"
      parameters:
      - name: aantal
        in: path
        description: "Het aantal nieuwsberichten per resultaatpagina."
        required: true
        default: 15
        type: string
      responses:
        200:
            description: "Success"
            schema:
              type: "object"
              properties:
                page: 
                  type: "integer"
                count: 
                  type: "integer"
                news:
                  type: "array"
                  items: 
                    $ref: "#/definitions/NewsItem"
  '/nieuws/overzicht/{aantal}/{pagina}':
    get:
      tags:
      - "nieuws"
      summary: "Overzicht van nieuwsberichten"
      description: "Geeft een overzicht van {aantal} recente nieuwsberichten, de meest recente {pagina} pagina's overslaand"
      produces:
      - "application/json"
      parameters:
      - name: aantal
        in: path
        description: "Het aantal nieuwsberichten per resultaatpagina."
        required: true
        default: 15
        type: string
      - name: pagina
        in: path
        description: "Het paginanummer."
        required: true
        default: 1
        type: string
      responses:
        200:
            description: "Success"
            schema:
              type: "object"
              properties:
                page: 
                  type: "integer"
                count: 
                  type: "integer"
                news:
                  type: "array"
                  items: 
                    $ref: "#/definitions/NewsItem"
  '/nieuws/bericht/{id}':
    get:
      tags:
      - "nieuws"
      summary: "Details van een specifiek nieuwsbericht"
      description: "Geeft de details van een specifiek nieuwsbericht"
      produces:
      - "application/json"
      parameters:
      - name: id
        in: path
        description: "Het unieke ID van het nieuwsbericht"
        required: true
        type: "integer"
      responses:
        200:
            description: "Success"
            schema:
              $ref: '#/definitions/NewsItem'
        404:
            description: "ID is ongeldig"

  '/agenda/overzicht[/week]':
    get:
      tags:
      - "agenda"
      summary: "Overzicht van alle agendaberichten in de komende 7 dagen"
      description: "Geeft een overzicht van alle agendaberichten in de komende week"
      produces:
      - "application/json"
      responses:
        200:
            description: "Success"
            schema:
              type: "array"
              items:
                $ref: '#/definitions/AgendaItem'

  '/agenda/overzicht/maand':
    get:
      tags:
      - "agenda"
      summary: "Overzicht van alle agendaberichten in de komende 30 dagen"
      description: "Geeft een overzicht van alle agendaberichten in de komende maand"
      produces:
      - "application/json"
      responses:
        200:
            description: "Success"
            schema:
              type: "array"
              items:
                $ref: '#/definitions/AgendaItem'

  '/agenda/overzicht/alles':
    get:
      tags:
      - "agenda"
      summary: "Overzicht van alle agendaberichten in de toekomst"
      description: "Geeft een overzicht van alle agendaberichten in de toekomst"
      produces:
      - "application/json"
      responses:
        200:
            description: "Success"
            schema:
              type: "array"
              items:
                $ref: '#/definitions/AgendaItem'

  '/agenda/details/{id}':
    get:
      tags:
      - "agenda"
      summary: "Details van een specifiek agendaitem"
      description: "Geeft de details van een specifiek agendaitem"
      produces:
      - "application/json"
      parameters:
      - name: id
        in: path
        description: "Het unieke ID van het agendabericht"
        required: true
        type: "integer"
      responses:
        200:
            description: "Success"
            schema:
              $ref: '#/definitions/AgendaItem'
        404:
            description: "ID is ongeldig"


#securityDefinitions:
  #petstore_auth:
  #  type: "oauth2"
  #  authorizationUrl: "http://petstore.swagger.io/oauth/dialog"
  #  flow: "implicit"
  #  scopes:
  #    write:pets: "modify pets in your account"
  #    read:pets: "read your pets"
  #api_key:
  #  type: "apiKey"
  #  name: "api_key"
  #  in: "header"
definitions:
  DateTime:
    type: "object"
    properties:
      date:
        type: "string"
        format: "yyyy-mm-dd hh:mm:ss.zzzzzz"
      timezone_type:
        type: "integer"
      timezone:
        type: "string"
        description: "The timezone of the date/time, usually 'UTC' or 'Europe/Amsterdam'."
  NewsSource:
    type: "object"
    properties:
      title:
        type: "string"
      url:
        type: "string"
      show:
        type: "boolean"
  NewsImage:
    type: "object"
    properties:
      id:
        type: "integer"
      title:
        type: "string"
      url:
        type: "string"

  NewsItem:
    type: "object"
    properties:
      id:
        type: "integer"
      title:
        type: "string"
      content:
        type: "string"
      published:
        $ref: "#/definitions/DateTime"
      edited:
        $ref: "#/definitions/DateTime"
      keywords:
        type: "array"
        items:
          type: "string"
      source:
        type: "array"
        items:
          $ref: "#/definitions/NewsSource"
      theme:
        type: "string"
      region:
        type: "string"
      podcast:
        type: "string"
      images:
        type: "array"
        items:
          $ref: "#/definitions/NewsImage"
      video:
        type: "string"
      url:
        type: "string"

  AgendaItem:
    type: "object"
    properties:
      id:
        type: "integer"
      title:
        type: "string"
      region:
        type: "string"
      content:
        type: "string"
      starts:
        $ref: "#/definitions/DateTime"
      ends:
        $ref: "#/definitions/DateTime"
      images:
        type: "array"
        items:
          $ref: "#/definitions/NewsImage"
      url:
        type: "string"


externalDocs:
  description: "Find out more about Swagger"
  url: "http://swagger.io"
