Skip to content

Commit d98e966

Browse files
authored
Added TOC top links
1 parent 08dfde5 commit d98e966

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

policy/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,16 @@ This specification describes the digital relationship between _mobility as a ser
2525

2626
The following information applies to all `policy` API endpoints.
2727

28+
[Top][toc]
29+
2830
### Versioning
2931

3032
`policy` APIs must handle requests for specific versions of the specification from clients.
3133

3234
Versioning must be implemented as specified in the [Versioning section][versioning].
3335

36+
[Top][toc]
37+
3438
## Background
3539

3640
The goal of this specification is to enable Agencies to create, revise, and publish machine-readable policies, as sets of rules for individual and collective device behavior exhibited by both _mobility as a service_ Providers and riders / users. Examples of policies include:
@@ -63,6 +67,8 @@ Policies should be re-fetched whenever:
6367

6468
Flat files have an optional `end_date` field that will apply to the file as a whole.
6569

70+
[Top][toc]
71+
6672
### REST Endpoints
6773

6874
Among other use-cases, configuring a REST API allows an Agency to:
@@ -112,6 +118,8 @@ Method: `GET`
112118
| ------------ | --------- | --- | ---------------------------------------------- |
113119
| `id` | UUID | Optional | If provided, returns one geography object with the matching UUID; default is to return all geography objects. |
114120

121+
[Top][toc]
122+
115123
### Flat Files
116124

117125
To use flat files, policies shall be represented in two (2) files:
@@ -184,6 +192,8 @@ Response bodies must be a `UTF-8` encoded JSON object and must minimally include
184192
}
185193
```
186194

195+
[Top][toc]
196+
187197
### Policy
188198

189199
An individual `Policy` object is defined by the following fields:
@@ -201,6 +211,8 @@ An individual `Policy` object is defined by the following fields:
201211
| `prev_policies` | UUID[] | Optional | Unique IDs of prior policies replaced by this one |
202212
| `rules` | Rule[] | Required | List of applicable [Rule](#rules) objects |
203213

214+
[Top][toc]
215+
204216
### Rules
205217

206218
An individual `Rule` object is defined by the following fields:
@@ -225,6 +237,8 @@ An individual `Rule` object is defined by the following fields:
225237
| `messages` | `{ String:String }` | Optional | Message to rider user, if desired, in various languages, keyed by language tag (see [Messages](#messages)) |
226238
| `value_url` | URL | Optional | URL to an API endpoint that can provide dynamic information for the measured value (see [Value URL](#value-url)) |
227239

240+
[Top][toc]
241+
228242
### Rule Types
229243

230244
| Name | Description |
@@ -235,6 +249,8 @@ An individual `Rule` object is defined by the following fields:
235249
| `rate` | **[Beta feature](/general-information.md#beta-features):** Yes (as of 1.0.0). Fees or subsidies based on regions and time spent in one or more vehicle-states. Rule `rate_amount` refers to the rate charged according to the [Rate Recurrence](#rate_recurrence). Agencies and Providers must agree on terms of use prior to utilizing the `rate` rule type. |
236250
| `user` | Information for users, e.g. about helmet laws. Generally can't be enforced via events and telemetry. |
237251

252+
[Top][toc]
253+
238254
### Rule Units
239255

240256
| Name | Description |
@@ -246,6 +262,8 @@ An individual `Rule` object is defined by the following fields:
246262
| `mph` | Miles per hour |
247263
| `kph` | Kilometers per hour |
248264

265+
[Top][toc]
266+
249267
### Geography
250268

251269
| Name | Type | Required / Optional | Description |
@@ -258,6 +276,8 @@ An individual `Rule` object is defined by the following fields:
258276
| `publish_date` | [timestamp][ts] | Required | Timestamp that the policy was published, i.e. made immutable |
259277
| `prev_geographies` | UUID[] | Optional | Unique IDs of prior geographies replaced by this one |
260278

279+
[Top][toc]
280+
261281
### Rate Recurrences
262282

263283
Rate recurrences specify when a rate is applied – either once, or periodically according to a `time_unit` specified using [Rule Units](#rule-units). A `time_unit` refers to a unit of time as measured in local time for the juristiction – a day begins at midnight local time, an hour begins at the top of the hour, etc.
@@ -268,6 +288,8 @@ Rate recurrences specify when a rate is applied – either once, or periodicall
268288
| `each_time_unit` | During each `time_unit`, rate is applied once to vehicles entering or remaining in a matching status. Requires a `time_unit` to be specified using `rule_units`. |
269289
| `per_complete_time_unit` | Rate is applied once per complete `time_unit` that vehicles remain in a matching status. Requires a `time_unit` to be specified using `rule_units`. |
270290

291+
[Top][toc]
292+
271293
### Messages
272294

273295
Some Policies as established by the Agency may benefit from rider communication. This optional field contains a map of languages to messages, to be shown to the user.
@@ -283,6 +305,8 @@ Example for a decreased speed-limit rule for Venice Beach on weekends:
283305
},
284306
```
285307

308+
[Top][toc]
309+
286310
### Value URL
287311

288312
An Agency may wish to provide dynamic or global rules, e.g.
@@ -299,6 +323,8 @@ The payload returned from a `GET` request to the `value_url` will have the follo
299323
| `timestamp` | [timestamp][ts] | Required | Timestamp the value was recorded |
300324
| `policy_id` | UUID | Required | Relevant `policy_id` for reference |
301325

326+
[Top][toc]
327+
302328
### Order of Operations
303329

304330
Rules, being in a list, are ordered **most specific** to **most general**. E.g. an "earlier" rule (lower list index) would take precedence over a "later" rule (higher list index).

0 commit comments

Comments
 (0)