ooni-probe-cli/internal/ooapi/apimodel/checkin.go
Simone Basso d3c5196474
fix(ooniprobe): use ooniprobe-cli-unattended for unattended runs (#714)
This diff changes the software name used by unattended runs for which
we did not override the default software name (`ooniprobe-cli`).

It will become `ooniprobe-cli-unattended`. This software name is in line
with the one we use for Android, iOS, and desktop unattended runs.

While working in this diff, I introduced string constants for the run
types and a string constant for the default software name.

See https://github.com/ooni/probe/issues/2081.
2022-04-29 13:41:09 +02:00

50 lines
1.8 KiB
Go

package apimodel
import "github.com/ooni/probe-cli/v3/internal/model"
// CheckInRequestWebConnectivity contains WebConnectivity
// specific parameters to include into CheckInRequest
type CheckInRequestWebConnectivity struct {
CategoryCodes []string `json:"category_codes"`
}
// CheckInRequest is the check-in API request
type CheckInRequest struct {
Charging bool `json:"charging"`
OnWiFi bool `json:"on_wifi"`
Platform string `json:"platform"`
ProbeASN string `json:"probe_asn"`
ProbeCC string `json:"probe_cc"`
RunType model.RunType `json:"run_type"`
SoftwareName string `json:"software_name"`
SoftwareVersion string `json:"software_version"`
WebConnectivity CheckInRequestWebConnectivity `json:"web_connectivity"`
}
// CheckInResponseURLInfo contains information about an URL.
type CheckInResponseURLInfo struct {
CategoryCode string `json:"category_code"`
CountryCode string `json:"country_code"`
URL string `json:"url"`
}
// CheckInResponseWebConnectivity contains WebConnectivity
// specific information of a CheckInResponse
type CheckInResponseWebConnectivity struct {
ReportID string `json:"report_id"`
URLs []CheckInResponseURLInfo `json:"urls"`
}
// CheckInResponse is the check-in API response
type CheckInResponse struct {
ProbeASN string `json:"probe_asn"`
ProbeCC string `json:"probe_cc"`
Tests CheckInResponseTests `json:"tests"`
V int64 `json:"v"`
}
// CheckInResponseTests contains configuration for tests
type CheckInResponseTests struct {
WebConnectivity CheckInResponseWebConnectivity `json:"web_connectivity"`
}