openapi: "3.0.1"
info:
  title: "partner-api"
  version: "1.0"
servers:
- url: "https://partner-api.onthesnow.com"
paths:
  /resort/{resortId}/snowreport:
    get:
      parameters:
      - name: "resortId"
        in: "path"
        required: true
        schema:
          type: "string"
      responses:
        "200":
          description: "200 response"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ResortSnowReport"
      security:
      - api_key: []
  /resort/{resortId}/weather/daily:
    get:
      parameters:
      - name: "resortId"
        in: "path"
        required: true
        schema:
          type: "string"
      responses:
        "200":
          description: "200 response"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ResortWeatherDaily"
      security:
      - api_key: []
  /resort/{resortId}/webcams:
    get:
      parameters:
      - name: "resortId"
        in: "path"
        required: true
        schema:
          type: "string"
      responses:
        "200":
          description: "200 response"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PartnerWebcamItems"
      security:
      - api_key: []
  /resort/{resortId}/profile:
    get:
      parameters:
      - name: "resortId"
        in: "path"
        required: true
        schema:
          type: "string"
      responses:
        "200":
          description: "200 response"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ResortProfile"
      security:
      - api_key: []
  /resorts:
    get:
      operationId: "listResorts"
      parameters:
      - name: "state"
        in: "query"
        schema:
          type: "string"
      - name: "continent"
        in: "query"
        schema:
          type: "string"
      - name: "resortName"
        in: "query"
        schema:
          type: "string"
      - name: "country"
        in: "query"
        schema:
          type: "string"
      responses:
        "200":
          description: "200 response"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PartnerResortItems"
      security:
      - api_key: []
  /resort/{resortId}/weather/hourly:
    get:
      parameters:
      - name: "resortId"
        in: "path"
        required: true
        schema:
          type: "string"
      responses:
        "200":
          description: "200 response"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ResortWeatherHourly"
      security:
      - api_key: []
