Add omitempty

This commit is contained in:
Fred Boniface 2023-07-20 21:21:12 +01:00
parent a582c3495e
commit 4df6f0456e

View File

@ -1,46 +1,46 @@
package upstreamApi
type MsgData struct {
Data VstpMsg `json:"VSTPCIFMsgV1"`
Data VstpMsg `json:"VSTPCIFMsgV1,omitempty"`
}
type VstpMsg struct {
CIFMsg Schedule `json:"schedule"`
CIFMsg Schedule `json:"schedule,omitempty"`
}
type Schedule struct {
TransactionType string `json:"transaction_type"`
ScheduleStartDate string `json:"schedule_start_date"`
ScheduleEndDate string `json:"schedule_end_date"`
ScheduleDaysRun string `json:"schedule_days_runs"`
CIFTrainUID string `json:"CIF_train_uid"`
CIFSTPIndicator string `json:"CIF_stp_indicator"`
ScheduleSegment []ScheduleSegment `json:"schedule_segment"`
TransactionType string `json:"transaction_type,omitempty"`
ScheduleStartDate string `json:"schedule_start_date,omitempty"`
ScheduleEndDate string `json:"schedule_end_date,omitempty"`
ScheduleDaysRun string `json:"schedule_days_runs,omitempty"`
CIFTrainUID string `json:"CIF_train_uid,omitempty"`
CIFSTPIndicator string `json:"CIF_stp_indicator,omitempty"`
ScheduleSegment []ScheduleSegment `json:"schedule_segment,omitempty"`
}
type ScheduleSegment struct {
SignallingID string `json:"signalling_id"`
ATOCCode string `json:"atoc_code"`
CIFTrainCategory string `json:"CIF_train_category"`
CIFHeadcode string `json:"CIF_headcode"`
CIFPowerType string `json:"CIF_power_type"`
CIFSpeed string `json:"CIF_speed"`
ScheduleLocation []ScheduleLocation `json:"schedule_location"`
SignallingID string `json:"signalling_id,omitempty"`
ATOCCode string `json:"atoc_code,omitempty"`
CIFTrainCategory string `json:"CIF_train_category,omitempty"`
CIFHeadcode string `json:"CIF_headcode,omitempty"`
CIFPowerType string `json:"CIF_power_type,omitempty"`
CIFSpeed string `json:"CIF_speed,omitempty"`
ScheduleLocation []ScheduleLocation `json:"schedule_location,omitempty"`
}
type ScheduleLocation struct {
ScheduledArrivalTime string `json:"scheduled_arrival_time"`
ScheduledDepartureTime string `json:"scheduled_departure_time"`
ScheduledPassTime string `json:"scheduled_pass_time"`
PublicArrivalTime string `json:"public_arrival_time"`
PublicDepartureTime string `json:"public_departure_time"`
CIFPlatform string `json:"CIF_platform"`
CIFLine string `json:"CIF_line"`
Tiploc LocationTiploc `json:"location"`
ScheduledArrivalTime string `json:"scheduled_arrival_time,omitempty"`
ScheduledDepartureTime string `json:"scheduled_departure_time,omitempty"`
ScheduledPassTime string `json:"scheduled_pass_time,omitempty"`
PublicArrivalTime string `json:"public_arrival_time,omitempty"`
PublicDepartureTime string `json:"public_departure_time,omitempty"`
CIFPlatform string `json:"CIF_platform,omitempty"`
CIFLine string `json:"CIF_line,omitempty"`
Tiploc LocationTiploc `json:"location,omitempty"`
}
type LocationTiploc struct {
Tiploc struct {
TiplocId string `json:"tiploc_id"`
} `json:"tiploc"`
TiplocId string `json:"tiploc_id,omitempty"`
} `json:"tiploc,omitempty"`
}