swagger: "2.0"
info:
  description: ""
  version: "1.0.0"
  title: "TV Helfer API"
  termsOfService: "http://swagger.io/terms/"
  contact:
    email: "info@tvhelfer.de"
host: "api.tvhelfer.de"
basePath: "/"
schemes:
- "https"
paths:
  /countries:
    get:
      tags:
      - "countries"
      summary: "Get all countries"
      produces:
      - "application/json"
      responses:
        "200":
          description: "Returns countries with name"
          schema:
            type: "array"
            items:
              $ref: "#/definitions/Country"
    post:
      tags:
      - "countries"
      summary: "Create a new country"
      description: ""
      operationId: "addCountry"
      consumes:
      - "application/json"
      produces:
      - "application/json"
      parameters:
      - in: "body"
        name: "body"
        description: "Country object that needs to be added to the store"
        required: true
        schema:
          $ref: "#/definitions/Country"
      responses:
        "201":
          description: "Successfully created"
        "401":
          description: "No api key was included in the request"
        "403":
          description: "The given api key has not the right perfom this request"
      security:
      - x-api-key: []
  /countries/{countryId}:
    put:
      tags:
      - "countries"
      summary: "Update an existing country"
      description: ""
      operationId: "updateCountry"
      consumes:
      - "application/json"
      produces:
      - "application/json"
      parameters:
      - name: "countryId"
        in: "path"
        description: "ID of country to update"
        required: true
        type: "integer"
        format: "int64"
      - in: "body"
        name: "body"
        description: "Country object that needs to be updated to the store"
        required: true
        schema:
          $ref: "#/definitions/Country"
      responses:
        "200":
          description: "Updated successfully"
        "400":
          description: "Invalid ID supplied"
        "401":
          description: "No api key was included in the request"
        "403":
          description: "The given api key has not the right perfom this request"
        "404":
          description: "Country not found"
      security:
      - x-api-key: []
    delete:
      tags:
      - "countries"
      summary: "Delete an country"
      description: ""
      operationId: "deleteCountry"
      consumes:
      - "application/json"
      produces:
      - "application/json"
      parameters:
      - name: "countryId"
        in: "path"
        description: "ID of country to delete"
        required: true
        type: "integer"
        format: "int64"
      responses:
        "200":
          description: "Successfully deleted"
        "400":
          description: "Invalid ID supplied"
        "401":
          description: "No api key was included in the request"
        "403":
          description: "The given api key has not the right perfom this request"
        "404":
          description: "Country not found"
      security:
      - x-api-key: []
  /countries/{countryId}/states:
    get:
      tags:
      - "countries"
      summary: "Get states of a country"
      description: ""
      operationId: "getStates"
      produces:
      - "application/json"
      parameters:
      - name: "countryId"
        in: "path"
        description: "ID of country to get states of"
        required: true
        type: "integer"
        format: "int64"
      responses:
        "200":
          description: "Returns states with name"
          schema:
            type: "array"
            items:
              $ref: "#/definitions/State"
        "404":
          description: "Country not found"
securityDefinitions:
  x-api-key:
    type: "apiKey"
    name: "x-api-key"
    in: "header"
definitions:
  Country:
    type: "object"
    required:
    - "country"
    - "name"
    properties:
      id:
        type: "integer"
        format: "int64"
      name:
        type: "string"
        example: "Deutschland"
      country:
        type: "string"
        example: "de"
        description: "abbriviation of the country"
  State:
    type: "object"
    required:
    - "state"
    - "name"
    properties:
      id:
        type: "integer"
        format: "int64"
      name:
        type: "string"
        example: "Sachsen"
      state:
        type: "string"
        example: "sn"
        description: "abbriviation of the country"
externalDocs:
  description: "Find out more about Swagger"
  url: "http://swagger.io"