File size: 1,579 Bytes
88211d3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
defmodule PlausibleWeb.Plugins.API.Schemas.TrackerScriptConfiguration do
  @moduledoc """
  OpenAPI schema for TrackerScriptConfiguration object
  """
  use PlausibleWeb, :open_api_schema

  OpenApiSpex.schema(%{
    description: "Tracker Script Configuration object",
    type: :object,
    required: [:tracker_script_configuration],
    properties: %{
      tracker_script_configuration: %Schema{
        type: :object,
        required: [
          :id,
          :installation_type,
          :hash_based_routing,
          :outbound_links,
          :file_downloads,
          :form_submissions
        ],
        properties: %{
          id: %Schema{type: :string, description: "Tracker Script Configuration ID"},
          installation_type: %Schema{
            type: :string,
            description: "Tracker Script Installation Type",
            enum: ["manual", "wordpress", "gtm", "npm"]
          },
          hash_based_routing: %Schema{type: :boolean, description: "Hash Based Routing"},
          outbound_links: %Schema{type: :boolean, description: "Track Outbound Links"},
          file_downloads: %Schema{type: :boolean, description: "Track File Downloads"},
          form_submissions: %Schema{type: :boolean, description: "Track Form Submissions"}
        }
      }
    },
    example: %{
      tracker_script_configuration: %{
        id: "qyhkWtOWaTN0YPkhrcJgy",
        installation_type: "wordpress",
        hash_based_routing: true,
        outbound_links: false,
        file_downloads: true,
        form_submissions: false
      }
    }
  })
end