components:
  schemas:
    ResortSnowReport:
      type: "object"
      properties:
        surfaceType:
          type: "number"
          description: "\n *         Primary snow surface type at the top:\n *   \
            \      `1` - Powder\n *         `2` - Packed Powder\n *         `3` -\
            \ Machine Made\n *         `4` - Machine Groomed\n *         `5` - Hard\
            \ Packed\n *         `6` - Spring Snow\n *         `7` - Corn Snow\n *\
            \         `8` - Loose Granular\n *         `9` - Frozen Granular\n * \
            \        `10` - Granular\n *         `11` - Icy Spots\n *         `12`\
            \ - Bare Spots\n *         `13` - Obstacles\n *         `14` - Skiers\
            \ Packed\n *         `15` - Variable Conditions\n *         `16` - Wet\
            \ Snow\n *         `17` - Thin Cover\n *         `18` - Wind Blown"
          enum:
          - 1
          - 2
          - 3
          - 4
          - 5
          - 6
          - 7
          - 8
          - 9
          - 10
          - 11
          - 12
          - 13
          - 14
          - 15
          - 16
          - 17
          - 18
        depthes:
          required:
          - "base"
          - "summit"
          type: "object"
          properties:
            middle:
              type: "number"
              description: "Middle snow depth"
            summit:
              type: "number"
              description: "Summit snow depth"
            base:
              type: "number"
              description: "Base snow depth"
        lifts:
          required:
          - "total"
          type: "object"
          properties:
            total:
              type: "number"
              description: "Number of lifts total"
            details:
              type: "array"
              items:
                type: "object"
                properties:
                  difficulty:
                    type: "number"
                    description: "\n *               Trail difficulty:\n *       \
                      \        `1` - Easy\n *               `2` - Intermediate\n *\
                      \               `3` - Advanced\n *               `4` - Expert\n\
                      \ *             "
                    enum:
                    - 1
                    - 2
                    - 3
                    - 4
                  hours:
                    type: "string"
                    description: "Lift working hours"
                  lift_type:
                    type: "string"
                    description: "\n *               Lift Type:\n *              \
                      \ `sixHS` - Six Chair High Speed\n *               `gondolasAndTrams`\
                      \ - Gondola\n *               `fourHS` - Four Chair High Speed\n\
                      \ *               `fourChairs` - Four Chair\n *            \
                      \   `threeChairs` - Three Chairs\n *               `doubleChairs`\
                      \ - Double Chairs\n *               `surface` - Surface lift\n\
                      \ *               `other` - Other type of lift\n *         \
                      \    "
                    enum:
                    - "sixHS"
                    - "gondolasAndTrams"
                    - "fourHS"
                    - "fourChairs"
                    - "threeChairs"
                    - "doubleChairs"
                    - "surface"
                    - "other"
                  name:
                    type: "string"
                    description: "Lift name"
                  status:
                    type: "number"
                    description: "\n *               Lift Operating Status:\n *  \
                      \             `0` - No Info\n *               `1` - Open\n *\
                      \               `2` - Closed\n *               `3` - Temporarily\
                      \ Closed (On Hold)\n *               `4` - Delayed\n *     \
                      \          `5` - Open to Mid Station only\n *             "
                    enum:
                    - 0
                    - 1
                    - 2
                    - 3
                    - 4
                    - 5
            open:
              type: "number"
              description: "Number of lifts open"
          description: "Resort lifts element"
        terrain:
          type: "object"
          properties:
            parks:
              required:
              - "total"
              type: "object"
              properties:
                total:
                  type: "number"
                  description: "Number of pipes total"
                open:
                  type: "number"
                  description: "Number of pipes open"
            canReturnBySki:
              type: "boolean"
            km:
              required:
              - "total"
              type: "object"
              properties:
                total:
                  type: "number"
                  description: "Km of runs total"
                open:
                  type: "number"
                  description: "Km of runs open"
              description: "Resort runs in km element"
            runsIntermediate:
              required:
              - "total"
              - "totalLen"
              - "totalPercent"
              type: "object"
              properties:
                total:
                  type: "number"
                openPercent:
                  type: "number"
                totalLen:
                  type: "number"
                openNum:
                  type: "number"
                totalPercent:
                  type: "number"
                openLen:
                  type: "number"
              description: "Resort intermediate terrain item"
            runsExpert:
              required:
              - "total"
              - "totalLen"
              - "totalPercent"
              type: "object"
              properties:
                total:
                  type: "number"
                openPercent:
                  type: "number"
                totalLen:
                  type: "number"
                openNum:
                  type: "number"
                totalPercent:
                  type: "number"
                openLen:
                  type: "number"
              description: "Resort expert terrain item"
            runsBeginner:
              required:
              - "total"
              - "totalLen"
              - "totalPercent"
              type: "object"
              properties:
                total:
                  type: "number"
                openPercent:
                  type: "number"
                totalLen:
                  type: "number"
                openNum:
                  type: "number"
                totalPercent:
                  type: "number"
                openLen:
                  type: "number"
              description: "Resort beginner terrain item"
            runsAdvanced:
              required:
              - "total"
              - "totalLen"
              - "totalPercent"
              type: "object"
              properties:
                total:
                  type: "number"
                openPercent:
                  type: "number"
                totalLen:
                  type: "number"
                openNum:
                  type: "number"
                totalPercent:
                  type: "number"
                openLen:
                  type: "number"
              description: "Resort advanced terrain item"
            tubes:
              required:
              - "total"
              type: "object"
              properties:
                total:
                  type: "number"
                  description: "Number of tubes total"
                open:
                  type: "number"
                  description: "Number of tubes open"
            acres:
              required:
              - "total"
              type: "object"
              properties:
                total:
                  type: "number"
                  description: "Number of acres total"
                open:
                  type: "number"
                  description: "Number of acres open"
            nordic:
              required:
              - "total"
              type: "object"
              properties:
                total:
                  type: "number"
                  description: "Total in km"
                skategroomed:
                  type: "number"
                  description: "Skategroomed in km"
                trackset:
                  type: "number"
                  description: "Trackset in km"
                open:
                  type: "number"
                  description: "Nordic Open in km"
            runs:
              required:
              - "total"
              type: "object"
              properties:
                total:
                  type: "integer"
                  description: "Total number of runs"
                  format: "int32"
                openPercent:
                  type: "integer"
                  description: "Percentage of runs that are open"
                  format: "int32"
                details:
                  type: "array"
                  description: "List of individual runs with their statuses and attributes"
                  items:
                    type: "object"
                    properties:
                      difficulty:
                        type: "number"
                        description: "\n *                        Trail difficulty:\n\
                          \ *                        `1` - Easy\n *              \
                          \          `2` - Intermediate\n *                      \
                          \  `3` - Advanced\n *                        `4` - Expert\n\
                          \ *                      "
                        enum:
                        - 0
                        - 1
                        - 2
                        - 3
                        - 4
                        - 5
                      nightskiing:
                        type: "boolean"
                        description: "Indicates if the run supports night skiing"
                      snowmaking:
                        type: "boolean"
                        description: "Snowmaking"
                      name:
                        type: "string"
                        description: "Name of the run"
                      grooming:
                        type: "boolean"
                        description: "Indicates if the run is groomed"
                      status:
                        type: "number"
                        description: "\n *                        Lift Operating Status:\n\
                          \ *                        `0` - No Info\n *           \
                          \             `1` - Open\n *                        `2`\
                          \ - Closed\n *                        `3` - Temporarily\
                          \ Closed (On Hold)\n *                        `4` - Delayed\n\
                          \ *                        `5` - Open to Mid Station only\n\
                          \ *                      "
                        enum:
                        - 0
                        - 1
                        - 2
                        - 3
                        - 4
                        - 5
                open:
                  type: "integer"
                  description: "Number of open runs"
                  format: "int32"
            pipes:
              required:
              - "total"
              type: "object"
              properties:
                total:
                  type: "number"
                  description: "Number of pipes total"
                open:
                  type: "number"
                  description: "Number of pipes open"
        recent:
          type: "array"
          description: "Recent snow history for the last 7 days."
          items:
            required:
            - "date"
            - "snow"
            type: "object"
            properties:
              date:
                type: "string"
                description: "ISO date without time in YYYY-MM-dd format"
              snow:
                type: "number"
                description: "Snow fall value in cm"
            description: "Describes snow history chart item"
        surfaceTypeBottom:
          type: "number"
          description: "\n *         Primary snow surface type at the bottom:\n *\
            \         `1` - Powder\n *         `2` - Packed Powder\n *         `3`\
            \ - Machine Made\n *         `4` - Machine Groomed\n *         `5` - Hard\
            \ Packed\n *         `6` - Spring Snow\n *         `7` - Corn Snow\n *\
            \         `8` - Loose Granular\n *         `9` - Frozen Granular\n * \
            \        `10` - Granular\n *         `11` - Icy Spots\n *         `12`\
            \ - Bare Spots\n *         `13` - Obstacles\n *         `14` - Skiers\
            \ Packed\n *         `15` - Variable Conditions\n *         `16` - Wet\
            \ Snow\n *         `17` - Thin Cover\n *         `18` - Wind Blown"
          enum:
          - 1
          - 2
          - 3
          - 4
          - 5
          - 6
          - 7
          - 8
          - 9
          - 10
          - 11
          - 12
          - 13
          - 14
          - 15
          - 16
          - 17
          - 18
        status:
          required:
          - "openFlag"
          type: "object"
          properties:
            openFlag:
              type: "number"
              description: "\n *              Resort Open Status:\n *            \
                \  `1` - Open\n *              `2` - Closed\n *              `3` -\
                \ Temporarily Closed\n *              `4` - Weekends only\n *    \
                \          `5` - No Report Available\n *              `6` - Permanently\
                \ Closed\n *          "
              enum:
              - 1
              - 2
              - 3
              - 4
              - 5
              - 6
            closingDate:
              type: "string"
              description: "ISO 8601 date without time"
            openingDate:
              type: "string"
              description: "ISO 8601 date without time"
          description: "Report Status"
        updatedAt:
          type: "string"
          description: "The last update date and time of the snow report in ISO 8601\
            \ format."
          format: "date-time"
      description: "Represents the snow report for a partner resort."
    PartnerWebcamItems:
      type: "array"
      description: "Collection of partner webcams"
      items:
        type: "object"
        properties:
          image:
            type: "object"
            properties:
              large:
                type: "string"
                format: "uri"
              thumb:
                type: "string"
                format: "uri"
              xlarge:
                type: "string"
                format: "uri"
              mid:
                type: "string"
                format: "uri"
          lastUpdate:
            type: "string"
            format: "date-time"
          webcamId:
            type: "number"
          resort:
            type: "number"
          webcamName:
            type: "string"
          liveStreaming:
            type: "boolean"
    ResortProfile:
      type: "object"
      properties:
        elevation:
          required:
          - "base"
          - "summit"
          - "verticalDrop"
          type: "object"
          properties:
            verticalDrop:
              type: "number"
            summit:
              type: "number"
            base:
              type: "number"
          description: "Mountain elevation info in meters"
        website:
          type: "string"
          description: "Official website URL of the resort"
          format: "url"
        resortName:
          type: "string"
          description: "Name of the resort"
        location:
          type: "object"
          properties:
            zip:
              type: "string"
              description: "ZIP code of the resort"
            city:
              type: "string"
              description: "City where the resort is located"
            stateName:
              type: "string"
              description: "Name of the state"
            street:
              type: "string"
              description: "Street address of the resort"
            latitude:
              type: "number"
              description: "Latitude"
              format: "float"
            countryName:
              type: "string"
              description: "Name of the country"
            longitude:
              type: "number"
              description: "Longitude"
              format: "float"
          description: "Location details of the resort"
        lifts:
          required:
          - "total"
          type: "object"
          properties:
            total:
              type: "number"
              description: "Number of lifts total"
            details:
              type: "array"
              items:
                type: "string"
            open:
              type: "number"
              description: "Number of lifts open"
          description: "Resort lifts element"
        id:
          type: "integer"
          description: "Unique identifier for the resort profile"
          format: "int32"
        runs:
          type: "object"
          properties:
            expert:
              type: "integer"
              description: "Number of expert runs"
              format: "int32"
            total:
              type: "integer"
              description: "Total number of runs"
              format: "int32"
            beginner:
              type: "integer"
              description: "Number of beginner runs"
              format: "int32"
            advanced:
              type: "integer"
              description: "Number of advanced runs"
              format: "int32"
            intermediate:
              type: "integer"
              description: "Number of intermediate runs"
              format: "int32"
            totalRunsLength:
              type: "number"
              description: "Total length of all runs in km"
              format: "float"
          description: "Information about the resort's runs"
        terrain:
          type: "object"
          properties:
            km:
              type: "number"
              description: "Kilometers of pistes"
              format: "float"
            acres:
              type: "integer"
              description: "Skiable acres"
              format: "int32"
            skiReturn:
              type: "integer"
              description: "Ability to return by ski"
              format: "int32"
          description: "Terrain information"
        facts:
          type: "object"
          properties:
            projectedOpening:
              type: "string"
              description: "Projected opening date in YYYY-MM-DD format"
              format: "date"
            numDaysOpenLastYear:
              type: "integer"
              description: "Number of days the resort was open last year"
              format: "int32"
            projectedClosing:
              type: "string"
              description: "Projected closing date in YYYY-MM-DD format"
              format: "date"
          description: "Additional facts about the resort"
      description: "Detailed profile information of a resort"
    ResortWeatherDaily:
      required:
      - "base"
      - "summit"
      - "weatherItems"
      type: "object"
      properties:
        weatherItems:
          type: "array"
          items:
            required:
            - "base"
            - "datetime"
            - "summit"
            type: "object"
            properties:
              datetime:
                type: "string"
                description: "ISO 8601 date with time"
              mid:
                required:
                - "snow"
                - "temp"
                - "type"
                - "wind"
                type: "object"
                properties:
                  temp:
                    type: "object"
                    properties:
                      min:
                        type: "number"
                      max:
                        type: "number"
                  snow:
                    type: "object"
                    properties:
                      density:
                        type: "number"
                      snowfall:
                        type: "number"
                      probability:
                        type: "number"
                      snowline:
                        type: "number"
                  type:
                    type: "string"
                  wind:
                    type: "object"
                    properties:
                      gusts:
                        type: "number"
                      speed:
                        type: "number"
                      direction:
                        type: "number"
              summit:
                required:
                - "snow"
                - "temp"
                - "type"
                - "wind"
                type: "object"
                properties:
                  temp:
                    type: "object"
                    properties:
                      min:
                        type: "number"
                      max:
                        type: "number"
                  snow:
                    type: "object"
                    properties:
                      density:
                        type: "number"
                      snowfall:
                        type: "number"
                      probability:
                        type: "number"
                      snowline:
                        type: "number"
                  type:
                    type: "string"
                  wind:
                    type: "object"
                    properties:
                      gusts:
                        type: "number"
                      speed:
                        type: "number"
                        description: "Wind speed in meters/second"
                      direction:
                        type: "number"
              base:
                required:
                - "snow"
                - "temp"
                - "type"
                - "wind"
                type: "object"
                properties:
                  temp:
                    type: "object"
                    properties:
                      min:
                        type: "number"
                      max:
                        type: "number"
                  snow:
                    type: "object"
                    properties:
                      density:
                        type: "number"
                      snowfall:
                        type: "number"
                      probability:
                        type: "number"
                      snowline:
                        type: "number"
                  type:
                    type: "string"
                  wind:
                    type: "object"
                    properties:
                      gusts:
                        type: "number"
                      speed:
                        type: "number"
                      direction:
                        type: "number"
            description: "Historical Weather Item"
        summit:
          type: "number"
        base:
          type: "number"
    PartnerResortItems:
      type: "array"
      description: "Collection of partner resorts"
      items:
        type: "object"
        properties:
          continent:
            type: "string"
            description: "Resort Continent"
          country:
            type: "string"
            description: "Resort country"
          name:
            type: "string"
            description: "Name of the resort"
          state:
            type: "string"
            description: "Resort State"
          id:
            type: "number"
            description: "Unique identifier of the resort"
    ResortWeatherHourly:
      required:
      - "base"
      - "summit"
      - "weatherItems"
      type: "object"
      properties:
        weatherItems:
          type: "array"
          items:
            required:
            - "base"
            - "datetime"
            - "summit"
            type: "object"
            properties:
              datetime:
                type: "string"
                description: "ISO 8601 date with time"
              mid:
                required:
                - "snow"
                - "temp"
                - "type"
                - "wind"
                type: "object"
                properties:
                  temp:
                    type: "object"
                    properties:
                      min:
                        type: "number"
                      max:
                        type: "number"
                  snow:
                    type: "object"
                    properties:
                      density:
                        type: "number"
                      snowfall:
                        type: "number"
                      probability:
                        type: "number"
                      snowline:
                        type: "number"
                  type:
                    type: "string"
                  wind:
                    type: "object"
                    properties:
                      gusts:
                        type: "number"
                      speed:
                        type: "number"
                      direction:
                        type: "number"
              summit:
                required:
                - "snow"
                - "temp"
                - "type"
                - "wind"
                type: "object"
                properties:
                  temp:
                    type: "object"
                    properties:
                      min:
                        type: "number"
                      max:
                        type: "number"
                  snow:
                    type: "object"
                    properties:
                      density:
                        type: "number"
                      snowfall:
                        type: "number"
                      probability:
                        type: "number"
                      snowline:
                        type: "number"
                  type:
                    type: "string"
                  wind:
                    type: "object"
                    properties:
                      gusts:
                        type: "number"
                      speed:
                        type: "number"
                        description: "Wind speed in meters/second"
                      direction:
                        type: "number"
              base:
                required:
                - "snow"
                - "temp"
                - "type"
                - "wind"
                type: "object"
                properties:
                  temp:
                    type: "object"
                    properties:
                      min:
                        type: "number"
                      max:
                        type: "number"
                  snow:
                    type: "object"
                    properties:
                      density:
                        type: "number"
                      snowfall:
                        type: "number"
                      probability:
                        type: "number"
                      snowline:
                        type: "number"
                  type:
                    type: "string"
                  wind:
                    type: "object"
                    properties:
                      gusts:
                        type: "number"
                      speed:
                        type: "number"
                      direction:
                        type: "number"
            description: "Historical Weather Item"
        summit:
          type: "number"
        base:
          type: "number"
  securitySchemes:
    api_key:
      type: "apiKey"
      name: "x-api-key"
      in: "header"
