swagger: "2.0"

info:
  version: 1.0.0
  title: Podcast API Specifications
schemes:
  - https
host: qa-ows-podcast.theorchard.io
paths:
  /hello/:
    get:
      summary: Check the health of the application.
      responses:
        200:
          description: 200 OK
          examples:
            application/json: { "status": "ok" }

  /podcasts/:
    get:
      tags:
        - "podcast"
      summary: Returns all the podcasts
      parameters:
      - in: "query"
        name: "limit"
        description: "The number of podcasts to retrieve"
        required: false
        type: "integer"
      - in: "query"
        name: "offset"
        description: "The starting offset"
        required: false
        type: "integer"
      responses:
        200:
          description: 200 OK
          examples:
            application/json: { "items": [{
              "title": "Test Podcast",
              "description": "This is a test podcast",
              "slug": "my_test_podcast",
              "host": "host",
              "owner": "owner",
              "copyright": "The Orchard",
              "show_type": "episodic",
              "email": "email",
              "link": "https://www.example.com",
              "explicit": "yes",
              "categories": [1, 2],
              "created_by": "auth0_id",
              "updated_by": "auth0_id",
              "created_date": "2019-09-16 07:27:02",
              "updated_date": "2019-09-16 07:27:02"
            }], "pagination": "standard", total_records: 1}
    post:
      tags:
        - "podcast"
      summary: "Create podcast"
      operationId: "create_podcast"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - in: "body"
          name: "body"
          description: "The data with which to create a podcast"
          required: false
          schema:
            $ref: "#/definitions/Podcast"
      responses:
        200:
          description: "200 OK"
          schema:
            $ref: "#/definitions/Podcast"
        400:
          description: "400 Bad Request"
        404:
          description: "404 Not found"

  /podcasts-by-id:
    get:
      tags:
        - "podcast"
      summary: Returns a podcasts by podcast_ids
      operationId: "get_podcasts_by_ids"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - in: "query"
          name: "ids"
          description: "The podcasts unique identifiers"
          required: true
          type: "array"
          items:
            type: "integer"
      responses:
        200:
          description: 200 OK
          examples:
            application/json: { 'items': [{
                  "title": "Test Podcast",
                  "description": "This is a test podcast",
                  "slug": "my_test_podcast",
                  "host": "host",
                  "owner": "owner",
                  "show_type": "episodic",
                  "copyright": "The Orchard",
                  "email": "email",
                  "link": "https://www.example.com",
                  "explicit": "yes",
                  "created_by": "auth0_id",
                  "updated_by": "auth0_id",
                  "created_date": "2019-09-16 07:27:02",
                  "updated_date": "2019-09-16 07:27:02"
                }]}
  /podcasts/{podcast_id}:
    get:
      tags:
        - "podcast"
      summary: Returns a podcast by podcast_id
      operationId: "get_podcast_by_id"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - in: "path"
          name: "podcast_id"
          description: "The podcast unique identifier"
          required: true
          type: "integer"
      responses:
        200:
          description: 200 OK
          examples:
            application/json: {
                  "title": "Test Podcast",
                  "description": "This is a test podcast",
                  "slug": "my_test_podcast",
                  "host": "host",
                  "owner": "owner",
                  "show_type": "episodic",
                  "copyright": "The Orchard",
                  "email": "email",
                  "link": "https://www.example.com",
                  "explicit": "yes",
                  "created_by": "auth0_id",
                  "updated_by": "auth0_id",
                  "created_date": "2019-09-16 07:27:02",
                  "updated_date": "2019-09-16 07:27:02"
                }
    put:
      tags:
        - "podcast"
      summary: "Update podcast"
      operationId: "update_podcast"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - in: "path"
          name: "podcast_id"
          description: "The podcast unique identifier"
          required: true
          type: "integer"
        - in: "body"
          name: "body"
          description: "The data with which to update a podcast"
          required: true
          schema:
            $ref: "#/definitions/PodcastUpdate"
      responses:
        200:
          description: "200 OK"
          schema:
            $ref: "#/definitions/Podcast"
        400:
          description: "400 Bad Request"
        404:
          description: "404 Not found"
    delete:
      tags:
        - "podcast"
      summary: "Delete podcast"
      operationId: "delete_podcast"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - in: "path"
          name: "podcast_id"
          description: "The podcast unique identifier"
          required: true
          type: "integer"
      responses:
        200:
          description: "200 OK"
          schema:
            $ref: "#/definitions/Podcast"
        400:
          description: "400 Bad Request"
        404:
          description: "404 Not found"

  /podcasts/{podcast_id}/episodes:
    get:
      tags:
      - "episode"
      summary: "Get all Episodes for a podcast"
      operationId: "get_episodes"
      consumes:
      - "application/json"
      produces:
      - "application/json"
      parameters:
      - in: "path"
        name: "podcast_id"
        description: "The podcast unique identifier"
        required: true
        type: "integer"
      - in: "query"
        name: "limit"
        description: "The number of episodes to retrieve"
        required: false
        type: "integer"
      - in: "query"
        name: "offset"
        description: "The starting offset"
        required: false
        type: "integer"
      - in: "query"
        name: "filter_by_state"
        description: "DONE, PUBLISHED or other to filter the episodes"
        required: false
        type: "string"
      responses:
        200:
          description: "200 OK"
          examples:
              application/json: { "items": [{
                  "id": 1,
                  "podcast_id": 1,
                  "title": "Title 1",
                  "summary": "Summary Example",
                  "season_number": 1,
                  "episode_number": 1,
                  "episode_type": "full",
                  "content": "clean",
                  "created_by": "auth0_id",
                  "updated_by": "auth0_id",
                  "created_date": "2019-09-16 07:27:02",
                  "updated_date": "2019-09-16 07:27:02",
                  "planned_pre_roll_count": 1,
                  "planned_post_roll_count": 0,
                  "planned_mid_roll_count": 6,
                  "insertion_points": [
                    {"point_type": "mid", "count": 1, "timecode": "3.15"},
                    {"point_type": "post", "count": 1, "timecode": "0"}
                  ],
                  "status": "draft",
                  "published_date": null
              }], "pagination": "standard", total_records: 1, total_done: 1, total_drafts: 0}
        400:
          description: "400 Bad Request"
        404:
          description: "404 Not found"

    post:
      tags:
        - "episode"
      summary: "Create Episode"
      operationId: "create_episode"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - in: "path"
          name: "podcast_id"
          description: "The podcast unique identifier"
          required: true
          type: "integer"
        - in: "body"
          name: "body"
          description: "The data with which to create an episode."
          required: true
          schema:
            $ref: "#/definitions/Episode"
      responses:
        200:
          description: "200 OK"
          schema:
            $ref: "#/definitions/Podcast"
        400:
          description: "400 Bad Request"
        404:
          description: "404 Not found"

  /episodes-by-id:
    get:
      tags:
        - "episode"
      summary: Returns a episodes by episode_ids
      operationId: "get_episodes_by_ids"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - in: "query"
          name: "ids"
          description: "The episodes unique identifiers"
          required: true
          type: "array"
          items:
            type: "integer"
      responses:
        200:
          description: 200 OK
          examples:
            application/json: { "items": [{
                "id": 1,
                "podcast_id": 1,
                "title": "Title 1",
                "summary": "Summary Example",
                "season_number": 1,
                "episode_number": 1,
                "episode_type": "full",
                "content": "clean",
                "created_by": "auth0_id",
                "updated_by": "auth0_id",
                "created_date": "2019-09-16 07:27:02",
                "updated_date": "2019-09-16 07:27:02",
                "insertion_points": [
                  {"point_type": "mid", "count": 1, "timecode": "3.15"},
                  {"point_type": "post", "count": 1, "timecode": "0"}
                ],
                "status": "draft",
                "published_date": null
            }]}
  /podcasts/{podcast_id}/episodes/{episode_id}:
    get:
      tags:
        - "episode"
      summary: "Get Episode by podcast_id and episode_id"
      operationId: "get_episode_by_id"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - in: "path"
          name: "podcast_id"
          description: "The podcast unique identifier"
          required: true
          type: "integer"
        - in: "path"
          name: "episode_id"
          description: "The episode unique identifier"
          required: true
          type: "integer"
      responses:
        200:
          description: "200 OK"
          examples:
            application/json: { "items": [{
                "id": 1,
                "podcast_id": 1,
                "title": "Title 1",
                "summary": "Summary Example",
                "season_number": 1,
                "episode_number": 1,
                "episode_type": "full",
                "content": "clean",
                "created_by": "auth0_id",
                "updated_by": "auth0_id",
                "created_date": "2019-09-16 07:27:02",
                "updated_date": "2019-09-16 07:27:02",
                "insertion_points": [
                  {"point_type": "mid", "count": 1, "timecode": "3.15"},
                  {"point_type": "post", "count": 1, "timecode": "0"}
                ],
                "status": "draft",
                "published_date": null
            }], "pagination": "standard", total_records: 1}
        400:
          description: "400 Bad Request"
        404:
          description: "404 Not found"

  /podcasts/{podcast_id}/episodes/{episode_id}/points:
    post:
      tags:
        - "insertion_points"
      summary: "Create/update insertion points"
      operationId: "insertion_points"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - in: "path"
          name: "podcast_id"
          description: "The podcast unique identifier"
          required: true
          type: "integer"
        - in: "path"
          name: "episode_id"
          description: "The episode unique identifier"
          required: true
          type: "integer"
        - in: "body"
          name: "body"
          description: "List of insertion points to be created"
          required: true
          schema:
            $ref: "#/definitions/InsertionPoint"
      responses:
        200:
          description: "200 OK"
        400:
          description: "400 Bad Request"
        404:
          description: "404 Not found"

  /podcasts/{podcast_id}/episodes/planned-inventory:
    post:
      tags:
        - "planned_inventory"
      summary: "Create Planned Inventory"
      operationId: "planned_inventory"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - in: "path"
          name: "podcast_id"
          description: "The podcast unique identifier"
          required: true
          type: "integer"
        - in: "body"
          name: "body"
          description: "List of dates and ad points"
          required: true
          schema:
            $ref: "#/definitions/PlannedInventory"
      responses:
        200:
          description: "200 OK"
        400:
          description: "400 Bad Request"
        404:
          description: "404 Not found"

  /assets/upload-token/:
    get:
      tags:
        - "assets"
      description: Generate credentials for input asset upload.
      responses:
        '200':
          description: 200 OK
          schema:
            example:
              bucket: dev-orcd-podcast-input-assets
              credentials:
                aws_access_key_id: AKIAIOSFODNN7EXAMPLE
                aws_secret_access_key: wJalrXUtnFEMI/K7MDENG/bPxRfiCYzEXAMPLEKEY
                expiration: '2016-01-25T19:55:29.611Z'
                token: AQoEXAMPLEH4aoAH0gNCAPyJxz4BlCFFxWNE1OPTgk5TthT+FvwqnKwRcOIfrRh3c/L
              filename: hjhj45_rfwri_424524

  /assets:
    post:
      tags:
        - "assets"
      summary: "Update asset_upload with file's metadata, is invoked by acknowledge lambda."
      operationId: "post_asset"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - in: "body"
          name: "body"
          description: "Uploaded file metadata"
          required: true
          schema:
            $ref: "#/definitions/AssetUploadUpdate"
      responses:
        200:
          description: "200 OK"
          schema:
            $ref: "#/definitions/AssetUpload"
        400:
          description: "400 Bad Request"
        404:
          description: "404 Not found"

    delete:
      tags:
        - "assets"
      summary: "Soft delete asset upload by provided filename"
      operationId: "delete_asset"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - in: "body"
          name: "body"
          description: "Asset's data"
          required: true
          schema:
            $ref: "#/definitions/AssetUploadDelete"
      responses:
        200:
          description: "200 OK"
          schema:
            $ref: "#/definitions/AssetUpload"
        400:
          description: "400 Bad Request"
        404:
          description: "404 Not found"

  /assets/status:
    post:
      tags:
        - "assets"
      summary: "Create new status for uploaded asset"
      operationId: "post_asset_general_status"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - in: "body"
          name: "body"
          description: "New status data"
          required: true
          schema:
            $ref: "#/definitions/AssetStatusUpdate"
      responses:
        200:
          description: "200 OK"
          schema:
            $ref: "#/definitions/AssetStatus"
        400:
          description: "400 Bad Request"
        404:
          description: "404 Not found"

  /assets/final:
    post:
      tags:
        - "assets"
      summary: "Create new status and asset final"
      operationId: "post_asset_final"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - in: "body"
          name: "body"
          description: "New status data with final assets"
          required: true
          schema:
            $ref: "#/definitions/AssetFinalUpdate"
      responses:
        200:
          description: "200 OK"
          schema:
            $ref: "#/definitions/AssetStatus"
        400:
          description: "400 Bad Request"
        404:
          description: "404 Not found"

  /assets/status/{filename}:
    get:
      tags:
        - "assets"
      summary: "Get the status of an upload"
      operationId: "get_asset_status"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - in: "path"
          name: "filename"
          description: "Filename with extension"
          required: true
          type: "string"
      responses:
        200:
          description: "200 OK"
          examples:
            application/json: {
              "id": 4,
              "asset_upload_id": 31,
              "status": "validation_complete",
              "description": "",
              "created_date": 1573900680.0,
              "message": {
                "function": "encoding-images-validation",
                "status": "validation_complete",
                "input": {
                  "key": "47d84a8a_2bc6_4f81_ac12_5fef3f2bce43.jpg",
                  "bucket": "qa-orcd-podcast-input-assets",
                  "file_type": "jpeg",
                  "transcoding_type": "image"
                }
              }
            }
        400:
          description: "400 Bad Request"
        404:
          description: "404 Not found"
  /ad-reads:
    post:
      tags:
        - "ad_read"
      summary: "Create ad read"
      operationId: "ad_read_post"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - in: "body"
          name: "body"
          description: "Ad read payload"
          required: true
          schema:
            $ref: "#/definitions/AdReadsPost"
      responses:
        201:
          description: "201 Created"
        400:
          description: "400 Bad Request"
        404:
          description: "404 Not found"
    get:
      tags:
        - "ad_read"
      summary: "Get ad reads"
      operationId: "ad_reads_get"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - in: "body"
          name: "body"
          description: "Search parameters"
          required: true
          schema:
            $ref: "#/definitions/AdReadsGet"
      responses:
        200:
          description: "200 OK"
        400:
          description: "400 Bad Request"
        404:
          description: "404 Not found"
  /ad-reads/{ad_read_id}:
    put:
      tags:
        - "ad_read"
      summary: "Update ad read"
      operationId: "ad_read"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - in: "path"
          name: "ad_read_id"
          description: "The ad read unique identifier"
          required: true
          type: "integer"
        - in: "body"
          name: "body"
          description: "The data with which to update a podcast"
          required: true
          schema:
            $ref: "#/definitions/AdReadUpdate"
      responses:
        200:
          description: "200 OK"
        400:
          description: "400 Bad Request"
        404:
          description: "404 Not found"
    delete:
      tags:
        - "ad_read"
      summary: "Delete ad read"
      operationId: "ad_read_delete"
      parameters:
        - in: "path"
          name: "ad_read_id"
          description: "The ad read unique identifier"
          required: true
          type: "integer"
      responses:
        200:
          description: "200 OK"
        400:
          description: "400 Bad Request"
        404:
          description: "404 Not found"
  /does-ad-read-exist:
    get:
      tags:
        - "ad_read"
      summary: "Check for existence of ad read"
      operationId: "ad_read_exists"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - in: "body"
          name: "body"
          description: "Search parameters"
          required: true
          schema:
            $ref: "#/definitions/AdReadExists"
      responses:
        200:
          description: "200 OK"
        400:
          description: "400 Bad Request"
        404:
          description: "404 Not found"
  /ad-read-virus-free:
    post:
      tags:
        - "ad_read"
      summary: "Set ad read to is_virus_free = true"
      operationId: "ad_read_virus_free"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - in: "body"
          name: "body"
          description: "File information"
          required: true
          schema:
            $ref: "#/definitions/AdReadVirusFree"
      responses:
        200:
          description: "200 OK"
        400:
          description: "400 Bad Request"
        404:
          description: "404 Not found"
  /ad-read-comment:
    post:
      tags:
        - "ad_read_comment"
      summary: "Add a comment to an ad action"
      operationId: "ad_read_comment_add"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - in: header
          name: orchard-user-uuid
          description: Used to find ows_podcast.user.id and set as user id in the comments table
          required: true
          type: string
        - in: "body"
          name: "body"
          description: "Comment metadata"
          required: true
          schema:
            $ref: "#/definitions/AdReadCommentAdd"
      responses:
        201:
          description: "201 Created"
          examples:
            application/json:
              ad_action_id: 6126
              comment: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
              id: 888
              user_id: 1293
              created_date: 2021-12-06T19:32:32.565752.000Z
        400:
          description: "400 Bad Request"
        404:
          description: "404 Not found"

  /ad-read-comment/{ad_action_comment_id}:
    delete:
      tags:
        - "ad_read_comment"
      summary: "Delete a comment for an ad action"
      operationId: "ad_read_comment_delete"
      parameters:
        - in: "path"
          name: "ad_action_comment_id"
          description: ows_podcast.ad_action_comment.id
          required: true
          type: "integer"
      responses:
        200:
          description: "200 Ok"
          examples:
            application/json:
              id: 8888
              ad_action_id: 777
              user_id: 1293
              comment: Donec id elementum orci. Integer et magna quis leo tempor sollicitudin.
              created_date: 2021-12-06T16:30:15.869256.000Z
              updated_date: null
              date_deleted: 2021-12-06T19:05:36.057423.000Z
        400:
          description: "400 Bad Request"
        404:
          description: "404 Not found"
  /ad-read-comments/{ad_action_id}:
    get:
      tags:
        - "ad_read_comment"
      summary: "Get the comments for an ad action. Does not return deleted comments."
      operationId: "ad_read_comments_get"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - in: "path"
          name: "ad_action_id"
          description: ows_podcast.ad_action.id
          required: true
          type: "integer"
        - in: "query"
          name: "limit"
          description: number of comments to return
          required: true
          type: "integer"
          default: 50
        - in: "query"
          name: "offset"
          description: the page offset based on limit
          required: true
          type: "integer"
          default: 0
      responses:
        200:
          description: "200 Ok"
          examples:
            application/json:
              items:
                - id: 700
                  ad_action_id: 415
                  user_id: 555
                  comment: Donec id elementum orci. Integer et magna quis leo tempor sollicitudin.
                  created_date: 2021-12-06T16:30:15.869256.000Z
                  updated_date: null
                - id: 701
                  ad_action_id: 415
                  user_id: 1293
                  comment: '**Nunc vehicula varius imperdiet**. Vestibulum gravida aliquam mi, ut maximus orci facilisis id.'
                  created_date: 2021-12-06T16:30:15.869256.000Z
                  updated_date: null
                - id: 702
                  ad_action_id: 415
                  user_id: 555
                  comment: |
                    Lorem ipsum dolor sit amet, consectetur adipiscing elit.
                    Cras facilisis lectus in rhoncus ornare. Morbi pulvinar, est id ullamcorper molestie, magna nisi feugiat lectus, vitae aliquam justo quam vitae arcu.

                    Pellentesque vitae molestie nisi.
                  created_date: 2021-12-05T14:30:15.869256.000Z
                  updated_date: null
                - id: 703
                  ad_action_id: 415
                  user_id: 1293
                  comment: Morbi malesuada, _risus et laoreet_ accumsan, dui ligula maximus quam, aliquam posuere mi mauris id lectus.
                  created_date: 2021-12-06T08:30:15.869256.000Z
                  updated_date: null
                - id: 704
                  ad_action_id: 415
                  user_id: 555
                  comment: Proin accumsan risus eget elementum aliquet. [Mauris molestie](Mauris molestie) neque a egestas porttitor. Quisque in maximus ligula, sit amet lobortis augue.
                  created_date: 2021-12-06T16:30:15.869256.000Z
                  updated_date: null
              pagination:
                total_records: 5
        400:
          description: "400 Bad Request"
        404:
          description: "404 Not found"
  /users:
    post:
      tags:
        - "users"
      summary: "Create new user"
      operationId: "create_user"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - in: "body"
          name: "body"
          description: "User data"
          required: true
          schema:
            $ref: "#/definitions/UserCreate"
      responses:
        200:
          description: "200 OK"
          schema:
            $ref: "#/definitions/User"
        400:
          description: "400 Bad Request"
        404:
          description: "404 Not found"
    get:
      tags:
        - "users"
      summary: "Returns all the users"
      parameters:
      - in: "query"
        name: "limit"
        description: "The number of users to retrieve"
        required: false
        type: "integer"
      - in: "query"
        name: "offset"
        description: "The starting offset"
        required: false
        type: "integer"
      responses:
        200:
          description: 200 OK
          examples:
            application/json: { "items": [{
              "auth0_user_id": "billy",
              "email": "billy@bally.com",
              "name": "Billy Bally",
              "active": "true",
              "language": "en",
              "admin": "True",
              "networks": []
            }], "pagination": "standard", total_records: 1}
  /users/current:
    get:
      tags:
        - "users"
      summary: "Returns current user"
      responses:
        200:
          description: "200 OK"
          examples:
            application/json: {
              "auth0_user_id": "billy",
              "email": "billy@bally.com",
              "name": "Billy Bally",
              "active": "true",
              "language": "en",
              "admin": "True",
              "networks": []
            }
  /users/{user_id}:
    put:
      tags:
        - "users"
      summary: "Update user"
      operationId: "update_user"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - in: "path"
          name: "user_id"
          description: "The user unique identifier"
          required: true
          type: "string"
        - in: "body"
          name: "body"
          description: "The data with which to update a user"
          required: true
          schema:
            $ref: "#/definitions/UserCreate"
      responses:
        200:
          description: "200 OK"
        400:
          description: "400 Bad Request"
        404:
          description: "404 Not found"
    delete:
      tags:
        - "users"
      summary: "Soft delete user"
      parameters:
        - in: "path"
          name: "user_id"
          description: "The user unique identifier"
          required: true
          type: "string"
      responses:
        200:
          description: "200 OK"
          schema:
            $ref: "#/definitions/PodcastUser"
        400:
          description: "400 Bad Request"
        404:
          description: "404 Not found"

