#%RAML 0.8

title: API Gateway Test API
version: 1.0.0

documentation:
  - title: About
    content: Move your app forward with the Uber API

baseUri: https://api.uber.com/v1

mediaType: application/json

schemas:
  - Product: |
      {
        "properties": {
          "product_id": {
            "type": "string",
            "description": "Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles."
          },
          "description": {
            "type": "string",
            "description": "Description of product."
          },
          "display_name": {
            "type": "string",
            "description": "Display name of product."
          },
          "capacity": {
            "type": "string",
            "description": "Capacity of product. For example, 4 people."
          },
          "image": {
            "type": "string",
            "description": "Image URL representing the product."
          }
        }
      }
  - PriceEstimate: |
      {
        "properties": {
          "product_id": {
            "type": "string",
            "description": "Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles"
          },
          "currency_code": {
            "type": "string",
            "description": "[ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code."
          },
          "display_name": {
            "type": "string",
            "description": "Display name of product."
          },
          "estimate": {
            "type": "string",
            "description": "Formatted string of estimate in local currency of the start location. Estimate could be a range, a single number (flat rate) or \"Metered\" for TAXI."
          },
          "low_estimate": {
            "type": "number",
            "description": "Lower bound of the estimated price."
          },
          "high_estimate": {
            "type": "number",
            "description": "Upper bound of the estimated price."
          },
          "surge_multiplier": {
            "type": "number",
            "description": "Expected surge multiplier. Surge is active if surge_multiplier is greater than 1. Price estimate already factors in the surge multiplier."
          }
        }
      }
  - Profile: |
      {
        "properties": {
          "first_name": {
            "type": "string",
            "description": "First name of the Uber user."
          },
          "last_name": {
            "type": "string",
            "description": "Last name of the Uber user."
          },
          "email": {
            "type": "string",
            "description": "Email address of the Uber user"
          },
          "picture": {
            "type": "string",
            "description": "Image URL of the Uber user."
          },
          "promo_code": {
            "type": "string",
            "description": "Promo code of the Uber user."
          }
        }
      }
  - Activity: |
      {
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Unique identifier for the activity"
          }
        }
      }
  - Activities: |
      {
        "properties": {
          "offset": {
            "type": "integer",
            "format": "int32",
            "description": "Position in pagination."
          },
          "limit": {
            "type": "integer",
            "format": "int32",
            "description": "Number of items to retrieve (100 max)."
          },
          "count": {
            "type": "integer",
            "format": "int32",
            "description": "Total number of items available."
          },
          "history": {
            "type": "array",
            "items": {
              "properties": {
                "uuid": {
                  "type": "string",
                  "description": "Unique identifier for the activity"
                }
              }
            }
          }
        }
      }
  - Error: |
      {
        "properties": {
          "code": {
            "type": "integer",
            "format": "int32"
          },
          "message": {
            "type": "string"
          },
          "fields": {
            "type": "string"
          }
        }
      }

/products:
  get:
    description: |
      The Products endpoint returns information about the *Uber* products
      offered at a given location. The response includes the display name
      and other details about each product, and lists the products in the
      proper display order.
    queryParameters:
      latitude:
        description: Latitude component of location.
        type: number
        required: true
      longitude:
        description: Longitude component of location.
        type: number
        required: true
    responses:
      200:
        description: An array of products
        body:
          schema: |
            {
              "type": "array",
              "items": {
                "properties": {
                  "product_id": {
                    "type": "string",
                    "description": "Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles."
                  },
                  "description": {
                    "type": "string",
                    "description": "Description of product."
                  },
                  "display_name": {
                    "type": "string",
                    "description": "Display name of product."
                  },
                  "capacity": {
                    "type": "string",
                    "description": "Capacity of product. For example, 4 people."
                  },
                  "image": {
                    "type": "string",
                    "description": "Image URL representing the product."
                  }
                }
              }
            }
        headers:
          test-method-response-header:
            type: string
      400:
        description: Bad Request
        body:
          schema: Error
  /child:
    post:
      description: |
        The Products endpoint returns information about the *Uber* products
        offered at a given location. The response includes the display name
        and other details about each product, and lists the products in the
        proper display order.
      queryParameters:
        latitude:
          description: Latitude component of location.
          type: number
          required: true
        longitude:
          description: Longitude component of location.
          type: number
          required: true
      responses:
        200:
          description: An array of products
          body:
            schema: |
              {
                "type": "array",
                "items": {
                  "properties": {
                    "product_id": {
                      "type": "string",
                      "description": "Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles."
                    },
                    "description": {
                      "type": "string",
                      "description": "Description of product."
                    },
                    "display_name": {
                      "type": "string",
                      "description": "Display name of product."
                    },
                    "capacity": {
                      "type": "string",
                      "description": "Capacity of product. For example, 4 people."
                    },
                    "image": {
                      "type": "string",
                      "description": "Image URL representing the product."
                    }
                  }
                }
              }
          headers:
            test-method-response-header:
              type: string
        400:
          description: Bad Request
          body:
            schema: Error
