openapi: 3.0.2
info:
  title: Content APIs
  description: API supported for Property Search
  version: 1.0.0
  contact:
    name: Contract Support
    url: 'https://www.lastminute.com'
    email: info@lastminute.com
  termsOfService: 'https://www.lastminute.com/terms/terms-and-conditions.html'

servers:
  - url: 'https://qa-partner.momorooms.com'
    description: qa server
  - url: 'https://partner.momorooms.com'
    description: production server
tags:
  - name: Property Static Content
    description: API related to Quote.
paths:
  /v1/properties:
    get:
      description: Fetch all the contracted propertyId(s) for the Partner.
      operationId: GetContractedPropertyID(s)
      responses:
        '200':
          description: OK
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/GetPropertiesResponse'
        '500':
          description: Server Side Error
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/ServerErrorResponse'
      summary: Get PropertyId(s)
  /v1/property/content:
    post:
      description: Fetch all the property content for given propertyId(s).
      operationId: GetPropertyContent
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PropertyContentRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/PropertyContentResponse'
        '400':
          description: Client Side Error
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/PropertyContentClientServerResponse'
        '500':
          description: Server Side Error
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/ServerErrorResponse'
      summary: Property content
  /v1/room/content:
    post:
      description: Fetch all the room content for given propertyId(s).
      operationId: GetRoomContent
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RoomContentRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/RoomContentResponse'
        '400':
          description: Client Side Error
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/RoomContentClientErrorResponse'
        '500':
          description: Server Side Error
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/ServerErrorResponse'
      summary: Room content