definitions:
  Podcast:
    type: "object"
    properties:
      id:
        type: "integer"
        format: "int64"
      title:
        type: "string"
      description:
        type: "string"
      slug:
        type: "string"
      host:
        type: "string"
      owner:
        type: "string"
      copyright:
        type: "string"
      link:
        type: "string"
      email:
        type: "string"
      explicit:
        type: "string"
        enum: [no, clean, yes]
      show_type:
        type: "string"
        enum: [episodic, serial]
      categories:
        type: "array"
        items:
          type: "integer"
      created_by:
        type: "string"
      updated_by:
        type: "string"
      created_date:
        type: "string"
        format: "date-time"
      updated_date:
        type: "string"
  PodcastUpdate:
    type: "object"
    properties:
      title:
        type: "string"
      description:
        type: "string"
      slug:
        type: "string"
      host:
        type: "string"
      copyright:
        type: "string"
      link:
        type: "string"
      email:
        type: "string"
      explicit:
        type: "string"
        enum: [no, clean, yes]
      show_type:
        type: "string"
        enum: [episodic, serial]
  Episode:
    type: "object"
    properties:
      id:
        type: "integer"
        format: "int64"
      podcast_id:
        type: "integer"
        format: "int64"
      title:
        type: "string"
      description:
        type: "string"
      season_number:
        type: "integer"
        format: "int64"
      episode_number:
        type: "integer"
        format: "int64"
      episode_type:
        type: "string"
        enum: [full, trailer, bonus]
      content:
        type: "string"
        enum: [clean, explicit]
      created_by:
        type: "string"
      updated_by:
        type: "string"
      created_date:
        type: "string"
        format: "date-time"
      updated_date:
        type: "string"
      status:
        type: "string"
      published_date:
        type: "string"
      planned_pre_roll_count:
        type: "integer"
        format: "int64"
      planned_mid_roll_count:
        type: "integer"
        format: "int64"
      planned_post_roll_count:
        type: "integer"
        format: "int64"
  InsertionPoint:
    type: "object"
    properties:
      id:
        type: "integer"
        format: "int64"
      episode_id:
        type: "integer"
        format: "int64"
      point_type:
        type: "string"
        enum: [pre, mid, post]
      count:
        type: "integer"
        format: "int64"
      timecode:
        type: "number"
        format: "float"
  PlannedInventory:
    type: "object"
    properties:
      dates:
        type: "array"
        items:
          type: "string"
      pre_rolls:
        type: "integer"
        format: "int64"
      post_rolls:
        type: "integer"
        format: "int64"
      mid_rolls:
        type: "integer"
        format: "int64"
      title_prefix:
        type: "string"
  AssetUpload:
    type: "object"
    properties:
      id:
        type: "integer"
        format: "int64"
      user_id:
        type: "string"
      asset_type:
        type: "string"
      filename:
        type: "string"
      object_id:
        type: "string"
      object_type:
        type: "string"
        enum: [episode, podcast]
      bucket:
        type: "string"
      original_filename:
        type: "string"
      deleted:
        type: "integer"
        enum: [0, 1]
  AssetUploadUpdate:
    type: "object"
    properties:
      object_id:
        type: "string"
      object_type:
        type: "string"
      filename:
        type: "string"
      original_filename:
        type: "string"
      asset_type:
        type: "string"
  AssetUploadDelete:
    type: "object"
    properties:
      object_id:
        type: "string"
      object_type:
        type: "string"
      asset_type:
        type: "string"
  AssetStatus:
    type: "object"
    properties:
      id:
        type: "integer"
        format: "int64"
      asset_upload_id:
        type: "integer"
        format: "int64"
      status:
        type: "string"
      description:
        type: "string"
      created_date:
        type: "string"
        format: "date-time"
      message:
        type: "object"
  AssetStatusUpdate:
    type: "object"
    properties:
      filename:
        type: "string"
      status:
        type: "string"
      description:
        type: "string"
      message:
        type: "object"
      timestamp:
        type: "string"
  AssetFinalUpdate:
    type: "object"
    properties:
      filename:
        type: "string"
      status:
        type: "string"
      description:
        type: "string"
      message:
        type: "object"
      timestamp:
        type: "string"
      final_assets:
        type: "array"
        items:
          type: "object"
  AdReadsPost:
    type: "object"
    properties:
      title:
        type: "string"
      campaign_id:
        type: "string"
      order_id:
        type: "string"
      advertisement_id:
          type: "string"
      roll_type:
          type: "string"
      assignee_id:
          type: "integer"
      assignee_ids:
          type: "array"
          items:
            type: "integer"
      copy_url_path:
          type: "string"
      due_date:
          type: "string"
      status:
        type: "string"
      rejection_reason:
        type: "string"
      requires_approval:
        type: "boolean"
      is_archived_early:
        type: "boolean"
      is_skip_virus_scan:
        type: "boolean"
  AdReadsGet:
    type: "object"
    properties:
      is_archived:
        type: "boolean"
      only_show_mine:
        type: "boolean"
      limit:
        type: "integer"
        default: 9999
      offset:
        type: "integer"
        default: 0
      date_range:
        type: "string"
        default: "all_time"
  AdReadUpdate:
    type: "object"
    properties:
      status:
        type: "string"
  AdReadExists:
    type: "object"
    properties:
      campaign_id:
        type: "string"
      order_id:
        type: "string"
      advertisement_id:
        type: "string"
  AdReadVirusFree:
    type: "object"
    properties:
      filename:
        type: "string"
  AdReadCommentAdd:
    type: "object"
    properties:
      ad_action_id:
        type: "integer"
        description: ows_podcast.ad_action.id
      comment:
        type: "string"
        description: the comment
  User:
    type: "object"
    properties:
      id:
        type: "string"
      email:
        type: "string"
      name:
        type: "string"
      active:
        type: "integer"
        enum: [0, 1]
      language:
        type: "string"
      admin:
        type: "integer"
        enum: [0, 1]
      networks:
        type: "array"
        items:
          type: "object"
          properties:
            id:
              type: "integer"
            name:
              type: "string"
  UserCreate:
    type: "object"
    properties:
      id:
        type: "string"
      email:
        type: "string"
      name:
        type: "string"
      admin:
        type: "integer"
        enum: [0, 1]
      networks:
        type: "array"
        items:
          type: "integer"
  PodcastUser:
    type: "object"
    properties:
      id:
        type: "string"
      email:
        type: "string"
      name:
        type: "string"
      admin:
        type: "boolean"
      networks:
        type: "array"
        items:
          type: "object"
          properties:
            id:
              type: "integer"
            name:
              type: "string"
