# ECTicketInfo

ECTicketInfo handles representing a ticket for a given title ID. It provides usable data about the status of the title on the Wii.

You do not want to instantiate this object yourself. Instead, obtain one via `ec.getTicketInfos(titleId)` and iterate through all [ECTicketInfos](#ecticketinfos) until you find what is desired. This will populate all ECTicketInfo available with usable data.

For example:

```javascript
// Obtains tickets for the System Menu
var infos = ec.getTicketInfos("0000000100000002");

// Ensure you check infos.length. In this example, we do not.
var ticket = infos.get(0);
```

### Properties

| Property Name          | Discussion                                                                                                                     |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `ticket.ticketId`      | The ticket ID of the retrieved ticket.                                                                                         |
| `ticket.titleId`       | The title ID this ticket is intended for.                                                                                      |
| `ticket.nLimits`       | The number of limits available for this ticket.                                                                                |
| `ticket.limits`        | Returns an [ECTitleLimits](/wii-shop-channel/js/ec/title-objects/ectitlelimit.md#ectitlelimits) object for the current ticket. |
| `ticket.version`       | The file version of this ticket, which should be 0.                                                                            |
| `ticket.deviceId`      | The device ID this ticket is specified for.                                                                                    |
| `ticket.ticketVersion` | The version of this title.                                                                                                     |
| `ticket.licenseType`   | <p>The type of license this ticket represents.<br><br>TODO: determine possible values</p>                                      |
| `ticket.cidxMask`      | <p>A base64-encoded field of some field within the ticket.<br><br>TODO: determine</p>                                          |
| `ticket.reserved`      | <p>A base64-encoded field of some field within the ticket.<br><br>TODO: determine</p>                                          |

## ECTicketInfos

`ECTicketInfos` manages multiple of an `ECTicketInfo`. It is intended to be an immutable array, and its values only be retrived, not set.

### Properties

| Property Name       | Discussion                                                                                                               |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| `ticket.length`     | Returns the length of the tracked array.                                                                                 |
| `ticket.get(index)` | Returns the [ECTicketInfo](/wii-shop-channel/js/ec/title-objects/ecticketinfo.md) at the given index.                    |
| `ticket.set`        | This array is considered immutable. Despite it existing, attempting to call or access this property results in an error. |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.oscwii.org/wii-shop-channel/js/ec/title-objects/ecticketinfo.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
