swagger: '2.0'

info:
  version: "1.0.1"
  title: Control Site REST API
  description: |
    This is the API used by the UI in Control Site

    ## Usage

    You can access the api documentation for each environment below
    - [Local](http://localhost:9000/apidev)
    - [Dev](https://cs-dev.business.stingray.com/apidev)
    - [Stage](https://cs-stage.business.stingray.com/apidev)
    - [Prod](https://cs.business.stingray.com/apidev)

    ## Structure

    ### The Envelope
    Every response is contained by an envelope. That is, each response has a predictable set of keys:
    ```json
    {
        "meta": {
            "code": "..."
        },
        "data": {
            ...
        }
    }
    ```

    #### META
    The ```meta``` key is used to communicate extra information about the response to
    the developer. If all goes well, you'll only ever see a code key with value
    ```OK```. However, sometimes things go wrong, and in that case you might see a
    response like:
    ```json
    {
        "meta": {
            "code": "...",
            "details": "...",
            "exception": "...",
            "errors": [
                {
                  "type": "...",
                  "itemInfo": {}
                  "details": "...",
                  "exception": "..."
                }
              ]
        }
    }
    ```

    The ```errors``` array is not mandatory and can be present even if the code is ```ok```. 
    That would mean that the function was able to finish but it encountered one or multiple errors.

    #### DATA
    The ```data``` key is the meat of the response. Most of the time, it will contains an specific
    type of object or an array of a specific object.

  termsOfService: http://business.stingray.com/faq
  contact:
    name: Jean-François Côté
    email: jcote@stingray.com
    url: http://www.stingray.com
  license:
    name: Copyright (C) Stingray Digital - All Rights Reserved
basePath: /api
host: "cs.business.stingray.com"
consumes:
  - application/json
produces:
  - application/json

################################################################################
#                                   Security                                   #
################################################################################

securityDefinitions:
  basicAuth:
    type: basic
  accessToken:
    type: oauth2
    description: Control site authentication with brearer access token using keycloak provider.
    authorizationUrl: https://login.business.stingray.com/auth/realms/cs_prod/protocol/openid-connect/auth
    tokenUrl: https://login.business.stingray.com/auth/realms/cs_prod/protocol/openid-connect/token
    x-tokenIntrospectUrl: https://login.business.stingray.com/auth/realms/cs_prod/protocol/openid-connect/token/introspect
    x-jwksUrl: https://login.business.stingray.com/auth/realms/cs_prod/protocol/openid-connect/certs
    flow: accessCode
    scopes:
      defaultScope: Not sure if we will be using scopes, at least in the beginning, but since we need to specify one, we added a default one.

################################################################################
#                                   Parameters                                 #
################################################################################
parameters:
  empty-body:
    in: body
    name: empty-body
    required: true
    schema:
      $ref: "./definitions.yaml#/definitions/EmptyObject"
  affiliate-id:
    in: path
    name: affiliate-id
    required: true
    type: integer
    format: int64
  brand-id:
    in: path
    name: brand-id
    required: true
    type: integer
    format: int64
  client-name:
    in: path
    name: client-name
    required: true
    type: string
  role-id:
    in: path
    name: role-id
    required: true
    type: integer
    format: int64
  station-id:
    in: path
    name: station-id
    required: true
    type: integer
    format: int64
  investigation-id:
    in: path
    name: investigation-id
    required: true
    type: integer
    format: int64
  comment-id:
    in: path
    name: comment-id
    required: true
    type: integer
    format: int64
  device-id:
    in: path
    name: device-id
    required: true
    type: integer
    format: int64
  device-external-id:
    in: path
    name: device-external-id
    required: true
    type: string
  output-id:
    in: path
    name: output-id
    required: true
    type: integer
    format: int64
  tag-category-id:
    in: path
    name: tag-category-id
    required: true
    type: integer
    format: int64
  station-schedule-id:
    in: path
    name: station-schedule-id
    required: true
    type: integer
    format: int64
  station-schedule-style-id:
    in: path
    name: station-schedule-style-id
    required: true
    type: integer
    format: int64
  playback-schedule-id:
    in: path
    name: playback-schedule-id
    required: true
    type: integer
    format: int64
  hardware-id:
    in: path
    name: hardware-id
    required: true
    type: integer
    format: int64
  hardware-model-id:
    in: path
    name: hardware-model-id
    required: true
    type: integer
    format: int64
  store-id:
    in: path
    name: store-id
    required: true
    type: integer
    format: int64
  software-id:
    in: path
    name: software-id
    required: true
    type: integer
    format: int64
  image-id:
    in: path
    name: image-id
    required: true
    type: integer
    format: int64
  address-id:
    in: path
    name: address-id
    required: true
    type: integer
    format: int64
  zone-index:
    in: path
    name: zone-index
    minimum: 1
    maximum: 2
    required: true
    type: integer
    format: int32
  zone-id:
    in: path
    name: zone-id
    required: true
    type: integer
    format: int64
  limit:
    in: query
    name: limit
    required: true
    type: integer
    format: int32
  from-timestamp:
    in: query
    name: from-timestamp
    required: true
    type: string
  use-store-time-zone:
    in: query
    name: use-store-time-zone
    required: true
    type: boolean
  task-id:
    in: path
    name: task-id
    required: true
    type: integer
    format: int64
  user-rights-role-id:
    in: path
    name: user-rights-role-id
    required: true
    type: integer
    format: int64
  segment-id:
    in: path
    name: segment-id
    required: true
    type: integer
    format: int64
  message-schedule-id:
    in: path
    name: message-schedule-id
    required: true
    type: integer
    format: int64
  message-feature-id:
    in: path
    name: message-feature-id
    required: true
    type: integer
    format: int64
  message-id:
    in: path
    name: message-id
    required: true
    type: integer
    format: int64
  message-scheduling-rule-id:
    in: path
    name: message-scheduling-rule-id
    required: true
    type: integer
    format: int64
  segment-scheduling-rule-id:
    in: path
    name: segment-scheduling-rule-id
    required: true
    type: integer
    format: int64
  shipping-group-id:
    in: path
    name: shipping-group-id
    required: true
    type: integer
    format: int64
  shipping-usb-update-id:
    in: path
    name: shipping-usb-update-id
    required: true
    type: integer
    format: int64
  return-analysis-status-id:
    in: path
    name: return-analysis-status-id
    required: true
    type: integer
    format: int64
  user-id:
    in: path
    name: user-id
    required: true
    type: integer
    format: int64
  media-feed-id:
    in: path
    name: media-feed-id
    required: true
    type: integer
    format: int64
  galaxie-api-account-id:
    in: path
    name: galaxie-api-account-id
    required: true
    type: integer
    format: int64
  encrypted-invoice-id:
    in: path
    name: encrypted-invoice-id
    required: true
    type: string
  device-configuration-id:
    in: path
    name: device-configuration-id
    required: true
    type: integer
    format: int64
  deployment-request-id:
    in: path
    name: deployment-request-id
    required: true
    type: integer
    format: int64
  return-request-id:
    in: path
    name: return-request-id
    required: true
    type: integer
    format: int64
  replacement-request-id:
    in: path
    name: replacement-request-id
    required: true
    type: integer
    format: int64
  reassignment-request-id:
    in: path
    name: reassignment-request-id
    required: true
    type: integer
    format: int64
  work-order-id:
    in: path
    name: work-order-id
    required: true
    type: integer
    format: int64
  contextual-help-menu-item-id:
    in: path
    name: contextual-help-menu-item-id
    required: true
    type: integer
    format: int64
  view-type:
    in: path
    name: view-type
    required: true
    type: string
  username:
    in: path
    name: username
    required: true
    type: string
  product-id:
    in: path
    name: product-id
    required: true
    type: integer
    format: int64
  license-id:
    in: path
    name: license-id
    required: true
    type: integer
    format: int64
  device-error-log-classification-rule-id:
    in: path
    name: device-error-log-classification-rule-id
    required: true
    type: integer
    format: int64
  musicbox-location-external-id:
    in: path
    name: musicbox-location-external-id
    required: true
    type: string
  brand-external-id:
    in: path
    name: brand-external-id
    required: true
    type: string
  station-scheduling-feature-id:
    in: path
    name: station-scheduling-feature-id
    required: true
    type: integer
    format: int64
  player-playback-feature-id:
    in: path
    name: player-playback-feature-id
    required: true
    type: integer
    format: int64
  messaging-feature-id:
    in: path
    name: messaging-feature-id
    required: true
    type: integer
    format: int64
  jukebox-feature-id:
    in: path
    name: jukebox-feature-id
    required: true
    type: integer
    format: int64
  galaxie-api-feature-id:
    in: path
    name: galaxie-api-feature-id
    required: true
    type: integer
    format: int64
  licensing-feature-id:
    in: path
    name: licensing-feature-id
    required: true
    type: integer
    format: int64
  sbx-tech-id:
    in: path
    name: sbx-tech-id
    required: true
    type: integer
    format: int64
  galaxie-api-tech-id:
    in: path
    name: galaxie-api-tech-id
    required: true
    type: integer
    format: int64
  audio-test-id:
    in: path
    name: audio-test-id
    required: true
    type: integer
    format: int64
  audio-test-area-id:
    in: path
    name: audio-test-area-id
    required: true
    type: integer
    format: int64
  audio-analysis-id:
    in: path
    name: audio-analysis-id
    required: true
    type: integer
    format: int64
  retail-media-schedule-id:
    in: path
    name: retail-media-schedule-id
    required: true
    type: integer
    format: int64
  affiliate-ids:
    in: query
    name: affiliate-ids
    required: false
    type: array
    items:
      type: integer
      format: int64
    collectionFormat: multi
  brand-names:
    in: query
    name: brand-names
    required: false
    type: array
    items:
      type: string
    collectionFormat: multi
  store-names:
      in: query
      name: store-names
      required: false
      type: array
      items:
        type: string
      collectionFormat: multi
  store-admin-tags:
      in: query
      name: store-admin-tags
      required: false
      type: array
      items:
        type: string
      collectionFormat: multi
  device-external-ids:
    in: query
    name: device-external-ids
    required: false
    type: array
    items:
      type: string
    collectionFormat: multi
  fetch-active-devices:
    in: query
    name: fetch-active-devices
    required: false
    default: true
    type: boolean
  fetch-inactive-devices:
    in: query
    name: fetch-inactive-devices
    required: false
    default: true
    type: boolean
  log-levels:
    in: query
    name: log-levels
    required: false
    type: array
    items:
      type: string
      enum:
        - VERBOSE
        - DEBUG
        - INFO
        - WARN
        - ERROR
        - TURNED_OFF
        - ROGUE
        - EVENT
    collectionFormat: multi
  connection-status:
    in: query
    name: connection-status
    required: false
    type: string
    enum:
      - Offline
      - Online
  player-software-ids:
    in: query
    name: player-software-ids
    required: false
    type: array
    items:
      type: integer
      format: int64
    collectionFormat: multi
  retrieve-requested-software:
    in: query
    name: retrieve-requested-software
    required: false
    default: true
    type: boolean
  retrieve-monitoring-data:
    in: query
    name: retrieve-monitoring-data
    required: false
    default: true
    type: boolean
  days-ago:
    in: query
    name: days-ago
    required: false
    type: integer
    format: int32

################################################################################
#                                 EndPoints                                    #
################################################################################
paths:
#### BRAND ####
  /brands/{brand-id}/devices:
    get:
      tags:
        - Brand
      summary: Gets a list of devices available for the given brand.
      operationId: getBrandDevices
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/GetDevicesResponse"
  /brands/{brand-id}/basic-devices:
    get:
      tags:
        - Brand
      summary: Gets a list of basic devices available for the given brand.
      operationId: getBrandBasicDevices
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/GetBasicDevicesResponse"
  /brands/{brand-id}/products:
    get:
      tags:
        - Brand
      summary: Gets the basic info of the given brand's products.
      operationId: getBrandProducts
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBrandProductsResponse"
    post:
      tags:
        - Brand
      summary: Adds a new product to the given brand.
      operationId: addBrandProduct
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: body
          name: new-product
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/NewProduct"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/ProductResponse"
  /brands/{brand-id}/stations:
    get:
      deprecated: true
      tags:
        - Brand
      summary: Returns a list of the brand's stations. Use GET /station-scheduling-features/{station-scheduling-feature-id}/stations or StationSchedulingFeature.getStationSchedulingFeatureStations instead.
      operationId: getBrandStations
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: query
          name: available-to-client-only
          required: true
          type: boolean
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBrandStationsResponse"
    put:
      deprecated: true
      tags:
        - Brand
      summary: Updates the list of stations linked to the given brand. Use PUT /station-scheduling-features/{station-scheduling-feature-id}/stations or StationSchedulingFeature.updateStationSchedulingFeatureStations instead.
      operationId: updateBrandStations
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: body
          name: brand-stations-info
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/BrandStationsInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBrandStationsResponse"
    post:
      deprecated: true
      tags:
        - Brand
      summary: Adds a station to the given brand. Use POST /station-scheduling-features/{station-scheduling-feature-id}/stations or StationSchedulingFeature.addStationToStationSchedulingFeature instead.
      operationId: addStationToBrand
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: body
          name: station-assignation-info
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/StationAssignationInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBrandStationsResponse"
  /brands/{brand-id}/stores:
    get:
      tags:
        - Brand
      summary: Returns the stores in the given brand with complete information and some filters.
      operationId: getBrandStores
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: query
          name: shipping-usb-update-id
          required: false
          type: integer
          format: int64
        - in: query
          name: product-id
          required: false
          type: integer
          format: int64
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetStoresResponse"
    post:
      deprecated: true
      tags:
        - Brand
      summary: Creates new store (with device) using a CSV file that is uploaded. Use POST /products/{product-id}/stores or Product.importProductStores instead.
      operationId: importStores
      security:
        - accessToken: [ defaultScope ]
      consumes:
        - multipart/form-data
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: formData
          name: file-to-upload
          required: true
          type: file
        - in: formData
          name: workorder-tracking-id-override
          required: false
          type: string
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetStoreCreationLogsResponse"
  /brands/{brand-id}/basic-stores:
    get:
      tags:
        - Brand
      summary: Gets a list of stores with basic info for the given brand.
      operationId: getBrandBasicStores
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: query
          name: fetch-active-stores-only
          required: false
          default: false
          type: boolean
        - in: query
          name: exclude-cradles
          required: false
          default: false
          type: boolean
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBasicStoresResponse"
    post:
      tags:
        - Brand
      summary: Creates a store and, if needed, the deployment request.
      operationId: createStore
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: body
          name: store-creation-info
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/StoreCreationInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/StoreCreationConfirmationResponse"
  /brands/{brand-id}/logs:
    get:
      tags:
        - Brand
      summary: Returns the logs for the given brand.
      operationId: getBrandLogs
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - $ref: "#/parameters/limit"
        - $ref: "#/parameters/from-timestamp"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBrandLogsResponse"
  /brands/{brand-id}/feature-types:
    get:
      deprecated: true
      tags:
        - Brand
      summary: Returns all available feature types for the given brand. Use GET /products/{product-id}/feature-types or Product.getProductFeatureTypes instead.
      operationId: getBrandFeatureTypes
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetFeatureTypesResponse"
  /brands/{brand-id}/publish-requests:
    post:
      tags:
        - Brand
      summary: Creates a new publish request which will be processed by the system asynchronously.
      operationId: createPublishRequest
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: body
          name: scheduling-mode-request
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/SchedulingModeRequest"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /brands/{brand-id}/output-meta:
    get:
      deprecated: true
      tags:
        - Brand
      summary: Returns the output meta of the given brand. Use GET /products/{product-id}/output-meta or Product.getProductOutputMeta instead.
      operationId: getBrandOutputMeta
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: query
          name: exclude-unpublished-channels
          required: false
          default: false
          type: boolean
      responses:
        200:
          description: OK
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/GetOutputMetaResponse"
  /brands/{brand-id}/ads:
    get:
      tags:
        - Brand
      summary: Returns a list of all ads in the Ad Manager.
      operationId: getAds
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetAdsResponse"
  /brands/{brand-id}/schedule-statistics-entries:
    get:
      tags:
        - Brand
      summary: Returns schedule statistics entries for the given brand between a start date and an end date.
      operationId: getScheduleStatisticsEntries
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: query
          description: "Start date for the schedule statistics entries. Format: yyyy-MM-dd"
          name: start-date
          required: true
          type: string
        - in: query
          description: "End date for the schedule statistics entries. Format: yyyy-MM-dd"
          name: end-date
          required: true
          type: string
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetScheduleStatisticsEntriesResponse"
  /brands/{brand-id}/audio-test-areas:
    get:
      tags:
        - Brand
      summary: Returns a list of suggested audio tests areas for the given brand.
      operationId: getAudioTestAreas
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetAudioTestAreasResponse"
    post:
      tags:
        - Brand
      summary: Creates an audio test area for the given brand.
      operationId: createAudioTestArea
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: body
          name: new-audio-test-area
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/NewAudioTestArea"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetAudioTestAreaResponse"
  /audio-test-areas/{audio-test-area-id}:
    put:
      tags:
        - Brand
      summary: Updates an audio test area.
      operationId: updateAudioTestArea
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/audio-test-area-id"
        - in: body
          name: audio-test-area-update
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/AudioTestAreaUpdate"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetAudioTestAreaResponse"
    delete:
      tags:
        - Brand
      summary: Deletes an audio test area.
      operationId: deleteAudioTestArea
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/audio-test-area-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /brands/{brand-id}/network-configuration:
    get:
      deprecated: true
      tags:
        - Brand
      summary: Returns the brand's network configuration. Use GET /sbx-techs/{sbx-tech-id}/network-configuration or SbxTech.getSbxTechNetworkConfiguration instead.
      operationId: getBrandNetworkConfiguration
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetNetworkConfigurationResponse"
    put:
      deprecated: true
      tags:
        - Brand
      summary: Updates the brand's network configuration. Use PUT /sbx-techs/{sbx-tech-id}/network-configuration or SbxTech.updateSbxTechNetworkConfiguration instead.
      operationId: updateBrandNetworkConfiguration
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: body
          name: updated-network-config
          required: true
          schema:
            #TODO: Refactor to use NetworkConfig core if front end doesn't have access to the ID
            $ref: "./definitions.yaml#/definitions/NetworkConfigCore"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetNetworkConfigurationResponse"
  /brands/{brand-id}/task-logs:
    get:
      tags:
        - Brand
      summary: Returns brand's task logs of the given type.
      operationId: getBrandTaskLogs
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: query
          name: task-type
          required: true
          #When switching to OpenApi 3, we will be able to use an enum here
          type: string
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetTaskLogsResponse"
  /brands/{brand-id}/task-logs/{task-id}/entries:
    get:
      tags:
        - Brand
      summary: Returns brand's task logs of the given type.
      operationId: getBrandTaskLogEntries
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - $ref: "#/parameters/task-id"
        - in: query
          name: task-type
          required: true
          #When switching to OpenApi 3, we will be able to use an enum here
          type: string
        - $ref: "#/parameters/limit"
        - $ref: "#/parameters/from-timestamp"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetTaskLogEntriesResponse"
  /brands/{brand-id}/latest-snapshots:
    get:
      tags:
        - Brand
      summary: Returns the last snapshot of every device for a specific brand. By default, returns the last snapshot for active devices only.
      operationId: getBrandLatestSnapshots
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: query
          name: fetch-active-device-snapshots
          default: true
          type: boolean
        - in: query
          name: fetch-inactive-device-snapshots
          default: false
          type: boolean
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBrandLatestSnapshotsResponse"
  /brands/{brand-id}/device-metrics-snapshots-history:
    get:
      tags:
        - Brand
      summary: Gets the the device metrics snapshots history for all devices in the brand.
      operationId: getBrandDeviceMetricsSnapshotHistory
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/GetDeviceMetricsSnapshotsResponse"
  /brands/{brand-id}/user-rights-roles:
    get:
      tags:
        - Brand
      summary: Returns the user rights roles for the given brand.
      operationId: getBrandUserRightsRoles
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetUserRightsRolesResponse"
  /brands/{brand-id}/user-rights-role-assignments:
    get:
      tags:
        - Brand
      summary: Gets all user rights role assignments for the given brand.
      operationId: getBrandUserRightsRoleAssignments
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetUserRightsRoleAssignmentsResponse"
    post:
      tags:
        - Brand
      summary: Assigns roles to users for the given brand.
      operationId: assignBrandRoles
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: body
          name: role-assignments
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/RoleAssignments"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
    delete:
      tags:
        - Brand
      summary: Revokes roles to user.
      operationId: revokeBrandRoles
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: query
          name: target-instance-ids
          required: true
          type: array
          items:
            type: integer
            format: int64
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /brands/{brand-id}/pushed-device-configs:
    post:
      tags:
        - Brand
      summary: Pushes the config of all of the brand's devices.
      operationId: pushConfigToAllBrandDevices
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - $ref: "#/parameters/empty-body"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /brands/{brand-id}/files:
    post:
      tags:
        - Brand
      summary: Uploads files for the given brand.
      operationId: uploadBrandFile
      security:
        - accessToken: [ defaultScope ]
      consumes:
        - multipart/form-data
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: formData
          name: file-type
          required: true
          type: string
          enum:
            - messageAlbumCoverLarge
            - messageAlbumCoverSmall
            - claperLogo
            - claperCustomUIElements
        - in: formData
          name: file-to-upload
          required: true
          type: file
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /channels/{channel-id}/published-status:
    #TODO move to channel controller instead of brand if additional channel operations are needed
    get:
      tags:
        - Brand
      summary: Gets the published status of a channel.
      operationId: getChannelPublishedStatus
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: path
          name: channel-id
          required: true
          type: integer
          format: int64
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetChannelPublishedStatusResponse"
  /brands/{brand-id}/media-player-outputs:
    get:
      deprecated: true
      tags:
        - Brand
      summary: Gets a list of the media player outputs in the given brand. Use GET /products/{product-id}/media-player-outputs or Product.getProductMediaPlayerOutputs instead.
      operationId: getBrandMediaPlayerOutputs
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetMediaPlayerOutputsResponse"
    put:
      tags:
        - Brand
      summary: Updates a list of media player outputs.
      operationId: updateMediaPlayerOutputs
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: body
          name: media-player-outputs-update-info
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/MediaPlayerOutputsUpdateInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /brands/{brand-id}/channels:
    get:
      deprecated: true
      tags:
        - Brand
      summary: Gets a list of the available channels for the given brand. Use GET /products/{product-id}/channels or Product.getProductChannels instead.
      operationId: getBrandChannels
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetGenericPairsResponse"
  /brands/{brand-id}/playback-channels:
    get:
      deprecated: true
      tags:
        - Brand
      summary: Gets a list of the available playback channels for the given brand. Use GET /products/{product-id}/playback-channels or Product.getProductPlaybackChannels instead.
      operationId: getBrandPlaybackChannels
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetGenericPairsResponse"
  /brands/{brand-id}/ban-config:
    get:
      tags:
        - Brand
      summary: Gets the ban configuration.
      operationId: getBanConfig
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: query
          name: station-id
          required: false
          type: integer
          format: int64
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBanConfigResponse"
    post:
      tags:
        - Brand
      summary: Creates or updates the ban configuration.
      operationId: updateBanConfig
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: body
          name: updated-ban-config
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/UpdateBanConfigInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBanConfigResponse"
  /brands/{brand-id}/throttling-scheme-preview:
    get:
      deprecated: true
      tags:
        - Brand
      summary: Gets the throttling scheme preview. Use GET /sbx-techs/{sbx-tech-id}/throttling-scheme-preview or SbxTech.getSbxTechThrottlingSchemePreview instead.
      operationId: getThrottlingSchemePreview
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetThrottlingSchemePreviewResponse"
  /brands/{brand-id}/throttling-scheme:
    get:
      deprecated: true
      tags:
        - Brand
      summary: Gets the throttling scheme. Use GET /sbx-techs/{sbx-tech-id}/throttling-scheme or SbxTech.getSbxTechThrottlingScheme instead.
      operationId: getThrottlingScheme
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetThrottlingSchemeResponse"
    put:
      deprecated: true
      tags:
        - Brand
      summary: Creates or updates the throttling scheme. Use PUT /sbx-techs/{sbx-tech-id}/throttling-scheme or SbxTech.updateSbxTechThrottlingScheme instead.
      operationId: updateThrottlingScheme
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: body
          name: updated-throttling-scheme
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/ThrottlingScheme"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetThrottlingSchemeResponse"
  /brands/{brand-id}/songs/{song-id}:
    get:
      deprecated: true
      tags:
        - Brand
      summary: Gets information about for the given song. Use GET /products/{product-id}/songs/{song-id} or Product.getProductSong instead.
      operationId: getSong
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: path
          name: song-id
          required: true
          type: integer
          format: int64
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetSongResponse"
  /brands/{brand-id}/admin-settings:
    get:
      deprecated: true
      tags:
        - Brand
      summary: Gets information about the settings. Only available to brand administrators. Use GET /products/{product-id}/admin-settings or Product.getAdminProductSettings instead.
      operationId: getAdminBrandProductSettings
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetAdminBrandProductSettingsResponse"
  /brands/{brand-id}:
    get:
      tags:
        - Brand
      summary: Gets information about the given brand.
      operationId: getBrand
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBrandResponse"
    put:
      tags:
        - Brand
      summary: Updates the brand properties, often called "configuration".
      operationId: updateBrand
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: body
          name: brand-update
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/BrandUpdate"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBrandResponse"
  /brands/{brand-id}/basic:
    get:
      tags:
        - Brand
      summary: Gets the minimal brand info.
      operationId: getBrandBasicInfo
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: query
          type: boolean
          name: fetch-logo
          required: true
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBasicBrandResponse"
    put:
      tags:
        - Brand
      summary: Updates the minimal brand info.
      operationId: editBrandBasicInfo
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: body
          name: updated-brand
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/UpdateBrandBasicInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBasicBrandResponse"
  /brands/{brand-id}/logo:
    put:
      tags:
        - Brand
      summary: Updates the brand logo.
      operationId: updateBrandLogo
      security:
        - accessToken: [ defaultScope ]
      consumes:
        - multipart/form-data
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: formData
          name: file-to-upload
          required: true
          type: file
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /brands/{brand-id}/available-stations:
    get:
      deprecated: true
      tags:
        - Brand
      summary: Gets the available stations for this brand. Use GET /station-scheduling-features/{station-scheduling-feature-id}/available-stations or StationSchedulingFeature.getStationSchedulingFeatureAvailableStations instead.
      operationId: getBrandAvailableStations
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetAvailableStationsResponse"
  /brands/{brand-id}/size-simulation:
    get:
      deprecated: true
      tags:
        - Brand
      summary: Gets the total size of all assets in the brand's primary role for a given list of stations. Use GET /station-scheduling-features/{station-scheduling-feature-id}/size-simulation or StationSchedulingFeature.getStationSchedulingFeatureSimulatedSize instead.
      operationId: getBrandSimulatedSize
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: query
          name: station-sam-ids
          required: true
          type: array
          items:
            type: string
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBrandSizeResponse"
  #TODO: Here we could update using /addresses/{addressId}: but we need a new access right. Leaving it that way for now
  /brands/{brand-id}/shipping-addresses/{address-id}:
    put:
      tags:
        #TODO: Maybe move this to Shipping?
        - Brand
      summary: Updates a shipping address.
      operationId: updateShippingAddress
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - $ref: "#/parameters/address-id"
        - in: body
          name: new-shipping-address
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/AddressCore"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetAddressResponse"
    delete:
      tags:
        - Brand
      summary: Deletes a shipping address and remove it from the given brand.
      operationId: deleteShippingAddress
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - $ref: "#/parameters/address-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /brands/{brand-id}/pool-devices:
    get:
      deprecated: true
      tags:
        - Brand
      summary: Returns the pool devices. Use GET /products/{product-id}/pool-devices or Product.getProductPoolDevices instead.
      operationId: getPoolDevices
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/GetDevicesResponse"
    post:
      deprecated: true
      tags:
        - Brand
      summary: Creates a new deployment request in the pool store. Creates the pool store if it doesn't already exist. Returns all pool devices. Use POST /products/{product-id}/pool-devices or Product.createProductPoolDeploymentRequest instead.
      operationId: createPoolDeploymentRequest
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: body
          name: pool-deployment-request-creation-info
          required: true
          schema:
            $ref: "./device-definitions.yaml#/definitions/PoolDeploymentRequestCreationInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/GetDevicesResponse"
  /brands/{brand-id}/stations/{station-id}:
    put:
      deprecated: true
      tags:
        - Brand
      summary: Updates some properties of the station related to this brand. Use PUT /station-scheduling-features/{station-scheduling-feature-id}/stations or StationSchedulingFeature.updateStationSchedulingFeatureStation instead.
      operationId: updateBrandStation
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - $ref: "#/parameters/station-id"
        - in: body
          name: brand-station-update
          schema:
            $ref: "./definitions.yaml#/definitions/BrandStationUpdate"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBrandStationResponse"
    delete:
      deprecated: true
      tags:
        - Brand
      summary: Removes a station from the given brand. Use DELETE /station-scheduling-features/{station-scheduling-feature-id}/stations/{station-id} or StationSchedulingFeature.removeStationFromStationSchedulingFeature instead.
      operationId: removeStationFromBrand
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - $ref: "#/parameters/station-id"
        - in: query
          name: fallback-station
          required: false
          type: integer
          format: int64
        - in: query
          name: force-remove
          required: false
          type: boolean
          default: false
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBrandStationsResponse"
  /brands/{brand-id}/device-types:
    get:
      deprecated: true
      tags:
        - Brand
      summary: Returns a list of the device types available for the given brand. Use GET /products/{product-id}/device-types or Product.getProductDeviceTypes instead.
      operationId: getBrandDeviceTypes
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetEnumPairsResponse"
  /brands:
    get:
      tags:
        - Brand
      summary: Returns a list of all brands in the system.
      operationId: getBrands
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBasicBrandsResponse"
  /brands/{brand-id}/zones/{zone-index}/default-schedule:
    put:
      tags:
        - Brand
      summary: Updates the default schedule for the given brand and zone index.
      operationId: updateDefaultMessageSchedule
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - $ref: "#/parameters/zone-index"
        - in: body
          name: new-default-value
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/IntegerIDUpdateInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /brands/{brand-id}/zones/{zone-index}/default-zone:
    put:
      tags:
        - Brand
      summary: Updates the default zone for the given brand and zone index.
      operationId: updateDefaultZone
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - $ref: "#/parameters/zone-index"
        - in: body
          name: new-default-value
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/IntegerIDUpdateInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /brands/{brand-id}/zones/{zone-index}/default-station-scheduling-channel:
    put:
      deprecated: true
      tags:
        - Brand
      summary: Updates the default station scheduling channel for the given brand and zone index. Use PUT /station-scheduling-features/{station-scheduling-feature-id}/zones/{zone-index}/default-station-scheduling-channel or StationSchedulingFeature.updateStationSchedulingFeatureDefaultStationSchedulingChannel instead.
      operationId: updateDefaultStationSchedulingChannel
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - $ref: "#/parameters/zone-index"
        - in: body
          name: new-default-value
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/IntegerIDUpdateInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /brands/{brand-id}/default-playback-channel:
    put:
      deprecated: true
      tags:
        - Brand
      summary: Updates the default playback channel for the given brand. Use PUT /player-playback-features/{player-playback-feature-id}/default-playback-channel or PlayerPlaybackFeature.updatePlayerPlaybackFeatureDefaultPlaybackChannel instead.
      operationId: updateDefaultPlaybackChannel
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: body
          name: updated-playback-channel
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/PlaybackChannelUpdateInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /brands/{brand-id}/fallback-station:
    put:
      deprecated: true
      tags:
        - Brand
      summary: Updates the fallback station for the given streaming brand. Use PUT /station-scheduling-features/{station-scheduling-feature-id}/fallback-station or StationSchedulingFeature.updateStationSchedulingFeatureFallbackStation instead.
      operationId: updateFallbackStation
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: body
          name: updated-fallback-station
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/IntegerIDUpdateInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /brands/{brand-id}/shipping-usb-updates:
    get:
      deprecated: true
      tags:
        #TODO: Maybe move this to shipping controller
        - Brand
      summary: Returns all available shipping usb updates. Use GET /products/{product-id}/shipping-usb-updates or Shipping.getProductShippingUsbUpdates instead.
      operationId: getShippingUsbUpdates
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetGenericPairsResponse"
    post:
      deprecated: true
      tags:
        - Shipping
      summary: Creates a new shipping usb update. Use POST /products/{product-id}/shipping-usb-updates or Shipping.createProductShippingUsbUpdate instead.
      operationId: createShippingUsbUpdate
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: body
          name: shipping-usb-update
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/ShippingUsbUpdate"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /brands/{brand-id}/station-ban-ratio:
    get:
      tags:
        - Brand
      summary: Returns the station ban ratio for the given brand.
      operationId: getStationBanRatio
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: query
          name: station-id
          required: false
          type: integer
          format: int64
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetStationBanRatioResponse"
  /brands/{client-name}/user_notification_configuration:
    put:
      tags:
        - Brand
      summary: Updates the user notification configuration for the given client's brands.
      operationId: updateUserNotificationConfiguration
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/client-name"
        - in: body
          name: updated-user-notification-configuration
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/UpdateUserNotificationConfiguration"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetUserNotificationConfigurationResponse"
    get:
      tags:
        - Brand
      summary: Gets the user notification configuration for the given client's brands.
      operationId: getUserNotificationConfiguration
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/client-name"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetUserNotificationConfigurationResponse"
    post:
      tags:
        - Brand
      summary: Creates a new user notification configuration for the given client's brands.
      operationId: createUserNotificationConfiguration
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/client-name"
        - in: body
          name: new-user-notification-configuration
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/UpdateUserNotificationConfiguration"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetUserNotificationConfigurationResponse"
    delete:
      tags:
        - Brand
      summary: Delete a user notification configuration.
      operationId: deleteUserNotificationConfiguration
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/client-name"
        - in: body
          name: user-notification-configuration
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/UserNotificationConfiguration"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /brands/{brand-id}/monthly-connectivity-report:
    get:
      tags:
        - Brand
      summary: Return the byte array for the monthly connectivity report workbook.
      operationId: getBrandMonthlyConnectivityReport
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetConnectivityReportDataResponse"

#### AFFILIATES ####
  # TODO FIX TAG MISMATCH
  /affiliates/{affiliate-id}/brands:
    get:
      tags:
        - Affiliate
      summary: Returns a list of all brands the connected user has access to in the given affiliate.
      operationId: getAffiliateBrands
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
        - in: query
          name: wanted-statuses
          required: false
          type: array
          items:
            type: string
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBrandsResponse"
    post:
      tags:
        - Brand
      summary: Adds a new brand to the given affiliate.
      operationId: addBrand
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
        - in: body
          name: new-brand
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/NewBrand"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetCreatedIdResponse"
  /affiliates/{affiliate-id}/matching-roles:
    get:
      tags:
        - Affiliate
      summary: Gets the matching roles for the given affiliate.
      operationId: getMatchingRoles
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
        - in: query
          name: video
          required: true
          type: boolean
        - in: query
          name: mono
          required: true
          type: boolean
        - in: query
          name: audio-bit-rate
          required: false
          #TODO: Replace this with enum when OpenApi 3.0 is available
          type: string
        - in: query
          name: related-media-type
          required: false
          #TODO: Replace this with enum when OpenApi 3.0 is available
          type: string
        - in: query
          name: claper-enabled
          required: true
          type: boolean
        - in: query
          name: messaging
          required: true
          type: boolean
        - in: query
          name: branding-type
          required: false
          #TODO: Replace this with enum when OpenApi 3.0 is available
          type: string
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetMatchingRolesResponse"
  /affiliates/{affiliate-id}/matching-roles-media-types:
    get:
      tags:
        - Affiliate
      summary: Gets the media types for the matching roles.
      operationId: getMatchingRolesMediaTypes
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetMediaTypesResponse"
  /affiliates/{affiliate-id}/matching-roles-audio-signal-types:
    get:
      tags:
        - Affiliate
      summary: Gets the audio signal types for the matching roles.
      operationId: getMatchingRolesAudioSignalTypes
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
        - in: query
          name: video
          required: true
          type: boolean
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetAudioSignalsResponse"
  /affiliates/{affiliate-id}/matching-roles-audio-bit-rates:
    get:
      tags:
        - Affiliate
      summary: Gets the audio bit rates for the matching roles.
      operationId: getMatchingRolesAudioBitRates
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
        - in: query
          name: mono
          required: true
          type: boolean
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetStringListResponse"
  /affiliates/{affiliate-id}/matching-roles-product-types:
    get:
      tags:
        - Affiliate
      summary: Gets the product types for the matching roles.
      operationId: getMatchingRolesProductTypes
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
        - in: query
          name: video
          required: true
          type: boolean
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetProductTypesResponse"
  /affiliates/{affiliate-id}/matching-roles-technology-types:
    get:
      tags:
        - Affiliate
      summary: Gets the technology types for the matching roles.
      operationId: getMatchingRolesTechnologyTypes
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetTechTypesResponse"
  /affiliates/{affiliate-id}/matching-roles-branding-types:
    get:
      tags:
        - Affiliate
      summary: Gets the branding types for the matching roles.
      operationId: getMatchingRolesBrandingTypes
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
        #TODO: Replace this with an enum when it will be supported in OpenApi 3.0
        - in: query
          name: tech-type
          required: true
          type: string
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBrandingTypesResponse"
  /affiliates/{affiliate-id}/matching-roles-related-media-types:
    get:
      tags:
        - Affiliate
      summary: Gets the related media types for the matching roles.
      operationId: getMatchingRolesRelatedMediaTypes
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
        - in: query
          name: video
          required: true
          type: boolean
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetRelatedMediaTypesResponse"
  /affiliates/{affiliate-id}/matching-roles-claper-support-validation:
    get:
      tags:
        - Affiliate
      summary: Gets the claper support validation for the matching roles.
      operationId: getMatchingRolesClaperSupportValidation
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
        #TODO: Replace this with an enum when it will be supported in OpenApi 3.0
        - in: query
          name: tech-type
          required: true
          type: string
        - in: query
          name: video
          required: true
          type: boolean
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetClaperSupportValidationResponse"
  /affiliates/{affiliate-id}/devices:
    get:
      tags:
        - Affiliate
      summary: Gets a list of devices available for the given affiliate.
      operationId: getAffiliateDevices
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
        - in: query
          name: available-sbaby-only
          required: false
          default: false
          type: boolean
        - in: query
          name: external-ids
          required: false
          type: array
          items:
            type: string
          collectionFormat: multi
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/GetDevicesResponse"
  /affiliates/{affiliate-id}/stores:
    get:
      tags:
        - Affiliate
      summary: Gets a list of stores for the given affiliate.
      operationId: getAffiliateStores
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBasicStoresResponse"
  /affiliates/{affiliate-id}/shipping-types:
    get:
      tags:
        - Affiliate
      summary: Returns all shipping types available for the given affiliate.
      operationId: getAvailableShippingTypes
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetEnumPairsResponse"
  /task-logs/{task-id}/entries:
    get:
      tags:
        - Affiliate
      summary: Returns the entries from a task log id.
      operationId: getTaskLogEntries
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/task-id"
        - $ref: "#/parameters/limit"
        - $ref: "#/parameters/from-timestamp"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetTaskLogEntriesResponse"
  /affiliates/{affiliate-id}/task-logs:
    get:
      tags:
        - Affiliate
      summary: Returns all task logs for the given affiliate.
      operationId: getAffiliateTaskLogs
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetTaskLogsResponse"
  /affiliates/{affiliate-id}/cradle-logs:
    get:
      tags:
        - Affiliate
      summary: Returns all cradle logs for the given affiliate.
      operationId: getCradleLogs
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
        - $ref: "#/parameters/limit"
        - $ref: "#/parameters/from-timestamp"
        - $ref: "#/parameters/use-store-time-zone"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetCradleLogsResponse"
  /affiliates/{affiliate-id}/user-rights-roles:
    get:
      tags:
        - Affiliate
      summary: Returns the user rights roles for the given affiliate.
      operationId: getAffiliateUserRightsRoles
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetUserRightsRolesResponse"
  /affiliates/{affiliate-id}/user-rights-role-assignments:
    get:
      tags:
        - Affiliate
      summary: Gets all user rights role assignments for the given affiliate.
      operationId: getAffiliateUserRightsRoleAssignments
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetUserRightsRoleAssignmentsResponse"
    post:
      tags:
        - Affiliate
      summary: Assigns roles to users for the given affiliate.
      operationId: assignAffiliateRoles
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
        - in: body
          name: role-assignments
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/RoleAssignments"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
    delete:
      tags:
        - Affiliate
      summary: Revokes roles to user.
      operationId: revokeAffiliateRoles
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
        - in: query
          name: target-instance-ids
          required: true
          type: array
          items:
            type: integer
            format: int64
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /affiliates:
    get:
      tags:
        - Affiliate
      summary: Returns the affiliates.
      operationId: getAffiliates
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetAffiliatesResponse"
    post:
      tags:
        - Affiliate
      summary: Adds an affiliate in the system.
      operationId: addAffiliate
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: body
          name: new-affiliate
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/AffiliateCore"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetAffiliateResponse"
  /affiliates/{affiliate-id}:
    get:
      tags:
        - Affiliate
      summary: Returns the given affiliate.
      operationId: getAffiliate
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetAffiliateResponse"
    put:
      tags:
        - Affiliate
      summary: Edits an affiliate.
      operationId: editAffiliate
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
        - in: body
          name: updated-affiliate
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/AffiliateCore"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetAffiliateResponse"
  /affiliates/{affiliate-id}/logo:
    put:
      tags:
        - Affiliate
      summary: Updates the affiliate logo.
      operationId: updateAffiliateLogo
      security:
        - accessToken: [ defaultScope ]
      consumes:
        - multipart/form-data
      parameters:
        - $ref: "#/parameters/affiliate-id"
        - in: formData
          name: file-to-upload
          required: true
          type: file
        - in: formData
          name: language
          required: true
          type: string
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /affiliates/{affiliate-id}/roles:
    get:
      tags:
        - Affiliate
      summary: Returns all available roles for the given affiliate.
      operationId: getRoles
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetAffiliateRolesResponse"
  /affiliates/{affiliate-id}/roles/{role-id}:
    put:
      tags:
        - Affiliate
      summary: Adds a related role to the affiliate.
      operationId: updateRoleLink
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
        - $ref: "#/parameters/role-id"
        - $ref: "#/parameters/empty-body"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
    delete:
      tags:
        - Affiliate
      summary: Removes a related role from the affiliate.
      operationId: removeRoleLink
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
        - $ref: "#/parameters/role-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /affiliates/{affiliate-id}/stations:
    get:
      tags:
        - Affiliate
      summary: Returns all available stations for the given affiliate.
      operationId: getStations
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
        - in: query
          name: role-code
          required: false
          type: string
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetAffiliateStationsResponse"
    post:
      tags:
        - Affiliate
      summary: Adds a station to the given affiliate.
      operationId: addStationToAffiliate
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
        - in: body
          name: station-assignation-info
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/StationAssignationInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /affiliates/{affiliate-id}/stations/{station-id}:
    delete:
      tags:
        - Affiliate
      summary: Removes a related station from the affiliate.
      operationId: removeStationLink
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
        - $ref: "#/parameters/station-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /affiliates/{affiliate-id}/product-types:
    get:
      tags:
        - Affiliate
      summary: Returns all product types for the given affiliate.
      operationId: getAffiliateProductTypes
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetProductTypesResponse"
  /affiliates/{affiliate-id}/streaming-licenses:
    get:
      tags:
        - Affiliate
      summary: Returns the list of streaming licenses for the given affiliate.
      operationId: getStreamingLicenses
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/StreamingLicensesResponse"
  /affiliates/{affiliate-id}/sync-overview-entries:
    get:
      tags:
        - Affiliate
      summary: Retrieves all sync overview entries for the given affiliate.
      operationId: getAffiliateSyncOverviewEntries
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/SyncOverviewEntriesResponse"
  /affiliates/{affiliate-id}/operators:
    get:
      tags:
        - Affiliate
      summary: Returns all operators for a given affiliate.
      operationId: getOperators
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/OperatorsResponse"
  #TODO: I put this in affiliate because I'm sure one day it will be filtered by affiliates
  /shipping-package-types:
    get:
      tags:
        - Affiliate
      summary: Returns all shipping package types.
      operationId: getAvailableShippingPackageTypes
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetGenericPairsResponse"

#### STORE ####
  /stores/{store-id}/addresses/{address-id}:
    put:
      tags:
        - Store
      summary: Updates a store address in the system.
      operationId: updateStoreAddress
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/store-id"
        - $ref: "#/parameters/address-id"
        - in: body
          name: updated-address
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/AddressCore"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetAddressResponse"
  /stores/{store-id}/logs:
    get:
      tags:
        - Store
      summary: Returns all logs for a given store.
      operationId: getStoreLogs
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/store-id"
        - $ref: "#/parameters/limit"
        - $ref: "#/parameters/from-timestamp"
        - $ref: "#/parameters/use-store-time-zone"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetStoreLogsResponse"
    post:
      tags:
        - Store
      summary: Adds a log to the given store.
      operationId: addStoreLog
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/store-id"
        - in: body
          name: new-store-log
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/NewLog"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /stores/{store-id}:
    get:
      tags:
        - Store
      summary: Returns the given store.
      operationId: getStore
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/store-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBasicStoreResponse"
    put:
      tags:
        - Store
      summary: Updates the given store.
      operationId: updateStore
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/store-id"
        - in: body
          name: updated-store
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/StoreUpdateInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBasicStoreResponse"
  /stores/{store-id}/adminTags:
    put:
      tags:
        - Store
      summary: Updates admin tags for the given store.
      operationId: updateStoreAdminTags
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/store-id"
        - in: body
          name: updated-store-admin-tag
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/StoreAdminTagsUpdateInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBasicStoreResponse"
  /stores/{store-id}/basic:
    put:
      tags:
        - Store
      summary: Updates the given store's minimal info.
      operationId: updateStoreBasicInfo
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/store-id"
        - in: body
          name: updated-store
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/UpdateStoreBasicInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBasicStoreResponse"
  /stores/{store-id}/user-rights-roles:
    get:
      tags:
        - Store
      summary: Returns the user rights roles for the given store.
      operationId: getStoreUserRightsRoles
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/store-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetUserRightsRolesResponse"
  /stores/{store-id}/devices:
    get:
      tags:
        - Store
      summary: Gets a list of devices available for the given store.
      operationId: getStoreDevices
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/store-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/GetDevicesResponse"
    put:
      tags:
        - Store
      summary: Moves a device to the store. For the moment, it only supports "Devices pool store" to "store" flow.
      operationId: moveDeviceToStore
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/store-id"
        - in: body
          name: device-assignation-info
          required: true
          schema:
            $ref: "./device-definitions.yaml#/definitions/DeviceAssignationInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /stores:
    get:
      tags:
        - Store
      summary: Gets a list of stores for the connected user.
      operationId: getAuthorizedStores
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: query
          name: external-id
          required: false
          type: string
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBasicStoresResponse"
  /retail-media-players:
    post:
      tags:
        - Store
      summary: Creates a Retail Media player in the Ad Manager for a store.
      operationId: createRetailMediaPlayer
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: body
          name: new-retail-media-player
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/NewRetailMediaPlayer"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetRetailMediaPlayerResponse"
  /store/{store-id}/retail-media-player:
    get:
      tags:
        - Store
      summary: Gets the Retail Media player linked to the given store in the Ad Manager.
      operationId: getRetailMediaPlayer
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/store-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetRetailMediaPlayerResponse"
    put:
      tags:
        - Store
      summary: Updates the Retail Media player linked to the given store in the Ad Manager.
      operationId: updateRetailMediaPlayer
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/store-id"
        - in: body
          name: retail-media-player-update
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/RetailMediaPlayerUpdate"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetRetailMediaPlayerResponse"
  /store/{store-id}/ad-provider-device-status:
    get:
      tags:
        - Store
      summary: Gets the ad provider's device status for the given store in the Ad Manager.
      operationId: getAdProviderDeviceStatus
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/store-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetAdProviderDeviceStatusResponse"
    put:
      tags:
        - Store
      summary: Updates the ad provider's device status for the given store in the Ad Manager.
      operationId: updateAdProviderDeviceStatus
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/store-id"
        - in: body
          name: ad-provider-device-status
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/AdProviderDeviceStatus"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /store/{store-id}/ad-providers:
    get:
      tags:
        - Store
      summary: Gets the list of all ad providers in the Ad Manager.
      operationId: getAdProviders
      security:
          - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/store-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetAdProvidersResponse"

#### MESSSAGING ####
  /messaging-features/{message-schedule-id}/segments:
    get:
      tags:
        - Messaging
      summary: Returns the linkable library segments for a messaging schedules.
      operationId: getLinkableLibrarySegments
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/message-schedule-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetSegmentsResponse"
  /message-schedules/{message-schedule-id}/segments:
    get:
      tags:
        - Messaging
      summary: Returns segments for a given message schedule.
      operationId: getSegmentsInMessageSchedule
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/message-schedule-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetSegmentsResponse"
    post:
      tags:
        - Messaging
      summary: Adds a segment to the given message schedule.
      operationId: addSegmentToMessageSchedule
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/message-schedule-id"
        - in: body
          name: new-segment
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/SegmentCoreWithTimeListEntries"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetSegmentResponse"
  /segments/{segment-id}:
    get:
      tags:
        - Messaging
      summary: Returns a segment.
      operationId: getSegment
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/segment-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetSegmentResponse"
    put:
      tags:
        - Messaging
      summary: Updates a segment.
      operationId: updateSegment
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/segment-id"
        - in: body
          name: new-segment
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/SegmentCoreWithTimeListEntries"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetSegmentResponse"
    delete:
      tags:
        - Messaging
      summary: Deletes a segment.
      operationId: removeSegment
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/segment-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /segments/{segment-id}/segment-scheduling-rules:
    post:
      tags:
        - Messaging
      summary: Create a new SegmentSchedulingRule.
      operationId: createSegmentSchedulingRule
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/segment-id"
        - in: body
          name: new-segment-scheduling-rule
          schema:
            $ref: "./definitions.yaml#/definitions/NewSegmentSchedulingRule"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetSegmentSchedulingRuleResponse"
  /segments/{segment-id}/time-list-entries:
    get:
      tags:
        - Messaging
      summary: Returns the time list entries for a given segment.
      operationId: getSegmentTimeListEntries
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/segment-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetTimeListEntriesResponse"
  /segment-scheduling-rules/{segment-scheduling-rule-id}:
    put:
      tags:
        - Messaging
      summary: Updates a SegmentSchedulingRule.
      operationId: updateSegmentSchedulingRule
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/segment-scheduling-rule-id"
        - in: body
          name: update-segment-scheduling-rule
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/UpdateSegmentSchedulingRule"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetSegmentSchedulingRuleResponse"
    delete:
      tags:
        - Messaging
      summary: Delete a SegmentSchedulingRule.
      operationId: deleteSegmentSchedulingRule
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/segment-scheduling-rule-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /brands/{brand-id}/message-schedules:
    get:
      tags:
        - Messaging
      summary: Returns the message schedules for the given brand.
      operationId: getBrandMessageSchedules
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: query
          name: include-library
          type: boolean
          default: true
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetMessageSchedulesResponse"
    post:
      tags:
        - Messaging
      summary: Creates a new message schedule in the given brand.
      operationId: addMessageScheduleToBrand
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: body
          name: new-message-schedule
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/NewMessageSchedule"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetMessageScheduleResponse"
  /message-schedules/{message-schedule-id}:
    put:
      tags:
        - Messaging
      summary: Updates a message schedule.
      operationId: updateMessageSchedule
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/message-schedule-id"
        - in: body
          name: updated-message-schedule
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/NewMessageSchedule"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetMessageScheduleResponse"
    delete:
      tags:
        - Messaging
      summary: Removes a message schedule.
      operationId: removeMessageSchedule
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/message-schedule-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /brands/{brand-id}/messages:
    get:
      tags:
        - Messaging
      summary: Returns all messages of a given brand.
      operationId: getBrandMessages
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: query
          name: only-valid
          type: boolean
          required: false
          default: false
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetMessagesResponse"
    post:
      tags:
        - Messaging
      summary: Adds a message to the given brand.
      operationId: addMessageToBrand
      security:
        - accessToken: [ defaultScope ]
      consumes:
        - multipart/form-data
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: formData
          name: message-name
          type: string
          required: true
        - in: formData
          name: tags
          type: array
          items:
            type: string
        - in: formData
          name: tag-logic-gate
          type: string
          enum:
            - AND
            - OR
        - in: formData
          name: file-fr
          type: file
          required: false
        - in: formData
          name: file-en
          type: file
          required: false
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetMessageResponse"
  /messages/{message-id}:
    get:
      tags:
        - Messaging
      summary: Returns a message.
      operationId: getMessage
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/message-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetMessageResponse"
    put:
      tags:
        - Messaging
      summary: Updates a message.
      operationId: updateMessage
      security:
        - accessToken: [ defaultScope ]
      consumes:
        - multipart/form-data
      parameters:
        - $ref: "#/parameters/message-id"
        - in: formData
          name: message-name
          type: string
          required: true
        - in: formData
          name: tags
          type: array
          items:
            type: string
        - in: formData
          name: tag-logic-gate
          type: string
          enum:
            - AND
            - OR
        - in: formData
          name: file-fr
          type: file
          required: false
        - in: formData
          name: file-en
          type: file
          required: false
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetMessageResponse"
    delete:
      tags:
        - Messaging
      summary: Removes a message.
      operationId: removeMessage
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/message-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /messages/{message-id}/message-scheduling-rules:
    post:
      tags:
        - Messaging
      summary: Create a new MessageSchedulingRule.
      operationId: createMessageSchedulingRule
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/message-id"
        - in: body
          name: new-message-scheduling-rule
          schema:
            $ref: "./definitions.yaml#/definitions/NewMessageSchedulingRule"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/CreateMessageSchedulingRuleResponse"
  /brands/{brand-id}/languages:
    get:
      tags:
        - Messaging
      summary: Returns the languages linked to the given brand.
      operationId: getBrandLanguages
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetLanguagesResponse"
  /message-scheduling-rules/{message-scheduling-rule-id}:
    delete:
      tags:
        - Messaging
      summary: Delete a MessageSchedulingRule.
      operationId: deleteMessageSchedulingRule
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/message-scheduling-rule-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
    put:
      tags:
        - Messaging
      summary: Updates a MessageSchedulingRule.
      operationId: updateMessageSchedulingRule
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/message-scheduling-rule-id"
        - in: body
          name: update-message-scheduling-rule
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/UpdateMessageSchedulingRule"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/UpdateMessageSchedulingRuleResponse"
  /message-schedule/{message-schedule-id}/update-link:
    post:
      tags:
        - Messaging
      summary: Link or unlink a segment from a message schedule.
      operationId: updateSegmentLinkInMessageSchedule
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/message-schedule-id"
        - in: query
          name: segment-id
          type: integer
          format: int64
          required: true
        - in: query
          name: link-state
          type: boolean
          required: true
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /messaging-feature/{segment-id}/update-all-links:
    post:
      tags:
        - Messaging
      summary: Link or unlink all segments from a message schedule.
      operationId: updateSegmentLinkInAllMessageSchedules
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/segment-id"
        - in: query
          name: link-state
          type: boolean
          required: true
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"

#### TAG ####
  /dead-actors:
    post:
      tags:
        - Actor
      summary: Kills an actor in the actor system (MAW).
      operationId: killActor
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: body
          name: actor-info
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/ActorInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /actor-status:
    post:
      tags:
        - Actor
      summary: Requests the status of an actor.
      operationId: getActorStatus
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: body
          name: actor-info
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/ActorInfo"
      responses:
        200:
          description: OK
          #This will change in the future when the call will work. Now it returns nothing
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /actors/pools:
    put:
      tags:
        - Actor
      summary: Resets the actor pools.
      operationId: resetPools
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/empty-body"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"

#### USER ####
  /users:
    get:
      tags:
        - User
      summary: Returns all users in the system.
      operationId: getUsers
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetUsersResponse"
    post:
      tags:
        - User
      summary: Creates a new user in the system.
      operationId: createUser
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: body
          name: new-user
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/NewUser"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetUserDataResponse"
    put:
      tags:
        - User
      summary: Updates users in the system.
      operationId: updateUsers
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: query
          name: emails
          required: true
          type: array
          items:
            type: string
        - in: body
          name: updated-user
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/UpdatedUser"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /current-user:
    get:
      tags:
        - User
      summary: Returns the current user only. Null if there is no connected user.
      operationId: getCurrentUser
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetUserResponse"
  /current-user-preferences:
    put:
      tags:
        - User
      summary: Modifies the preferences of a user.
      operationId: updateUserPreferences
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: body
          name: user-preferences-update
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/UserPreferencesUpdate"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/UserPreferencesResponse"
  /user/{user-id}:
    get:
      tags:
        - User
      summary: Returns the given user.
      operationId: getUser
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/user-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetUserResponse"
  /user:
    get:
      tags:
        - User
      summary: Returns a user based on the provided parameters.
      operationId: getUserByEmail
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: query
          name: email
          required: true
          type: string
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetUserResponse"
  /affiliates/{affiliate-id}/users:
    get:
      tags:
        - User
      summary: Returns all users in the given affiliate.
      operationId: getAffiliateUsers
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetUsersResponse"
    post:
      tags:
        - User
      summary: Creates a new user in the given affiliate.
      operationId: createAffiliateUser
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
        - in: body
          name: new-user
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/NewUser"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetUserDataResponse"
    put:
      tags:
        - User
      summary: Updates users in the given affiliate.
      operationId: updateAffiliateUsers
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
        - in: query
          name: emails
          required: true
          type: array
          items:
            type: string
        - in: body
          name: updated-user
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/UpdatedUser"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /brands/{brand-id}/users:
    get:
      tags:
        - User
      summary: Returns all users in the given brand.
      operationId: getBrandUsers
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetUsersResponse"
    post:
      tags:
        - User
      summary: Creates a new user in the given brand.
      operationId: createBrandUser
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: body
          name: new-user
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/NewUser"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetUserDataResponse"
    put:
      tags:
        - User
      summary: Updates users in the given brand.
      operationId: updateBrandUsers
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: query
          name: emails
          required: true
          type: array
          items:
            type: string
        - in: body
          name: updated-user
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/UpdatedUser"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /current-user-system-permissions:
    get:
      tags:
        - User
      summary: Returns permissions needed by the front-end for the system level.
      operationId: getCurrentUserSystemPermissions
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetFrontEndPermissionsResponse"
  /current-user-affiliate-permissions:
    get:
      tags:
        - User
      summary: Returns permissions needed by the front-end for the given affiliate level.
      operationId: getCurrentUserAffiliatePermissions
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: query
          name: affiliate-id
          type: integer
          format: int64
          required: true
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetFrontEndPermissionsResponse"
  /current-user-brand-permissions:
    get:
      tags:
        - User
      summary: Returns permissions needed by the front-end for the given brand level.
      operationId: getCurrentUserBrandPermissions
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: query
          name: brand-id
          type: integer
          format: int64
          required: true
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetFrontEndPermissionsResponse"
  /current-user-store-permissions:
    get:
      tags:
        - User
      summary: Returns permissions needed by the front-end for the given store level.
      operationId: getCurrentUserStorePermissions
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: query
          name: store-id
          type: integer
          format: int64
          required: true
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetFrontEndPermissionsResponse"
  /users/reset-2fa:
    put:
      tags:
        - User
      summary: Reset the 2FA method for a list of users.
      operationId: resetUsers2FA
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: query
          name: emails
          required: true
          type: array
          items:
            type: string
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"

#### DEVICE ####
  /devices/{device-id}/logs:
    get:
      tags:
        - Device
      summary: Returns the logs of the given device.
      operationId: getDeviceLogs
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-id"
        - $ref: "#/parameters/limit"
        - $ref: "#/parameters/from-timestamp"
        - in: query
          name: message
          required: false
          type: string
        - in: query
          name: log-level
          required: false
          type: string
          #Since it's a query param, we need to use a duplicated enum (not the object in definitions). Will probably change in OpenApi 3.0.
          #https://stackoverflow.com/questions/32255384/swagger-reusing-an-enum-definition-as-query-parameter
          enum:
            - VERBOSE
            - DEBUG
            - INFO
            - WARN
            - ERROR
            - TURNED_OFF
            - ROGUE
            - EVENT
        - in: query
          name: code
          required: false
          type: integer
          format: int64
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetDeviceLogsResponse"
  /devices/{device-id}/playouts:
    get:
      tags:
        - Device
      summary: Returns the playouts of the given device.
      operationId: getDevicePlayouts
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-id"
        - $ref: "#/parameters/limit"
        - $ref: "#/parameters/from-timestamp"
        - $ref: "#/parameters/use-store-time-zone"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetDevicePlayoutsResponse"
  /devices/{device-id}/published-config:
    post:
      tags:
        - Device
      summary: Publishes a device's configuration, pushing it to the device if it is online.
      operationId: publishConfig
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-id"
        - $ref: "#/parameters/empty-body"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBooleanResponse"
  /devices/{device-id}/actions:
    post:
      tags:
        - Device
      summary: Sends an action to the device if it is online.
      operationId: sendAction
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-id"
        - in: body
          name: action
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/DeviceAction"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /devices/{device-id}/commands:
    post:
      tags:
        - Device
      summary: Sends a command to the device if it is online.
      operationId: sendCommand
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-id"
        - in: body
          name: command
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/DeviceCommand"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /device-locations:
    get:
      tags:
        - Device
      summary: Returns the location of all devices that the current user has access to.
      operationId: getDeviceLocations
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: query
          name: brand-id
          required: false
          type: integer
          format: int64
        - in: query
          name: exclude-internal
          required: false
          type: boolean
          default: false
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetDeviceLocationsResponse"
  /devices/{device-id}/config:
    get:
      tags:
        - Device
      summary: Returns the current config for the given device.
      operationId: getDeviceConfig
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetStringResponse"
  /devices/{device-id}/expected-online-date:
    put:
      tags:
        - Device
      summary: Updates the device's expected online date.
      operationId: updateDeviceExpectedOnlineDate
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-id"
        - in: body
          name: expected-online-date-update-info
          required: true
          schema:
            $ref: "./device-definitions.yaml#/definitions/DeviceExpectedOnlineDateUpdateInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /devices/{device-id}/lifecycle-metrics:
    get:
      tags:
        - Device
      summary: Returns the lifecycle metrics of the given device.
      operationId: getDeviceLifecycleMetrics
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-id"
        - $ref: "#/parameters/limit"
        - $ref: "#/parameters/from-timestamp"
        - $ref: "#/parameters/use-store-time-zone"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetDeviceLifecycleMetricsResponse"
  /devices/{device-id}/advanced-logs:
    get:
      tags:
        - Device
      summary: Returns the advanced logs of the given device.
      operationId: getDeviceAdvancedLogs
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-id"
        - $ref: "#/parameters/limit"
        - $ref: "#/parameters/from-timestamp"
        - $ref: "#/parameters/use-store-time-zone"
        - in: query
          name: message
          required: false
          type: string
        - in: query
          name: log-level
          required: false
          type: string
          #Since it's a query param, we need to use a duplicated enum (not the object in definitions). Will probably change in OpenApi 3.0.
          #https://stackoverflow.com/questions/32255384/swagger-reusing-an-enum-definition-as-query-parameter
          enum:
            - VERBOSE
            - DEBUG
            - INFO
            - WARN
            - ERROR
            - TURNED_OFF
            - ROGUE
            - EVENT
        - in: query
          name: code
          required: false
          type: integer
          format: int64
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetDeviceAdvancedLogsResponse"
  /affiliates/{affiliate-id}/device-preparation-data:
    get:
      tags:
        - Device
      summary: Returns the device preparation data.
      operationId: getDevicePreparationData
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
        - in: query
          name: product-id
          required: false
          type: integer
          format: int64
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/GetDevicePreparationDataResponse"
  /device-tasks:
    post:
      tags:
        - Device
      summary: Creates a task to handle actions on device list.
      operationId: createDeviceTask
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: body
          name: device-task
          required: true
          schema:
            $ref: "./device-definitions.yaml#/definitions/DeviceTask"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetTaskResponse"
  /outputs/{output-id}:
    put:
      tags:
        - Device
      summary: Updates the station playing on a given output.
      operationId: updateDeviceOutput
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/output-id"
        - in: body
          name: updated-output
          required: true
          schema:
            $ref: "./device-definitions.yaml#/definitions/DeviceOutputUpdateInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /device-configurations/{device-configuration-id}:
    get:
      tags:
        - Device
      summary: Returns the given device configuration.
      operationId: getDeviceConfiguration
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-configuration-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/GetDeviceConfigurationResponse"
    put:
      tags:
        - Device
      summary: Updates the given device configuration.
      operationId: updateDeviceConfiguration
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-configuration-id"
        - in: body
          name: device-configuration
          required: true
          schema:
            $ref: "./device-definitions.yaml#/definitions/DeviceConfigurationUpdate"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/GetDeviceConfigurationResponse"
  /device-configurations/{device-configuration-id}/video-configuration:
    put:
      tags:
        - Device
      summary: Updates the video config of the given device configuration.
      operationId: updateVideoConfiguration
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-configuration-id"
        - in: body
          name: video-config
          required: true
          schema:
            $ref: "./device-definitions.yaml#/definitions/DeviceVideoConfig"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/GetDeviceVideoConfigResponse"
  /device-configurations/{device-configuration-id}/network-configuration:
    get:
      tags:
        - Device
      summary: Returns the device configuration's network configuration.
      operationId: getDeviceNetworkConfiguration
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-configuration-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetNetworkConfigurationResponse"
    put:
      tags:
        - Device
      summary: Updates the device configuration's network configuration.
      operationId: updateDeviceNetworkConfiguration
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-configuration-id"
        - in: body
          name: updated-network-config
          required: true
          schema:
            #TODO: Refactor to use NetworkConfig core if front end doesn't have access to the ID
            $ref: "./definitions.yaml#/definitions/NetworkConfig"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetNetworkConfigurationResponse"
  /device-configurations/{device-configuration-id}/audio-configuration:
    put:
      tags:
        - Device
      summary: Updates the audio configuration of the given device configuration.
      operationId: updateAudioConfiguration
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-configuration-id"
        - in: body
          name: audio-config
          required: true
          schema:
            $ref: "./device-definitions.yaml#/definitions/DeviceAudioConfig"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/GetDeviceAudioConfigResponse"
  /device-configurations/{device-configuration-id}/audio-monitoring-configuration:
    put:
      tags:
        - Device
      summary: Updates the audio monitoring configuration of the given device configuration.
      operationId: updateAudioMonitoringConfiguration
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-configuration-id"
        - in: body
          name: audio-monitoring-configuration-update
          required: true
          schema:
            $ref: "./device-definitions.yaml#/definitions/AudioMonitoringConfigurationUpdate"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/AudioMonitoringConfigurationResponse"
  /device-configurations/{device-configuration-id}/outputs-configuration:
    put:
      tags:
        - Device
      summary: Updates the configuration of the given device configuration's outputs.
      operationId: updateOutputsConfig
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-configuration-id"
        - in: body
          name: outputs-config
          required: true
          schema:
            $ref: "./device-definitions.yaml#/definitions/DeviceOutputsConfig"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/GetDeviceOutputsResponse"
  /device-configurations/{device-configuration-id}/device-menu-access-rights:
    put:
      tags:
        - Device
      summary: Updates the menu access rights of the given device configuration.
      operationId: updateDeviceMenuAccessRights
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-configuration-id"
        - in: body
          name: device-menu-access-info
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/DeviceMenuAccessRights"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/GetDeviceMenuAccessRightsResponse"
  /maintenance-devices/{device-id}:
    get:
      tags:
        - Device
      summary: Returns a device formatted for the maintenance grid.
      operationId: getMaintenanceDevice
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/GetMaintenanceDeviceResponse"
  /maintenance-devices:
    get:
      tags:
        - Device
      summary: Returns all devices in the system formatted for the maintenance grid.
      operationId: getMaintenanceDevices
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: query
          name: affiliate-id
          required: true
          type: integer
          format: int64
        - in: query
          name: fetch-active-devices
          required: true
          default: true
          type: boolean
        - in: query
          name: fetch-inactive-devices
          required: true
          default: false
          type: boolean
      responses:
        200:
          description: OK
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/GetMaintenanceDevicesResponse"
  /device-metrics-snapshots:
    get:
      tags:
        - Device
      summary: Returns daily device metrics snapshots for the affiliate.
      operationId: getDeviceMetricsSnapshots
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: query
          name: affiliate-id
          required: true
          type: integer
          format: int64
        - in: query
          name: days-ago
          required: false
          type: integer
          format: int32
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/GetDeviceMetricsSnapshotsResponse"
  /device-metric-snapshot:
    get:
      tags:
        - Device
      summary: Returns a single daily device metric snapshot.
      operationId: getDeviceMetricSnapshot
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: query
          name: device-id
          required: true
          type: integer
          format: int64
        - in: query
          name: days-ago
          required: false
          type: integer
          format: int32
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/GetDeviceMetricsSnapshotResponse"
  /current-persistent-weights-reset:
    post:
      tags:
        - Device
      summary: Resets the persistent weights in current device metrics snapshots.
      operationId: resetCurrentDeviceMetricsSnapshotsPersistentWeights
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: query
          name: device-metrics-snapshot-ids
          required: true
          type: array
          items:
            type: integer
            format: int64
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /devices/{device-id}/device-metrics-snapshots-history:
    get:
      tags:
        - Device
      summary: Returns history of device metrics snapshots for the device.
      operationId: getDeviceMetricsSnapshotsHistory
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/GetDeviceMetricsSnapshotsResponse"
  /device-monitoring-configuration:
    get:
      tags:
        - Device
      summary: Returns the device monitoring configuration info.
      operationId: getDeviceMonitoringConfiguration
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/GetDeviceMonitoringConfigurationResponse"
    put:
      tags:
        - Device
      summary: Updates the device monitoring configuration info.
      operationId: updateDeviceMonitoringConfiguration
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: body
          name: device-monitoring-configuration-update
          required: true
          schema:
            $ref: "./device-definitions.yaml#/definitions/DeviceMonitoringConfigurationCore"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/GetDeviceMonitoringConfigurationResponse"
  /device-error-log-classification-rules:
    get:
      tags:
        - Device
      summary: Returns all error log classification rules.
      operationId: getDeviceErrorLogClassificationRules
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/GetDeviceErrorLogClassificationRulesResponse"
    post:
      tags:
        - Device
      summary: Adds a new device error log classification rule.
      operationId: addDeviceErrorLogClassificationRule
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: body
          name: device-error-log-classification-rule
          required: true
          schema:
            $ref: "./device-definitions.yaml#/definitions/DeviceErrorLogClassificationRuleCore"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/GetDeviceErrorLogClassificationRuleResponse"
  /device-error-log-classification-rules/{device-error-log-classification-rule-id}:
    put:
      tags:
        - Device
      summary: Updates a device error log classification rule.
      operationId: updateDeviceErrorLogClassificationRule
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-error-log-classification-rule-id"
        - in: body
          name: device-error-log-classification-rule-update
          required: true
          schema:
            $ref: "./device-definitions.yaml#/definitions/DeviceErrorLogClassificationRuleCore"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/GetDeviceErrorLogClassificationRuleResponse"
    delete:
      tags:
        - Device
      summary: Deletes a device error log classification rule.
      operationId: deleteDeviceErrorLogClassificationRule
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-error-log-classification-rule-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /devices/external/{device-external-id}:
    get:
      tags:
        - Device
      summary: Returns a device.
      operationId: getBasicDeviceUsingExternalId
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-external-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/GetBasicDeviceResponse"
  /devices/{device-id}:
    get:
      tags:
        - Device
      summary: Returns a device.
      operationId: getDevice
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/GetDeviceResponse"
    put:
      tags:
        - Device
      summary: Updates a device.
      operationId: updateDevice
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-id"
        - in: body
          name: device-update
          required: true
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/DeviceUpdate"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /devices/{device-id}/audio-tests:
    get:
      tags:
        - Device
      summary: Returns a list of all audio tests for a given device.
      operationId: getAudioTests
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/AudioTestsResponse"
    post:
      tags:
        - Device
      summary: Creates an audio test for the given device.
      operationId: createAudioTest
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-id"
        - in: body
          name: new-audio-test
          required: true
          schema:
            $ref: "./device-definitions.yaml#/definitions/NewAudioTest"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/AudioTestResponse"
  /devices/{device-id}/audio-analyses:
    get:
      tags:
        - Device
      summary: Returns the audio analyses for the given device id.
      operationId: getAudioAnalyses
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-id"
        - $ref: "#/parameters/limit"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/AudioAnalysesResponse"
  /analyses/{audio-analysis-id}/audio-analysis-artifacts:
    get:
      tags:
        - Device
      summary: Returns the audio analysis artifacts for the given audio analysis id.
      operationId: getAudioAnalysisArtifacts
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/audio-analysis-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/AudioAnalysisArtifactsResponse"
  /devices/{device-id}/latest-audio-tests/{test-type}:
    get:
      tags:
        - Device
      summary: Returns the latest audio test for a given device and for a given type.
      operationId: getLatestAudioTest
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-id"
        - in: path
          name: test-type
          required: true
          type: string
          #          #Since it's a query param, we need to use a duplicated enum (not the object in definitions). Will probably change in OpenApi 3.0.
          #          #https://stackoverflow.com/questions/32255384/swagger-reusing-an-enum-definition-as-query-parameter
          enum:
            - SILENCE
            - MUSIC
            - MESSAGE
            - MESSAGE_GAIN
            - CUSTOM
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/AudioTestResponse"
  /message-audio-test-approvals/{audio-test-id}:
    post:
      tags:
        - Device
      summary: Approves an audio test of type MESSAGE.
      operationId: approveMessageAudioTest
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/audio-test-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /audio-tests/{audio-test-id}:
    put:
      tags:
        - Device
      summary: Updates an audio test.
      operationId: updateAudioTest
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/audio-test-id"
        - in: body
          name: audio-test-update
          required: true
          schema:
            $ref: "./device-definitions.yaml#/definitions/AudioTestUpdate"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/AudioTestResponse"
  /basic-devices/{device-id}:
    get:
      tags:
        - Device
      summary: Returns a basic device.
      operationId: getBasicDevice
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/GetBasicDeviceResponse"
  /devices/{device-id}/lifecycle-events:
    get:
      tags:
        - Device
      summary: Returns all lifecycle events of the given device.
      operationId: getDeviceActivityLifecycleEvents
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/GetLifecycleEventsResponse"
  /devices/{device-external-id}/current-playout-status-report:
    get:
      tags:
        - Device
      summary: Returns if the device is supposed to be playing right now based on the player playback schedules.
      operationId: getDeviceCurrentPlayoutStatusReport
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-external-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/PlayoutStatusReportResponse"
  /devices/{device-id}/sync-state-snapshots:
    get:
      tags:
        - Device
      summary: Returns a list of sync state snapshots for the given device.
      operationId: getDeviceSyncStateSnapshots
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetGenericPairsResponse"
  /state-snapshots/{sync-state-snapshot-id}:
    get:
      tags:
        - Device
      summary: Returns the sync state snapshot info for the given id.
      operationId: getSyncStateSnapshot
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: path
          name: sync-state-snapshot-id
          required: true
          type: integer
          format: int64
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetSyncStateSnapshotResponse"
  # TODO FIX TAG MISMATCH
  /devices-software:
    post:
      tags:
        - Device
      summary: Pushes requested software to selected devices if they are connected.
      operationId: pushDevicesSoftware
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: body
          name: device-software-push
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/DeviceSoftwarePushInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/GetDeviceSoftwarePushBatchOperationResponse"
    get:
      tags:
        - System
      summary: Returns all device software.
      operationId: getDeviceSoftwareList
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: query
          name: deprecated
          required: false
          type: boolean
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetDeviceSoftwareListResponse"
  /device-meta-grid-rows:
    get:
      tags:
        - Device
      summary: Returns meta grid row information.
      operationId: getMetaGridRows
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: '#/parameters/affiliate-ids'
        - $ref: '#/parameters/brand-names'
        - $ref: '#/parameters/store-names'
        - $ref: '#/parameters/store-admin-tags'
        - $ref: '#/parameters/device-external-ids'
        - $ref: '#/parameters/fetch-active-devices'
        - $ref: '#/parameters/fetch-inactive-devices'
        - $ref: '#/parameters/log-levels'
        - $ref: '#/parameters/connection-status'
        - $ref: '#/parameters/player-software-ids'
        - $ref: '#/parameters/retrieve-requested-software'
        - $ref: '#/parameters/retrieve-monitoring-data'
        - $ref: '#/parameters/days-ago'
      responses:
        200:
          description: OK
          schema:
            $ref: "./meta-definitions.yaml#/definitions/GetMetaGridRowsResponse"
  /device-meta-grid-row:
    get:
      tags:
        - Device
      summary: Returns meta grid single row information.
      operationId: getMetaGridRow
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: query
          name: device-id
          required: true
          type: integer
          format: int64
        - $ref: '#/parameters/retrieve-requested-software'
        - $ref: '#/parameters/retrieve-monitoring-data'
        - $ref: '#/parameters/days-ago'
      responses:
        200:
          description: OK
          schema:
            $ref: "./meta-definitions.yaml#/definitions/GetMetaGridRowResponse"
  /devices/{device-id}/ad-requests:
    get:
      tags:
        - Device
      summary: Returns the ad requests for the given device id.
      operationId: getAdRequests
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-id"
        - $ref: "#/parameters/limit"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/AdRequestsResponse"

  #### DEPLOYMENT ####
  /deployment-requests/{deployment-request-id}/sbaby-preparation:
    get:
      tags:
        - Deployment
      summary: Returns the preparation info for a deployment request.
      operationId: getSBabyPreparationInfo
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/deployment-request-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/GetCommonPreparationInfoResponse"
    post:
      tags:
        - Deployment
      summary: Assigns an SBaby to the given deployment request.
      operationId: prepareSBabyDeploymentRequest
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/deployment-request-id"
        - in: body
          name: sbaby-deployment-request-preparation-info
          required: true
          schema:
            $ref: "./device-definitions.yaml#/definitions/SBabyDeploymentRequestsPreparationInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/GetDeploymentRequestResponse"
  /affiliates/{affiliate-id}/deployment-request-preparations:
    post:
      tags:
        - Deployment
      summary: Prepares the given deployment requests.
      operationId: prepareDeploymentRequests
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
        - in: body
          name: deployment-request-preparation-info
          required: true
          schema:
            $ref: "./device-definitions.yaml#/definitions/DeploymentRequestsPreparationInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/GetBatchOperationResponse"
  /affiliates/{affiliate-id}/deployment-request-shipments:
    post:
      tags:
        - Deployment
      summary: Reships the given deployment request. Usually shipped by default when prepared.
      operationId: shipDeploymentRequests
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
        - in: body
          name: deployment-requests-shipment-info
          required: true
          schema:
            $ref: "./device-definitions.yaml#/definitions/DeploymentRequestsShipmentInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/GetBatchOperationResponse"
  /stores/{store-id}/deployment-requests:
    post:
      tags:
        - Deployment
      summary: Creates a new deployment request.
      operationId: createStoreDeploymentRequest
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/store-id"
        - in: body
          name: new-deployment-request
          required: true
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/NewDeploymentRequest"
      responses:
        200:
          description: OK
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/GetDeploymentRequestResponse"
  /deployment-requests:
    get:
      tags:
        - Deployment
      summary: Returns all deployment requests in the system.
      operationId: getDeploymentRequests
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: query
          name: affiliate-id
          required: true
          type: integer
          format: int64
        - in: query
          name: wanted-statuses
          required: true
          type: array
          #TODO: Duplication of existing enum, impossible to use in OpenApi 2.0
          items:
            type: string
            enum:
              - New
              - Pending
              - Prepared
              - Printed
              - Tested
              - Completed
              - Cancelled
              - Promoted
              - Assigned
              - Ready
              - Packaged
              - Pairing
              - Paired
      responses:
        200:
          description: OK
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/GetDeploymentRequestsResponse"
    put:
      tags:
        - Deployment
      summary: Updates a list of deployment requests.
      operationId: updateDeploymentRequests
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: query
          name: affiliate-id
          required: true
          type: integer
          format: int64
        - in: body
          name: deployment-request-update
          required: true
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/MultiDeploymentRequestUpdate"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/GetBatchOperationResponse"
  /deployment-requests/{deployment-request-id}:
    get:
      tags:
        - Deployment
      summary: Returns the given deployment request.
      operationId: getDeploymentRequest
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/deployment-request-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/GetDeploymentRequestResponse"
  /return-requests:
    get:
      tags:
        - Deployment
      summary: Returns all return requests in the system.
      operationId: getReturnRequests
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: query
          name: affiliate-id
          required: true
          type: integer
          format: int64
        - in: query
          name: wanted-statuses
          required: true
          type: array
          #TODO: Duplication of existing enum, impossible to use in OpenApi 2.0
          items:
            type: string
            enum:
              - New
              - Received
              - Processed
              - Cancelled
      responses:
        200:
          description: OK
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/GetReturnRequestsResponse"
    put:
      tags:
        - Deployment
      summary: Updates a list of return requests.
      operationId: updateReturnRequests
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: query
          name: affiliate-id
          required: true
          type: integer
          format: int64
        - in: body
          name: return-request-update
          required: true
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/MultiReturnRequestUpdate"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/GetBatchOperationResponse"
  /return-requests/{return-request-id}:
    get:
      tags:
        - Deployment
      summary: Returns the given return request.
      operationId: getReturnRequest
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/return-request-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/GetReturnRequestResponse"
    put:
      tags:
        - Deployment
      summary: Updates the given return request.
      operationId: updateReturnRequest
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/return-request-id"
        - in: body
          name: return-request-update
          required: true
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/ReturnRequestUpdate"
      responses:
        200:
          description: OK
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/GetReturnRequestResponse"
  /devices/{device-id}/return-requests:
    post:
      tags:
        - Deployment
      summary: Creates a return request for the given device.
      operationId: createDeviceReturnRequest
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-id"
        - in: body
          name: new-return-request
          required: true
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/NewReturnRequest"
      responses:
        200:
          description: OK
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/GetReturnRequestResponse"
  /devices/{device-id}/replacement-requests:
    post:
      tags:
        - Deployment
      summary: Creates a replacement request for the given device.
      operationId: createDeviceReplacementRequest
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-id"
        - in: body
          name: new-replacement-request
          required: true
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/NewReplacementRequest"
      responses:
        200:
          description: OK
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/GetReplacementRequestResponse"
  /devices/{device-id}/reassignment-requests:
    post:
      tags:
        - Deployment
      summary: Creates a reassignment request for the given device.
      operationId: createDeviceReassignmentRequest
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-id"
        - in: body
          name: new-reassignment-request
          required: true
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/NewReassignmentRequest"
      responses:
        200:
          description: OK
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/GetReassignmentRequestResponse"
  /replacement-requests:
    get:
      tags:
        - Deployment
      summary: Returns all replacement requests in the system.
      operationId: getReplacementRequests
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: query
          name: affiliate-id
          required: true
          type: integer
          format: int64
        - in: query
          name: wanted-statuses
          required: true
          type: array
          #TODO: Duplication of existing enum, impossible to use in OpenApi 2.0
          items:
            type: string
            enum:
              - New
              - InProgress
              - Completed
              - Cancelled
      responses:
        200:
          description: OK
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/GetReplacementRequestsResponse"
  /replacement-requests/{replacement-request-id}:
    get:
      tags:
        - Deployment
      summary: Returns the given replacement request.
      operationId: getReplacementRequest
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/replacement-request-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/GetReplacementRequestResponse"
    put:
      tags:
        - Deployment
      summary: Updates the given replacement request.
      operationId: updateReplacementRequest
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/replacement-request-id"
        - in: body
          name: replacement-request-update
          required: true
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/ReplacementRequestUpdate"
      responses:
        200:
          description: OK
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/GetReplacementRequestResponse"
  /reassignment-requests:
    get:
      tags:
        - Deployment
      summary: Returns all reassignments requests in the system.
      operationId: getReassignmentRequests
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: query
          name: affiliate-id
          required: true
          type: integer
          format: int64
        - in: query
          name: wanted-statuses
          required: true
          type: array
          #TODO: Duplication of existing enum, impossible to use in OpenApi 2.0
          items:
            type: string
            enum:
              - New
              - Accepted
              - Reviewed
              - InProgress
              - Reassigned
              - Completed
              - Cancelled
      responses:
        200:
          description: OK
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/GetReassignmentRequestsResponse"
  /reassignment-requests/{reassignment-request-id}:
    get:
      tags:
        - Deployment
      summary: Returns the given reassignment request.
      operationId: getReassignmentRequest
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/reassignment-request-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/GetReassignmentRequestResponse"
    put:
      tags:
        - Deployment
      summary: Updates the given reassignment request.
      operationId: updateReassignmentRequest
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/reassignment-request-id"
        - in: body
          name: reassignment-request-update
          required: true
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/ReassignmentRequestUpdate"
      responses:
        200:
          description: OK
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/GetReassignmentRequestResponse"
  /affiliates/{affiliate-id}/reassignment-requests:
    put:
      tags:
        - Deployment
      summary: Updates a list of reassignment requests in an affiliate.
      operationId: updateReassignmentRequests
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
        - in: body
          name: reassignment-request-update
          required: true
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/MultiReassignmentRequestUpdate"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/GetBatchOperationResponse"
  /deployment-request/{deployment-request-id}/lifecycle-events:
    get:
      tags:
        - Deployment
      summary: Returns all lifecycle events of the given deployment request.
      operationId: getDeploymentRequestLifecycleEvents
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/deployment-request-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/GetLifecycleEventsResponse"
  /return-request/{return-request-id}/lifecycle-events:
    get:
      tags:
        - Deployment
      summary: Returns all lifecycle events of the given return request.
      operationId: getReturnRequestLifecycleEvents
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/return-request-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/GetLifecycleEventsResponse"
  /replacement-request/{replacement-request-id}/lifecycle-events:
    get:
      tags:
        - Deployment
      summary: Returns all lifecycle events of the given replacement request.
      operationId: getReplacementRequestLifecycleEvents
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/replacement-request-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/GetLifecycleEventsResponse"
  /reassignment-request/{reassignment-request-id}/lifecycle-events:
    get:
      tags:
        - Deployment
      summary: Returns all lifecycle events of the given reassignment request.
      operationId: getReassignmentRequestLifecycleEvents
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/reassignment-request-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/GetLifecycleEventsResponse"
  /work-orders/{work-order-id}:
    get:
      tags:
        - Deployment
      summary: Returns the given work order.
      operationId: getWorkOrder
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/work-order-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/GetWorkOrderResponse"
    put:
      tags:
        - Deployment
      summary: Updates the given work order.
      operationId: updateWorkOrder
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/work-order-id"
        - in: body
          name: work-order-update
          required: true
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/WorkOrderUpdate"
      responses:
        200:
          description: OK
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/GetWorkOrderResponse"
  /return-requests/{return-request-id}/return-analysis:
    delete:
      tags:
        - Deployment
      summary: Deletes the analysis result of the given return request.
      operationId: deleteReturnRequestReturnAnalysis
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/return-request-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/GetReturnRequestResponse"
  /deployment-requests/{deployment-request-id}/status:
    put:
      tags:
        - Deployment
      summary: Updates the status for a given deployment request.
      operationId: updateDeploymentRequestStatus
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/deployment-request-id"
        - in: query
          name: deployment-request-status
          required: true
          type: string
          enum:
            - NEW
            - PENDING
            - PREPARED
            - PRINTED
            - TESTED
            - COMPLETED
            - CANCELLED
            - PROMOTED
            - ASSIGNED
            - READY
            - PACKAGED
            - PAIRING
            - PAIRED
      responses:
        200:
          description: OK
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/GetDeploymentRequestResponse"

#### SHIPPING ####
  /devices/{deployment-request-id}/print-device-request:
    get:
      tags:
        - Shipping
      summary: Returns the info needed to print the device and the label for the shipping.
      operationId: getPrintRequestInfo
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/deployment-request-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/GetDevicePrintRequestInfoResponse"
    put:
      tags:
        - Shipping
      summary: Updates the status of a device and returns the info needed to print the device and its labels for shipping.
      operationId: requestPrintDevice
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/deployment-request-id"
        - $ref: "#/parameters/empty-body"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/GetDevicePrintRequestInfoResponse"
  /devices/{device-id}/basic-shipping-label:
    get:
      tags:
        - Shipping
      summary: Returns a basic shipping label.
      operationId: getBasicShippingLabel
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBasicShippingLabelResponse"
  /brands/{brand-id}/shipping-groups:
    get:
      tags:
        - Shipping
      summary: Returns the shipping groups of the given brand.
      operationId: getBrandShippingGroups
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetShippingGroupsResponse"
    post:
      tags:
        - Shipping
      summary: Creates a new shipping group in the given brand.
      operationId: createShippingGroup
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: body
          name: new-shipping-group
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/NewShippingGroup"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetShippingGroupsResponse"
  /shipping-groups/{shipping-group-id}:
    put:
      tags:
        - Shipping
      summary: Updates a given shipping group.
      operationId: updateShippingGroup
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/shipping-group-id"
        - in: body
          name: new-shipping-group
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/NewShippingGroup"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetShippingGroupsResponse"
  /shipping-groups/{shipping-group-id}/shipping-info-list:
    get:
      tags:
        - Shipping
      summary: Returns the shipping info list for the given shipping group.
      operationId: getShippingGroupShippingInfoList
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/shipping-group-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetShippingInfoListResponse"
  /shipping-usb-updates/{shipping-usb-update-id}/stores:
    put:
      tags:
        - Shipping
      summary: Updates the stores linked to a given shipping usb update.
      operationId: updateShippingUsbUpdateLinkedStores
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/shipping-usb-update-id"
        - in: body
          name: shipping-usb-update-linked-stores-info
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/ShippingUsbUpdateLinkedStoresInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/UpdateShippingUsbUpdateLinkedStoresResponse"
  /brands/{brand-id}/addresses/{address-id}/shipping-info-list:
    get:
      tags:
        - Shipping
      summary: Returns the shipping info list for the given address.
      operationId: getAddressShippingInfoList
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - $ref: "#/parameters/address-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetShippingInfoListResponse"
  /stores/{store-id}/shipping-info-list:
    get:
      tags:
        - Shipping
      summary: Returns the shipping info list for the given store.
      operationId: getStoreShippingInfoList
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/store-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetShippingInfoListResponse"
  /affiliates/{affiliate-id}/shipping-info-list:
    post:
      tags:
        - Shipping
      summary: Creates a shipping info.
      operationId: createShippingInfo
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
        - in: body
          name: new-shipping-info
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/NewShippingInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetShippingInfoResponse"
  /affiliates/{affiliate-id}/shipping-info-list/{shipping-info-id}:
    get:
      tags:
        - Shipping
      summary: Returns the given shipping info.
      operationId: getShippingInfo
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
        - in: path
          name: shipping-info-id
          required: true
          type: integer
          format: int64
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetShippingInfoResponse"
  /affiliates/{affiliate-id}/addresses/{address-id}/basic-shipping-label:
    get:
      tags:
        - Shipping
      summary: Returns the basic shipping label for the given affiliate/address pair.
      operationId: getAddressBasicShippingLabel
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
        - $ref: "#/parameters/address-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBasicShippingLabelResponse"
  /devices/{device-external-id}/fedex-label:
    put:
      tags:
        - Shipping
      summary: Updates the status of a device and returns the info needed to print the device and its labels for shipping.
      operationId: refreshFedexLabel
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-external-id"
        - $ref: "#/parameters/empty-body"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/GetDevicePrintRequestInfoResponse"
  /deployment/update-related-jira-issue-key:
    put:
      tags:
        - Shipping
      summary: Updates the related jira issue key of a device's shipping info.
      operationId: updateRelatedJiraIssueKey
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: body
          name: update-related-jira-issue-key-info
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/UpdateRelatedJiraIssueKeyInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /brands/{brand-id}/shipping-addresses:
    get:
      tags:
        - Shipping
      summary: Returns the shipping addresses of the given brand.
      operationId: getBrandShippingAddresses
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetShippingAddressesResponse"
    post:
      tags:
        #TODO: Maybe move this to Shipping?
        - Brand
      summary: Creates and assigns a shipping address to the given brand.
      operationId: addShippingAddress
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: body
          name: new-shipping-address
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/AddressCore"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetAddressResponse"
  /products/{product-id}/shipping-usb-updates:
    get:
      tags:
        #TODO: Maybe move this to shipping controller
        - Shipping
      summary: Returns all available shipping usb updates.
      operationId: getProductShippingUsbUpdates
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/product-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetGenericPairsResponse"
    post:
      tags:
        - Shipping
      summary: Creates a new shipping usb update for the product.
      operationId: createProductShippingUsbUpdate
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/product-id"
        - in: body
          name: shipping-usb-update
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/ShippingUsbUpdate"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /deployment/refresh-fedex-tracking-statuses:
    put:
      tags:
        - Shipping
      summary: Updates the related FedEx tracking status for the given deployment requests.
      operationId: refreshFedexTrackingStatuses
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: body
          name: refresh-fedex-tracking-statuses-info
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/RefreshFedexTrackingStatusesInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"

#### ZONE ####
  /brands/{brand-id}/zones:
    get:
      tags:
        - Zone
      summary: Returns a list of zones for the given brand.
      operationId: getBrandZones
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetZonesResponse"
    post:
      tags:
        - Zone
      summary: Adds a zone to the given brand.
      operationId: addZoneToBrand
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: body
          name: new-zone
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/ZoneCore"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetZoneResponse"
  /zones/{zone-id}:
    put:
      tags:
        - Zone
      summary: Updates a given zone.
      operationId: updateZone
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/zone-id"
        - in: body
          name: updated-zone
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/ZoneCore"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetZoneResponse"
    delete:
      tags:
        - Zone
      summary: Deletes a given zone.
      operationId: deleteZone
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/zone-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetZonesResponse"

#### SYSTEM ####
  /config-formats:
    get:
      tags:
        - System
      summary: Returns all available config formats in the system.
      operationId: getConfigFormats
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetGenericPairsResponse"
  /software-dependencies:
    post:
      tags:
        - System
      summary: Updates the dependencies of a software.
      operationId: updateSoftwareDependencies
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: body
          name: software-dependency-info
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/SoftwareDependencyInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /deprecated-files:
    post:
      tags:
        - System
      summary: Upload files to the system. This is legacy call that will eventually be removed.
      operationId: deprecatedUploadFile
      security:
        - accessToken: [ defaultScope ]
      consumes:
        - multipart/form-data
      parameters:
        - in: formData
          name: file-to-upload
          required: true
          type: file
        - in: formData
          name: path
          required: true
          type: string
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetDeprecatedFilesResponse"
  /files:
    post:
      tags:
        - System
      summary: Uploads files to the system.
      operationId: uploadFile
      security:
        - accessToken: [ defaultScope ]
      consumes:
        - multipart/form-data
      parameters:
        - in: formData
          name: file-to-upload
          required: true
          type: file
        - in: formData
          name: file-type
          required: true
          type: string
          enum:
            - genericAlbumCoverLarge
            - genericAlbumCoverSmall
            - genericClaperBrandFolderContent
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /interface-types:
    get:
      tags:
        - System
      summary: Returns all available interface types in the system.
      operationId: getInterfaceTypes
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetEnumPairsResponse"
  /authentication-types:
    get:
      tags:
        - System
      summary: Returns all available authentication types in the system.
      operationId: getAuthenticationTypes
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetEnumPairsResponse"
  /task-logs:
    get:
      tags:
        - System
      summary: Returns all task logs for the system.
      operationId: getTaskLogs
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetTaskLogsResponse"
  /task-logs/{task-id}:
    delete:
      tags:
        - System
      summary: Removes the given task log.
      operationId: removeTaskLog
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/task-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /task-logs-cleanup:
    post:
      tags:
        - System
      summary: Removes irrelevant task logs from the system.
      operationId: removeIrrelevantTaskLogs
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /logs:
    get:
      tags:
        - System
      summary: Returns the system logs.
      operationId: getLogs
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/limit"
        - $ref: "#/parameters/from-timestamp"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetSystemLogsResponse"
  /user-rights-roles:
    get:
      tags:
        - System
      summary: Returns the user rights roles for the system.
      operationId: getUserRightsRoles
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetUserRightsRolesResponse"
  /user-rights-roles/{user-rights-role-id}:
    get:
      tags:
        - System
      summary: Returns a single user rights role.
      operationId: getUserRightsRole
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/user-rights-role-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetUserRightsRoleResponse"
  /user-rights-permissions:
    get:
      tags:
        - System
      summary: Returns the requested permissions.
      operationId: getUserRightsPermissionDetailedEntries
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: query
          type: integer
          format: int64
          name: user-rights-role-id
          required: true
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetUserRightsPermissionDetailedEntriesResponse"
    put:
      tags:
        - System
      summary: Updates a user rights permission. Not available unless activated on special occasions.
      operationId: updateUserRightsPermission
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: body
          name: updated-user-rights-role-permission
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/UserRightsPermission"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /user-rights-role-assignments:
    get:
      tags:
        - System
      summary: Gets all user rights role assignments.
      operationId: getUserRightsRoleAssignments
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetUserRightsRoleAssignmentsResponse"
    post:
      tags:
        - System
      summary: Assigns roles to users.
      operationId: assignSystemRoles
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: body
          name: role-assignments
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/RoleAssignments"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
    delete:
      tags:
        - System
      summary: Revokes roles to user.
      operationId: revokeSystemRoles
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: query
          name: target-instance-ids
          required: true
          type: array
          items:
            type: integer
            format: int64
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /clap-bucket-urls/{public-key}:
    get:
      tags:
        - System
      summary: Returns a clap bucket URL for the given public key.
      operationId: getClapBucketUrl
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: path
          name: public-key
          required: true
          type: string
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetStringResponse"
  /return-analysis-statuses:
    get:
      tags:
        - System
      summary: Returns all available statuses for a device return.
      operationId: getReturnAnalysisStatuses
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetReturnAnalysisStatusesResponse"
    post:
      tags:
        - System
      summary: Adds a return analysis status.
      operationId: addReturnAnalysisStatus
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: body
          name: new-return-analysis-status
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/ReturnAnalysisStatusCore"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetReturnAnalysisStatusResponse"
  /return-analysis-statuses/{return-analysis-status-id}:
    put:
      tags:
        - System
      summary: Edits a return analysis status.
      operationId: editReturnAnalysisStatus
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/return-analysis-status-id"
        - in: body
          name: updated-return-analysis-status
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/ReturnAnalysisStatusCore"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetReturnAnalysisStatusResponse"
    delete:
      tags:
        - System
      summary: Deletes a return analysis status.
      operationId: deleteReturnAnalysisStatus
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/return-analysis-status-id"
        - in: query
          name: return-status-type
          required: true
          type: string
          #Since it's a query param, we need to use a duplicated enum (not the object in definitions). Will probably change in OpenApi 3.0.
          #https://stackoverflow.com/questions/32255384/swagger-reusing-an-enum-definition-as-query-parameter
          enum:
            - DeviceHardwareStatus
            - DeviceSoftwareStatus
            - StorageHardwareStatus
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /device-hardware-statuses:
    get:
      tags:
        - System
      summary: Returns all device hardware statuses.
      operationId: getDeviceHardwareStatuses
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetGenericPairsResponse"
  /device-software-statuses:
    get:
      tags:
        - System
      summary: Returns all device software statuses.
      operationId: getDeviceSoftwareStatuses
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetGenericPairsResponse"
  /storage-hardware-status:
    get:
      tags:
        - System
      summary: Returns all storage hardware statuses.
      operationId: getStorageHardwareStatuses
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetGenericPairsResponse"
  /store-statuses:
    get:
      tags:
        - System
      summary: Returns all available store statuses.
      operationId: getStoreStatuses
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetEnumPairsResponse"
  /store-content-update-types:
    get:
      tags:
        - System
      summary: Returns all available content update types.
      operationId: getStoreContentUpdateTypes
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetEnumPairsResponse"
  /url-styles:
    get:
      tags:
        - System
      summary: Retrieves all available url styles.
      operationId: getUrlStyles
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetEnumPairsResponse"
  /software/{software-id}:
    put:
      tags:
        - System
      summary: Edits a device software.
      operationId: editSoftware
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/software-id"
        - in: body
          name: updated-software
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/SoftwareUpdateInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetDeviceSoftwareResponse"
    delete:
      tags:
        - System
      summary: Deletes a software.
      operationId: deleteSoftware
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/software-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /all-software-list:
    get:
      tags:
        - System
      summary: Returns a list of the available software.
      operationId: getAllSoftwareList
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: query
          name: device-software-listing-purpose
          required: true
          type: string
          #Since it's a query param, we need to use a duplicated enum (not the object in definitions). Will probably change in OpenApi 3.0.
          #https://stackoverflow.com/questions/32255384/swagger-reusing-an-enum-definition-as-query-parameter
          enum:
            - SetMaximumSoftwareVersion
            - SelectSoftwareVersion
            - Unspecified
        - in: query
          name: deprecated
          required: false
          type: boolean
          default: false
        - in: query
          name: sbx-tech-id
          required: false
          type: integer
          format: int64
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetAllSoftwareListResponse"
  /device-software-implementations:
    get:
      tags:
        - System
      summary: Returns a list of the available software implementations with their S3 references.
      operationId: getAllDeviceSoftwareImplementationS3Sources
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetAllDeviceSoftwareImplementationS3SourceListResponse"
  /device-software-implementations-file:
    post:
      tags:
        - System
      summary: Uploads device software implementation files to the system from a file.
      operationId: uploadSoftwareImplementationFromFile
      security:
        - accessToken: [ defaultScope ]
      consumes:
        - multipart/form-data
      parameters:
        - in: formData
          name: source-file
          required: true
          type: file
        - in: formData
          name: version
          required: true
          type: string
        - in: formData
          name: configFormat
          required: false
          type: string
        - in: formData
          name: schedulingEngineVersion
          required: false
          type: string
        - in: formData
          name: softwareType
          required: true
          type: string
        - in: formData
          name: label
          required: true
          type: string
        - in: formData
          name: platform
          required: true
          type: string
        - in: formData
          name: fileFormat
          required: true
          type: string
        - in: formData
          name: additionalUpdateSpaceBytes
          required: false
          type: integer
          format: int64
          description: "Additional space on the SB3 to install that software (separate from the space required to download the file itself)."
        - in: formData
          name: incrementalUpdate
          required: false
          type: boolean
          description: "Indicates whether this file an incremental build or not. For now, this can be true only for SB firmware updates."
        - in: formData
          name: defaultVersion
          required: true
          type: boolean
        - in: formData
          name: usePreviousVersionDependencies
          required: true
          type: boolean
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /device-software-implementations-url:
    post:
      tags:
        - System
      summary: Uploads device software implementation files to the system from an URL.
      operationId: uploadSoftwareImplementationFromUrl
      parameters:
        - in: body
          name: deviceSoftwareImplementationUrlSourceUploadData
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/DeviceSoftwareImplementationUrlSourceUploadData"
        - in: header
          name: X-API-Key
          required: true
          type: string
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /device-software-implementations-s3-reference:
    post:
      tags:
        - System
      summary: Uploads device software implementation files to the system from a S3 reference.
      operationId: uploadSoftwareImplementationFromS3Reference
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: body
          name: deviceSoftwareImplementationS3SourceUploadData
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/DeviceSoftwareImplementationS3SourceUploadData"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /software-list:
    get:
      tags:
        - System
      summary: Returns a list of the available software for a given type. Only sbx-tech-id or device-id-list must be provided, not both.
      operationId: getSoftwareList
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: query
          name: software-type
          required: true
          #TODO: Replace this with enum when OpenApi 3.0 is available
          type: string
        - in: query
          name: device-software-listing-purpose
          required: true
          type: string
          #Since it's a query param, we need to use a duplicated enum (not the object in definitions). Will probably change in OpenApi 3.0.
          #https://stackoverflow.com/questions/32255384/swagger-reusing-an-enum-definition-as-query-parameter
          enum:
            - SetMaximumSoftwareVersion
            - SelectSoftwareVersion
            - Unspecified
        - in: query
          name: sbx-tech-id
          required: false
          type: integer
          format: int64
        - in: query
          name: device-id-list
          required: false
          type: array
          items:
            type: integer
            format: int64
        - in: query
          name: include-deprecated
          required: false
          type: boolean
          default: false
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetSoftwareListResponse"
  /default-values:
    get:
      tags:
        - System
      summary: Returns default values of the system.
      operationId: getDefaultValues
      security: [ ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetDefaultValuesResponse"
  /time-zones:
    get:
      tags:
        - System
      summary: Returns all available time zones in the system.
      operationId: getTimeZones
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/TimeZonesResponse"
  /app-current-language:
    get:
      tags:
        - System
      summary: Returns the current application language.
      operationId: getApplicationLanguage
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetStringResponse"
    put:
      tags:
        - System
      summary: Updates the current application language and returns it.
      operationId: updateApplicationLanguage
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: body
          name: application-language
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/ApplicationLanguage"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetStringResponse"
  /default-affiliate-support-info:
    get:
      tags:
        - System
      summary: Returns the default affiliate support info.
      operationId: getDefaultAffiliateSupportInfo
      security: [ ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetAffiliateSupportInfoResponse"
  /version:
    get:
      tags:
        - System
      summary: Returns the current version of Control Site.
      operationId: getVersion
      security: [ ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetStringResponse"
  /csv-creator-info:
    get:
      tags:
        - System
      summary: Returns information about the CSV creator.
      operationId: getCSVCreatorInfo
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetCSVCreatorInfoResponse"
  /industry-types:
    get:
      tags:
        - System
      summary: Returns all industry types in the system.
      operationId: getIndustryTypes
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetIndustryTypesResponse"
  /feature-flags-cache:
    delete:
      tags:
        - System
      summary: Invalidates all entries in the feature flag cache.
      operationId: invalidateFeatureFlagCache
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /feature-flags:
    get:
      tags:
        - System
      summary: Determines if the feature flag is activated.
      operationId: hasFeatureFlag
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: query
          name: feature-flag
          required: true
          type: string
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBooleanResponse"
  /feature-flag-values:
    get:
      tags:
        - System
      summary: Returns the value of the feature flag.
      operationId: getFeatureFlagValue
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: query
          name: feature-flag
          required: true
          type: string
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetStringResponse"
  /device-meta:
    get:
      tags:
        - System
      summary: Returns the device meta.
      operationId: getDeviceMeta
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/GetDeviceMetaResponse"
  /video-configuration-meta:
    get:
      tags:
        - System
      summary: Returns the meta for video configuration.
      operationId: getVideoConfigurationMeta
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/GetVideoConfigurationMetaResponse"
  /audio-configuration-meta:
    get:
      tags:
        - System
      summary: Returns the meta for audio configuration.
      operationId: getAudioConfigurationMeta
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/GetAudioConfigurationMetaResponse"
  /contextual-help-menu-items-view-type/{view-type}:
    get:
      tags:
        - System
      summary: Returns the contextual help menu items for the given view type.
      operationId: getContextualHelpMenuItemsByViewType
      security: [ ]
      parameters:
        - $ref: "#/parameters/view-type"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetContextualHelpMenuItemsResponse"
  /contextual-help-menu-items/{contextual-help-menu-item-id}:
    put:
      tags:
        - System
      summary: Updates the given contextual help menu item. Should only be used by the script updateOnlineHelpMenuItems in the Control Site back-end app.
      operationId: updateContextualHelpMenuItem
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/contextual-help-menu-item-id"
        - in: body
          name: updated-contextual-help-menu-item
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/ContextualHelpMenuItemCore"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetContextualHelpMenuItemResponse"
    delete:
      tags:
        - System
      summary: Deletes a contextual help menu item. Should only be used by the script updateOnlineHelpMenuItems in the Control Site back-end app.
      operationId: deleteContextualHelpMenuItem
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/contextual-help-menu-item-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /contextual-help-menu-items:
    post:
      tags:
        - System
      summary: Creates a contextual help menu item. Should only be used by the script updateOnlineHelpMenuItems in the Control Site back-end app.
      operationId: createContextualHelpMenuItem
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: body
          name: new-contextual-help-menu-item
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/ContextualHelpMenuItem"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetContextualHelpMenuItemResponse"
    delete:
      tags:
        - System
      summary: Deletes all contextual help menu items. Should only be used by the script updateOnlineHelpMenuItems in the Control Site back-end app.
      operationId: deleteAllContextualHelpMenuItems
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /database-powerup:
    post:
      tags:
        - System
      summary: Fills the database with the given number of brands/stores. Can only be called in local by a System Admin.
      operationId: powerUpDatabase
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: query
          name: number-of-parent-companies
          required: false
          default: 5
          type: integer
          format: int32
        - in: query
          name: number-of-brands-per-parent-company
          required: false
          default: 10
          type: integer
          format: int32
        - in: query
          name: number-of-stores-per-brand
          required: false
          default: 500
          type: integer
          format: int32
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /sync-overview-entries:
    get:
      tags:
        - System
      summary: Retrieves all sync overview entries.
      operationId: getSyncOverviewEntries
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/SyncOverviewEntriesResponse"
  /external-authentication-user-cache:
    delete:
      tags:
        - System
      summary: Invalidates an entry in the external authentication user cache for the given user.
      operationId: invalidateExternalAuthenticationCacheForUser
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: query
          name: email
          required: false
          type: string
        - in: query
          name: keycloak-id
          required: false
          type: string
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /retail-media-schedules:
    get:
      tags:
        - System
      summary: Gets all retail media schedules.
      operationId: getRetailMediaSchedules
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetGenericPairsResponse"
  /retail-media-schedules/{retail-media-schedule-id}:
    get:
      tags:
        - System
      summary: Gets a retail media schedule.
      operationId: getRetailMediaSchedule
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/retail-media-schedule-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetRetailMediaScheduleResponse"
  /scheduling-patterns:
    get:
      tags:
        - System
      summary: Returns a list of all scheduling patterns in the Ad Manager.
      operationId: getSchedulingPatterns
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetSchedulingPatternsResponse"

#### OUTPUT ####
  /latest-playouts:
    get:
      tags:
        - Output
      summary: Returns the playouts of the output for the given device.
      operationId: getLatestPlayouts
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: query
          name: output-id
          required: true
          type: integer
          format: int64
        - in: query
          name: device-id
          required: true
          type: integer
          format: int64
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetDevicePlayoutsResponse"
  /outputs/{output-id}/volume-configuration-rms:
    put:
      tags:
        - Output
      summary: Updates a device output's volume configuration's rms.
      operationId: updateVolumeConfigurationRms
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/output-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/VolumeConfigurationResponse"
  /outputs/{output-id}/volume-configuration:
    get:
      tags:
        - Output
      summary: Returns a device output's volume configuration.
      operationId: getVolumeConfiguration
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/output-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/VolumeConfigurationResponse"
    put:
      tags:
        - Output
      summary: Updates a device output's volume configuration.
      operationId: updateVolumeConfiguration
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/output-id"
        - in: body
          name: volume-configuration
          required: true
          schema:
            $ref: "./device-definitions.yaml#/definitions/UpdatedVolumeConfiguration"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/VolumeConfigurationResponse"
  /outputs/{output-id}/volume-configuration-validation:
    post:
      tags:
        - Output
      summary: Validates the volume configuration.
      operationId: validateVolumeConfiguration
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/output-id"
        - in: body
          name: volume-configuration
          required: true
          schema:
            $ref: "./device-definitions.yaml#/definitions/VolumeConfigurationCore"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /outputs/{output-id}/volume-configuration-warnings:
    get:
      tags:
        - Output
      summary: Retrieves warnings related to the volume configuration.
      operationId: getVolumeConfigurationWarnings
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/output-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/VolumeConfigurationWarningsResponse"
  /random-message-request:
    post:
      tags:
        - Output
      summary: Plays a random message on a remote device immediately.
      operationId: playRandomMessageNow
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: query
          name: output-id
          required: true
          type: integer
          format: int64
        - in: query
          name: device-id
          required: true
          type: integer
          format: int64
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /devices/{device-external-id}/special-muting:
    put:
      tags:
        - Output
      summary: Mutes or unmutes a specific device. Requires a special API key. For demo purpose only. Should not be used widely. This call will disappear shortly.
      operationId: muteDevice
      parameters:
        - $ref: "#/parameters/device-external-id"
        - in: header
          name: X-API-Key
          required: true
          type: string
        - in: body
          name: mute-update
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/MuteUpdate"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /devices/{device-external-id}/special-dimming:
    put:
      tags:
        - Output
      summary: Dims or undims a specific device. Requires a special API key. For demo purpose only. Should not be used widely. This call will disappear shortly.
      operationId: dimDevice
      parameters:
        - $ref: "#/parameters/device-external-id"
        - in: header
          name: X-API-Key
          required: true
          type: string
        - in: body
          name: dim-update
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/DimUpdate"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /outputs/{output-id}/daily-schedule-previews:
    get:
      tags:
        - Output
      summary: Returns a list of daily schedule previews for the given output.
      operationId: getDailySchedulePreviews
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/output-id"
        - in: query
          name: date
          required: true
          type: string
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetDailySchedulePreviewsResponse"

#### TAG ####
  /brands/{brand-id}/tags:
    get:
      tags:
        - Tag
      summary: Returns all tags for the brand.
      operationId: getTags
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetTagsResponse"
  /brands/{brand-id}/tag-categories:
    post:
      tags:
        - Tag
      summary: Creates a tag category.
      operationId: createCategory
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: body
          name: new-category
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/NewTagCategory"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/BrandTagCategoriesResponse"
    get:
      tags:
        - Tag
      summary: Returns a list of the categories associated to a brand.
      operationId: getCategoriesForBrand
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/BrandTagCategoriesResponse"
  /brands/{brand-id}/tag-categories/{tag-category-id}/tags:
    get:
      tags:
        - Tag
      summary: Returns a list of tags that are in the given category for that brand.
      operationId: getTagsForCategory
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - $ref: "#/parameters/tag-category-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetTagsResponse"
    post:
      tags:
        - Tag
      summary: Uses existing tag (or create it if not existing) and link it to a category.
      operationId: createTagInCategory
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - $ref: "#/parameters/tag-category-id"
        - in: body
          name: new-tag
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/TagLink"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetTagsResponse"
  /brands/{brand-id}/tag-categories/{tag-category-id}:
    get:
      tags:
        - Tag
      summary: Returns the type of entities associated to a tag category.
      operationId: getAssociatedEntityTypeForCategory
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - $ref: "#/parameters/tag-category-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/EntityTypeCategoryAssociationsResponse"
    put:
      tags:
        - Tag
      summary: Updates the type of entities associated to a tag category.
      operationId: updateCategoryAssociation
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - $ref: "#/parameters/tag-category-id"
        - in: body
          name: tag-category-associations
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/EntityTypeEnums"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
    delete:
      tags:
        - Tag
      summary: Deletes a tag category.
      operationId: deleteCategory
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - $ref: "#/parameters/tag-category-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/BrandTagCategoriesResponse"
  /brands/{brand-id}/tag-categories/{tag-category-id}/tags/{tag-id}:
    delete:
      tags:
        - Tag
      summary: Deletes a tag from a category.
      operationId: deleteTagInCategory
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - $ref: "#/parameters/tag-category-id"
        - in: path
          name: tag-id
          required: true
          type: integer
          format: int64
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetTagsResponse"

#### StationScheduling ####
  /station-schedules-styles/{station-schedule-style-id}:
    get:
      tags:
        - StationScheduling
      summary: Returns the specific station schedule style.
      operationId: getStationScheduleStyle
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/station-schedule-style-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetStationScheduleStyleResponse"
  /station-schedule-styles/{station-schedule-style-id}:
    put:
      tags:
        - StationScheduling
      summary: Updates a station schedule style and returns the station schedule styles for the brand.
      operationId: updateStationScheduleStyle
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/station-schedule-style-id"
        - in: body
          name: update-station-schedule-style
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/NewStationScheduleStyle"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetStationScheduleStyleResponse"
    delete:
      tags:
        - StationScheduling
      summary: Deletes a station schedule style and returns the station schedule styles for the brand.
      operationId: deleteStationScheduleStyle
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/station-schedule-style-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetStationScheduleStylesResponse"
  /station-scheduling-features/{station-scheduling-feature-id}:
    get:
      tags:
        - StationSchedulingFeature
      summary: Gets the station scheduling feature.
      operationId: getStationSchedulingFeature
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/station-scheduling-feature-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetStationSchedulingFeatureResponse"
    put:
      tags:
        - StationSchedulingFeature
      summary: Updates the given station scheduling feature.
      operationId: updateStationSchedulingFeature
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/station-scheduling-feature-id"
        - in: body
          name: station-scheduling-feature-update
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/StationSchedulingFeatureUpdate"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetStationSchedulingFeatureResponse"
  /station-scheduling-features/{station-scheduling-feature-id}/stations:
    get:
      tags:
        - StationSchedulingFeature
      summary: Returns a list of the station schedling feature's stations.
      operationId: getStationSchedulingFeatureStations
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/station-scheduling-feature-id"
        - in: query
          name: available-to-client-only
          required: true
          type: boolean
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBrandStationsResponse"
    post:
      tags:
        - StationSchedulingFeature
      summary: Adds a station to the given station scheduling feature.
      operationId: addStationToStationSchedulingFeature
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/station-scheduling-feature-id"
        - in: body
          name: station-assignation-info
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/StationAssignationInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBrandStationsResponse"
    put:
      tags:
        - StationSchedulingFeature
      summary: Updates the list of stations linked to the given station scheduling feature.
      operationId: updateStationSchedulingFeatureStations
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/station-scheduling-feature-id"
        - in: body
          name: brand-stations-info
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/BrandStationsInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBrandStationsResponse"
  /station-scheduling-features/{station-scheduling-feature-id}/available-stations:
    get:
      tags:
        - StationSchedulingFeature
      summary: Gets the available stations for station scheduling feature.
      operationId: getStationSchedulingFeatureAvailableStations
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/station-scheduling-feature-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetAvailableStationsResponse"
  /station-scheduling-features/{station-scheduling-feature-id}/size-simulation:
    get:
      tags:
        - StationSchedulingFeature
      summary: Gets the total size of all assets in the station scheduling feature's primary role for a given list of stations.
      operationId: getStationSchedulingFeatureSimulatedSize
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/station-scheduling-feature-id"
        - in: query
          name: station-sam-ids
          required: true
          type: array
          items:
            type: string
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBrandSizeResponse"
  /station-scheduling-features/{station-scheduling-feature-id}/stations/{station-id}:
    put:
      tags:
        - StationSchedulingFeature
      summary: Updates some properties of the station related to this station scheduling feature.
      operationId: updateStationSchedulingFeatureStation
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/station-id"
        - $ref: "#/parameters/station-scheduling-feature-id"
        - in: body
          name: brand-station-update
          schema:
            $ref: "./definitions.yaml#/definitions/BrandStationUpdate"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBrandStationResponse"
    delete:
      tags:
        - StationSchedulingFeature
      summary: Removes a station from the given station scheduling feature.
      operationId: removeStationFromStationSchedulingFeature
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/station-id"
        - $ref: "#/parameters/station-scheduling-feature-id"
        - in: query
          name: fallback-station
          required: false
          type: integer
          format: int64
        - in: query
          name: force-remove
          required: false
          type: boolean
          default: false
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBrandStationsResponse"
  /station-scheduling-features/{station-scheduling-feature-id}/zones/{zone-index}/default-station-scheduling-channel:
    put:
      tags:
        - StationSchedulingFeature
      summary: Updates the default station scheduling channel for the given station scheduling feature and zone index.
      operationId: updateStationSchedulingFeatureDefaultStationSchedulingChannel
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/zone-index"
        - $ref: "#/parameters/station-scheduling-feature-id"
        - in: body
          name: new-default-value
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/IntegerIDUpdateInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /station-scheduling-features/{station-scheduling-feature-id}/fallback-station:
    put:
      tags:
        - StationSchedulingFeature
      summary: Updates the fallback station for the given streaming station scheduling feature.
      operationId: updateStationSchedulingFeatureFallbackStation
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/station-scheduling-feature-id"
        - in: body
          name: updated-fallback-station
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/IntegerIDUpdateInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /brands/{brand-id}/station-schedule-styles:
    get:
      tags:
        - Schedule
      summary: Returns the station schedule styles of the given brand. Use GET /station-scheduling-features/{station-scheduling-feature-id}/station-schedule-styles or Schedule.getStationSchedulingFeatureStyles instead.
      operationId: getStationScheduleStyles
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: query
          name: available-to-clients-only
          required: true
          type: boolean
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/StationScheduleStylesResponse"
    post:
      deprecated: true
      tags:
        - StationScheduling
      summary: Creates a new station schedule style. Use POST /station-scheduling-features/{station-scheduling-feature-id}/station-schedule-styles or StationScheduling.createStationSchedulingFeatureStyle instead.
      operationId: createStationScheduleStyle
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: body
          name: new-station-schedule-style
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/NewStationScheduleStyle"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetStationScheduleStyleResponse"
  /brands/{brand-id}/station-scheduling-features:
    get:
      tags:
        - StationSchedulingFeature
      summary: Gets all station scheduling features in the given brand's products.
      operationId: getBrandStationSchedulingFeatures
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBrandStationSchedulingFeaturesResponse"
  /station-scheduling-features/{station-scheduling-feature-id}/station-schedule-styles:
    get:
      tags:
        - Schedule
      summary: Returns the station schedule styles for a specific station scheduling feature.
      operationId: getStationSchedulingFeatureStyles
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/station-scheduling-feature-id"
        - in: query
          name: available-to-clients-only
          required: true
          type: boolean
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/StationScheduleStylesResponse"
    post:
      tags:
        - StationScheduling
      summary: Creates a new station schedule style and returns the station schedule styles for the station scheduling feature.
      operationId: createStationSchedulingFeatureStyle
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/station-scheduling-feature-id"
        - in: body
          name: new-station-schedule-style
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/NewStationScheduleStyle"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetStationScheduleStyleResponse"
  /station-scheduling-features/{station-scheduling-feature-id}/editable:
    put:
      tags:
        - Schedule
      summary: Update the editable state of a schedule
      operationId: updateContainerEditableState
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/station-scheduling-feature-id"
        - in: body
          name: cotainer-editable-status-update
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/ContainerEditableStateUpdate"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/ScheduleResponse"

#### LANGUAGE ####
  /languages:
    get:
      tags:
        - Language
      summary: Returns a list of the existing languages.
      operationId: getLanguages
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetLanguagesResponse"

#### HARDWARE ####
  /affiliates/{affiliate-id}/hardware-list:
    get:
      tags:
        - Hardware
      summary: Returns the hardware list for a specific affiliate.
      operationId: getHardwareList
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
        #Since it's a query param, we need to use a duplicated enum (not the object in definitions). Will probably change in OpenApi 3.0.
        #https://stackoverflow.com/questions/32255384/swagger-reusing-an-enum-definition-as-query-parameter
        - in: query
          name: hardware-type
          required: true
          type: string
          enum:
            - Generic
            - Player
            - Storage
            - Screen
            - Network
            - Tablet
        - in: query
          name: serial-no
          required: false
          type: string
        - in: query
          name: brand-id
          required: false
          type: integer
          format: int64
        - in: query
          name: store-id
          required: false
          type: integer
          format: int64
        - in: query
          name: device-id
          required: false
          type: integer
          format: int64
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetHardwareListResponse"
    post:
      tags:
        - Hardware
      summary: Adds a hardware to the given affiliate.
      operationId: createHardware
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
        - in: body
          name: new-hardware
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/HardwareCore"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetHardwareResponse"
  /affiliates/{affiliate-id}/hardware-models:
    get:
      tags:
        - Hardware
      summary: Returns the hardware models for a specific affiliate.
      operationId: getHardwareModels
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
        - in: query
          name: hardware-type
          required: true
          type: string
          #Since it's a query param, we need to use a duplicated enum (not the object in definitions). Will probably change in OpenApi 3.0.
          #https://stackoverflow.com/questions/32255384/swagger-reusing-an-enum-definition-as-query-parameter
          enum:
            - Generic
            - Player
            - Storage
            - Screen
            - Network
            - Tablet
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetHardwareModelsResponse"
    post:
      tags:
        - Hardware
      summary: Adds a hardware model to the given affiliate.
      operationId: createHardwareModel
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
        - in: body
          name: new-hardware-model
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/HardwareModelCore"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetHardwareModelResponse"
  /affiliates/{affiliate-id}/parent-hardware-list:
    get:
      tags:
        - Hardware
      summary: Returns a list of the hardware that can be assigned to.
      operationId: getParentHardwareList
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetHardwareListResponse"
  /hardware-list/{hardware-id}/assignations:
    get:
      tags:
        - Hardware
      summary: Returns the previous and current assignation of a specific hardware.
      operationId: getHardwareAssignations
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/hardware-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetHardwareAssignationsResponse"
    put:
      tags:
        - Hardware
      summary: Updates the assignation of the hardware.
      operationId: updateHardwareAssignation
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/hardware-id"
        - in: body
          name: hardware-assignation-info
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/UpdatedHardwareAssignation"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetHardwareAssignationsResponse"
  /hardware-list/{hardware-id}:
    put:
      tags:
        - Hardware
      summary: Updates a hardware.
      operationId: updateHardware
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/hardware-id"
        - in: body
          name: updated-hardware
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/Hardware"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetHardwareResponse"
    delete:
      tags:
        - Hardware
      summary: Removes a hardware from the system.
      operationId: removeHardware
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/hardware-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /hardware-models/{hardware-model-id}:
    put:
      tags:
        - Hardware
      summary: Updates the information related to a hardware model.
      operationId: updateHardwareModel
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/hardware-model-id"
        - in: body
          name: updated-hardware-model
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/HardwareModel"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetHardwareModelResponse"
    delete:
      tags:
        - Hardware
      summary: Removes the hardware model from the system.
      operationId: removeHardwareModel
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/hardware-model-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /storage-types:
    get:
      tags:
        - Hardware
      summary: Gets a list of the available storage types.
      operationId: getStorageTypes
      security: [ ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetGenericPairsResponse"
  /storage-brands:
    get:
      tags:
        - Hardware
      summary: Gets a list of the available storage brands.
      operationId: getStorageBrands
      security: [ ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetGenericPairsResponse"

#### IMAGE ####
  /brands/{brand-id}/images:
    get:
      deprecated: true
      tags:
        - Image
      summary: Returns a list of the brand's images. Use GET /products/{product-id}/images or Image.getProductImages instead.
      operationId: getBrandImages
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetImagesResponse"
    post:
      deprecated: true
      tags:
        - Image
      summary: Creates an image for the given brand. Use POST /products/{product-id}/images or Image.createProductImage instead.
      operationId: createImage
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: body
          name: new-image-info
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/ImageInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /images/{image-id}/summary:
    get:
      tags:
        - Image
      summary: Returns a summary for the image creation.
      operationId: getImageSummary
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/image-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetImageSummaryResponse"
  /brands/{brand-id}/initial-images:
    post:
      deprecated: true
      tags:
        - Image
      summary: Creates an initial image for the given brand. Use POST /products/{product-id}/initial-images or Image.createProductInitialImage instead.
      operationId: createInitialImage
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: body
          name: new-image-info
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/InitialImageInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /images/{image-id}:
    put:
      tags:
        - Image
      summary: Decommissions an image and delete its cloud stored file.
      operationId: decommissionImage
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/image-id"
        - $ref: "#/parameters/empty-body"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
    delete:
      tags:
        - Image
      summary: Removes an image from the system.
      operationId: removeImage
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/image-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /brands/{brand-id}/initial-images-stations:
    get:
      deprecated: true
      tags:
        - Image
      summary: Indicates if the brand stations are at least one month old. Use GET /product/{product-id}/initial-images-stations or Image.isProductStationLongEnough instead.
      operationId: isStationLongEnough
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBooleanResponse"
  /products/{product-id}/images:
    get:
      tags:
        - Image
      summary: Returns a list of the product's images.
      operationId: getProductImages
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/product-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetImagesResponse"
    post:
      tags:
        - Image
      summary: Creates an image for the given product.
      operationId: createProductImage
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/product-id"
        - in: body
          name: new-image-info
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/ImageInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /products/{product-id}/initial-images:
    post:
      tags:
        - Image
      summary: Creates an initial image for the given product.
      operationId: createProductInitialImage
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/product-id"
        - in: body
          name: new-image-info
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/InitialImageInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /product/{product-id}/initial-images-stations:
    get:
      tags:
        - Image
      summary: Indicates if the product stations are at least one month old.
      operationId: isProductStationLongEnough
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/product-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBooleanResponse"

#### SYNC ####
  /synchronizations:
    post:
      tags:
        - Sync
      summary: Calls a manual and complete synchronization of the system with SAM servers. May soon be replaced with a call with more specific parameters.
      operationId: requestManualSync
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/empty-body"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/SyncConfirmationResponse"
  /brands/{brand-id}/synchronizations:
    post:
      tags:
        - Sync
      summary: Calls a manual brand synchronization with SAM servers. May soon be replaced with a call with more specific parameters.
      operationId: requestBrandSync
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - $ref: "#/parameters/empty-body"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/SyncConfirmationsResponse"
  /sync-state/logs:
    get:
      tags:
        - Sync
      summary: Returns the logs related to the sync.
      operationId: getSyncLogs
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/limit"
        - $ref: "#/parameters/from-timestamp"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetSyncLogsResponse"
  /affiliates/{affiliate-id}/sync-stations:
    get:
      tags:
        - Sync
      summary: Returns a list of the stations sync snapshots for a specific affiliate.
      operationId: getAffiliateSyncStations
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetSyncStationsResponse"
  /sync-stations:
    get:
      tags:
        - Sync
      summary: Returns a list of all stations sync snapshots.
      operationId: getSyncStations
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetSyncStationsResponse"
  /sync-stations/{station-id}:
    get:
      tags:
        - Sync
      summary: Returns a single station sync snapshot.
      operationId: getSyncStation
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/station-id"
        - in: query
          name: affiliate-id
          required: false
          type: integer
          format: int64
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetSyncStationDetailsResponse"
  /affiliates/{affiliate-id}/sync-brands:
    get:
      tags:
        - Sync
      summary: Returns a list of the brands sync snapshots for a specific affiliate.
      operationId: getAffiliateSyncBrands
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetSyncBrandsResponse"
  /sync-brands:
    get:
      tags:
        - Sync
      summary: Returns a list of all brands sync snapshots.
      operationId: getSyncBrands
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetSyncBrandsResponse"
  /affiliates/{affiliate-id}/sync-songs:
    get:
      tags:
        - Sync
      summary: Returns a list of the brands sync snapshots for a specific affiliate.
      operationId: getAffiliateSyncSongs
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetSyncSongsResponse"
  /sync-songs:
    get:
      tags:
        - Sync
      summary: Returns a list of all songs sync snapshots.
      operationId: getSyncSongs
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetSyncSongsResponse"
  /sync-playlists:
    get:
      tags:
        - Sync
      summary: Returns a specific playlist sync snapshot. Use either the playlistId or the archive playlist Id. None will result in an error.
      operationId: getSyncPlaylist
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: query
          name: playlist-id
          required: false
          type: integer
          format: int64
        - in: query
          name: archive-playlist-id
          required: false
          type: integer
          format: int64
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetSyncPlaylistResponse"
  /sync-stations/{station-id}/sync-playlists:
    get:
      tags:
        - Sync
      summary: Returns a list of all playlists sync snapshots from a specific station.
      operationId: getStationSyncPlaylists
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/station-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetStationSyncPlaylistsResponse"
  /sync-stations/{station-id}/sync-songs:
    get:
      tags:
        - Sync
      summary: Returns a list of all songs in a sync stations.
      operationId: getStationSyncSongs
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/station-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetStationSyncSongsResponse"
  /sync-playlists/{playlist-id}/archives:
    get:
      tags:
        - Sync
      summary: Returns a list of the available versions of the given station playlist.
      operationId: getSyncPlaylistArchives
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - in: path
          name: playlist-id
          required: true
          type: integer
          format: int64
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetGenericPairsResponse"

#### AUTHORIZATION ####
  /authorized-view-types-info:
    get:
      tags:
        - Authorization
      summary: Returns the authorized system view types info.
      operationId: getAuthorizedSystemViewTypesInfo
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetAuthorizedViewTypesInfoResponse"
  /affiliates/{affiliate-id}/authorized-view-types-info:
    get:
      tags:
        - Authorization
      summary: Returns the authorized affiliate view types info for the given affiliate.
      operationId: getAuthorizedAffiliateViewTypesInfo
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetAuthorizedViewTypesInfoResponse"
  /brands/{brand-id}/authorized-view-types-info:
    get:
      tags:
        - Authorization
      summary: Returns the authorized brand view types info for the given brand.
      operationId: getAuthorizedBrandViewTypesInfo
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetAuthorizedViewTypesInfoResponse"
  /authorization-related-affiliates:
    get:
      tags:
        - Authorization
      summary: Returns the current user's affiliates that are parent of all access rights he owns.
      operationId: getAuthorizationRelatedAffiliates
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetAuthorizationRelatedAffiliatesResponse"
  /authorization-related-affiliates/{affiliate-id}/authorization-related-brands:
    get:
      tags:
        - Authorization
      summary: Returns the current user's brands that are parent of all access rights he owns and that are under the given affiliate id.
      operationId: getAuthorizationRelatedAffiliateBrands
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
        - in: query
          type: boolean
          name: fetch-logo
          required: true
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetAuthorizationRelatedBrandsResponse"

#### MEDIAFEED ####
  /media-feeds:
    get:
      tags:
        - MediaFeed
      summary: Returns a list of all media feeds available.
      operationId: getMediaFeeds
      security:
        - accessToken: [ defaultScope ]
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetMediaFeedsResponse"
  /brands/{brand-id}/media-feed-logs:
    get:
      tags:
        - MediaFeed
      summary: Returns the logs of a brand's media feeds.
      operationId: getBrandMediaFeedLogs
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - $ref: "#/parameters/limit"
        - $ref: "#/parameters/from-timestamp"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetMediaFeedLogsResponse"
  /affiliates/{affiliate-id}/media-feed-logs:
    get:
      tags:
        - MediaFeed
      summary: Returns the logs of an affiliate's media feeds.
      operationId: getAffiliateMediaFeedLogs
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
        - $ref: "#/parameters/limit"
        - $ref: "#/parameters/from-timestamp"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetMediaFeedLogsResponse"
  /affiliates/{affiliate-id}/media-feeds:
    get:
      tags:
        - MediaFeed
      summary: Returns the media feeds available for the given affiliate.
      operationId: getAffiliateMediaFeeds
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetMediaFeedsResponse"
    post:
      tags:
        - MediaFeed
      summary: Links a media feed to the given affiliate and returns the updated affiliate's media feeds.
      operationId: linkToAffiliate
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
        - in: body
          name: media-feed-link
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/MediaFeedLink"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetMediaFeedsResponse"
  /brands/{brand-id}/media-feeds:
    get:
      tags:
        - MediaFeed
      summary: Returns the media feeds available for the given brand.
      operationId: getBrandMediaFeeds
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetMediaFeedsResponse"
    post:
      tags:
        - MediaFeed
      summary: Links a media feed to the given brand and returns the updated brand's media feeds.
      operationId: linkToBrand
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: body
          name: media-feed-link
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/MediaFeedLink"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetMediaFeedsResponse"
  /outputs/{output-id}/media-feeds:
    get:
      tags:
        - MediaFeed
      summary: Returns the media feeds available for the given output.
      operationId: getOutputMediaFeeds
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/output-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetMediaFeedsResponse"
    post:
      tags:
        - MediaFeed
      summary: Links a media feed to the given output and returns the updated output's media feeds.
      operationId: linkToOutput
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/output-id"
        - in: body
          name: media-feed-link
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/MediaFeedLink"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetMediaFeedsResponse"
  /affiliates/{affiliate-id}/media-feeds/{media-feed-id}:
    delete:
      tags:
        - MediaFeed
      summary: Unlinks the given media feed from the given affiliate and returns the updated affiliate's media feeds.
      operationId: unlinkFromAffiliate
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/affiliate-id"
        - $ref: "#/parameters/media-feed-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetMediaFeedsResponse"
  /brands/{brand-id}/media-feeds/{media-feed-id}:
    delete:
      tags:
        - MediaFeed
      summary: Unlinks the given media feed from the given brand and returns the updated brand's media feeds.
      operationId: unlinkFromBrand
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - $ref: "#/parameters/media-feed-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetMediaFeedsResponse"
  /media-feed-notification:
    post:
      tags:
        - MediaFeed
      summary: Notifies the devices linked to this media feed.
      operationId: notifyDevices
      parameters:
        - in: body
          name: media-feed-notification
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/MediaFeedNotification"
        - in: header
          name: X-API-Key
          required: true
          type: string
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"

#### GALAXIE API ACCOUNT ####
  /galaxie-api-accounts/{galaxie-api-account-id}/associated-player-logout:
    post:
      tags:
        - GalaxieApiAccount
      summary: Logs out the associated player from the Galaxie API account.
      operationId: logOutAssociatedPlayer
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/galaxie-api-account-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GalaxieApiAccountResponse"
  /brands/{brand-id}/galaxie-api-accounts:
    get:
      tags:
        - GalaxieApiAccount
      summary: Returns the list of Galaxie API accounts for the given brand.
      operationId: getBrandGalaxieApiAccounts
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/BrandGalaxieApiAccountsResponse"

#### SCHEDULE ####
  /brands/{brand-id}/station-schedules:
    get:
      deprecated: true
      tags:
        - Schedule
      summary: Gets the list of station schedules for a specific brand. Use GET /station-scheduling-features/{station-scheduling-feature-id}/station-schedules or Schedule.getStationSchedulingFeatureSchedules instead.
      operationId: getStationSchedules
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/SchedulesResponse"
    post:
      deprecated: true
      tags:
        - Schedule
      summary: Creates a station schedule for a specific brand. Use POST /station-scheduling-features/{station-scheduling-feature-id}/station-schedules or Schedule.createStationSchedulingFeatureSchedule instead.
      operationId: createStationSchedule
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: body
          name: station-schedule
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/ScheduleCore"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/ScheduleResponse"
  /brands/{brand-id}/playback-schedules:
    get:
      deprecated: true
      tags:
        - Schedule
      summary: Gets the list of playback schedules for a specific brand. Use GET /player-playback-features/{player-playback-feature-id}/playback-schedules or Schedule.getPlayerPlaybackFeatureSchedules instead.
      operationId: getPlaybackSchedules
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/SchedulesResponse"
    post:
      deprecated: true
      tags:
        - Schedule
      summary: Creates a playback schedule for a specific brand. Use POST /player-playback-features/{player-playback-feature-id}/playback-schedules or Schedule.createPlayerPlaybackFeatureSchedule instead.
      operationId: createPlaybackSchedule
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
        - in: body
          name: playback-schedule
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/ScheduleCore"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/ScheduleResponse"
  /station-schedules/{station-schedule-id}:
    get:
      tags:
        - Schedule
      summary: Gets a station schedule.
      operationId: getStationSchedule
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/station-schedule-id"
        - in: query
          name: include-schedule-time-slots
          required: false
          default: false
          type: boolean
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/ScheduleResponse"
    put:
      tags:
        - Schedule
      summary: Updates a station schedule.
      operationId: updateStationSchedule
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/station-schedule-id"
        - in: body
          name: station-schedule-update
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/ScheduleCore"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/ScheduleResponse"
    delete:
      tags:
        - Schedule
      summary: Deletes a station schedule.
      operationId: deleteStationSchedule
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/station-schedule-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /playback-schedules/{playback-schedule-id}:
    get:
      tags:
        - Schedule
      summary: Gets a playback schedule.
      operationId: getPlaybackSchedule
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/playback-schedule-id"
        - in: query
          name: include-schedule-time-slots
          required: false
          default: false
          type: boolean
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/ScheduleResponse"
    put:
      tags:
        - Schedule
      summary: Updates a playback schedule.
      operationId: updatePlaybackSchedule
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/playback-schedule-id"
        - in: body
          name: playback-schedule-update
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/ScheduleCore"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/ScheduleResponse"
    delete:
      tags:
        - Schedule
      summary: Deletes a playback schedule.
      operationId: deletePlaybackSchedule
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/playback-schedule-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /station-schedules/{station-schedule-id}/schedule-time-slots:
    get:
      tags:
        - Schedule
      summary: Gets the schedule of a specific station schedule.
      operationId: getStationScheduleTimeSlots
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/station-schedule-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/ScheduleTimeSlotsResponse"
    put:
      tags:
        - Schedule
      summary: Updates the schedule of a specific station schedule.
      operationId: updateStationScheduleTimeSlots
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/station-schedule-id"
        - in: body
          name: schedule-time-slots
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/ScheduleTimeSlots"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/ScheduleTimeSlotsResponse"
  /playback-schedules/{playback-schedule-id}/schedule-time-slots:
    get:
      tags:
        - Schedule
      summary: Gets the schedule of a specific playback schedule.
      operationId: getPlaybackScheduleTimeSlots
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/playback-schedule-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/ScheduleTimeSlotsResponse"
    put:
      tags:
        - Schedule
      summary: Updates the schedule of a specific playback schedule.
      operationId: updatePlaybackScheduleTimeSlots
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/playback-schedule-id"
        - in: body
          name: schedule-time-slots
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/ScheduleTimeSlots"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/ScheduleTimeSlotsResponse"

#### PRODUCT ####
  /products/{product-id}/license-bundle:
    post:
      tags:
        - Product
      summary: Adds new licenses to the given product.
      operationId: addLicenses
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/product-id"
        - in: body
          name: license-bundle
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/LicenseBundle"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"
  /products/{product-id}:
    get:
      tags:
        - Product
      summary: Gets the product.
      operationId: getProduct
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/product-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/ProductResponse"
    put:
      tags:
        - Product
      summary: Updates the given product.
      operationId: updateProduct
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/product-id"
        - in: body
          name: product-update
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/ProductUpdate"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/ProductResponse"
  /licenses/{license-id}:
    put:
      tags:
        - Product
      summary: Updates the licence.
      operationId: updateLicense
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/license-id"
        - in: body
          name: license-update
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/LicenseUpdate"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/LicenseResponse"
  /licenses/{license-id}/lifecycle-events:
    get:
      tags:
        - Product
      summary: Returns all lifecycle events of the given license.
      operationId: getLicenseActivityLifecycleEvents
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/license-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/GetLifecycleEventsResponse"
  /products/{product-id}/messaging-feature:
    put:
      deprecated: true
      tags:
        - Product
      summary: Updates the messaging feature of the given product.
      operationId: updateProductMessagingFeature
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/product-id"
        - in: body
          name: messaging-feature-update
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/MessagingFeatureUpdate"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/MessagingFeatureResponse"
  /products/{product-id}/station-scheduling-feature:
    put:
      deprecated: true
      tags:
        - Product
      summary: Updates the station scheduling feature of the given product.
      operationId: updateProductStationSchedulingFeature
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/product-id"
        - in: body
          name: station-scheduling-feature-update
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/StationSchedulingFeatureUpdate"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/StationSchedulingFeatureResponse"
  /products/{product-id}/player-playback-feature:
    put:
      deprecated: true
      tags:
        - Product
      summary: Updates the player playback feature of the given product.
      operationId: updateProductPlayerPlaybackFeature
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/product-id"
        - in: body
          name: player-playback-feature-update
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/PlayerPlaybackFeatureUpdate"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/PlayerPlaybackFeatureResponse"
  /products/{product-id}/jukebox-feature:
    put:
      deprecated: true
      tags:
        - Product
      summary: Updates the Jukebox feature of the given product.
      operationId: updateProductJukeboxFeature
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/product-id"
        - in: body
          name: jukebox-feature-update
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/JukeboxFeatureUpdate"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/JukeboxFeatureResponse"
  /products/{product-id}/galaxie-api-feature:
    put:
      deprecated: true
      tags:
        - Product
      summary: Updates the Galaxie API feature of the given product.
      operationId: updateProductGalaxieApiFeature
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/product-id"
        - in: body
          name: galaxie-api-feature-update
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/GalaxieApiFeatureUpdate"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GalaxieApiFeatureResponse"
  /products/{product-id}/sbx-tech:
    put:
      deprecated: true
      tags:
        - Product
      summary: Updates the SBX tech of the given product.
      operationId: updateProductSbxTech
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/product-id"
        - in: body
          name: sbx-tech-update
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/SbxTechUpdate"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/SbxTechResponse"
    post:
      tags:
        - Product
      summary: Creates the SBX tech of the given product.
      operationId: createProductSbxTech
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/product-id"
        - $ref: "#/parameters/empty-body"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/SbxTechResponse"
  /products/{product-id}/admin-settings:
    get:
      tags:
        - Product
      summary: Gets information about the settings. Only available to brand administrators.
      operationId: getAdminProductSettings
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/product-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetAdminBrandProductSettingsResponse"
  /products/{product-id}/channels:
    get:
      tags:
        - Product
      summary: Gets a list of the available channels for the given product.
      operationId: getProductChannels
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/product-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetGenericPairsResponse"
  /products/{product-id}/device-types:
    get:
      tags:
        - Product
      summary: Returns a list of the device types available for the given product.
      operationId: getProductDeviceTypes
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/product-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetEnumPairsResponse"
  /products/{product-id}/media-player-outputs:
    get:
      tags:
        - Product
      summary: Gets a list of the media player outputs in the given product.
      operationId: getProductMediaPlayerOutputs
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/product-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetMediaPlayerOutputsResponse"
  /products/{product-id}/output-meta:
    get:
      tags:
        - Product
      summary: Returns the output meta of the given product.
      operationId: getProductOutputMeta
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/product-id"
        - in: query
          name: exclude-unpublished-channels
          required: false
          default: false
          type: boolean
      responses:
        200:
          description: OK
          schema:
            $ref: "./deployment-definitions.yaml#/definitions/GetOutputMetaResponse"
  /products/{product-id}/playback-channels:
    get:
      tags:
        - Product
      summary: Gets a list of the available playback channels for the given product.
      operationId: getProductPlaybackChannels
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/product-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetGenericPairsResponse"
  /products/{product-id}/feature-types:
    get:
      tags:
        - Product
      summary: Returns all available feature types for the given product.
      operationId: getProductFeatureTypes
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/product-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetFeatureTypesResponse"
  /products/{product-id}/songs/{song-id}:
    get:
      tags:
        - Product
      summary: Gets information about the given song.
      operationId: getProductSong
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/product-id"
        - in: path
          name: song-id
          required: true
          type: integer
          format: int64
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetSongResponse"
  /products/{product-id}/basic-stores:
    get:
      tags:
        - Product
      summary: Gets a list of stores with basic info for the given product.
      operationId: getProductBasicStores
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/product-id"
        - in: query
          name: fetch-active-stores-only
          required: false
          default: false
          type: boolean
        - in: query
          name: exclude-cradles
          required: false
          default: false
          type: boolean
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBasicStoresResponse"
  /products/{product-id}/pool-devices:
    get:
      tags:
        - Product
      summary: Returns the product's pool devices.
      operationId: getProductPoolDevices
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/product-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/GetDevicesResponse"
    post:
      tags:
        - Product
      summary: Creates a new deployment request in the pool store. Creates the pool store if it doesn't already exist. Returns all pool devices.
      operationId: createProductPoolDeploymentRequest
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/product-id"
        - in: body
          name: pool-deployment-request-creation-info
          required: true
          schema:
            $ref: "./device-definitions.yaml#/definitions/PoolDeploymentRequestCreationInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./device-definitions.yaml#/definitions/GetDevicesResponse"
  /products/{product-id}/stores:
    post:
      tags:
        - Product
      summary: Creates new store (with device) using a CSV file that is uploaded in the given product.
      operationId: importProductStores
      security:
        - accessToken: [ defaultScope ]
      consumes:
        - multipart/form-data
      parameters:
        - $ref: "#/parameters/product-id"
        - in: formData
          name: file-to-upload
          required: true
          type: file
        - in: formData
          name: workorder-tracking-id-override
          required: false
          type: string
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetStoreCreationLogsResponse"

#### MUSICBOX ####
  /brands/{brand-external-id}/musicbox-locations:
    get:
      tags:
        - Musicbox
      summary: Gets the list of Musicbox locations for a specific brand.
      operationId: getBrandMusicboxLocations
      parameters:
        - $ref: "#/parameters/brand-external-id"
        - in: header
          name: X-API-KEY
          required: true
          type: string
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetMusicboxLocationsResponse"
  /musicbox-locations/{musicbox-location-external-id}/available-channels:
    get:
      tags:
        - Musicbox
      summary: Gets the list of available channels for a Musicbox location.
      operationId: getMusicboxLocationAvailableChannels
      parameters:
        - $ref: "#/parameters/musicbox-location-external-id"
        - in: header
          name: X-API-KEY
          required: true
          type: string
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetMusicboxChannelsResponse"
  /musicbox-locations/{musicbox-location-external-id}:
    get:
      tags:
        - Musicbox
      summary: Gets the Musicbox location.
      operationId: getMusicboxLocation
      parameters:
        - $ref: "#/parameters/musicbox-location-external-id"
        - in: header
          name: X-API-KEY
          required: true
          type: string
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetMusicboxLocationResponse"
  /musicbox-locations/{musicbox-location-external-id}/current-channel:
    put:
      tags:
        - Musicbox
      summary: Sets the current channel of the Musicbox location.
      operationId: updateMusicboxLocationChannel
      parameters:
        - $ref: "#/parameters/musicbox-location-external-id"
        - in: header
          name: X-API-KEY
          required: true
          type: string
        - in: body
          name: channel-update
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/MusicboxChannelUpdateInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetMusicboxChannelResponse"

#### INVESTIGATION ####
  /devices/{device-id}/investigations:
    get:
      tags:
        - Investigation
      summary: Returns a list of the investigations for a given device.
      operationId: getDeviceInvestigations
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/InvestigationsResponse"
    post:
      tags:
        - Investigation
      summary: Adds an investigation to a device. Only succeeds when all current investigations are inactive.
      operationId: createDeviceInvestigation
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-id"
        - $ref: "#/parameters/empty-body"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/InvestigationResponse"
  /devices/{device-id}/active-investigation:
    get:
      tags:
        - Investigation
      summary: Returns the active investigation for a device, if any.
      operationId: getDeviceActiveInvestigation
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/device-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/InvestigationResponse"
  /investigations/{investigation-id}:
    get:
      tags:
        - Investigation
      summary: Returns a given investigation.
      operationId: getInvestigation
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/investigation-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/InvestigationResponse"
    put:
      tags:
        - Investigation
      summary: Updates an investigation.
      operationId: updateInvestigation
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/investigation-id"
        - in: body
          name: investigation-update
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/InvestigationCore"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/InvestigationResponse"
  /investigations/{investigation-id}/comments:
    post:
      tags:
        - Investigation
      summary: Creates a comment in the given investigation.
      operationId: createInvestigationComment
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/investigation-id"
        - in: body
          name: new-comment
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/CommentCore"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/CommentResponse"
  /comments/{comment-id}:
    put:
      tags:
        - Investigation
      summary: Updates a comment.
      operationId: updateComment
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/comment-id"
        - in: body
          name: comment-update
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/CommentCore"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/CommentResponse"
    delete:
      tags:
        - Investigation
      summary: Removes a comment.
      operationId: deleteComment
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/comment-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"

#### PLAYER PAYBACK SCHEDULE ####
  /brands/{brand-id}/player-playback-features:
    get:
      tags:
        - PlayerPlaybackFeature
      summary: Gets all player playback features in the given brand's products.
      operationId: getBrandPlayerPlaybackFeatures
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBrandPlayerPlaybackFeaturesResponse"
  /player-playback-features/{player-playback-feature-id}:
    get:
      tags:
        - PlayerPlaybackFeature
      summary: Gets the player playback feature.
      operationId: getPlayerPlaybackFeature
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/player-playback-feature-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetPlayerPlaybackFeatureResponse"
    put:
      tags:
        - PlayerPlaybackFeature
      summary: Updates the given player playback feature.
      operationId: updatePlayerPlaybackFeature
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/player-playback-feature-id"
        - in: body
          name: player-playback-feature-update
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/PlayerPlaybackFeatureUpdate"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetPlayerPlaybackFeatureResponse"
  /player-playback-features/{player-playback-feature-id}/default-playback-channel:
    put:
      tags:
        - PlayerPlaybackFeature
      summary: Updates the default playback channel for the given player playback feature.
      operationId: updatePlayerPlaybackFeatureDefaultPlaybackChannel
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/player-playback-feature-id"
        - in: body
          name: updated-playback-channel
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/PlaybackChannelUpdateInfo"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/DefaultMetaOnlyResponse"

#### SBX TECH ####
  /brands/{brand-id}/sbx-techs:
    get:
      tags:
        - SbxTech
      summary: Gets all SBX techs in the given brand's products.
      operationId: getBrandSbxTechs
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/brand-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetBrandSbxTechsResponse"
  /sbx-techs/{sbx-tech-id}/network-configuration:
    get:
      tags:
        - SbxTech
      summary: Returns the SBX tech's network configuration.
      operationId: getSbxTechNetworkConfiguration
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/sbx-tech-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetNetworkConfigurationResponse"
    put:
      tags:
        - SbxTech
      summary: Updates the SBX tech's network configuration.
      operationId: updateSbxTechNetworkConfiguration
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/sbx-tech-id"
        - in: body
          name: updated-network-config
          required: true
          schema:
            #TODO: Refactor to use NetworkConfig core if front end doesn't have access to the ID
            $ref: "./definitions.yaml#/definitions/NetworkConfigCore"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetNetworkConfigurationResponse"
  /sbx-techs/{sbx-tech-id}:
    get:
      tags:
        - SbxTech
      summary: Gets the SBX tech.
      operationId: getSbxTech
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/sbx-tech-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetSbxTechResponse"
    put:
      tags:
        - SbxTech
      summary: Updates the given SBX tech.
      operationId: updateSbxTech
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/sbx-tech-id"
        - in: body
          name: sbx-tech-update
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/SbxTechUpdate"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetSbxTechResponse"
  /sbx-techs/{sbx-tech-id}/throttling-scheme:
    get:
      tags:
        - SbxTech
      summary: Gets the SBX tech's throttling scheme.
      operationId: getSbxTechThrottlingScheme
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/sbx-tech-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetThrottlingSchemeResponse"
    put:
      tags:
        - SbxTech
      summary: Creates or updates the SBX tech's throttling scheme.
      operationId: updateSbxTechThrottlingScheme
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/sbx-tech-id"
        - in: body
          name: updated-throttling-scheme
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/ThrottlingScheme"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetThrottlingSchemeResponse"
  /sbx-techs/{sbx-tech-id}/throttling-scheme-preview:
    get:
      tags:
        - SbxTech
      summary: Gets the SBX tech's throttling scheme preview.
      operationId: getSbxTechThrottlingSchemePreview
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/sbx-tech-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetThrottlingSchemePreviewResponse"
  /sbx-techs/{sbx-tech-id}/device-types:
    get:
      tags:
        - SbxTech
      summary: Returns a list of the device types available for the given SBX tech.
      operationId: getSbxTechDeviceTypes
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/sbx-tech-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetEnumPairsResponse"

#### SCHEDULE ####
  /station-scheduling-features/{station-scheduling-feature-id}/station-schedules:
    get:
      tags:
        - Schedule
      summary: Gets the list of station schedules for a specific station scheduling feature.
      operationId: getStationSchedulingFeatureSchedules
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/station-scheduling-feature-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/SchedulesResponse"
    post:
      tags:
        - Schedule
      summary: Creates a station schedule for a specific station scheduling feature.
      operationId: createStationSchedulingFeatureSchedule
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/station-scheduling-feature-id"
        - in: body
          name: station-schedule
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/ScheduleCore"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/ScheduleResponse"
  /player-playback-features/{player-playback-feature-id}/playback-schedules:
    get:
      tags:
        - Schedule
      summary: Gets the list of playback schedules for a specific player playback feature.
      operationId: getPlayerPlaybackFeatureSchedules
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/player-playback-feature-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/SchedulesResponse"
    post:
      deprecated: true
      tags:
        - Schedule
      summary: Creates a playback schedule for a specific player playback feature.
      operationId: createPlayerPlaybackFeatureSchedule
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/player-playback-feature-id"
        - in: body
          name: playback-schedule
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/ScheduleCore"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/ScheduleResponse"
  /player-playback-states/{player-playback-feature-id}:
    get:
      tags:
        - Schedule
      summary: Returns the list of player playback states for a specific player playback feature.
      operationId: getAllPlayerPlaybackFeatureStates
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/player-playback-feature-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/PlayerPlaybackStatesResponse"

#### MESSAGING FEATURE ####
  /messaging-features/{messaging-feature-id}:
    get:
      tags:
        - MessagingFeature
      summary: Gets the messaging feature.
      operationId: getMessagingFeature
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/messaging-feature-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetMessagingFeatureResponse"
    put:
      tags:
        - MessagingFeature
      summary: Updates the given messaging feature.
      operationId: updateMessagingFeature
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/messaging-feature-id"
        - in: body
          name: messaging-feature-update
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/MessagingFeatureUpdate"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetMessagingFeatureResponse"

#### JUKEBOX FEATURE ####
  /jukebox-features/{jukebox-feature-id}:
    get:
      tags:
        - JukeboxFeature
      summary: Gets the jukebox feature.
      operationId: getJukeboxFeature
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/jukebox-feature-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetJukeboxFeatureResponse"
    put:
      tags:
        - JukeboxFeature
      summary: Updates the given jukebox feature.
      operationId: updateJukeboxFeature
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/jukebox-feature-id"
        - in: body
          name: jukebox-feature-update
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/JukeboxFeatureUpdate"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetJukeboxFeatureResponse"

#### GALAXIE API FEATURE ####
  /galaxie-api-features/{galaxie-api-feature-id}:
    get:
      tags:
        - GalaxieApiFeature
      summary: Gets the Galaxie API feature.
      operationId: getGalaxieApiFeature
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/galaxie-api-feature-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetGalaxieApiFeatureResponse"
    put:
      tags:
        - GalaxieApiFeature
      summary: Updates the given Galaxie API feature.
      operationId: updateGalaxieApiFeature
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/galaxie-api-feature-id"
        - in: body
          name: galaxie-api-feature-update
          required: true
          schema:
            $ref: "./definitions.yaml#/definitions/GalaxieApiFeatureUpdate"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetGalaxieApiFeatureResponse"

#### LICENSING FEATURE ####
  /licensing-features/{licensing-feature-id}:
    get:
      tags:
        - LicensingFeature
      summary: Gets the licensing feature.
      operationId: getLicensingFeature
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/licensing-feature-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetLicensingFeatureResponse"

#### GALAXIE API TECH ####
  /galaxie-api-techs/{galaxie-api-tech-id}:
    get:
      tags:
        - GalaxieApiTech
      summary: Gets the Galaxie API tech.
      operationId: getGalaxieApiTech
      security:
        - accessToken: [ defaultScope ]
      parameters:
        - $ref: "#/parameters/galaxie-api-tech-id"
      responses:
        200:
          description: OK
          schema:
            $ref: "./definitions.yaml#/definitions/GetGalaxieApiTechResponse"

#### PROMETHEUS ####
  /prometheus-device-metrics:
    get:
      tags:
        - Prometheus
      summary: Returns device metrics in Prometheus format.
      operationId: getPrometheusDeviceMetrics
      produces:
        - text/plain
      security:
        - basicAuth: [ ]
      responses:
        200:
          description: OK
          schema:
            type: string