components:
  schemas:
    GetPropertiesResponse:
      type: object
      properties:
        propertyIds:
          type: array
          items:
            type: integer
            format: int64
          description: Momorooms ID(s) of the contracted properties.
    PropertyContentRequest:
      type: object
      required:
        - propertyIds
      properties:
        propertyIds:
          description: List of Momorooms ID(s) of the properties to get complete static content
          type: array
          minItems: 1
          maxItems: 5
          items:
            type: integer
            format: int64
    RoomContentRequest:
      type: object
      required:
        - propertyIds
      properties:
        propertyIds:
          description: List of Momorooms ID(s) of the properties to get all the rooms and it's content
          type: array
          minItems: 1
          maxItems: 5
          items:
            type: integer
            format: int64
    RoomContentResponse:
      type: object
      properties:
        properties:
          type: array
          items:
            $ref: '#/components/schemas/Property'
    RoomContentClientErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/RoomClientError'
    ServerErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ServerError'
    Property:
      type: object
      properties:
        propertyId:
          description: 'Momorooms ID of the property for which room content is requested'
          type: integer
          format: int64
        giata:
          description: 'GiataId of the property for which room content is requested'
          type: integer
          format: int64
        rooms:
          type: array
          items:
            $ref: '#/components/schemas/Room'
    Room:
      type: object
      properties:
        roomId:
          description: 'Room Unique Identifier'
          type: integer
          format: int64
        roomCode:
          description: 'Unique Identifier Room Code; example: KNG'
          type: string
        details:
            $ref: '#/components/schemas/RoomDetails'
        bedTypeInfo:
          type: array
          items:
            $ref: '#/components/schemas/BedTypeInfo'
        dormInfo:
          $ref: '#/components/schemas/DormInfo'
        description:
          description: 'description of the room'
          type: string
        amenities:
          description: 'all the amenities supported in the rooom'
          type: array
          items:
            type:
              string
        images:
          description: List of images url for this room.
          type: array
          items:
            type: string
    RoomDetails:
      type: object
      properties:
        roomName:
          description: 'Room name coined from the selected roomType and other attributes'
          type: string
        roomType:
          description: 'type of room: example: Single Room or Bungalow'
          type: string
        noOfBedRooms:
          description: 'denotes no of bed rooms in certain type of rooms like appartment, villa, bungalow'
          type: integer
          format: int32
        roomAttributes:
          $ref: '#/components/schemas/RoomAttributes'
    DormInfo:
      type: object
      description: 'available only if roomType is dormitory'
      properties:
        noOfBeds:
          description: 'Number of beds in the room'
          type: integer
          format: int32
        dormCapacity:
          description: 'Capacity of the dormitory'
          type: integer
          format: int32
        bedType:
          description: 'denotes the bedType available in the room. Example:Double'
          type: string
        conjunction:
          description: >
            Optional. Used only when the room supports more than one bedType.
            It defines how the current bedType relates to the next one.

            Example:
            If bedTypeInfo includes:
              - noOfBeds: 1, bedType: X beds in XX Bed Dorm (Female), dormCapacity: 5, conjunction: or
              - noOfBeds: 1, bedType: X beds in XX Bed Dorm (Male), dormCapacity: 5

            This should be interpreted as: "1 Bed in 5 Bed Dorm (Female) or 1 Bed in 5 Bed Dorm (Male)"
          type: string
    RoomAttributes:
      type: object
      properties:
        style:
          type: array
          items:
            type:
              string
          description: 'The style of the Room'
        view:
          description: 'View associated with the room'
          type: array
          items:
            type:
              string
        feature:
          description: 'feature available in the room'
          type: array
          items:
            type:
              string
    BedTypeInfo:
      type: object
      properties:
        noOfBeds:
          description: 'Number of beds in the room'
          type: integer
          format: int32
        bedType:
          description: 'denotes the bedType available in the room. Example:Double'
          type: string
        conjunction:
          description: >
            Optional. Used only when the room supports more than one bedType.
            It defines how the current bedType relates to the next one.

            Example:
            If bedTypeInfo includes:
              - noOfBeds: 1, bedType: Double, conjunction: or
              - noOfBeds: 2, bedType: Single

            This should be interpreted as: "1 Double or 2 Single"
          type: string
    PropertyContentClientServerResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/PropertyClientError'
    PropertyContentResponse:
      type: object
      properties:
        properties:
          type: array
          description: List of properties with their content details
          items:
            $ref: '#/components/schemas/PropertyContent'
    PropertyContent:
      type: object
      properties:
        id:
          type: integer
          format: int64
          description: Momorooms ID of the available property based on the search criteria.
        giata:
          type: string
          description: GIATA code of the Momorooms ID.
        name:
          $ref: '#/components/schemas/ContentInLanguage'
        accommodation_type:
          type: string
          description: Hotel Type of the Momorooms ID.
        chain:
          $ref: '#/components/schemas/Chain'
        contact:
          $ref: '#/components/schemas/Contact'
        location:
          $ref: '#/components/schemas/Location'
        stars:
          type: integer
          format: int32
          description: Star rating of the Momorooms ID.
        checkin_checkout:
          $ref: '#/components/schemas/CheckInCheckOut'
        dsa:
          $ref: '#/components/schemas/DSA'
        descriptions:
          $ref: '#/components/schemas/Descriptions'
        images:
          type: array
          description: Images of the Momorooms ID.
          items:
            $ref: '#/components/schemas/Images'
        services:
          $ref: '#/components/schemas/Services'
    PropertyClientError:
      type: object
      properties:
        errorCode:
          type: integer
          format: int32
        errorDescription:
          type: string
          description: 'Possible error responses:  <table> <thead> <tr> <th>ErrorCode</th> <th>ErrorDesc</th> </tr> </thead> <tbody> <tr><td>2001</td><td>PropertyIds is required, Please provide a valid value </td></tr> <tr><td>2002</td><td>Number of property requested must be within 5 </td></tr> <tr><td>2004</td><td>Number of property requested must be greater than 1 </td></tr>  <tr><td>2003</td><td>None of the requested properties is not in the contracted properties</td></tr> </tbody> </table>'
    RoomClientError:
      type: object
      properties:
        errorCode:
          type: integer
          format: int32
        errorDescription:
          type: string
          description: 'Possible error responses:  <table> <thead> <tr> <th>ErrorCode</th> <th>ErrorDesc</th> </tr> </thead> <tbody> <tr><td>2001</td><td>PropertyIds is required, Please provide a valid value </td></tr> <tr><td>2002</td><td>Number of property requested must be within 5 </td></tr> <tr><td>2004</td><td>Number of property requested must be greater than 1 </td></tr>  <tr><td>2003</td><td>None of the requested properties is not in the contracted properties</td></tr> </tbody> </table>'
    ServerError:
      type: object
      properties:
        errorCode:
          type: integer
          format: int32
        errorDescription:
          type: string
          description: 'Possible error responses:  <table> <thead> <tr> <th>ErrorCode</th> <th>ErrorDesc</th> </tr> </thead> <tbody>  <tr><td>500</td><td>An unexpected error occurred. Please try again later. </td></tr>  </tbody> </table>'
    Images:
      type: object
      properties:
        url:
          type: string
          description: Image URL of the Momorooms ID.
        position:
          type: number
          format: int32
          description: Display Position of the Image of the Momorooms ID.
    Services:
      type: object
      properties:
        en:
          type: array
          description: Description in the english language.
          items:
            $ref: '#/components/schemas/Service'
        de:
          type: array
          description: Description in the German language.
          items:
            $ref: '#/components/schemas/Service'
    Service:
      type: object
      properties:
        type:
          type: string
          description: Type of Service supported by the Momorooms ID.
        description:
          type: string
          description: Service Description of the Momorooms ID.
        cost:
          type: boolean
          description: Is Cost associated to the Service or not.
    Descriptions:
      type: object
      properties:
        en:
          type: array
          description: Description in the english language.
          items:
            $ref: '#/components/schemas/Description'
        de:
          type: array
          description: Description in the German language.
          items:
            $ref: '#/components/schemas/Description'
    Description:
      type: object
      properties:
        title:
          type: string
          description: Description's Title of the Momorooms ID.
        description:
          type: string
          description: Description of the Momorooms ID.
    CheckInCheckOut:
      type: object
      properties:
        checkin_time:
          $ref: '#/components/schemas/Range'
        checkout_time:
          $ref: '#/components/schemas/Range'
    DSA:
      type: object
      properties:
        registration_number:
          type: string
          description: Registration Number of the Momorooms ID.
        email:
          type: string
          description: Registered Email of the Momorooms ID.
        name:
          type: string
          description: Registered Name of the Momorooms ID.
        phone:
          type: string
          description: Registered phone of the Momorooms ID.
        trade_register:
          type: string
          description: Trade Register of the Momorooms ID.
        license_numbers:
          description: License Numbers of the Momorooms ID.
          type: array
          items:
            type:
              string
        address:
          $ref: '#/components/schemas/DSA_Address'
    DSA_Address:
      type: object
      properties:
        street:
          type: string
          description: Registered trade street name where hotel/property is located.
        postalCode:
          type: string
          description: Registered trade postalCode where hotel/property is located.
        city:
          type: string
          description: Registered trade city where hotel/property is located.
        country:
          type: string
          description: Registered trade country where hotel/property is located.
    Range:
      type: object
      properties:
        from:
          type: string
          description: Time from when we can CheckIn/CheckOut.
        to:
          type: string
          description: Time till when we can CheckIn/CheckOut.
    Chain:
      type: object
      properties:
        name:
          type: string
          description: Chain name of the Momorooms ID.
        code:
          type: string
          description: Chain code of the Momorooms ID.
    Contact:
      type: object
      properties:
        phone:
          type: string
          description: Phone number of the Momorooms ID.
        email:
          type: string
          description: Contact email of the Momorooms ID.
    Location:
      type: object
      properties:
        coordinates:
          $ref: '#/components/schemas/Coordinates'
        country_iso_code:
          type: string
          description: Country of the Momorooms ID.
        region:
          $ref: '#/components/schemas/ContentInLanguage'
        city:
          $ref: '#/components/schemas/ContentInLanguage'
        address:
          type: string
          description: Address of the Momorooms ID.
        postal_code:
          type: string
          description: Postal Code of the Momorooms ID.
    Coordinates:
      type: object
      properties:
        latitude:
          type: number
          format: double
          description: latitude Location of the Momorooms ID.
        longitude:
          type: number
          format: double
          description: longitude Location of the Momorooms ID.
    ContentInLanguage:
      type: object
      properties:
        en:
          type: string
          description: Content in English.
        de:
          type: string
          description: Content in German.
  securitySchemes:
    oAuthSecurity:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://qa-partner.momorooms.com/auth/oauth/token
          scopes:
            read_rooms: sample scope to execute read operations
            write_rooms: sample scope to execute write operations

security:
  - oAuthSecurity:
    - read_rooms
    - write_rooms



