openai_struct/models/
approximate_location.rs

1/*
2 * OpenAI API
3 *
4 * The OpenAI REST API. Please see pub https://platform.openai.com/docs/api-reference for more details.
5 *
6 * OpenAPI spec pub version: 2.3.0
7 *
8 * Generated pub by: https://github.com/swagger-api/swagger-codegen.git
9 */
10
11#[allow(unused_imports)]
12use serde_json::Value;
13
14/// # on openapi.yaml
15///
16/// ```yaml
17///     ApproximateLocation:
18///       properties:
19///         type:
20///           type: string
21///           enum:
22///             - approximate
23///           description: The type of location approximation. Always `approximate`.
24///           default: approximate
25///           x-stainless-const: true
26///         country:
27///           anyOf:
28///             - type: string
29///               description: The two-letter [ISO country
30///                 code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user,
31///                 e.g. `US`.
32///             - type: "null"
33///         region:
34///           anyOf:
35///             - type: string
36///               description: Free text input for the region of the user, e.g. `California`.
37///             - type: "null"
38///         city:
39///           anyOf:
40///             - type: string
41///               description: Free text input for the city of the user, e.g. `San Francisco`.
42///             - type: "null"
43///         timezone:
44///           anyOf:
45///             - type: string
46///               description: The [IANA
47///                 timezone](https://timeapi.io/documentation/iana-timezones) of
48///                 the user, e.g. `America/Los_Angeles`.
49///             - type: "null"
50///       type: object
51///       required:
52///         - type
53/// ```
54#[derive(Debug, Serialize, Deserialize)]
55pub struct ApproximateLocation {
56    #[serde(rename = "city")]
57    pub city: Option<String>,
58    #[serde(rename = "country")]
59    pub country: Option<String>,
60    #[serde(rename = "region")]
61    pub region: Option<String>,
62    #[serde(rename = "timezone")]
63    pub timezone: Option<String>,
64    /// The type of location approximation. Always `approximate`.
65    #[serde(rename = "type")]
66    #[serde(default = "default_type")]
67    pub _type: String,
68}
69
70fn default_type() -> String {
71    "approximate".into()
72}