diff --git a/basic/v2/models/p_t_x_api_basic_model_v2_basic_wrapper_p_t_x_service_d_t_o_shared_specification_v2_base_news.go b/basic/v2/models/p_t_x_api_basic_model_v2_basic_wrapper_p_t_x_service_d_t_o_shared_specification_v2_base_news.go index 97753261..f0899bd7 100644 --- a/basic/v2/models/p_t_x_api_basic_model_v2_basic_wrapper_p_t_x_service_d_t_o_shared_specification_v2_base_news.go +++ b/basic/v2/models/p_t_x_api_basic_model_v2_basic_wrapper_p_t_x_service_d_t_o_shared_specification_v2_base_news.go @@ -27,7 +27,7 @@ type PTXAPIBasicModelV2BasicWrapperPTXServiceDTOSharedSpecificationV2BaseNews st // // 資料(陣列) // Required: true - Newses []*PTXServiceDTOSharedSpecificationV2BaseNews `json:"Newses"` + Newses []*PTXServiceDTOSharedSpecificationV2BaseNews "json:\"Newses\" xml:\"List`1\"" // Int32 // @@ -39,7 +39,8 @@ type PTXAPIBasicModelV2BasicWrapperPTXServiceDTOSharedSpecificationV2BaseNews st // // 更新日期時間 // Required: true - UpdateTime *string `json:"UpdateTime"` + // Format: date-time + UpdateTime *strfmt.DateTime `json:"UpdateTime"` } // Validate validates this p t x API basic model v2 basic wrapper p t x service d t o shared specification v2 base news @@ -104,6 +105,10 @@ func (m *PTXAPIBasicModelV2BasicWrapperPTXServiceDTOSharedSpecificationV2BaseNew return err } + if err := validate.FormatOf("UpdateTime", "body", "date-time", m.UpdateTime.String(), formats); err != nil { + return err + } + return nil } diff --git a/basic/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_authority.go b/basic/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_authority.go index 02059141..153974e1 100644 --- a/basic/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_authority.go +++ b/basic/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_authority.go @@ -25,18 +25,18 @@ type PTXServiceDTOSharedSpecificationV2BaseAuthority struct { // // 業管機關簡碼 // Required: true - AuthorityCode *string `json:"AuthorityCode"` + AuthorityCode *string `json:"AuthorityCode" xml:"String"` // String // // 業管機關電子信箱 - AuthorityEmail string `json:"AuthorityEmail,omitempty"` + AuthorityEmail string `json:"AuthorityEmail,omitempty" xml:"String,omitempty"` // String // // 業管機關代碼 // Required: true - AuthorityID *string `json:"AuthorityID"` + AuthorityID *string `json:"AuthorityID" xml:"String"` // NameType // @@ -44,23 +44,24 @@ type PTXServiceDTOSharedSpecificationV2BaseAuthority struct { // Required: true AuthorityName struct { PTXServiceDTOSharedSpecificationV2BaseNameType - } `json:"AuthorityName"` + } `json:"AuthorityName" xml:"NameType"` // String // // 業管機關連絡電話 - AuthorityPhone string `json:"AuthorityPhone,omitempty"` + AuthorityPhone string `json:"AuthorityPhone,omitempty" xml:"String,omitempty"` // String // // 業管機關網址鏈結 - AuthorityURL string `json:"AuthorityUrl,omitempty"` + AuthorityURL string `json:"AuthorityUrl,omitempty" xml:"String,omitempty"` // DateTime // // 資料更新日期時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz) // Required: true - UpdateTime *string `json:"UpdateTime"` + // Format: date-time + UpdateTime *strfmt.DateTime `json:"UpdateTime"` } // Validate validates this p t x service d t o shared specification v2 base authority @@ -118,6 +119,10 @@ func (m *PTXServiceDTOSharedSpecificationV2BaseAuthority) validateUpdateTime(for return err } + if err := validate.FormatOf("UpdateTime", "body", "date-time", m.UpdateTime.String(), formats); err != nil { + return err + } + return nil } diff --git a/basic/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_name_type.go b/basic/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_name_type.go index b757afa0..e5163b66 100644 --- a/basic/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_name_type.go +++ b/basic/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_name_type.go @@ -22,12 +22,12 @@ type PTXServiceDTOSharedSpecificationV2BaseNameType struct { // String // // 英文名稱 - En string `json:"En,omitempty"` + En string `json:"En,omitempty" xml:"String,omitempty"` // String // // 中文繁體名稱 - ZhTw string `json:"Zh_tw,omitempty"` + ZhTw string `json:"Zh_tw,omitempty" xml:"String,omitempty"` } // Validate validates this p t x service d t o shared specification v2 base name type diff --git a/basic/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_news.go b/basic/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_news.go index a762d30c..f88c5d2b 100644 --- a/basic/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_news.go +++ b/basic/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_news.go @@ -24,34 +24,33 @@ type PTXServiceDTOSharedSpecificationV2BaseNews struct { // String // // 相關網站連結 - AttachmentURL string `json:"AttachmentURL,omitempty"` + AttachmentURL string `json:"AttachmentURL,omitempty" xml:"String,omitempty"` // String // // 發布單位 - Department string `json:"Department,omitempty"` + Department string `json:"Department,omitempty" xml:"String,omitempty"` // String // // 內容描述 // Required: true - Description *string `json:"Description"` + Description *string `json:"Description" xml:"String"` - // DateTime - // // 結束時間 - EndTime string `json:"EndTime,omitempty"` + // Format: date-time + EndTime strfmt.DateTime `json:"EndTime,omitempty"` // String // // 語系 // Required: true - Language *string `json:"Language"` + Language *string `json:"Language" xml:"String"` - // integer + // Int32 // // 消息類別 : [1:'最新消息',2:'新聞稿',3:'營運資訊',4:'轉乘資訊',5:'活動訊息',6:'系統公告',7:'新服務上架',8:'API修正',9:'來源異常',99:'其他'] - NewsCategory string `json:"NewsCategory,omitempty"` + NewsCategory int64 `json:"NewsCategory,omitempty"` // Guid // @@ -63,27 +62,26 @@ type PTXServiceDTOSharedSpecificationV2BaseNews struct { // String // // 報導網站連結 - NewsURL string `json:"NewsURL,omitempty"` + NewsURL string `json:"NewsURL,omitempty" xml:"String,omitempty"` - // DateTime - // // 消息公告日期時間 - PublishTime string `json:"PublishTime,omitempty"` + // Format: date-time + PublishTime strfmt.DateTime `json:"PublishTime,omitempty"` - // DateTime - // // 開始時間 - StartTime string `json:"StartTime,omitempty"` + // Format: date-time + StartTime strfmt.DateTime `json:"StartTime,omitempty"` // String // // 消息標題 - Title string `json:"Title,omitempty"` + Title string `json:"Title,omitempty" xml:"String,omitempty"` // DateTime // // 消息更新時間 - UpdateTime string `json:"UpdateTime,omitempty"` + // Format: date-time + UpdateTime strfmt.DateTime `json:"UpdateTime,omitempty"` } // Validate validates this p t x service d t o shared specification v2 base news @@ -94,6 +92,10 @@ func (m *PTXServiceDTOSharedSpecificationV2BaseNews) Validate(formats strfmt.Reg res = append(res, err) } + if err := m.validateEndTime(formats); err != nil { + res = append(res, err) + } + if err := m.validateLanguage(formats); err != nil { res = append(res, err) } @@ -102,6 +104,18 @@ func (m *PTXServiceDTOSharedSpecificationV2BaseNews) Validate(formats strfmt.Reg res = append(res, err) } + if err := m.validatePublishTime(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStartTime(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdateTime(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -117,6 +131,18 @@ func (m *PTXServiceDTOSharedSpecificationV2BaseNews) validateDescription(formats return nil } +func (m *PTXServiceDTOSharedSpecificationV2BaseNews) validateEndTime(formats strfmt.Registry) error { + if swag.IsZero(m.EndTime) { // not required + return nil + } + + if err := validate.FormatOf("EndTime", "body", "date-time", m.EndTime.String(), formats); err != nil { + return err + } + + return nil +} + func (m *PTXServiceDTOSharedSpecificationV2BaseNews) validateLanguage(formats strfmt.Registry) error { if err := validate.Required("Language", "body", m.Language); err != nil { @@ -139,6 +165,42 @@ func (m *PTXServiceDTOSharedSpecificationV2BaseNews) validateNewsID(formats strf return nil } +func (m *PTXServiceDTOSharedSpecificationV2BaseNews) validatePublishTime(formats strfmt.Registry) error { + if swag.IsZero(m.PublishTime) { // not required + return nil + } + + if err := validate.FormatOf("PublishTime", "body", "date-time", m.PublishTime.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PTXServiceDTOSharedSpecificationV2BaseNews) validateStartTime(formats strfmt.Registry) error { + if swag.IsZero(m.StartTime) { // not required + return nil + } + + if err := validate.FormatOf("StartTime", "body", "date-time", m.StartTime.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PTXServiceDTOSharedSpecificationV2BaseNews) validateUpdateTime(formats strfmt.Registry) error { + if swag.IsZero(m.UpdateTime) { // not required + return nil + } + + if err := validate.FormatOf("UpdateTime", "body", "date-time", m.UpdateTime.String(), formats); err != nil { + return err + } + + return nil +} + // ContextValidate validates this p t x service d t o shared specification v2 base news based on context it is used func (m *PTXServiceDTOSharedSpecificationV2BaseNews) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil diff --git a/basic/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_operator.go b/basic/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_operator.go index cead550e..e37a421d 100644 --- a/basic/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_operator.go +++ b/basic/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_operator.go @@ -25,24 +25,24 @@ type PTXServiceDTOSharedSpecificationV2BaseOperator struct { // // 營運業者業管機關簡碼(對於於公路客運/國道客運而言為THB) // Required: true - AuthorityCode *string `json:"AuthorityCode"` + AuthorityCode *string `json:"AuthorityCode" xml:"String"` // String // // 營運業者簡碼 // Required: true - OperatorCode *string `json:"OperatorCode"` + OperatorCode *string `json:"OperatorCode" xml:"String"` // String // // 營運業者電子信箱 - OperatorEmail string `json:"OperatorEmail,omitempty"` + OperatorEmail string `json:"OperatorEmail,omitempty" xml:"String,omitempty"` // String // // 營運業者代碼 // Required: true - OperatorID *string `json:"OperatorID"` + OperatorID *string `json:"OperatorID" xml:"String"` // NameType // @@ -50,50 +50,51 @@ type PTXServiceDTOSharedSpecificationV2BaseOperator struct { // Required: true OperatorName struct { PTXServiceDTOSharedSpecificationV2BaseNameType - } `json:"OperatorName"` + } `json:"OperatorName" xml:"NameType"` // String // // 營運業者編號[交通部票證資料系統定義] // Required: true - OperatorNo *string `json:"OperatorNo"` + OperatorNo *string `json:"OperatorNo" xml:"String"` // String // // 營運業者連絡電話 - OperatorPhone string `json:"OperatorPhone,omitempty"` + OperatorPhone string `json:"OperatorPhone,omitempty" xml:"String,omitempty"` // String // // 營運業者網址鏈結 - OperatorURL string `json:"OperatorUrl,omitempty"` + OperatorURL string `json:"OperatorUrl,omitempty" xml:"String,omitempty"` // String // // 資料提供平台代碼 // Required: true - ProviderID *string `json:"ProviderID"` + ProviderID *string `json:"ProviderID" xml:"String"` // String // // 訂票連絡電話 - ReservationPhone string `json:"ReservationPhone,omitempty"` + ReservationPhone string `json:"ReservationPhone,omitempty" xml:"String,omitempty"` // String // // 訂票網址鏈結 - ReservationURL string `json:"ReservationUrl,omitempty"` + ReservationURL string `json:"ReservationUrl,omitempty" xml:"String,omitempty"` // String // // 營運業者所屬業管子機關簡碼(對於公路客運/國道客運路線而言為區監理所如THB-VO10-1..等) - SubAuthorityCode string `json:"SubAuthorityCode,omitempty"` + SubAuthorityCode string `json:"SubAuthorityCode,omitempty" xml:"String,omitempty"` // DateTime // // 資料更新日期時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz) // Required: true - UpdateTime *string `json:"UpdateTime"` + // Format: date-time + UpdateTime *strfmt.DateTime `json:"UpdateTime"` } // Validate validates this p t x service d t o shared specification v2 base operator @@ -190,6 +191,10 @@ func (m *PTXServiceDTOSharedSpecificationV2BaseOperator) validateUpdateTime(form return err } + if err := validate.FormatOf("UpdateTime", "body", "date-time", m.UpdateTime.String(), formats); err != nil { + return err + } + return nil } diff --git a/basic/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_provider.go b/basic/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_provider.go index 2c4c1e9b..7b5b863d 100644 --- a/basic/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_provider.go +++ b/basic/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_provider.go @@ -25,18 +25,18 @@ type PTXServiceDTOSharedSpecificationV2BaseProvider struct { // // 資料提供平台簡碼 // Required: true - ProviderCode *string `json:"ProviderCode"` + ProviderCode *string `json:"ProviderCode" xml:"String"` // String // // 資料提供平台電子信箱 - ProviderEmail string `json:"ProviderEmail,omitempty"` + ProviderEmail string `json:"ProviderEmail,omitempty" xml:"String,omitempty"` // String // // 資料提供平台代碼 // Required: true - ProviderID *string `json:"ProviderID"` + ProviderID *string `json:"ProviderID" xml:"String"` // NameType // @@ -44,23 +44,24 @@ type PTXServiceDTOSharedSpecificationV2BaseProvider struct { // Required: true ProviderName struct { PTXServiceDTOSharedSpecificationV2BaseNameType - } `json:"ProviderName"` + } `json:"ProviderName" xml:"NameType"` // String // // 資料提供平台連絡電話 - ProviderPhone string `json:"ProviderPhone,omitempty"` + ProviderPhone string `json:"ProviderPhone,omitempty" xml:"String,omitempty"` // String // // 資料提供平台網址鏈結 - ProviderURL string `json:"ProviderUrl,omitempty"` + ProviderURL string `json:"ProviderUrl,omitempty" xml:"String,omitempty"` // DateTime // // 資料更新日期時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz) // Required: true - UpdateTime *string `json:"UpdateTime"` + // Format: date-time + UpdateTime *strfmt.DateTime `json:"UpdateTime"` } // Validate validates this p t x service d t o shared specification v2 base provider @@ -118,6 +119,10 @@ func (m *PTXServiceDTOSharedSpecificationV2BaseProvider) validateUpdateTime(form return err } + if err := validate.FormatOf("UpdateTime", "body", "date-time", m.UpdateTime.String(), formats); err != nil { + return err + } + return nil } diff --git a/bus/v2/client/city_bus/city_bus_api_daily_stop_time_table1_parameters.go b/bus/v2/client/city_bus/city_bus_api_daily_stop_time_table1_parameters.go new file mode 100644 index 00000000..1a47167c --- /dev/null +++ b/bus/v2/client/city_bus/city_bus_api_daily_stop_time_table1_parameters.go @@ -0,0 +1,416 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package city_bus + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewCityBusAPIDailyStopTimeTable1Params creates a new CityBusAPIDailyStopTimeTable1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCityBusAPIDailyStopTimeTable1Params() *CityBusAPIDailyStopTimeTable1Params { + return &CityBusAPIDailyStopTimeTable1Params{ + timeout: cr.DefaultTimeout, + } +} + +// NewCityBusAPIDailyStopTimeTable1ParamsWithTimeout creates a new CityBusAPIDailyStopTimeTable1Params object +// with the ability to set a timeout on a request. +func NewCityBusAPIDailyStopTimeTable1ParamsWithTimeout(timeout time.Duration) *CityBusAPIDailyStopTimeTable1Params { + return &CityBusAPIDailyStopTimeTable1Params{ + timeout: timeout, + } +} + +// NewCityBusAPIDailyStopTimeTable1ParamsWithContext creates a new CityBusAPIDailyStopTimeTable1Params object +// with the ability to set a context for a request. +func NewCityBusAPIDailyStopTimeTable1ParamsWithContext(ctx context.Context) *CityBusAPIDailyStopTimeTable1Params { + return &CityBusAPIDailyStopTimeTable1Params{ + Context: ctx, + } +} + +// NewCityBusAPIDailyStopTimeTable1ParamsWithHTTPClient creates a new CityBusAPIDailyStopTimeTable1Params object +// with the ability to set a custom HTTPClient for a request. +func NewCityBusAPIDailyStopTimeTable1ParamsWithHTTPClient(client *http.Client) *CityBusAPIDailyStopTimeTable1Params { + return &CityBusAPIDailyStopTimeTable1Params{ + HTTPClient: client, + } +} + +/* CityBusAPIDailyStopTimeTable1Params contains all the parameters to send to the API endpoint + for the city bus Api daily stop time table 1 operation. + + Typically these are written to a http.Request. +*/ +type CityBusAPIDailyStopTimeTable1Params struct { + + /* DollarFilter. + + 過濾 + */ + DollarFilter *string + + /* DollarFormat. + + 指定來源格式 + */ + DollarFormat string + + /* DollarOrderby. + + 排序 + */ + DollarOrderby *string + + /* DollarSelect. + + 挑選 + */ + DollarSelect *string + + /* DollarSkip. + + 跳過前幾筆 + */ + DollarSkip *string + + /* DollarTop. + + 取前幾筆 + + Default: 30 + */ + DollarTop *int64 + + /* City. + + 欲查詢縣市 + */ + City string + + /* RouteName. + + 繁體中文路線名稱,如'307' + */ + RouteName string + + /* Health. + + 加入參數'?health=true'即可查詢此API服務的健康狀態 + */ + Health *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the city bus Api daily stop time table 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CityBusAPIDailyStopTimeTable1Params) WithDefaults() *CityBusAPIDailyStopTimeTable1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the city bus Api daily stop time table 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CityBusAPIDailyStopTimeTable1Params) SetDefaults() { + var ( + dollarTopDefault = int64(30) + ) + + val := CityBusAPIDailyStopTimeTable1Params{ + DollarTop: &dollarTopDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the city bus Api daily stop time table 1 params +func (o *CityBusAPIDailyStopTimeTable1Params) WithTimeout(timeout time.Duration) *CityBusAPIDailyStopTimeTable1Params { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the city bus Api daily stop time table 1 params +func (o *CityBusAPIDailyStopTimeTable1Params) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the city bus Api daily stop time table 1 params +func (o *CityBusAPIDailyStopTimeTable1Params) WithContext(ctx context.Context) *CityBusAPIDailyStopTimeTable1Params { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the city bus Api daily stop time table 1 params +func (o *CityBusAPIDailyStopTimeTable1Params) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the city bus Api daily stop time table 1 params +func (o *CityBusAPIDailyStopTimeTable1Params) WithHTTPClient(client *http.Client) *CityBusAPIDailyStopTimeTable1Params { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the city bus Api daily stop time table 1 params +func (o *CityBusAPIDailyStopTimeTable1Params) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDollarFilter adds the dollarFilter to the city bus Api daily stop time table 1 params +func (o *CityBusAPIDailyStopTimeTable1Params) WithDollarFilter(dollarFilter *string) *CityBusAPIDailyStopTimeTable1Params { + o.SetDollarFilter(dollarFilter) + return o +} + +// SetDollarFilter adds the dollarFilter to the city bus Api daily stop time table 1 params +func (o *CityBusAPIDailyStopTimeTable1Params) SetDollarFilter(dollarFilter *string) { + o.DollarFilter = dollarFilter +} + +// WithDollarFormat adds the dollarFormat to the city bus Api daily stop time table 1 params +func (o *CityBusAPIDailyStopTimeTable1Params) WithDollarFormat(dollarFormat string) *CityBusAPIDailyStopTimeTable1Params { + o.SetDollarFormat(dollarFormat) + return o +} + +// SetDollarFormat adds the dollarFormat to the city bus Api daily stop time table 1 params +func (o *CityBusAPIDailyStopTimeTable1Params) SetDollarFormat(dollarFormat string) { + o.DollarFormat = dollarFormat +} + +// WithDollarOrderby adds the dollarOrderby to the city bus Api daily stop time table 1 params +func (o *CityBusAPIDailyStopTimeTable1Params) WithDollarOrderby(dollarOrderby *string) *CityBusAPIDailyStopTimeTable1Params { + o.SetDollarOrderby(dollarOrderby) + return o +} + +// SetDollarOrderby adds the dollarOrderby to the city bus Api daily stop time table 1 params +func (o *CityBusAPIDailyStopTimeTable1Params) SetDollarOrderby(dollarOrderby *string) { + o.DollarOrderby = dollarOrderby +} + +// WithDollarSelect adds the dollarSelect to the city bus Api daily stop time table 1 params +func (o *CityBusAPIDailyStopTimeTable1Params) WithDollarSelect(dollarSelect *string) *CityBusAPIDailyStopTimeTable1Params { + o.SetDollarSelect(dollarSelect) + return o +} + +// SetDollarSelect adds the dollarSelect to the city bus Api daily stop time table 1 params +func (o *CityBusAPIDailyStopTimeTable1Params) SetDollarSelect(dollarSelect *string) { + o.DollarSelect = dollarSelect +} + +// WithDollarSkip adds the dollarSkip to the city bus Api daily stop time table 1 params +func (o *CityBusAPIDailyStopTimeTable1Params) WithDollarSkip(dollarSkip *string) *CityBusAPIDailyStopTimeTable1Params { + o.SetDollarSkip(dollarSkip) + return o +} + +// SetDollarSkip adds the dollarSkip to the city bus Api daily stop time table 1 params +func (o *CityBusAPIDailyStopTimeTable1Params) SetDollarSkip(dollarSkip *string) { + o.DollarSkip = dollarSkip +} + +// WithDollarTop adds the dollarTop to the city bus Api daily stop time table 1 params +func (o *CityBusAPIDailyStopTimeTable1Params) WithDollarTop(dollarTop *int64) *CityBusAPIDailyStopTimeTable1Params { + o.SetDollarTop(dollarTop) + return o +} + +// SetDollarTop adds the dollarTop to the city bus Api daily stop time table 1 params +func (o *CityBusAPIDailyStopTimeTable1Params) SetDollarTop(dollarTop *int64) { + o.DollarTop = dollarTop +} + +// WithCity adds the city to the city bus Api daily stop time table 1 params +func (o *CityBusAPIDailyStopTimeTable1Params) WithCity(city string) *CityBusAPIDailyStopTimeTable1Params { + o.SetCity(city) + return o +} + +// SetCity adds the city to the city bus Api daily stop time table 1 params +func (o *CityBusAPIDailyStopTimeTable1Params) SetCity(city string) { + o.City = city +} + +// WithRouteName adds the routeName to the city bus Api daily stop time table 1 params +func (o *CityBusAPIDailyStopTimeTable1Params) WithRouteName(routeName string) *CityBusAPIDailyStopTimeTable1Params { + o.SetRouteName(routeName) + return o +} + +// SetRouteName adds the routeName to the city bus Api daily stop time table 1 params +func (o *CityBusAPIDailyStopTimeTable1Params) SetRouteName(routeName string) { + o.RouteName = routeName +} + +// WithHealth adds the health to the city bus Api daily stop time table 1 params +func (o *CityBusAPIDailyStopTimeTable1Params) WithHealth(health *string) *CityBusAPIDailyStopTimeTable1Params { + o.SetHealth(health) + return o +} + +// SetHealth adds the health to the city bus Api daily stop time table 1 params +func (o *CityBusAPIDailyStopTimeTable1Params) SetHealth(health *string) { + o.Health = health +} + +// WriteToRequest writes these params to a swagger request +func (o *CityBusAPIDailyStopTimeTable1Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.DollarFilter != nil { + + // query param $filter + var qrDollarFilter string + + if o.DollarFilter != nil { + qrDollarFilter = *o.DollarFilter + } + qDollarFilter := qrDollarFilter + if qDollarFilter != "" { + + if err := r.SetQueryParam("$filter", qDollarFilter); err != nil { + return err + } + } + } + + // query param $format + qrDollarFormat := o.DollarFormat + qDollarFormat := qrDollarFormat + if qDollarFormat != "" { + + if err := r.SetQueryParam("$format", qDollarFormat); err != nil { + return err + } + } + + if o.DollarOrderby != nil { + + // query param $orderby + var qrDollarOrderby string + + if o.DollarOrderby != nil { + qrDollarOrderby = *o.DollarOrderby + } + qDollarOrderby := qrDollarOrderby + if qDollarOrderby != "" { + + if err := r.SetQueryParam("$orderby", qDollarOrderby); err != nil { + return err + } + } + } + + if o.DollarSelect != nil { + + // query param $select + var qrDollarSelect string + + if o.DollarSelect != nil { + qrDollarSelect = *o.DollarSelect + } + qDollarSelect := qrDollarSelect + if qDollarSelect != "" { + + if err := r.SetQueryParam("$select", qDollarSelect); err != nil { + return err + } + } + } + + if o.DollarSkip != nil { + + // query param $skip + var qrDollarSkip string + + if o.DollarSkip != nil { + qrDollarSkip = *o.DollarSkip + } + qDollarSkip := qrDollarSkip + if qDollarSkip != "" { + + if err := r.SetQueryParam("$skip", qDollarSkip); err != nil { + return err + } + } + } + + if o.DollarTop != nil { + + // query param $top + var qrDollarTop int64 + + if o.DollarTop != nil { + qrDollarTop = *o.DollarTop + } + qDollarTop := swag.FormatInt64(qrDollarTop) + if qDollarTop != "" { + + if err := r.SetQueryParam("$top", qDollarTop); err != nil { + return err + } + } + } + + // path param City + if err := r.SetPathParam("City", o.City); err != nil { + return err + } + + // path param RouteName + if err := r.SetPathParam("RouteName", o.RouteName); err != nil { + return err + } + + if o.Health != nil { + + // query param health + var qrHealth string + + if o.Health != nil { + qrHealth = *o.Health + } + qHealth := qrHealth + if qHealth != "" { + + if err := r.SetQueryParam("health", qHealth); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/bus/v2/client/city_bus/city_bus_api_daily_stop_time_table1_responses.go b/bus/v2/client/city_bus/city_bus_api_daily_stop_time_table1_responses.go new file mode 100644 index 00000000..e844761a --- /dev/null +++ b/bus/v2/client/city_bus/city_bus_api_daily_stop_time_table1_responses.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package city_bus + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/minchao/go-ptx/bus/v2/models" +) + +// CityBusAPIDailyStopTimeTable1Reader is a Reader for the CityBusAPIDailyStopTimeTable1 structure. +type CityBusAPIDailyStopTimeTable1Reader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CityBusAPIDailyStopTimeTable1Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCityBusAPIDailyStopTimeTable1OK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 299: + result := NewCityBusAPIDailyStopTimeTable1Status299() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 304: + result := NewCityBusAPIDailyStopTimeTable1NotModified() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCityBusAPIDailyStopTimeTable1OK creates a CityBusAPIDailyStopTimeTable1OK with default headers values +func NewCityBusAPIDailyStopTimeTable1OK() *CityBusAPIDailyStopTimeTable1OK { + return &CityBusAPIDailyStopTimeTable1OK{} +} + +/* CityBusAPIDailyStopTimeTable1OK describes a response with status code 200, with default header values. + +Success +*/ +type CityBusAPIDailyStopTimeTable1OK struct { + Payload []*models.PTXServiceDTOBusSpecificationV2BusDailyStopTimeTable +} + +func (o *CityBusAPIDailyStopTimeTable1OK) Error() string { + return fmt.Sprintf("[GET /v2/Bus/DailyStopTimeTable/City/{City}/{RouteName}][%d] cityBusApiDailyStopTimeTable1OK %+v", 200, o.Payload) +} +func (o *CityBusAPIDailyStopTimeTable1OK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusDailyStopTimeTable { + return o.Payload +} + +func (o *CityBusAPIDailyStopTimeTable1OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCityBusAPIDailyStopTimeTable1Status299 creates a CityBusAPIDailyStopTimeTable1Status299 with default headers values +func NewCityBusAPIDailyStopTimeTable1Status299() *CityBusAPIDailyStopTimeTable1Status299 { + return &CityBusAPIDailyStopTimeTable1Status299{} +} + +/* CityBusAPIDailyStopTimeTable1Status299 describes a response with status code 299, with default header values. + +加入參數'?health=true'即可查詢此API服務的健康狀態 +*/ +type CityBusAPIDailyStopTimeTable1Status299 struct { + Payload *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth +} + +func (o *CityBusAPIDailyStopTimeTable1Status299) Error() string { + return fmt.Sprintf("[GET /v2/Bus/DailyStopTimeTable/City/{City}/{RouteName}][%d] cityBusApiDailyStopTimeTable1Status299 %+v", 299, o.Payload) +} +func (o *CityBusAPIDailyStopTimeTable1Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth { + return o.Payload +} + +func (o *CityBusAPIDailyStopTimeTable1Status299) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCityBusAPIDailyStopTimeTable1NotModified creates a CityBusAPIDailyStopTimeTable1NotModified with default headers values +func NewCityBusAPIDailyStopTimeTable1NotModified() *CityBusAPIDailyStopTimeTable1NotModified { + return &CityBusAPIDailyStopTimeTable1NotModified{} +} + +/* CityBusAPIDailyStopTimeTable1NotModified describes a response with status code 304, with default header values. + +服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content +*/ +type CityBusAPIDailyStopTimeTable1NotModified struct { +} + +func (o *CityBusAPIDailyStopTimeTable1NotModified) Error() string { + return fmt.Sprintf("[GET /v2/Bus/DailyStopTimeTable/City/{City}/{RouteName}][%d] cityBusApiDailyStopTimeTable1NotModified ", 304) +} + +func (o *CityBusAPIDailyStopTimeTable1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/bus/v2/client/city_bus/city_bus_api_daily_stop_time_table_parameters.go b/bus/v2/client/city_bus/city_bus_api_daily_stop_time_table_parameters.go new file mode 100644 index 00000000..ff5dac7a --- /dev/null +++ b/bus/v2/client/city_bus/city_bus_api_daily_stop_time_table_parameters.go @@ -0,0 +1,394 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package city_bus + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewCityBusAPIDailyStopTimeTableParams creates a new CityBusAPIDailyStopTimeTableParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCityBusAPIDailyStopTimeTableParams() *CityBusAPIDailyStopTimeTableParams { + return &CityBusAPIDailyStopTimeTableParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCityBusAPIDailyStopTimeTableParamsWithTimeout creates a new CityBusAPIDailyStopTimeTableParams object +// with the ability to set a timeout on a request. +func NewCityBusAPIDailyStopTimeTableParamsWithTimeout(timeout time.Duration) *CityBusAPIDailyStopTimeTableParams { + return &CityBusAPIDailyStopTimeTableParams{ + timeout: timeout, + } +} + +// NewCityBusAPIDailyStopTimeTableParamsWithContext creates a new CityBusAPIDailyStopTimeTableParams object +// with the ability to set a context for a request. +func NewCityBusAPIDailyStopTimeTableParamsWithContext(ctx context.Context) *CityBusAPIDailyStopTimeTableParams { + return &CityBusAPIDailyStopTimeTableParams{ + Context: ctx, + } +} + +// NewCityBusAPIDailyStopTimeTableParamsWithHTTPClient creates a new CityBusAPIDailyStopTimeTableParams object +// with the ability to set a custom HTTPClient for a request. +func NewCityBusAPIDailyStopTimeTableParamsWithHTTPClient(client *http.Client) *CityBusAPIDailyStopTimeTableParams { + return &CityBusAPIDailyStopTimeTableParams{ + HTTPClient: client, + } +} + +/* CityBusAPIDailyStopTimeTableParams contains all the parameters to send to the API endpoint + for the city bus Api daily stop time table operation. + + Typically these are written to a http.Request. +*/ +type CityBusAPIDailyStopTimeTableParams struct { + + /* DollarFilter. + + 過濾 + */ + DollarFilter *string + + /* DollarFormat. + + 指定來源格式 + */ + DollarFormat string + + /* DollarOrderby. + + 排序 + */ + DollarOrderby *string + + /* DollarSelect. + + 挑選 + */ + DollarSelect *string + + /* DollarSkip. + + 跳過前幾筆 + */ + DollarSkip *string + + /* DollarTop. + + 取前幾筆 + + Default: 30 + */ + DollarTop *int64 + + /* City. + + 欲查詢縣市 + */ + City string + + /* Health. + + 加入參數'?health=true'即可查詢此API服務的健康狀態 + */ + Health *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the city bus Api daily stop time table params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CityBusAPIDailyStopTimeTableParams) WithDefaults() *CityBusAPIDailyStopTimeTableParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the city bus Api daily stop time table params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CityBusAPIDailyStopTimeTableParams) SetDefaults() { + var ( + dollarTopDefault = int64(30) + ) + + val := CityBusAPIDailyStopTimeTableParams{ + DollarTop: &dollarTopDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the city bus Api daily stop time table params +func (o *CityBusAPIDailyStopTimeTableParams) WithTimeout(timeout time.Duration) *CityBusAPIDailyStopTimeTableParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the city bus Api daily stop time table params +func (o *CityBusAPIDailyStopTimeTableParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the city bus Api daily stop time table params +func (o *CityBusAPIDailyStopTimeTableParams) WithContext(ctx context.Context) *CityBusAPIDailyStopTimeTableParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the city bus Api daily stop time table params +func (o *CityBusAPIDailyStopTimeTableParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the city bus Api daily stop time table params +func (o *CityBusAPIDailyStopTimeTableParams) WithHTTPClient(client *http.Client) *CityBusAPIDailyStopTimeTableParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the city bus Api daily stop time table params +func (o *CityBusAPIDailyStopTimeTableParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDollarFilter adds the dollarFilter to the city bus Api daily stop time table params +func (o *CityBusAPIDailyStopTimeTableParams) WithDollarFilter(dollarFilter *string) *CityBusAPIDailyStopTimeTableParams { + o.SetDollarFilter(dollarFilter) + return o +} + +// SetDollarFilter adds the dollarFilter to the city bus Api daily stop time table params +func (o *CityBusAPIDailyStopTimeTableParams) SetDollarFilter(dollarFilter *string) { + o.DollarFilter = dollarFilter +} + +// WithDollarFormat adds the dollarFormat to the city bus Api daily stop time table params +func (o *CityBusAPIDailyStopTimeTableParams) WithDollarFormat(dollarFormat string) *CityBusAPIDailyStopTimeTableParams { + o.SetDollarFormat(dollarFormat) + return o +} + +// SetDollarFormat adds the dollarFormat to the city bus Api daily stop time table params +func (o *CityBusAPIDailyStopTimeTableParams) SetDollarFormat(dollarFormat string) { + o.DollarFormat = dollarFormat +} + +// WithDollarOrderby adds the dollarOrderby to the city bus Api daily stop time table params +func (o *CityBusAPIDailyStopTimeTableParams) WithDollarOrderby(dollarOrderby *string) *CityBusAPIDailyStopTimeTableParams { + o.SetDollarOrderby(dollarOrderby) + return o +} + +// SetDollarOrderby adds the dollarOrderby to the city bus Api daily stop time table params +func (o *CityBusAPIDailyStopTimeTableParams) SetDollarOrderby(dollarOrderby *string) { + o.DollarOrderby = dollarOrderby +} + +// WithDollarSelect adds the dollarSelect to the city bus Api daily stop time table params +func (o *CityBusAPIDailyStopTimeTableParams) WithDollarSelect(dollarSelect *string) *CityBusAPIDailyStopTimeTableParams { + o.SetDollarSelect(dollarSelect) + return o +} + +// SetDollarSelect adds the dollarSelect to the city bus Api daily stop time table params +func (o *CityBusAPIDailyStopTimeTableParams) SetDollarSelect(dollarSelect *string) { + o.DollarSelect = dollarSelect +} + +// WithDollarSkip adds the dollarSkip to the city bus Api daily stop time table params +func (o *CityBusAPIDailyStopTimeTableParams) WithDollarSkip(dollarSkip *string) *CityBusAPIDailyStopTimeTableParams { + o.SetDollarSkip(dollarSkip) + return o +} + +// SetDollarSkip adds the dollarSkip to the city bus Api daily stop time table params +func (o *CityBusAPIDailyStopTimeTableParams) SetDollarSkip(dollarSkip *string) { + o.DollarSkip = dollarSkip +} + +// WithDollarTop adds the dollarTop to the city bus Api daily stop time table params +func (o *CityBusAPIDailyStopTimeTableParams) WithDollarTop(dollarTop *int64) *CityBusAPIDailyStopTimeTableParams { + o.SetDollarTop(dollarTop) + return o +} + +// SetDollarTop adds the dollarTop to the city bus Api daily stop time table params +func (o *CityBusAPIDailyStopTimeTableParams) SetDollarTop(dollarTop *int64) { + o.DollarTop = dollarTop +} + +// WithCity adds the city to the city bus Api daily stop time table params +func (o *CityBusAPIDailyStopTimeTableParams) WithCity(city string) *CityBusAPIDailyStopTimeTableParams { + o.SetCity(city) + return o +} + +// SetCity adds the city to the city bus Api daily stop time table params +func (o *CityBusAPIDailyStopTimeTableParams) SetCity(city string) { + o.City = city +} + +// WithHealth adds the health to the city bus Api daily stop time table params +func (o *CityBusAPIDailyStopTimeTableParams) WithHealth(health *string) *CityBusAPIDailyStopTimeTableParams { + o.SetHealth(health) + return o +} + +// SetHealth adds the health to the city bus Api daily stop time table params +func (o *CityBusAPIDailyStopTimeTableParams) SetHealth(health *string) { + o.Health = health +} + +// WriteToRequest writes these params to a swagger request +func (o *CityBusAPIDailyStopTimeTableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.DollarFilter != nil { + + // query param $filter + var qrDollarFilter string + + if o.DollarFilter != nil { + qrDollarFilter = *o.DollarFilter + } + qDollarFilter := qrDollarFilter + if qDollarFilter != "" { + + if err := r.SetQueryParam("$filter", qDollarFilter); err != nil { + return err + } + } + } + + // query param $format + qrDollarFormat := o.DollarFormat + qDollarFormat := qrDollarFormat + if qDollarFormat != "" { + + if err := r.SetQueryParam("$format", qDollarFormat); err != nil { + return err + } + } + + if o.DollarOrderby != nil { + + // query param $orderby + var qrDollarOrderby string + + if o.DollarOrderby != nil { + qrDollarOrderby = *o.DollarOrderby + } + qDollarOrderby := qrDollarOrderby + if qDollarOrderby != "" { + + if err := r.SetQueryParam("$orderby", qDollarOrderby); err != nil { + return err + } + } + } + + if o.DollarSelect != nil { + + // query param $select + var qrDollarSelect string + + if o.DollarSelect != nil { + qrDollarSelect = *o.DollarSelect + } + qDollarSelect := qrDollarSelect + if qDollarSelect != "" { + + if err := r.SetQueryParam("$select", qDollarSelect); err != nil { + return err + } + } + } + + if o.DollarSkip != nil { + + // query param $skip + var qrDollarSkip string + + if o.DollarSkip != nil { + qrDollarSkip = *o.DollarSkip + } + qDollarSkip := qrDollarSkip + if qDollarSkip != "" { + + if err := r.SetQueryParam("$skip", qDollarSkip); err != nil { + return err + } + } + } + + if o.DollarTop != nil { + + // query param $top + var qrDollarTop int64 + + if o.DollarTop != nil { + qrDollarTop = *o.DollarTop + } + qDollarTop := swag.FormatInt64(qrDollarTop) + if qDollarTop != "" { + + if err := r.SetQueryParam("$top", qDollarTop); err != nil { + return err + } + } + } + + // path param City + if err := r.SetPathParam("City", o.City); err != nil { + return err + } + + if o.Health != nil { + + // query param health + var qrHealth string + + if o.Health != nil { + qrHealth = *o.Health + } + qHealth := qrHealth + if qHealth != "" { + + if err := r.SetQueryParam("health", qHealth); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/bus/v2/client/city_bus/city_bus_api_daily_stop_time_table_responses.go b/bus/v2/client/city_bus/city_bus_api_daily_stop_time_table_responses.go new file mode 100644 index 00000000..1e39eb3c --- /dev/null +++ b/bus/v2/client/city_bus/city_bus_api_daily_stop_time_table_responses.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package city_bus + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/minchao/go-ptx/bus/v2/models" +) + +// CityBusAPIDailyStopTimeTableReader is a Reader for the CityBusAPIDailyStopTimeTable structure. +type CityBusAPIDailyStopTimeTableReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CityBusAPIDailyStopTimeTableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCityBusAPIDailyStopTimeTableOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 299: + result := NewCityBusAPIDailyStopTimeTableStatus299() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 304: + result := NewCityBusAPIDailyStopTimeTableNotModified() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCityBusAPIDailyStopTimeTableOK creates a CityBusAPIDailyStopTimeTableOK with default headers values +func NewCityBusAPIDailyStopTimeTableOK() *CityBusAPIDailyStopTimeTableOK { + return &CityBusAPIDailyStopTimeTableOK{} +} + +/* CityBusAPIDailyStopTimeTableOK describes a response with status code 200, with default header values. + +Success +*/ +type CityBusAPIDailyStopTimeTableOK struct { + Payload []*models.PTXServiceDTOBusSpecificationV2BusDailyStopTimeTable +} + +func (o *CityBusAPIDailyStopTimeTableOK) Error() string { + return fmt.Sprintf("[GET /v2/Bus/DailyStopTimeTable/City/{City}][%d] cityBusApiDailyStopTimeTableOK %+v", 200, o.Payload) +} +func (o *CityBusAPIDailyStopTimeTableOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusDailyStopTimeTable { + return o.Payload +} + +func (o *CityBusAPIDailyStopTimeTableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCityBusAPIDailyStopTimeTableStatus299 creates a CityBusAPIDailyStopTimeTableStatus299 with default headers values +func NewCityBusAPIDailyStopTimeTableStatus299() *CityBusAPIDailyStopTimeTableStatus299 { + return &CityBusAPIDailyStopTimeTableStatus299{} +} + +/* CityBusAPIDailyStopTimeTableStatus299 describes a response with status code 299, with default header values. + +加入參數'?health=true'即可查詢此API服務的健康狀態 +*/ +type CityBusAPIDailyStopTimeTableStatus299 struct { + Payload *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth +} + +func (o *CityBusAPIDailyStopTimeTableStatus299) Error() string { + return fmt.Sprintf("[GET /v2/Bus/DailyStopTimeTable/City/{City}][%d] cityBusApiDailyStopTimeTableStatus299 %+v", 299, o.Payload) +} +func (o *CityBusAPIDailyStopTimeTableStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth { + return o.Payload +} + +func (o *CityBusAPIDailyStopTimeTableStatus299) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCityBusAPIDailyStopTimeTableNotModified creates a CityBusAPIDailyStopTimeTableNotModified with default headers values +func NewCityBusAPIDailyStopTimeTableNotModified() *CityBusAPIDailyStopTimeTableNotModified { + return &CityBusAPIDailyStopTimeTableNotModified{} +} + +/* CityBusAPIDailyStopTimeTableNotModified describes a response with status code 304, with default header values. + +服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content +*/ +type CityBusAPIDailyStopTimeTableNotModified struct { +} + +func (o *CityBusAPIDailyStopTimeTableNotModified) Error() string { + return fmt.Sprintf("[GET /v2/Bus/DailyStopTimeTable/City/{City}][%d] cityBusApiDailyStopTimeTableNotModified ", 304) +} + +func (o *CityBusAPIDailyStopTimeTableNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/bus/v2/client/city_bus/city_bus_api_daily_time_table1_parameters.go b/bus/v2/client/city_bus/city_bus_api_daily_time_table1_parameters.go new file mode 100644 index 00000000..efc15001 --- /dev/null +++ b/bus/v2/client/city_bus/city_bus_api_daily_time_table1_parameters.go @@ -0,0 +1,416 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package city_bus + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewCityBusAPIDailyTimeTable1Params creates a new CityBusAPIDailyTimeTable1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCityBusAPIDailyTimeTable1Params() *CityBusAPIDailyTimeTable1Params { + return &CityBusAPIDailyTimeTable1Params{ + timeout: cr.DefaultTimeout, + } +} + +// NewCityBusAPIDailyTimeTable1ParamsWithTimeout creates a new CityBusAPIDailyTimeTable1Params object +// with the ability to set a timeout on a request. +func NewCityBusAPIDailyTimeTable1ParamsWithTimeout(timeout time.Duration) *CityBusAPIDailyTimeTable1Params { + return &CityBusAPIDailyTimeTable1Params{ + timeout: timeout, + } +} + +// NewCityBusAPIDailyTimeTable1ParamsWithContext creates a new CityBusAPIDailyTimeTable1Params object +// with the ability to set a context for a request. +func NewCityBusAPIDailyTimeTable1ParamsWithContext(ctx context.Context) *CityBusAPIDailyTimeTable1Params { + return &CityBusAPIDailyTimeTable1Params{ + Context: ctx, + } +} + +// NewCityBusAPIDailyTimeTable1ParamsWithHTTPClient creates a new CityBusAPIDailyTimeTable1Params object +// with the ability to set a custom HTTPClient for a request. +func NewCityBusAPIDailyTimeTable1ParamsWithHTTPClient(client *http.Client) *CityBusAPIDailyTimeTable1Params { + return &CityBusAPIDailyTimeTable1Params{ + HTTPClient: client, + } +} + +/* CityBusAPIDailyTimeTable1Params contains all the parameters to send to the API endpoint + for the city bus Api daily time table 1 operation. + + Typically these are written to a http.Request. +*/ +type CityBusAPIDailyTimeTable1Params struct { + + /* DollarFilter. + + 過濾 + */ + DollarFilter *string + + /* DollarFormat. + + 指定來源格式 + */ + DollarFormat string + + /* DollarOrderby. + + 排序 + */ + DollarOrderby *string + + /* DollarSelect. + + 挑選 + */ + DollarSelect *string + + /* DollarSkip. + + 跳過前幾筆 + */ + DollarSkip *string + + /* DollarTop. + + 取前幾筆 + + Default: 30 + */ + DollarTop *int64 + + /* City. + + 欲查詢縣市 + */ + City string + + /* RouteName. + + 繁體中文路線名稱,如'307' + */ + RouteName string + + /* Health. + + 加入參數'?health=true'即可查詢此API服務的健康狀態 + */ + Health *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the city bus Api daily time table 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CityBusAPIDailyTimeTable1Params) WithDefaults() *CityBusAPIDailyTimeTable1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the city bus Api daily time table 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CityBusAPIDailyTimeTable1Params) SetDefaults() { + var ( + dollarTopDefault = int64(30) + ) + + val := CityBusAPIDailyTimeTable1Params{ + DollarTop: &dollarTopDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the city bus Api daily time table 1 params +func (o *CityBusAPIDailyTimeTable1Params) WithTimeout(timeout time.Duration) *CityBusAPIDailyTimeTable1Params { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the city bus Api daily time table 1 params +func (o *CityBusAPIDailyTimeTable1Params) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the city bus Api daily time table 1 params +func (o *CityBusAPIDailyTimeTable1Params) WithContext(ctx context.Context) *CityBusAPIDailyTimeTable1Params { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the city bus Api daily time table 1 params +func (o *CityBusAPIDailyTimeTable1Params) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the city bus Api daily time table 1 params +func (o *CityBusAPIDailyTimeTable1Params) WithHTTPClient(client *http.Client) *CityBusAPIDailyTimeTable1Params { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the city bus Api daily time table 1 params +func (o *CityBusAPIDailyTimeTable1Params) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDollarFilter adds the dollarFilter to the city bus Api daily time table 1 params +func (o *CityBusAPIDailyTimeTable1Params) WithDollarFilter(dollarFilter *string) *CityBusAPIDailyTimeTable1Params { + o.SetDollarFilter(dollarFilter) + return o +} + +// SetDollarFilter adds the dollarFilter to the city bus Api daily time table 1 params +func (o *CityBusAPIDailyTimeTable1Params) SetDollarFilter(dollarFilter *string) { + o.DollarFilter = dollarFilter +} + +// WithDollarFormat adds the dollarFormat to the city bus Api daily time table 1 params +func (o *CityBusAPIDailyTimeTable1Params) WithDollarFormat(dollarFormat string) *CityBusAPIDailyTimeTable1Params { + o.SetDollarFormat(dollarFormat) + return o +} + +// SetDollarFormat adds the dollarFormat to the city bus Api daily time table 1 params +func (o *CityBusAPIDailyTimeTable1Params) SetDollarFormat(dollarFormat string) { + o.DollarFormat = dollarFormat +} + +// WithDollarOrderby adds the dollarOrderby to the city bus Api daily time table 1 params +func (o *CityBusAPIDailyTimeTable1Params) WithDollarOrderby(dollarOrderby *string) *CityBusAPIDailyTimeTable1Params { + o.SetDollarOrderby(dollarOrderby) + return o +} + +// SetDollarOrderby adds the dollarOrderby to the city bus Api daily time table 1 params +func (o *CityBusAPIDailyTimeTable1Params) SetDollarOrderby(dollarOrderby *string) { + o.DollarOrderby = dollarOrderby +} + +// WithDollarSelect adds the dollarSelect to the city bus Api daily time table 1 params +func (o *CityBusAPIDailyTimeTable1Params) WithDollarSelect(dollarSelect *string) *CityBusAPIDailyTimeTable1Params { + o.SetDollarSelect(dollarSelect) + return o +} + +// SetDollarSelect adds the dollarSelect to the city bus Api daily time table 1 params +func (o *CityBusAPIDailyTimeTable1Params) SetDollarSelect(dollarSelect *string) { + o.DollarSelect = dollarSelect +} + +// WithDollarSkip adds the dollarSkip to the city bus Api daily time table 1 params +func (o *CityBusAPIDailyTimeTable1Params) WithDollarSkip(dollarSkip *string) *CityBusAPIDailyTimeTable1Params { + o.SetDollarSkip(dollarSkip) + return o +} + +// SetDollarSkip adds the dollarSkip to the city bus Api daily time table 1 params +func (o *CityBusAPIDailyTimeTable1Params) SetDollarSkip(dollarSkip *string) { + o.DollarSkip = dollarSkip +} + +// WithDollarTop adds the dollarTop to the city bus Api daily time table 1 params +func (o *CityBusAPIDailyTimeTable1Params) WithDollarTop(dollarTop *int64) *CityBusAPIDailyTimeTable1Params { + o.SetDollarTop(dollarTop) + return o +} + +// SetDollarTop adds the dollarTop to the city bus Api daily time table 1 params +func (o *CityBusAPIDailyTimeTable1Params) SetDollarTop(dollarTop *int64) { + o.DollarTop = dollarTop +} + +// WithCity adds the city to the city bus Api daily time table 1 params +func (o *CityBusAPIDailyTimeTable1Params) WithCity(city string) *CityBusAPIDailyTimeTable1Params { + o.SetCity(city) + return o +} + +// SetCity adds the city to the city bus Api daily time table 1 params +func (o *CityBusAPIDailyTimeTable1Params) SetCity(city string) { + o.City = city +} + +// WithRouteName adds the routeName to the city bus Api daily time table 1 params +func (o *CityBusAPIDailyTimeTable1Params) WithRouteName(routeName string) *CityBusAPIDailyTimeTable1Params { + o.SetRouteName(routeName) + return o +} + +// SetRouteName adds the routeName to the city bus Api daily time table 1 params +func (o *CityBusAPIDailyTimeTable1Params) SetRouteName(routeName string) { + o.RouteName = routeName +} + +// WithHealth adds the health to the city bus Api daily time table 1 params +func (o *CityBusAPIDailyTimeTable1Params) WithHealth(health *string) *CityBusAPIDailyTimeTable1Params { + o.SetHealth(health) + return o +} + +// SetHealth adds the health to the city bus Api daily time table 1 params +func (o *CityBusAPIDailyTimeTable1Params) SetHealth(health *string) { + o.Health = health +} + +// WriteToRequest writes these params to a swagger request +func (o *CityBusAPIDailyTimeTable1Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.DollarFilter != nil { + + // query param $filter + var qrDollarFilter string + + if o.DollarFilter != nil { + qrDollarFilter = *o.DollarFilter + } + qDollarFilter := qrDollarFilter + if qDollarFilter != "" { + + if err := r.SetQueryParam("$filter", qDollarFilter); err != nil { + return err + } + } + } + + // query param $format + qrDollarFormat := o.DollarFormat + qDollarFormat := qrDollarFormat + if qDollarFormat != "" { + + if err := r.SetQueryParam("$format", qDollarFormat); err != nil { + return err + } + } + + if o.DollarOrderby != nil { + + // query param $orderby + var qrDollarOrderby string + + if o.DollarOrderby != nil { + qrDollarOrderby = *o.DollarOrderby + } + qDollarOrderby := qrDollarOrderby + if qDollarOrderby != "" { + + if err := r.SetQueryParam("$orderby", qDollarOrderby); err != nil { + return err + } + } + } + + if o.DollarSelect != nil { + + // query param $select + var qrDollarSelect string + + if o.DollarSelect != nil { + qrDollarSelect = *o.DollarSelect + } + qDollarSelect := qrDollarSelect + if qDollarSelect != "" { + + if err := r.SetQueryParam("$select", qDollarSelect); err != nil { + return err + } + } + } + + if o.DollarSkip != nil { + + // query param $skip + var qrDollarSkip string + + if o.DollarSkip != nil { + qrDollarSkip = *o.DollarSkip + } + qDollarSkip := qrDollarSkip + if qDollarSkip != "" { + + if err := r.SetQueryParam("$skip", qDollarSkip); err != nil { + return err + } + } + } + + if o.DollarTop != nil { + + // query param $top + var qrDollarTop int64 + + if o.DollarTop != nil { + qrDollarTop = *o.DollarTop + } + qDollarTop := swag.FormatInt64(qrDollarTop) + if qDollarTop != "" { + + if err := r.SetQueryParam("$top", qDollarTop); err != nil { + return err + } + } + } + + // path param City + if err := r.SetPathParam("City", o.City); err != nil { + return err + } + + // path param RouteName + if err := r.SetPathParam("RouteName", o.RouteName); err != nil { + return err + } + + if o.Health != nil { + + // query param health + var qrHealth string + + if o.Health != nil { + qrHealth = *o.Health + } + qHealth := qrHealth + if qHealth != "" { + + if err := r.SetQueryParam("health", qHealth); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/bus/v2/client/city_bus/city_bus_api_daily_time_table1_responses.go b/bus/v2/client/city_bus/city_bus_api_daily_time_table1_responses.go new file mode 100644 index 00000000..5a32d02f --- /dev/null +++ b/bus/v2/client/city_bus/city_bus_api_daily_time_table1_responses.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package city_bus + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/minchao/go-ptx/bus/v2/models" +) + +// CityBusAPIDailyTimeTable1Reader is a Reader for the CityBusAPIDailyTimeTable1 structure. +type CityBusAPIDailyTimeTable1Reader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CityBusAPIDailyTimeTable1Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCityBusAPIDailyTimeTable1OK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 299: + result := NewCityBusAPIDailyTimeTable1Status299() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 304: + result := NewCityBusAPIDailyTimeTable1NotModified() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCityBusAPIDailyTimeTable1OK creates a CityBusAPIDailyTimeTable1OK with default headers values +func NewCityBusAPIDailyTimeTable1OK() *CityBusAPIDailyTimeTable1OK { + return &CityBusAPIDailyTimeTable1OK{} +} + +/* CityBusAPIDailyTimeTable1OK describes a response with status code 200, with default header values. + +Success +*/ +type CityBusAPIDailyTimeTable1OK struct { + Payload []*models.PTXServiceDTOBusSpecificationV2BusDailyTimeTable +} + +func (o *CityBusAPIDailyTimeTable1OK) Error() string { + return fmt.Sprintf("[GET /v2/Bus/DailyTimeTable/City/{City}/{RouteName}][%d] cityBusApiDailyTimeTable1OK %+v", 200, o.Payload) +} +func (o *CityBusAPIDailyTimeTable1OK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusDailyTimeTable { + return o.Payload +} + +func (o *CityBusAPIDailyTimeTable1OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCityBusAPIDailyTimeTable1Status299 creates a CityBusAPIDailyTimeTable1Status299 with default headers values +func NewCityBusAPIDailyTimeTable1Status299() *CityBusAPIDailyTimeTable1Status299 { + return &CityBusAPIDailyTimeTable1Status299{} +} + +/* CityBusAPIDailyTimeTable1Status299 describes a response with status code 299, with default header values. + +加入參數'?health=true'即可查詢此API服務的健康狀態 +*/ +type CityBusAPIDailyTimeTable1Status299 struct { + Payload *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth +} + +func (o *CityBusAPIDailyTimeTable1Status299) Error() string { + return fmt.Sprintf("[GET /v2/Bus/DailyTimeTable/City/{City}/{RouteName}][%d] cityBusApiDailyTimeTable1Status299 %+v", 299, o.Payload) +} +func (o *CityBusAPIDailyTimeTable1Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth { + return o.Payload +} + +func (o *CityBusAPIDailyTimeTable1Status299) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCityBusAPIDailyTimeTable1NotModified creates a CityBusAPIDailyTimeTable1NotModified with default headers values +func NewCityBusAPIDailyTimeTable1NotModified() *CityBusAPIDailyTimeTable1NotModified { + return &CityBusAPIDailyTimeTable1NotModified{} +} + +/* CityBusAPIDailyTimeTable1NotModified describes a response with status code 304, with default header values. + +服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content +*/ +type CityBusAPIDailyTimeTable1NotModified struct { +} + +func (o *CityBusAPIDailyTimeTable1NotModified) Error() string { + return fmt.Sprintf("[GET /v2/Bus/DailyTimeTable/City/{City}/{RouteName}][%d] cityBusApiDailyTimeTable1NotModified ", 304) +} + +func (o *CityBusAPIDailyTimeTable1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/bus/v3/client/city_bus/city_bus_api_daily_time_table_parameters.go b/bus/v2/client/city_bus/city_bus_api_daily_time_table_parameters.go similarity index 92% rename from bus/v3/client/city_bus/city_bus_api_daily_time_table_parameters.go rename to bus/v2/client/city_bus/city_bus_api_daily_time_table_parameters.go index f95dba5e..01057e0a 100644 --- a/bus/v3/client/city_bus/city_bus_api_daily_time_table_parameters.go +++ b/bus/v2/client/city_bus/city_bus_api_daily_time_table_parameters.go @@ -60,12 +60,6 @@ func NewCityBusAPIDailyTimeTableParamsWithHTTPClient(client *http.Client) *CityB */ type CityBusAPIDailyTimeTableParams struct { - /* DollarCount. - - 查詢數量 - */ - DollarCount *bool - /* DollarFilter. 過濾 @@ -106,7 +100,7 @@ type CityBusAPIDailyTimeTableParams struct { /* City. - 縣市 + 欲查詢縣市 */ City string @@ -180,17 +174,6 @@ func (o *CityBusAPIDailyTimeTableParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } -// WithDollarCount adds the dollarCount to the city bus Api daily time table params -func (o *CityBusAPIDailyTimeTableParams) WithDollarCount(dollarCount *bool) *CityBusAPIDailyTimeTableParams { - o.SetDollarCount(dollarCount) - return o -} - -// SetDollarCount adds the dollarCount to the city bus Api daily time table params -func (o *CityBusAPIDailyTimeTableParams) SetDollarCount(dollarCount *bool) { - o.DollarCount = dollarCount -} - // WithDollarFilter adds the dollarFilter to the city bus Api daily time table params func (o *CityBusAPIDailyTimeTableParams) WithDollarFilter(dollarFilter *string) *CityBusAPIDailyTimeTableParams { o.SetDollarFilter(dollarFilter) @@ -287,23 +270,6 @@ func (o *CityBusAPIDailyTimeTableParams) WriteToRequest(r runtime.ClientRequest, } var res []error - if o.DollarCount != nil { - - // query param $count - var qrDollarCount bool - - if o.DollarCount != nil { - qrDollarCount = *o.DollarCount - } - qDollarCount := swag.FormatBool(qrDollarCount) - if qDollarCount != "" { - - if err := r.SetQueryParam("$count", qDollarCount); err != nil { - return err - } - } - } - if o.DollarFilter != nil { // query param $filter diff --git a/bus/v3/client/city_bus/city_bus_api_daily_time_table_responses.go b/bus/v2/client/city_bus/city_bus_api_daily_time_table_responses.go similarity index 85% rename from bus/v3/client/city_bus/city_bus_api_daily_time_table_responses.go rename to bus/v2/client/city_bus/city_bus_api_daily_time_table_responses.go index d55a2022..9edb381e 100644 --- a/bus/v3/client/city_bus/city_bus_api_daily_time_table_responses.go +++ b/bus/v2/client/city_bus/city_bus_api_daily_time_table_responses.go @@ -12,7 +12,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" - "github.com/minchao/go-ptx/bus/v3/models" + "github.com/minchao/go-ptx/bus/v2/models" ) // CityBusAPIDailyTimeTableReader is a Reader for the CityBusAPIDailyTimeTable structure. @@ -56,22 +56,20 @@ func NewCityBusAPIDailyTimeTableOK() *CityBusAPIDailyTimeTableOK { Success */ type CityBusAPIDailyTimeTableOK struct { - Payload *models.PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecificationV3DailyTimeTable + Payload []*models.PTXServiceDTOBusSpecificationV2BusDailyTimeTable } func (o *CityBusAPIDailyTimeTableOK) Error() string { - return fmt.Sprintf("[GET /v3/Bus/DailyTimeTable/City/{City}][%d] cityBusApiDailyTimeTableOK %+v", 200, o.Payload) + return fmt.Sprintf("[GET /v2/Bus/DailyTimeTable/City/{City}][%d] cityBusApiDailyTimeTableOK %+v", 200, o.Payload) } -func (o *CityBusAPIDailyTimeTableOK) GetPayload() *models.PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecificationV3DailyTimeTable { +func (o *CityBusAPIDailyTimeTableOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusDailyTimeTable { return o.Payload } func (o *CityBusAPIDailyTimeTableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecificationV3DailyTimeTable) - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { return err } @@ -92,7 +90,7 @@ type CityBusAPIDailyTimeTableStatus299 struct { } func (o *CityBusAPIDailyTimeTableStatus299) Error() string { - return fmt.Sprintf("[GET /v3/Bus/DailyTimeTable/City/{City}][%d] cityBusApiDailyTimeTableStatus299 %+v", 299, o.Payload) + return fmt.Sprintf("[GET /v2/Bus/DailyTimeTable/City/{City}][%d] cityBusApiDailyTimeTableStatus299 %+v", 299, o.Payload) } func (o *CityBusAPIDailyTimeTableStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth { return o.Payload @@ -123,7 +121,7 @@ type CityBusAPIDailyTimeTableNotModified struct { } func (o *CityBusAPIDailyTimeTableNotModified) Error() string { - return fmt.Sprintf("[GET /v3/Bus/DailyTimeTable/City/{City}][%d] cityBusApiDailyTimeTableNotModified ", 304) + return fmt.Sprintf("[GET /v2/Bus/DailyTimeTable/City/{City}][%d] cityBusApiDailyTimeTableNotModified ", 304) } func (o *CityBusAPIDailyTimeTableNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/bus/v2/client/city_bus/city_bus_client.go b/bus/v2/client/city_bus/city_bus_client.go index 753c811d..d1c5043b 100644 --- a/bus/v2/client/city_bus/city_bus_client.go +++ b/bus/v2/client/city_bus/city_bus_client.go @@ -32,6 +32,14 @@ type ClientOption func(*runtime.ClientOperation) type ClientService interface { CityBusAPIAlert(params *CityBusAPIAlertParams, opts ...ClientOption) (*CityBusAPIAlertOK, *CityBusAPIAlertStatus299, error) + CityBusAPIDailyStopTimeTable(params *CityBusAPIDailyStopTimeTableParams, opts ...ClientOption) (*CityBusAPIDailyStopTimeTableOK, *CityBusAPIDailyStopTimeTableStatus299, error) + + CityBusAPIDailyStopTimeTable1(params *CityBusAPIDailyStopTimeTable1Params, opts ...ClientOption) (*CityBusAPIDailyStopTimeTable1OK, *CityBusAPIDailyStopTimeTable1Status299, error) + + CityBusAPIDailyTimeTable(params *CityBusAPIDailyTimeTableParams, opts ...ClientOption) (*CityBusAPIDailyTimeTableOK, *CityBusAPIDailyTimeTableStatus299, error) + + CityBusAPIDailyTimeTable1(params *CityBusAPIDailyTimeTable1Params, opts ...ClientOption) (*CityBusAPIDailyTimeTable1OK, *CityBusAPIDailyTimeTable1Status299, error) + CityBusAPIDataVersion(params *CityBusAPIDataVersionParams, opts ...ClientOption) (*CityBusAPIDataVersionOK, *CityBusAPIDataVersionStatus299, error) CityBusAPIDisplayStopOfRoute(params *CityBusAPIDisplayStopOfRouteParams, opts ...ClientOption) (*CityBusAPIDisplayStopOfRouteOK, *CityBusAPIDisplayStopOfRouteStatus299, error) @@ -148,6 +156,170 @@ func (a *Client) CityBusAPIAlert(params *CityBusAPIAlertParams, opts ...ClientOp panic(msg) } +/* + CityBusAPIDailyStopTimeTable 取得指定s 縣市 的市區公車每日站別時刻表資料 + + 市區公車每日站別時刻表資料 +*/ +func (a *Client) CityBusAPIDailyStopTimeTable(params *CityBusAPIDailyStopTimeTableParams, opts ...ClientOption) (*CityBusAPIDailyStopTimeTableOK, *CityBusAPIDailyStopTimeTableStatus299, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCityBusAPIDailyStopTimeTableParams() + } + op := &runtime.ClientOperation{ + ID: "CityBusApi_DailyStopTimeTable", + Method: "GET", + PathPattern: "/v2/Bus/DailyStopTimeTable/City/{City}", + ProducesMediaTypes: []string{"application/json", "application/xml"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &CityBusAPIDailyStopTimeTableReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, nil, err + } + switch value := result.(type) { + case *CityBusAPIDailyStopTimeTableOK: + return value, nil, nil + case *CityBusAPIDailyStopTimeTableStatus299: + return nil, value, nil + } + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for city_bus: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + CityBusAPIDailyStopTimeTable1 取得指定s 縣市 路線名稱 的市區公車每日站別時刻表資料 + + 市區公車每日站別時刻表資料 +*/ +func (a *Client) CityBusAPIDailyStopTimeTable1(params *CityBusAPIDailyStopTimeTable1Params, opts ...ClientOption) (*CityBusAPIDailyStopTimeTable1OK, *CityBusAPIDailyStopTimeTable1Status299, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCityBusAPIDailyStopTimeTable1Params() + } + op := &runtime.ClientOperation{ + ID: "CityBusApi_DailyStopTimeTable_1", + Method: "GET", + PathPattern: "/v2/Bus/DailyStopTimeTable/City/{City}/{RouteName}", + ProducesMediaTypes: []string{"application/json", "application/xml"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &CityBusAPIDailyStopTimeTable1Reader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, nil, err + } + switch value := result.(type) { + case *CityBusAPIDailyStopTimeTable1OK: + return value, nil, nil + case *CityBusAPIDailyStopTimeTable1Status299: + return nil, value, nil + } + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for city_bus: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + CityBusAPIDailyTimeTable 取得指定s 縣市 的市區公車每日營運時刻表資料 + + 市區公車每日營運時刻表資料 +*/ +func (a *Client) CityBusAPIDailyTimeTable(params *CityBusAPIDailyTimeTableParams, opts ...ClientOption) (*CityBusAPIDailyTimeTableOK, *CityBusAPIDailyTimeTableStatus299, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCityBusAPIDailyTimeTableParams() + } + op := &runtime.ClientOperation{ + ID: "CityBusApi_DailyTimeTable", + Method: "GET", + PathPattern: "/v2/Bus/DailyTimeTable/City/{City}", + ProducesMediaTypes: []string{"application/json", "application/xml"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &CityBusAPIDailyTimeTableReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, nil, err + } + switch value := result.(type) { + case *CityBusAPIDailyTimeTableOK: + return value, nil, nil + case *CityBusAPIDailyTimeTableStatus299: + return nil, value, nil + } + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for city_bus: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + CityBusAPIDailyTimeTable1 取得指定s 縣市 路線名稱 的市區公車每日營運時刻表資料 + + 市區公車之每日營運時刻表資料 +*/ +func (a *Client) CityBusAPIDailyTimeTable1(params *CityBusAPIDailyTimeTable1Params, opts ...ClientOption) (*CityBusAPIDailyTimeTable1OK, *CityBusAPIDailyTimeTable1Status299, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCityBusAPIDailyTimeTable1Params() + } + op := &runtime.ClientOperation{ + ID: "CityBusApi_DailyTimeTable_1", + Method: "GET", + PathPattern: "/v2/Bus/DailyTimeTable/City/{City}/{RouteName}", + ProducesMediaTypes: []string{"application/json", "application/xml"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &CityBusAPIDailyTimeTable1Reader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, nil, err + } + switch value := result.(type) { + case *CityBusAPIDailyTimeTable1OK: + return value, nil, nil + case *CityBusAPIDailyTimeTable1Status299: + return nil, value, nil + } + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for city_bus: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* CityBusAPIDataVersion 取得指定s 縣市 目前資料的最新版本資訊 @@ -233,7 +405,7 @@ func (a *Client) CityBusAPIDisplayStopOfRoute(params *CityBusAPIDisplayStopOfRou /* CityBusAPIDisplayStopOfRoute1 取得指定s 縣市 路線名稱 的市區公車顯示用路線站序資料 - 市區公車之顯示用路線站序資料,僅台北市與新北市可查詢 + 市區公車之顯示用路線站序資料 */ func (a *Client) CityBusAPIDisplayStopOfRoute1(params *CityBusAPIDisplayStopOfRoute1Params, opts ...ClientOption) (*CityBusAPIDisplayStopOfRoute1OK, *CityBusAPIDisplayStopOfRoute1Status299, error) { // TODO: Validate the params before sending diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_daily_stop_time_table.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_daily_stop_time_table.go new file mode 100644 index 00000000..25db6864 --- /dev/null +++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_daily_stop_time_table.go @@ -0,0 +1,380 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PTXServiceDTOBusSpecificationV2BusDailyStopTimeTable BusDailyStopTimeTable +// +// swagger:model PTX.Service.DTO.Bus.Specification.V2.BusDailyStopTimeTable +type PTXServiceDTOBusSpecificationV2BusDailyStopTimeTable struct { + + // DateTime + // + // 適用日期 + // Required: true + // Format: date-time + BusDate *strfmt.DateTime `json:"BusDate"` + + // String + // + // 迄點站站牌代碼,機關定義站牌代號(為原資料內碼) + // Required: true + DestinationStopID *string `json:"DestinationStopID" xml:"String"` + + // NameType + // + // 迄點站站牌名稱 + DestinationStopName struct { + PTXServiceDTOSharedSpecificationV2BaseNameType + } `json:"DestinationStopName,omitempty" xml:"NameType,omitempty"` + + // String + // + // 營運業者簡碼 + // Required: true + OperatorCode *string `json:"OperatorCode" xml:"String"` + + // String + // + // 營運業者代碼 + // Required: true + OperatorID *string `json:"OperatorID" xml:"String"` + + // String + // + // 地區既用中之路線代碼(為原資料內碼) + // Required: true + RouteID *string `json:"RouteID" xml:"String"` + + // NameType + // + // 路線名稱 + // Required: true + RouteName struct { + PTXServiceDTOSharedSpecificationV2BaseNameType + } `json:"RouteName" xml:"NameType"` + + // String + // + // 路線唯一識別代碼,規則為 {業管機關簡碼} + {RouteID},其中 {業管機關簡碼} 可於Authority API中的AuthorityCode欄位查詢 + // Required: true + RouteUID *string `json:"RouteUID" xml:"String"` + + // Array + // + // 公車站牌停靠資料 + // Required: true + Stops []*PTXServiceDTOBusSpecificationV2BusDailyStopTimeTableStop "json:\"Stops\" xml:\"List`1\"" + + // String + // + // 地區既用中之附屬路線代碼(為原資料內碼) + // Required: true + SubRouteID *string `json:"SubRouteID" xml:"String"` + + // NameType + // + // 附屬路線名稱 + SubRouteName struct { + PTXServiceDTOSharedSpecificationV2BaseNameType + } `json:"SubRouteName,omitempty" xml:"NameType,omitempty"` + + // String + // + // 附屬路線唯一識別代碼,規則為 {業管機關簡碼} + {SubRouteID},其中 {業管機關簡碼} 可於Authority API中的AuthorityCode欄位查詢 + // Required: true + SubRouteUID *string `json:"SubRouteUID" xml:"String"` + + // DateTime + // + // 資料更新日期時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz) + // Required: true + // Format: date-time + UpdateTime *strfmt.DateTime `json:"UpdateTime"` +} + +// Validate validates this p t x service d t o bus specification v2 bus daily stop time table +func (m *PTXServiceDTOBusSpecificationV2BusDailyStopTimeTable) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBusDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationStopID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationStopName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOperatorCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOperatorID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRouteID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRouteName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRouteUID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStops(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubRouteID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubRouteName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubRouteUID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdateTime(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyStopTimeTable) validateBusDate(formats strfmt.Registry) error { + + if err := validate.Required("BusDate", "body", m.BusDate); err != nil { + return err + } + + if err := validate.FormatOf("BusDate", "body", "date-time", m.BusDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyStopTimeTable) validateDestinationStopID(formats strfmt.Registry) error { + + if err := validate.Required("DestinationStopID", "body", m.DestinationStopID); err != nil { + return err + } + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyStopTimeTable) validateDestinationStopName(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationStopName) { // not required + return nil + } + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyStopTimeTable) validateOperatorCode(formats strfmt.Registry) error { + + if err := validate.Required("OperatorCode", "body", m.OperatorCode); err != nil { + return err + } + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyStopTimeTable) validateOperatorID(formats strfmt.Registry) error { + + if err := validate.Required("OperatorID", "body", m.OperatorID); err != nil { + return err + } + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyStopTimeTable) validateRouteID(formats strfmt.Registry) error { + + if err := validate.Required("RouteID", "body", m.RouteID); err != nil { + return err + } + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyStopTimeTable) validateRouteName(formats strfmt.Registry) error { + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyStopTimeTable) validateRouteUID(formats strfmt.Registry) error { + + if err := validate.Required("RouteUID", "body", m.RouteUID); err != nil { + return err + } + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyStopTimeTable) validateStops(formats strfmt.Registry) error { + + if err := validate.Required("Stops", "body", m.Stops); err != nil { + return err + } + + for i := 0; i < len(m.Stops); i++ { + if swag.IsZero(m.Stops[i]) { // not required + continue + } + + if m.Stops[i] != nil { + if err := m.Stops[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Stops" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyStopTimeTable) validateSubRouteID(formats strfmt.Registry) error { + + if err := validate.Required("SubRouteID", "body", m.SubRouteID); err != nil { + return err + } + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyStopTimeTable) validateSubRouteName(formats strfmt.Registry) error { + if swag.IsZero(m.SubRouteName) { // not required + return nil + } + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyStopTimeTable) validateSubRouteUID(formats strfmt.Registry) error { + + if err := validate.Required("SubRouteUID", "body", m.SubRouteUID); err != nil { + return err + } + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyStopTimeTable) validateUpdateTime(formats strfmt.Registry) error { + + if err := validate.Required("UpdateTime", "body", m.UpdateTime); err != nil { + return err + } + + if err := validate.FormatOf("UpdateTime", "body", "date-time", m.UpdateTime.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this p t x service d t o bus specification v2 bus daily stop time table based on the context it is used +func (m *PTXServiceDTOBusSpecificationV2BusDailyStopTimeTable) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDestinationStopName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRouteName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStops(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSubRouteName(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyStopTimeTable) contextValidateDestinationStopName(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyStopTimeTable) contextValidateRouteName(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyStopTimeTable) contextValidateStops(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Stops); i++ { + + if m.Stops[i] != nil { + if err := m.Stops[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Stops" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyStopTimeTable) contextValidateSubRouteName(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +// MarshalBinary interface implementation +func (m *PTXServiceDTOBusSpecificationV2BusDailyStopTimeTable) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PTXServiceDTOBusSpecificationV2BusDailyStopTimeTable) UnmarshalBinary(b []byte) error { + var res PTXServiceDTOBusSpecificationV2BusDailyStopTimeTable + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_daily_stop_time_table_stop.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_daily_stop_time_table_stop.go new file mode 100644 index 00000000..ca63a8c5 --- /dev/null +++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_daily_stop_time_table_stop.go @@ -0,0 +1,181 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PTXServiceDTOBusSpecificationV2BusDailyStopTimeTableStop Stop +// +// swagger:model PTX.Service.DTO.Bus.Specification.V2.BusDailyStopTimeTable+Stop +type PTXServiceDTOBusSpecificationV2BusDailyStopTimeTableStop struct { + + // String + // + // 地區既用中之站牌代碼(為原資料內碼) + // Required: true + StopID *string `json:"StopID" xml:"String"` + + // NameType + // + // 站牌名稱 + StopName struct { + PTXServiceDTOSharedSpecificationV2BaseNameType + } `json:"StopName,omitempty" xml:"NameType,omitempty"` + + // String + // + // 站牌唯一識別代碼,規則為 {業管機關代碼} + {StopID},其中 {業管機關代碼} 可於Authority API中的AuthorityCode欄位查詢 + // Required: true + StopUID *string `json:"StopUID" xml:"String"` + + // Array + // + // 預定班表 + TimeTables []*PTXServiceDTOBusSpecificationV2BusDailyStopTimeTableTimeTable "json:\"TimeTables\" xml:\"List`1\"" +} + +// Validate validates this p t x service d t o bus specification v2 bus daily stop time table stop +func (m *PTXServiceDTOBusSpecificationV2BusDailyStopTimeTableStop) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateStopID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStopName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStopUID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTimeTables(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyStopTimeTableStop) validateStopID(formats strfmt.Registry) error { + + if err := validate.Required("StopID", "body", m.StopID); err != nil { + return err + } + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyStopTimeTableStop) validateStopName(formats strfmt.Registry) error { + if swag.IsZero(m.StopName) { // not required + return nil + } + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyStopTimeTableStop) validateStopUID(formats strfmt.Registry) error { + + if err := validate.Required("StopUID", "body", m.StopUID); err != nil { + return err + } + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyStopTimeTableStop) validateTimeTables(formats strfmt.Registry) error { + if swag.IsZero(m.TimeTables) { // not required + return nil + } + + for i := 0; i < len(m.TimeTables); i++ { + if swag.IsZero(m.TimeTables[i]) { // not required + continue + } + + if m.TimeTables[i] != nil { + if err := m.TimeTables[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("TimeTables" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this p t x service d t o bus specification v2 bus daily stop time table stop based on the context it is used +func (m *PTXServiceDTOBusSpecificationV2BusDailyStopTimeTableStop) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateStopName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTimeTables(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyStopTimeTableStop) contextValidateStopName(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyStopTimeTableStop) contextValidateTimeTables(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.TimeTables); i++ { + + if m.TimeTables[i] != nil { + if err := m.TimeTables[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("TimeTables" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PTXServiceDTOBusSpecificationV2BusDailyStopTimeTableStop) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PTXServiceDTOBusSpecificationV2BusDailyStopTimeTableStop) UnmarshalBinary(b []byte) error { + var res PTXServiceDTOBusSpecificationV2BusDailyStopTimeTableStop + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_daily_stop_time_table_time_table.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_daily_stop_time_table_time_table.go new file mode 100644 index 00000000..591952f5 --- /dev/null +++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_daily_stop_time_table_time_table.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PTXServiceDTOBusSpecificationV2BusDailyStopTimeTableTimeTable TimeTable +// +// swagger:model PTX.Service.DTO.Bus.Specification.V2.BusDailyStopTimeTable+TimeTable +type PTXServiceDTOBusSpecificationV2BusDailyStopTimeTableTimeTable struct { + + // String + // + // 到站時間,格式為:HH:mm + // Required: true + ArrivalTime *string `json:"ArrivalTime" xml:"String"` + + // String + // + // 離站時間,格式為:HH:mm + // Required: true + DepartureTime *string `json:"DepartureTime" xml:"String"` + + // 該路線班次是否使用低地板公車車輛 , 0 = 否 , 1 = 是 + IsLowFloor bool `json:"IsLowFloor,omitempty"` + + // Int32 + // + // 發車順序(由1開始) + // Required: true + Sequence *int32 `json:"Sequence"` + + // Int32 + // + // 時刻表時間類型 : [0:'估算時間',1:'表訂時間'] + // Required: true + TimeType *int64 `json:"TimeType"` + + // String + // + // 班次代碼 + TripID string `json:"TripID,omitempty" xml:"String,omitempty"` +} + +// Validate validates this p t x service d t o bus specification v2 bus daily stop time table time table +func (m *PTXServiceDTOBusSpecificationV2BusDailyStopTimeTableTimeTable) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateArrivalTime(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDepartureTime(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSequence(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTimeType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyStopTimeTableTimeTable) validateArrivalTime(formats strfmt.Registry) error { + + if err := validate.Required("ArrivalTime", "body", m.ArrivalTime); err != nil { + return err + } + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyStopTimeTableTimeTable) validateDepartureTime(formats strfmt.Registry) error { + + if err := validate.Required("DepartureTime", "body", m.DepartureTime); err != nil { + return err + } + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyStopTimeTableTimeTable) validateSequence(formats strfmt.Registry) error { + + if err := validate.Required("Sequence", "body", m.Sequence); err != nil { + return err + } + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyStopTimeTableTimeTable) validateTimeType(formats strfmt.Registry) error { + + if err := validate.Required("TimeType", "body", m.TimeType); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this p t x service d t o bus specification v2 bus daily stop time table time table based on context it is used +func (m *PTXServiceDTOBusSpecificationV2BusDailyStopTimeTableTimeTable) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PTXServiceDTOBusSpecificationV2BusDailyStopTimeTableTimeTable) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PTXServiceDTOBusSpecificationV2BusDailyStopTimeTableTimeTable) UnmarshalBinary(b []byte) error { + var res PTXServiceDTOBusSpecificationV2BusDailyStopTimeTableTimeTable + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_daily_time_table.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_daily_time_table.go new file mode 100644 index 00000000..8f596cb7 --- /dev/null +++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_daily_time_table.go @@ -0,0 +1,336 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PTXServiceDTOBusSpecificationV2BusDailyTimeTable BusDailyTimeTable +// +// swagger:model PTX.Service.DTO.Bus.Specification.V2.BusDailyTimeTable +type PTXServiceDTOBusSpecificationV2BusDailyTimeTable struct { + + // DateTime + // + // 適用日期 + // Required: true + // Format: date-time + BusDate *strfmt.DateTime `json:"BusDate"` + + // Int32 + // + // 去返程 : [0:'去程',1:'返程',2:'迴圈',255:'未知'] + // Required: true + Direction *int64 `json:"Direction"` + + // String + // + // 營運業者簡碼 + // Required: true + OperatorCode *string `json:"OperatorCode" xml:"String"` + + // String + // + // 營運業者代碼 + // Required: true + OperatorID *string `json:"OperatorID" xml:"String"` + + // String + // + // 地區既用中之路線代碼(為原資料內碼) + // Required: true + RouteID *string `json:"RouteID" xml:"String"` + + // NameType + // + // 路線名稱 + // Required: true + RouteName struct { + PTXServiceDTOSharedSpecificationV2BaseNameType + } `json:"RouteName" xml:"NameType"` + + // String + // + // 路線唯一識別代碼,規則為 {業管機關簡碼} + {RouteID},其中 {業管機關簡碼} 可於Authority API中的AuthorityCode欄位查詢 + // Required: true + RouteUID *string `json:"RouteUID" xml:"String"` + + // String + // + // 地區既用中之附屬路線代碼(為原資料內碼) + // Required: true + SubRouteID *string `json:"SubRouteID" xml:"String"` + + // NameType + // + // 附屬路線名稱 + SubRouteName struct { + PTXServiceDTOSharedSpecificationV2BaseNameType + } `json:"SubRouteName,omitempty" xml:"NameType,omitempty"` + + // String + // + // 附屬路線唯一識別代碼,規則為 {業管機關簡碼} + {SubRouteID},其中 {業管機關簡碼} 可於Authority API中的AuthorityCode欄位查詢 + SubRouteUID string `json:"SubRouteUID,omitempty" xml:"String,omitempty"` + + // Array + // + // 預定班表 + Timetables []*PTXServiceDTOBusSpecificationV2BusDailyTimeTableTimeTable "json:\"Timetables\" xml:\"List`1\"" + + // DateTime + // + // 資料更新日期時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz) + // Required: true + // Format: date-time + UpdateTime *strfmt.DateTime `json:"UpdateTime"` +} + +// Validate validates this p t x service d t o bus specification v2 bus daily time table +func (m *PTXServiceDTOBusSpecificationV2BusDailyTimeTable) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBusDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDirection(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOperatorCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOperatorID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRouteID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRouteName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRouteUID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubRouteID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubRouteName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTimetables(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdateTime(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyTimeTable) validateBusDate(formats strfmt.Registry) error { + + if err := validate.Required("BusDate", "body", m.BusDate); err != nil { + return err + } + + if err := validate.FormatOf("BusDate", "body", "date-time", m.BusDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyTimeTable) validateDirection(formats strfmt.Registry) error { + + if err := validate.Required("Direction", "body", m.Direction); err != nil { + return err + } + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyTimeTable) validateOperatorCode(formats strfmt.Registry) error { + + if err := validate.Required("OperatorCode", "body", m.OperatorCode); err != nil { + return err + } + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyTimeTable) validateOperatorID(formats strfmt.Registry) error { + + if err := validate.Required("OperatorID", "body", m.OperatorID); err != nil { + return err + } + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyTimeTable) validateRouteID(formats strfmt.Registry) error { + + if err := validate.Required("RouteID", "body", m.RouteID); err != nil { + return err + } + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyTimeTable) validateRouteName(formats strfmt.Registry) error { + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyTimeTable) validateRouteUID(formats strfmt.Registry) error { + + if err := validate.Required("RouteUID", "body", m.RouteUID); err != nil { + return err + } + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyTimeTable) validateSubRouteID(formats strfmt.Registry) error { + + if err := validate.Required("SubRouteID", "body", m.SubRouteID); err != nil { + return err + } + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyTimeTable) validateSubRouteName(formats strfmt.Registry) error { + if swag.IsZero(m.SubRouteName) { // not required + return nil + } + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyTimeTable) validateTimetables(formats strfmt.Registry) error { + if swag.IsZero(m.Timetables) { // not required + return nil + } + + for i := 0; i < len(m.Timetables); i++ { + if swag.IsZero(m.Timetables[i]) { // not required + continue + } + + if m.Timetables[i] != nil { + if err := m.Timetables[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Timetables" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyTimeTable) validateUpdateTime(formats strfmt.Registry) error { + + if err := validate.Required("UpdateTime", "body", m.UpdateTime); err != nil { + return err + } + + if err := validate.FormatOf("UpdateTime", "body", "date-time", m.UpdateTime.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this p t x service d t o bus specification v2 bus daily time table based on the context it is used +func (m *PTXServiceDTOBusSpecificationV2BusDailyTimeTable) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateRouteName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSubRouteName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTimetables(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyTimeTable) contextValidateRouteName(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyTimeTable) contextValidateSubRouteName(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyTimeTable) contextValidateTimetables(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Timetables); i++ { + + if m.Timetables[i] != nil { + if err := m.Timetables[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Timetables" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PTXServiceDTOBusSpecificationV2BusDailyTimeTable) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PTXServiceDTOBusSpecificationV2BusDailyTimeTable) UnmarshalBinary(b []byte) error { + var res PTXServiceDTOBusSpecificationV2BusDailyTimeTable + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_daily_time_table_stop_time.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_daily_time_table_stop_time.go new file mode 100644 index 00000000..6735c93c --- /dev/null +++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_daily_time_table_stop_time.go @@ -0,0 +1,201 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PTXServiceDTOBusSpecificationV2BusDailyTimeTableStopTime StopTime +// +// swagger:model PTX.Service.DTO.Bus.Specification.V2.BusDailyTimeTable+StopTime +type PTXServiceDTOBusSpecificationV2BusDailyTimeTableStopTime struct { + + // String + // + // 到站時間,格式為:HH:mm + // Required: true + ArrivalTime *string `json:"ArrivalTime" xml:"String"` + + // String + // + // 離站時間,格式為:HH:mm + // Required: true + DepartureTime *string `json:"DepartureTime" xml:"String"` + + // String + // + // 地區既用中之站牌代碼(為原資料內碼) + // Required: true + StopID *string `json:"StopID" xml:"String"` + + // NameType + // + // 站牌名稱 + StopName struct { + PTXServiceDTOSharedSpecificationV2BaseNameType + } `json:"StopName,omitempty" xml:"NameType,omitempty"` + + // Int32 + // + // 路線經過站牌之順序(由1開始) + // Required: true + StopSequence *int32 `json:"StopSequence"` + + // String + // + // 站牌唯一識別代碼,規則為 {業管機關代碼} + {StopID},其中 {業管機關代碼} 可於Authority API中的AuthorityCode欄位查詢 + // Required: true + StopUID *string `json:"StopUID" xml:"String"` + + // Int32 + // + // 時刻表時間類型 : [0:'估算時間',1:'表訂時間'] + // Required: true + TimeType *int64 `json:"TimeType"` +} + +// Validate validates this p t x service d t o bus specification v2 bus daily time table stop time +func (m *PTXServiceDTOBusSpecificationV2BusDailyTimeTableStopTime) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateArrivalTime(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDepartureTime(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStopID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStopName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStopSequence(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStopUID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTimeType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyTimeTableStopTime) validateArrivalTime(formats strfmt.Registry) error { + + if err := validate.Required("ArrivalTime", "body", m.ArrivalTime); err != nil { + return err + } + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyTimeTableStopTime) validateDepartureTime(formats strfmt.Registry) error { + + if err := validate.Required("DepartureTime", "body", m.DepartureTime); err != nil { + return err + } + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyTimeTableStopTime) validateStopID(formats strfmt.Registry) error { + + if err := validate.Required("StopID", "body", m.StopID); err != nil { + return err + } + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyTimeTableStopTime) validateStopName(formats strfmt.Registry) error { + if swag.IsZero(m.StopName) { // not required + return nil + } + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyTimeTableStopTime) validateStopSequence(formats strfmt.Registry) error { + + if err := validate.Required("StopSequence", "body", m.StopSequence); err != nil { + return err + } + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyTimeTableStopTime) validateStopUID(formats strfmt.Registry) error { + + if err := validate.Required("StopUID", "body", m.StopUID); err != nil { + return err + } + + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyTimeTableStopTime) validateTimeType(formats strfmt.Registry) error { + + if err := validate.Required("TimeType", "body", m.TimeType); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this p t x service d t o bus specification v2 bus daily time table stop time based on the context it is used +func (m *PTXServiceDTOBusSpecificationV2BusDailyTimeTableStopTime) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateStopName(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyTimeTableStopTime) contextValidateStopName(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +// MarshalBinary interface implementation +func (m *PTXServiceDTOBusSpecificationV2BusDailyTimeTableStopTime) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PTXServiceDTOBusSpecificationV2BusDailyTimeTableStopTime) UnmarshalBinary(b []byte) error { + var res PTXServiceDTOBusSpecificationV2BusDailyTimeTableStopTime + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_daily_time_table_time_table.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_daily_time_table_time_table.go new file mode 100644 index 00000000..6a83e0a8 --- /dev/null +++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_daily_time_table_time_table.go @@ -0,0 +1,122 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PTXServiceDTOBusSpecificationV2BusDailyTimeTableTimeTable TimeTable +// +// swagger:model PTX.Service.DTO.Bus.Specification.V2.BusDailyTimeTable+TimeTable +type PTXServiceDTOBusSpecificationV2BusDailyTimeTableTimeTable struct { + + // Array + // + // 公車停靠時間資料 + // Required: true + StopTimes []*PTXServiceDTOBusSpecificationV2BusDailyTimeTableStopTime "json:\"StopTimes\" xml:\"List`1\"" + + // String + // + // 班次代碼 + TripID string `json:"TripID,omitempty" xml:"String,omitempty"` +} + +// Validate validates this p t x service d t o bus specification v2 bus daily time table time table +func (m *PTXServiceDTOBusSpecificationV2BusDailyTimeTableTimeTable) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateStopTimes(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyTimeTableTimeTable) validateStopTimes(formats strfmt.Registry) error { + + if err := validate.Required("StopTimes", "body", m.StopTimes); err != nil { + return err + } + + for i := 0; i < len(m.StopTimes); i++ { + if swag.IsZero(m.StopTimes[i]) { // not required + continue + } + + if m.StopTimes[i] != nil { + if err := m.StopTimes[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("StopTimes" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this p t x service d t o bus specification v2 bus daily time table time table based on the context it is used +func (m *PTXServiceDTOBusSpecificationV2BusDailyTimeTableTimeTable) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateStopTimes(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PTXServiceDTOBusSpecificationV2BusDailyTimeTableTimeTable) contextValidateStopTimes(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.StopTimes); i++ { + + if m.StopTimes[i] != nil { + if err := m.StopTimes[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("StopTimes" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PTXServiceDTOBusSpecificationV2BusDailyTimeTableTimeTable) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PTXServiceDTOBusSpecificationV2BusDailyTimeTableTimeTable) UnmarshalBinary(b []byte) error { + var res PTXServiceDTOBusSpecificationV2BusDailyTimeTableTimeTable + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_timetable.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_timetable.go index 97fda7db..f410bba4 100644 --- a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_timetable.go +++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_timetable.go @@ -42,7 +42,7 @@ type PTXServiceDTOBusSpecificationV2BusTimetable struct { // String // - // 班次代碼,為無意義之編碼 + // 班次代碼 TripID string `json:"TripID,omitempty" xml:"String,omitempty"` } diff --git a/bus/v3/client/city_bus/city_bus_api_daily_time_table2_parameters.go b/bus/v3/client/city_bus/city_bus_api_daily_time_table2_parameters.go new file mode 100644 index 00000000..8a7f0478 --- /dev/null +++ b/bus/v3/client/city_bus/city_bus_api_daily_time_table2_parameters.go @@ -0,0 +1,428 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package city_bus + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewCityBusAPIDailyTimeTable2Params creates a new CityBusAPIDailyTimeTable2Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCityBusAPIDailyTimeTable2Params() *CityBusAPIDailyTimeTable2Params { + return &CityBusAPIDailyTimeTable2Params{ + timeout: cr.DefaultTimeout, + } +} + +// NewCityBusAPIDailyTimeTable2ParamsWithTimeout creates a new CityBusAPIDailyTimeTable2Params object +// with the ability to set a timeout on a request. +func NewCityBusAPIDailyTimeTable2ParamsWithTimeout(timeout time.Duration) *CityBusAPIDailyTimeTable2Params { + return &CityBusAPIDailyTimeTable2Params{ + timeout: timeout, + } +} + +// NewCityBusAPIDailyTimeTable2ParamsWithContext creates a new CityBusAPIDailyTimeTable2Params object +// with the ability to set a context for a request. +func NewCityBusAPIDailyTimeTable2ParamsWithContext(ctx context.Context) *CityBusAPIDailyTimeTable2Params { + return &CityBusAPIDailyTimeTable2Params{ + Context: ctx, + } +} + +// NewCityBusAPIDailyTimeTable2ParamsWithHTTPClient creates a new CityBusAPIDailyTimeTable2Params object +// with the ability to set a custom HTTPClient for a request. +func NewCityBusAPIDailyTimeTable2ParamsWithHTTPClient(client *http.Client) *CityBusAPIDailyTimeTable2Params { + return &CityBusAPIDailyTimeTable2Params{ + HTTPClient: client, + } +} + +/* CityBusAPIDailyTimeTable2Params contains all the parameters to send to the API endpoint + for the city bus Api daily time table 2 operation. + + Typically these are written to a http.Request. +*/ +type CityBusAPIDailyTimeTable2Params struct { + + /* DollarCount. + + 查詢數量 + */ + DollarCount *bool + + /* DollarFilter. + + 過濾 + */ + DollarFilter *string + + /* DollarFormat. + + 指定來源格式 + */ + DollarFormat string + + /* DollarOrderby. + + 排序 + */ + DollarOrderby *string + + /* DollarSelect. + + 挑選 + */ + DollarSelect *string + + /* DollarSkip. + + 跳過前幾筆 + */ + DollarSkip *string + + /* DollarTop. + + 取前幾筆 + + Default: 30 + */ + DollarTop *int64 + + /* City. + + 縣市 + */ + City string + + /* Health. + + 加入參數'?health=true'即可查詢此API服務的健康狀態 + */ + Health *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the city bus Api daily time table 2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CityBusAPIDailyTimeTable2Params) WithDefaults() *CityBusAPIDailyTimeTable2Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the city bus Api daily time table 2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CityBusAPIDailyTimeTable2Params) SetDefaults() { + var ( + dollarTopDefault = int64(30) + ) + + val := CityBusAPIDailyTimeTable2Params{ + DollarTop: &dollarTopDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the city bus Api daily time table 2 params +func (o *CityBusAPIDailyTimeTable2Params) WithTimeout(timeout time.Duration) *CityBusAPIDailyTimeTable2Params { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the city bus Api daily time table 2 params +func (o *CityBusAPIDailyTimeTable2Params) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the city bus Api daily time table 2 params +func (o *CityBusAPIDailyTimeTable2Params) WithContext(ctx context.Context) *CityBusAPIDailyTimeTable2Params { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the city bus Api daily time table 2 params +func (o *CityBusAPIDailyTimeTable2Params) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the city bus Api daily time table 2 params +func (o *CityBusAPIDailyTimeTable2Params) WithHTTPClient(client *http.Client) *CityBusAPIDailyTimeTable2Params { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the city bus Api daily time table 2 params +func (o *CityBusAPIDailyTimeTable2Params) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDollarCount adds the dollarCount to the city bus Api daily time table 2 params +func (o *CityBusAPIDailyTimeTable2Params) WithDollarCount(dollarCount *bool) *CityBusAPIDailyTimeTable2Params { + o.SetDollarCount(dollarCount) + return o +} + +// SetDollarCount adds the dollarCount to the city bus Api daily time table 2 params +func (o *CityBusAPIDailyTimeTable2Params) SetDollarCount(dollarCount *bool) { + o.DollarCount = dollarCount +} + +// WithDollarFilter adds the dollarFilter to the city bus Api daily time table 2 params +func (o *CityBusAPIDailyTimeTable2Params) WithDollarFilter(dollarFilter *string) *CityBusAPIDailyTimeTable2Params { + o.SetDollarFilter(dollarFilter) + return o +} + +// SetDollarFilter adds the dollarFilter to the city bus Api daily time table 2 params +func (o *CityBusAPIDailyTimeTable2Params) SetDollarFilter(dollarFilter *string) { + o.DollarFilter = dollarFilter +} + +// WithDollarFormat adds the dollarFormat to the city bus Api daily time table 2 params +func (o *CityBusAPIDailyTimeTable2Params) WithDollarFormat(dollarFormat string) *CityBusAPIDailyTimeTable2Params { + o.SetDollarFormat(dollarFormat) + return o +} + +// SetDollarFormat adds the dollarFormat to the city bus Api daily time table 2 params +func (o *CityBusAPIDailyTimeTable2Params) SetDollarFormat(dollarFormat string) { + o.DollarFormat = dollarFormat +} + +// WithDollarOrderby adds the dollarOrderby to the city bus Api daily time table 2 params +func (o *CityBusAPIDailyTimeTable2Params) WithDollarOrderby(dollarOrderby *string) *CityBusAPIDailyTimeTable2Params { + o.SetDollarOrderby(dollarOrderby) + return o +} + +// SetDollarOrderby adds the dollarOrderby to the city bus Api daily time table 2 params +func (o *CityBusAPIDailyTimeTable2Params) SetDollarOrderby(dollarOrderby *string) { + o.DollarOrderby = dollarOrderby +} + +// WithDollarSelect adds the dollarSelect to the city bus Api daily time table 2 params +func (o *CityBusAPIDailyTimeTable2Params) WithDollarSelect(dollarSelect *string) *CityBusAPIDailyTimeTable2Params { + o.SetDollarSelect(dollarSelect) + return o +} + +// SetDollarSelect adds the dollarSelect to the city bus Api daily time table 2 params +func (o *CityBusAPIDailyTimeTable2Params) SetDollarSelect(dollarSelect *string) { + o.DollarSelect = dollarSelect +} + +// WithDollarSkip adds the dollarSkip to the city bus Api daily time table 2 params +func (o *CityBusAPIDailyTimeTable2Params) WithDollarSkip(dollarSkip *string) *CityBusAPIDailyTimeTable2Params { + o.SetDollarSkip(dollarSkip) + return o +} + +// SetDollarSkip adds the dollarSkip to the city bus Api daily time table 2 params +func (o *CityBusAPIDailyTimeTable2Params) SetDollarSkip(dollarSkip *string) { + o.DollarSkip = dollarSkip +} + +// WithDollarTop adds the dollarTop to the city bus Api daily time table 2 params +func (o *CityBusAPIDailyTimeTable2Params) WithDollarTop(dollarTop *int64) *CityBusAPIDailyTimeTable2Params { + o.SetDollarTop(dollarTop) + return o +} + +// SetDollarTop adds the dollarTop to the city bus Api daily time table 2 params +func (o *CityBusAPIDailyTimeTable2Params) SetDollarTop(dollarTop *int64) { + o.DollarTop = dollarTop +} + +// WithCity adds the city to the city bus Api daily time table 2 params +func (o *CityBusAPIDailyTimeTable2Params) WithCity(city string) *CityBusAPIDailyTimeTable2Params { + o.SetCity(city) + return o +} + +// SetCity adds the city to the city bus Api daily time table 2 params +func (o *CityBusAPIDailyTimeTable2Params) SetCity(city string) { + o.City = city +} + +// WithHealth adds the health to the city bus Api daily time table 2 params +func (o *CityBusAPIDailyTimeTable2Params) WithHealth(health *string) *CityBusAPIDailyTimeTable2Params { + o.SetHealth(health) + return o +} + +// SetHealth adds the health to the city bus Api daily time table 2 params +func (o *CityBusAPIDailyTimeTable2Params) SetHealth(health *string) { + o.Health = health +} + +// WriteToRequest writes these params to a swagger request +func (o *CityBusAPIDailyTimeTable2Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.DollarCount != nil { + + // query param $count + var qrDollarCount bool + + if o.DollarCount != nil { + qrDollarCount = *o.DollarCount + } + qDollarCount := swag.FormatBool(qrDollarCount) + if qDollarCount != "" { + + if err := r.SetQueryParam("$count", qDollarCount); err != nil { + return err + } + } + } + + if o.DollarFilter != nil { + + // query param $filter + var qrDollarFilter string + + if o.DollarFilter != nil { + qrDollarFilter = *o.DollarFilter + } + qDollarFilter := qrDollarFilter + if qDollarFilter != "" { + + if err := r.SetQueryParam("$filter", qDollarFilter); err != nil { + return err + } + } + } + + // query param $format + qrDollarFormat := o.DollarFormat + qDollarFormat := qrDollarFormat + if qDollarFormat != "" { + + if err := r.SetQueryParam("$format", qDollarFormat); err != nil { + return err + } + } + + if o.DollarOrderby != nil { + + // query param $orderby + var qrDollarOrderby string + + if o.DollarOrderby != nil { + qrDollarOrderby = *o.DollarOrderby + } + qDollarOrderby := qrDollarOrderby + if qDollarOrderby != "" { + + if err := r.SetQueryParam("$orderby", qDollarOrderby); err != nil { + return err + } + } + } + + if o.DollarSelect != nil { + + // query param $select + var qrDollarSelect string + + if o.DollarSelect != nil { + qrDollarSelect = *o.DollarSelect + } + qDollarSelect := qrDollarSelect + if qDollarSelect != "" { + + if err := r.SetQueryParam("$select", qDollarSelect); err != nil { + return err + } + } + } + + if o.DollarSkip != nil { + + // query param $skip + var qrDollarSkip string + + if o.DollarSkip != nil { + qrDollarSkip = *o.DollarSkip + } + qDollarSkip := qrDollarSkip + if qDollarSkip != "" { + + if err := r.SetQueryParam("$skip", qDollarSkip); err != nil { + return err + } + } + } + + if o.DollarTop != nil { + + // query param $top + var qrDollarTop int64 + + if o.DollarTop != nil { + qrDollarTop = *o.DollarTop + } + qDollarTop := swag.FormatInt64(qrDollarTop) + if qDollarTop != "" { + + if err := r.SetQueryParam("$top", qDollarTop); err != nil { + return err + } + } + } + + // path param City + if err := r.SetPathParam("City", o.City); err != nil { + return err + } + + if o.Health != nil { + + // query param health + var qrHealth string + + if o.Health != nil { + qrHealth = *o.Health + } + qHealth := qrHealth + if qHealth != "" { + + if err := r.SetQueryParam("health", qHealth); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/bus/v3/client/city_bus/city_bus_api_daily_time_table2_responses.go b/bus/v3/client/city_bus/city_bus_api_daily_time_table2_responses.go new file mode 100644 index 00000000..8a0825e1 --- /dev/null +++ b/bus/v3/client/city_bus/city_bus_api_daily_time_table2_responses.go @@ -0,0 +1,132 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package city_bus + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/minchao/go-ptx/bus/v3/models" +) + +// CityBusAPIDailyTimeTable2Reader is a Reader for the CityBusAPIDailyTimeTable2 structure. +type CityBusAPIDailyTimeTable2Reader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CityBusAPIDailyTimeTable2Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCityBusAPIDailyTimeTable2OK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 299: + result := NewCityBusAPIDailyTimeTable2Status299() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 304: + result := NewCityBusAPIDailyTimeTable2NotModified() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCityBusAPIDailyTimeTable2OK creates a CityBusAPIDailyTimeTable2OK with default headers values +func NewCityBusAPIDailyTimeTable2OK() *CityBusAPIDailyTimeTable2OK { + return &CityBusAPIDailyTimeTable2OK{} +} + +/* CityBusAPIDailyTimeTable2OK describes a response with status code 200, with default header values. + +Success +*/ +type CityBusAPIDailyTimeTable2OK struct { + Payload *models.PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecificationV3DailyTimeTable +} + +func (o *CityBusAPIDailyTimeTable2OK) Error() string { + return fmt.Sprintf("[GET /v3/Bus/DailyTimeTable/City/{City}][%d] cityBusApiDailyTimeTable2OK %+v", 200, o.Payload) +} +func (o *CityBusAPIDailyTimeTable2OK) GetPayload() *models.PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecificationV3DailyTimeTable { + return o.Payload +} + +func (o *CityBusAPIDailyTimeTable2OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecificationV3DailyTimeTable) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCityBusAPIDailyTimeTable2Status299 creates a CityBusAPIDailyTimeTable2Status299 with default headers values +func NewCityBusAPIDailyTimeTable2Status299() *CityBusAPIDailyTimeTable2Status299 { + return &CityBusAPIDailyTimeTable2Status299{} +} + +/* CityBusAPIDailyTimeTable2Status299 describes a response with status code 299, with default header values. + +加入參數'?health=true'即可查詢此API服務的健康狀態 +*/ +type CityBusAPIDailyTimeTable2Status299 struct { + Payload *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth +} + +func (o *CityBusAPIDailyTimeTable2Status299) Error() string { + return fmt.Sprintf("[GET /v3/Bus/DailyTimeTable/City/{City}][%d] cityBusApiDailyTimeTable2Status299 %+v", 299, o.Payload) +} +func (o *CityBusAPIDailyTimeTable2Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth { + return o.Payload +} + +func (o *CityBusAPIDailyTimeTable2Status299) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCityBusAPIDailyTimeTable2NotModified creates a CityBusAPIDailyTimeTable2NotModified with default headers values +func NewCityBusAPIDailyTimeTable2NotModified() *CityBusAPIDailyTimeTable2NotModified { + return &CityBusAPIDailyTimeTable2NotModified{} +} + +/* CityBusAPIDailyTimeTable2NotModified describes a response with status code 304, with default header values. + +服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content +*/ +type CityBusAPIDailyTimeTable2NotModified struct { +} + +func (o *CityBusAPIDailyTimeTable2NotModified) Error() string { + return fmt.Sprintf("[GET /v3/Bus/DailyTimeTable/City/{City}][%d] cityBusApiDailyTimeTable2NotModified ", 304) +} + +func (o *CityBusAPIDailyTimeTable2NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/bus/v3/client/city_bus/city_bus_client.go b/bus/v3/client/city_bus/city_bus_client.go index 78db51fd..fdeb6013 100644 --- a/bus/v3/client/city_bus/city_bus_client.go +++ b/bus/v3/client/city_bus/city_bus_client.go @@ -32,7 +32,7 @@ type ClientOption func(*runtime.ClientOperation) type ClientService interface { CityBusAPIAlert1(params *CityBusAPIAlert1Params, opts ...ClientOption) (*CityBusAPIAlert1OK, *CityBusAPIAlert1Status299, error) - CityBusAPIDailyTimeTable(params *CityBusAPIDailyTimeTableParams, opts ...ClientOption) (*CityBusAPIDailyTimeTableOK, *CityBusAPIDailyTimeTableStatus299, error) + CityBusAPIDailyTimeTable2(params *CityBusAPIDailyTimeTable2Params, opts ...ClientOption) (*CityBusAPIDailyTimeTable2OK, *CityBusAPIDailyTimeTable2Status299, error) CityBusAPIDepot(params *CityBusAPIDepotParams, opts ...ClientOption) (*CityBusAPIDepotOK, *CityBusAPIDepotStatus299, error) @@ -129,22 +129,22 @@ func (a *Client) CityBusAPIAlert1(params *CityBusAPIAlert1Params, opts ...Client } /* - CityBusAPIDailyTimeTable 取得指定s 縣市 的市區公車每日營運時刻表 + CityBusAPIDailyTimeTable2 取得指定s 縣市 的市區公車每日營運時刻表 */ -func (a *Client) CityBusAPIDailyTimeTable(params *CityBusAPIDailyTimeTableParams, opts ...ClientOption) (*CityBusAPIDailyTimeTableOK, *CityBusAPIDailyTimeTableStatus299, error) { +func (a *Client) CityBusAPIDailyTimeTable2(params *CityBusAPIDailyTimeTable2Params, opts ...ClientOption) (*CityBusAPIDailyTimeTable2OK, *CityBusAPIDailyTimeTable2Status299, error) { // TODO: Validate the params before sending if params == nil { - params = NewCityBusAPIDailyTimeTableParams() + params = NewCityBusAPIDailyTimeTable2Params() } op := &runtime.ClientOperation{ - ID: "CityBusApi_DailyTimeTable", + ID: "CityBusApi_DailyTimeTable_2", Method: "GET", PathPattern: "/v3/Bus/DailyTimeTable/City/{City}", ProducesMediaTypes: []string{"application/json", "application/xml"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &CityBusAPIDailyTimeTableReader{formats: a.formats}, + Reader: &CityBusAPIDailyTimeTable2Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, } @@ -157,9 +157,9 @@ func (a *Client) CityBusAPIDailyTimeTable(params *CityBusAPIDailyTimeTableParams return nil, nil, err } switch value := result.(type) { - case *CityBusAPIDailyTimeTableOK: + case *CityBusAPIDailyTimeTable2OK: return value, nil, nil - case *CityBusAPIDailyTimeTableStatus299: + case *CityBusAPIDailyTimeTable2Status299: return nil, value, nil } // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue diff --git a/oas.basic.v2.json b/oas.basic.v2.json index 5d9181cc..7ef5df63 100644 --- a/oas.basic.v2.json +++ b/oas.basic.v2.json @@ -317,6 +317,7 @@ "type": "object", "properties": { "UpdateTime": { + "format": "date-time", "title": "DateTime", "description": "更新日期時間", "type": "string" @@ -333,12 +334,19 @@ "type": "array", "items": { "$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V2.Base.News" + }, + "xml": { + "name": "List`1" } }, "Count": { "format": "int64", "type": "integer" } + }, + "xml": { + "name": "BasicWrapperOfNews", + "namespace": "https://ptx.transportdata.tw/standard/schema/" } }, "PTX.Service.DTO.Shared.Specification.V2.Base.Authority": { @@ -355,7 +363,10 @@ "AuthorityID": { "title": "String", "description": "業管機關代碼", - "type": "string" + "type": "string", + "xml": { + "name": "String" + } }, "AuthorityName": { "title": "NameType", @@ -364,33 +375,52 @@ { "$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V2.Base.NameType" } - ] + ], + "xml": { + "name": "NameType" + } }, "AuthorityPhone": { "title": "String", "description": "業管機關連絡電話", - "type": "string" + "type": "string", + "xml": { + "name": "String" + } }, "AuthorityEmail": { "title": "String", "description": "業管機關電子信箱", - "type": "string" + "type": "string", + "xml": { + "name": "String" + } }, "AuthorityUrl": { "title": "String", "description": "業管機關網址鏈結", - "type": "string" + "type": "string", + "xml": { + "name": "String" + } }, "AuthorityCode": { "title": "String", "description": "業管機關簡碼", - "type": "string" + "type": "string", + "xml": { + "name": "String" + } }, "UpdateTime": { + "format": "date-time", "title": "DateTime", "description": "資料更新日期時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)", "type": "string" } + }, + "xml": { + "name": "Authority" } }, "PTX.Service.DTO.Shared.Specification.V2.Base.NameType": { @@ -401,13 +431,22 @@ "Zh_tw": { "title": "String", "description": "中文繁體名稱", - "type": "string" + "type": "string", + "xml": { + "name": "String" + } }, "En": { "title": "String", "description": "英文名稱", - "type": "string" + "type": "string", + "xml": { + "name": "String" + } } + }, + "xml": { + "name": "NameType" } }, "PTX.Service.DTO.Shared.Specification.V2.Base.News": { @@ -429,58 +468,80 @@ "Language": { "title": "String", "description": "語系", - "type": "string" + "type": "string", + "xml": { + "name": "String" + } }, "Department": { "title": "String", "description": "發布單位", - "type": "string" + "type": "string", + "xml": { + "name": "String" + } }, "Title": { "title": "String", "description": "消息標題", - "type": "string" + "type": "string", + "xml": { + "name": "String" + } }, "NewsCategory": { - "title": "integer", + "title": "Int32", "description": "消息類別 : [1:'最新消息',2:'新聞稿',3:'營運資訊',4:'轉乘資訊',5:'活動訊息',6:'系統公告',7:'新服務上架',8:'API修正',9:'來源異常',99:'其他']", - "type": "string" + "type": "integer" }, "Description": { "title": "String", "description": "內容描述", - "type": "string" + "type": "string", + "xml": { + "name": "String" + } }, "NewsURL": { "title": "String", "description": "報導網站連結", - "type": "string" + "type": "string", + "xml": { + "name": "String" + } }, "AttachmentURL": { "title": "String", "description": "相關網站連結", - "type": "string" + "type": "string", + "xml": { + "name": "String" + } }, "PublishTime": { - "title": "DateTime", + "format": "date-time", "description": "消息公告日期時間", "type": "string" }, "StartTime": { - "title": "DateTime", + "format": "date-time", "description": "開始時間", "type": "string" }, "EndTime": { - "title": "DateTime", + "format": "date-time", "description": "結束時間", "type": "string" }, "UpdateTime": { + "format": "date-time", "title": "DateTime", "description": "消息更新時間", "type": "string" } + }, + "xml": { + "name": "News" } }, "PTX.Service.DTO.Shared.Specification.V2.Base.Operator": { @@ -500,12 +561,18 @@ "ProviderID": { "title": "String", "description": "資料提供平台代碼", - "type": "string" + "type": "string", + "xml": { + "name": "String" + } }, "OperatorID": { "title": "String", "description": "營運業者代碼", - "type": "string" + "type": "string", + "xml": { + "name": "String" + } }, "OperatorName": { "title": "NameType", @@ -514,58 +581,92 @@ { "$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V2.Base.NameType" } - ] + ], + "xml": { + "name": "NameType" + } }, "OperatorPhone": { "title": "String", "description": "營運業者連絡電話", - "type": "string" + "type": "string", + "xml": { + "name": "String" + } }, "OperatorEmail": { "title": "String", "description": "營運業者電子信箱", - "type": "string" + "type": "string", + "xml": { + "name": "String" + } }, "OperatorUrl": { "title": "String", "description": "營運業者網址鏈結", - "type": "string" + "type": "string", + "xml": { + "name": "String" + } }, "ReservationUrl": { "title": "String", "description": "訂票網址鏈結", - "type": "string" + "type": "string", + "xml": { + "name": "String" + } }, "ReservationPhone": { "title": "String", "description": "訂票連絡電話", - "type": "string" + "type": "string", + "xml": { + "name": "String" + } }, "OperatorCode": { "title": "String", "description": "營運業者簡碼", - "type": "string" + "type": "string", + "xml": { + "name": "String" + } }, "AuthorityCode": { "title": "String", "description": "營運業者業管機關簡碼(對於於公路客運/國道客運而言為THB)", - "type": "string" + "type": "string", + "xml": { + "name": "String" + } }, "SubAuthorityCode": { "title": "String", "description": "營運業者所屬業管子機關簡碼(對於公路客運/國道客運路線而言為區監理所如THB-VO10-1..等)", - "type": "string" + "type": "string", + "xml": { + "name": "String" + } }, "OperatorNo": { "title": "String", "description": "營運業者編號[交通部票證資料系統定義]", - "type": "string" + "type": "string", + "xml": { + "name": "String" + } }, "UpdateTime": { + "format": "date-time", "title": "DateTime", "description": "資料更新日期時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)", "type": "string" } + }, + "xml": { + "name": "Operator" } }, "PTX.Service.DTO.Shared.Specification.V2.Base.Provider": { @@ -582,7 +683,10 @@ "ProviderID": { "title": "String", "description": "資料提供平台代碼", - "type": "string" + "type": "string", + "xml": { + "name": "String" + } }, "ProviderName": { "title": "NameType", @@ -591,24 +695,37 @@ { "$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V2.Base.NameType" } - ] + ], + "xml": { + "name": "NameType" + } }, "ProviderPhone": { "title": "String", "description": "資料提供平台連絡電話", - "type": "string" + "type": "string", + "xml": { + "name": "String" + } }, "ProviderEmail": { "title": "String", "description": "資料提供平台電子信箱", - "type": "string" + "type": "string", + "xml": { + "name": "String" + } }, "ProviderUrl": { "title": "String", "description": "資料提供平台網址鏈結", - "type": "string" + "type": "string", + "xml": { + "name": "String" + } }, "UpdateTime": { + "format": "date-time", "title": "DateTime", "description": "資料更新日期時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)", "type": "string" @@ -616,8 +733,14 @@ "ProviderCode": { "title": "String", "description": "資料提供平台簡碼", - "type": "string" + "type": "string", + "xml": { + "name": "String" + } } + }, + "xml": { + "name": "Provider" } } }, diff --git a/oas.bike.v2.json b/oas.bike.v2.json index cd7c444c..58fbd581 100644 --- a/oas.bike.v2.json +++ b/oas.bike.v2.json @@ -287,8 +287,8 @@ "NantouCounty": "南投縣", "Chiayi": "嘉義市", "Taichung": "臺中市", - "NewTaipei": "新北市", "ChiayiCounty": "嘉義縣", + "NewTaipei": "新北市", "Kaohsiung": "高雄市", "YilanCounty": "宜蘭縣" } diff --git a/oas.bus.v2.json b/oas.bus.v2.json index 68e2fe67..5f42f0a8 100644 --- a/oas.bus.v2.json +++ b/oas.bus.v2.json @@ -46,19 +46,19 @@ "PenghuCounty" ], "x-enum": { - "YunlinCounty": "雲林縣", - "HualienCounty": "花蓮縣", - "HsinchuCounty": "新竹縣", - "Hsinchu": "新竹市", - "NantouCounty": "南投縣", - "PenghuCounty": "澎湖縣", - "Chiayi": "嘉義市", "TaitungCounty": "臺東縣", - "ChiayiCounty": "嘉義縣", - "ChanghuaCounty": "彰化縣", "MiaoliCounty": "苗栗縣", + "ChiayiCounty": "嘉義縣", + "Chiayi": "嘉義市", + "YilanCounty": "宜蘭縣", + "PenghuCounty": "澎湖縣", + "NantouCounty": "南投縣", + "HualienCounty": "花蓮縣", "PingtungCounty": "屏東縣", - "YilanCounty": "宜蘭縣" + "YunlinCounty": "雲林縣", + "Hsinchu": "新竹市", + "HsinchuCounty": "新竹縣", + "ChanghuaCounty": "彰化縣" } }, { @@ -178,19 +178,19 @@ "PenghuCounty" ], "x-enum": { - "YunlinCounty": "雲林縣", - "HualienCounty": "花蓮縣", - "HsinchuCounty": "新竹縣", - "Hsinchu": "新竹市", - "NantouCounty": "南投縣", - "PenghuCounty": "澎湖縣", - "Chiayi": "嘉義市", "TaitungCounty": "臺東縣", - "ChiayiCounty": "嘉義縣", - "ChanghuaCounty": "彰化縣", "MiaoliCounty": "苗栗縣", + "ChiayiCounty": "嘉義縣", + "Chiayi": "嘉義市", + "YilanCounty": "宜蘭縣", + "PenghuCounty": "澎湖縣", + "NantouCounty": "南投縣", + "HualienCounty": "花蓮縣", "PingtungCounty": "屏東縣", - "YilanCounty": "宜蘭縣" + "YunlinCounty": "雲林縣", + "Hsinchu": "新竹市", + "HsinchuCounty": "新竹縣", + "ChanghuaCounty": "彰化縣" } }, { @@ -317,19 +317,19 @@ "PenghuCounty" ], "x-enum": { - "NantouCounty": "南投縣", - "YilanCounty": "宜蘭縣", - "TaitungCounty": "臺東縣", "ChiayiCounty": "嘉義縣", "PingtungCounty": "屏東縣", - "MiaoliCounty": "苗栗縣", - "HsinchuCounty": "新竹縣", - "HualienCounty": "花蓮縣", "PenghuCounty": "澎湖縣", + "HualienCounty": "花蓮縣", + "NantouCounty": "南投縣", + "Hsinchu": "新竹市", + "HsinchuCounty": "新竹縣", "Chiayi": "嘉義市", - "YunlinCounty": "雲林縣", + "TaitungCounty": "臺東縣", "ChanghuaCounty": "彰化縣", - "Hsinchu": "新竹市" + "MiaoliCounty": "苗栗縣", + "YunlinCounty": "雲林縣", + "YilanCounty": "宜蘭縣" } }, { @@ -443,19 +443,19 @@ "PenghuCounty" ], "x-enum": { - "NantouCounty": "南投縣", - "YilanCounty": "宜蘭縣", - "TaitungCounty": "臺東縣", "ChiayiCounty": "嘉義縣", "PingtungCounty": "屏東縣", - "MiaoliCounty": "苗栗縣", - "HsinchuCounty": "新竹縣", - "HualienCounty": "花蓮縣", "PenghuCounty": "澎湖縣", + "HualienCounty": "花蓮縣", + "NantouCounty": "南投縣", + "Hsinchu": "新竹市", + "HsinchuCounty": "新竹縣", "Chiayi": "嘉義市", - "YunlinCounty": "雲林縣", + "TaitungCounty": "臺東縣", "ChanghuaCounty": "彰化縣", - "Hsinchu": "新竹市" + "MiaoliCounty": "苗栗縣", + "YunlinCounty": "雲林縣", + "YilanCounty": "宜蘭縣" } }, { @@ -576,19 +576,19 @@ "PenghuCounty" ], "x-enum": { - "MiaoliCounty": "苗栗縣", "TaitungCounty": "臺東縣", "Chiayi": "嘉義市", - "YilanCounty": "宜蘭縣", - "PingtungCounty": "屏東縣", - "YunlinCounty": "雲林縣", - "PenghuCounty": "澎湖縣", - "ChiayiCounty": "嘉義縣", + "HsinchuCounty": "新竹縣", "NantouCounty": "南投縣", + "ChiayiCounty": "嘉義縣", + "YunlinCounty": "雲林縣", "ChanghuaCounty": "彰化縣", - "HsinchuCounty": "新竹縣", + "PingtungCounty": "屏東縣", + "HualienCounty": "花蓮縣", "Hsinchu": "新竹市", - "HualienCounty": "花蓮縣" + "YilanCounty": "宜蘭縣", + "MiaoliCounty": "苗栗縣", + "PenghuCounty": "澎湖縣" } }, { @@ -702,19 +702,19 @@ "PenghuCounty" ], "x-enum": { - "MiaoliCounty": "苗栗縣", "TaitungCounty": "臺東縣", "Chiayi": "嘉義市", - "YilanCounty": "宜蘭縣", - "PingtungCounty": "屏東縣", - "YunlinCounty": "雲林縣", - "PenghuCounty": "澎湖縣", - "ChiayiCounty": "嘉義縣", + "HsinchuCounty": "新竹縣", "NantouCounty": "南投縣", + "ChiayiCounty": "嘉義縣", + "YunlinCounty": "雲林縣", "ChanghuaCounty": "彰化縣", - "HsinchuCounty": "新竹縣", + "PingtungCounty": "屏東縣", + "HualienCounty": "花蓮縣", "Hsinchu": "新竹市", - "HualienCounty": "花蓮縣" + "YilanCounty": "宜蘭縣", + "MiaoliCounty": "苗栗縣", + "PenghuCounty": "澎湖縣" } }, { @@ -844,28 +844,28 @@ "LienchiangCounty" ], "x-enum": { - "Tainan": "臺南市", - "HsinchuCounty": "新竹縣", - "MiaoliCounty": "苗栗縣", - "Keelung": "基隆市", - "NantouCounty": "南投縣", - "YunlinCounty": "雲林縣", + "LienchiangCounty": "連江縣", "NewTaipei": "新北市", - "Kaohsiung": "高雄市", - "Chiayi": "嘉義市", + "YunlinCounty": "雲林縣", "Hsinchu": "新竹市", - "HualienCounty": "花蓮縣", - "LienchiangCounty": "連江縣", - "ChiayiCounty": "嘉義縣", + "Keelung": "基隆市", + "NantouCounty": "南投縣", "TaitungCounty": "臺東縣", - "PenghuCounty": "澎湖縣", "Taoyuan": "桃園市", "Taichung": "臺中市", "YilanCounty": "宜蘭縣", "KinmenCounty": "金門縣", + "Taipei": "臺北市", + "Kaohsiung": "高雄市", + "Chiayi": "嘉義市", + "ChiayiCounty": "嘉義縣", + "HsinchuCounty": "新竹縣", + "HualienCounty": "花蓮縣", "ChanghuaCounty": "彰化縣", + "MiaoliCounty": "苗栗縣", "PingtungCounty": "屏東縣", - "Taipei": "臺北市" + "PenghuCounty": "澎湖縣", + "Tainan": "臺南市" } }, { @@ -994,28 +994,28 @@ "LienchiangCounty" ], "x-enum": { - "Tainan": "臺南市", - "HsinchuCounty": "新竹縣", - "MiaoliCounty": "苗栗縣", - "Keelung": "基隆市", - "NantouCounty": "南投縣", - "YunlinCounty": "雲林縣", + "LienchiangCounty": "連江縣", "NewTaipei": "新北市", - "Kaohsiung": "高雄市", - "Chiayi": "嘉義市", + "YunlinCounty": "雲林縣", "Hsinchu": "新竹市", - "HualienCounty": "花蓮縣", - "LienchiangCounty": "連江縣", - "ChiayiCounty": "嘉義縣", + "Keelung": "基隆市", + "NantouCounty": "南投縣", "TaitungCounty": "臺東縣", - "PenghuCounty": "澎湖縣", "Taoyuan": "桃園市", "Taichung": "臺中市", "YilanCounty": "宜蘭縣", "KinmenCounty": "金門縣", + "Taipei": "臺北市", + "Kaohsiung": "高雄市", + "Chiayi": "嘉義市", + "ChiayiCounty": "嘉義縣", + "HsinchuCounty": "新竹縣", + "HualienCounty": "花蓮縣", "ChanghuaCounty": "彰化縣", + "MiaoliCounty": "苗栗縣", "PingtungCounty": "屏東縣", - "Taipei": "臺北市" + "PenghuCounty": "澎湖縣", + "Tainan": "臺南市" } }, { @@ -1151,28 +1151,28 @@ "LienchiangCounty" ], "x-enum": { - "Hsinchu": "新竹市", - "NewTaipei": "新北市", - "NantouCounty": "南投縣", - "ChiayiCounty": "嘉義縣", "Taipei": "臺北市", - "ChanghuaCounty": "彰化縣", - "PenghuCounty": "澎湖縣", "MiaoliCounty": "苗栗縣", - "PingtungCounty": "屏東縣", - "KinmenCounty": "金門縣", + "NantouCounty": "南投縣", + "Tainan": "臺南市", "Keelung": "基隆市", - "YilanCounty": "宜蘭縣", - "TaitungCounty": "臺東縣", - "YunlinCounty": "雲林縣", + "HsinchuCounty": "新竹縣", + "ChiayiCounty": "嘉義縣", "Chiayi": "嘉義市", + "KinmenCounty": "金門縣", + "ChanghuaCounty": "彰化縣", + "YunlinCounty": "雲林縣", "Kaohsiung": "高雄市", + "PingtungCounty": "屏東縣", + "PenghuCounty": "澎湖縣", + "TaitungCounty": "臺東縣", + "NewTaipei": "新北市", "Taichung": "臺中市", "HualienCounty": "花蓮縣", + "YilanCounty": "宜蘭縣", "Taoyuan": "桃園市", - "LienchiangCounty": "連江縣", - "HsinchuCounty": "新竹縣", - "Tainan": "臺南市" + "Hsinchu": "新竹市", + "LienchiangCounty": "連江縣" } }, { @@ -1295,28 +1295,28 @@ "LienchiangCounty" ], "x-enum": { - "Hsinchu": "新竹市", - "NewTaipei": "新北市", - "NantouCounty": "南投縣", - "ChiayiCounty": "嘉義縣", "Taipei": "臺北市", - "ChanghuaCounty": "彰化縣", - "PenghuCounty": "澎湖縣", "MiaoliCounty": "苗栗縣", - "PingtungCounty": "屏東縣", - "KinmenCounty": "金門縣", + "NantouCounty": "南投縣", + "Tainan": "臺南市", "Keelung": "基隆市", - "YilanCounty": "宜蘭縣", - "TaitungCounty": "臺東縣", - "YunlinCounty": "雲林縣", + "HsinchuCounty": "新竹縣", + "ChiayiCounty": "嘉義縣", "Chiayi": "嘉義市", + "KinmenCounty": "金門縣", + "ChanghuaCounty": "彰化縣", + "YunlinCounty": "雲林縣", "Kaohsiung": "高雄市", + "PingtungCounty": "屏東縣", + "PenghuCounty": "澎湖縣", + "TaitungCounty": "臺東縣", + "NewTaipei": "新北市", "Taichung": "臺中市", "HualienCounty": "花蓮縣", + "YilanCounty": "宜蘭縣", "Taoyuan": "桃園市", - "LienchiangCounty": "連江縣", - "HsinchuCounty": "新竹縣", - "Tainan": "臺南市" + "Hsinchu": "新竹市", + "LienchiangCounty": "連江縣" } }, { @@ -1446,28 +1446,28 @@ "LienchiangCounty" ], "x-enum": { + "PenghuCounty": "澎湖縣", "Taipei": "臺北市", - "YunlinCounty": "雲林縣", - "PingtungCounty": "屏東縣", - "HualienCounty": "花蓮縣", + "YilanCounty": "宜蘭縣", + "LienchiangCounty": "連江縣", + "HsinchuCounty": "新竹縣", "ChiayiCounty": "嘉義縣", - "ChanghuaCounty": "彰化縣", "Hsinchu": "新竹市", "Chiayi": "嘉義市", - "NewTaipei": "新北市", - "MiaoliCounty": "苗栗縣", - "Keelung": "基隆市", - "NantouCounty": "南投縣", "Taoyuan": "桃園市", - "Taichung": "臺中市", - "HsinchuCounty": "新竹縣", - "Tainan": "臺南市", - "TaitungCounty": "臺東縣", + "Keelung": "基隆市", + "MiaoliCounty": "苗栗縣", "Kaohsiung": "高雄市", "KinmenCounty": "金門縣", - "LienchiangCounty": "連江縣", - "PenghuCounty": "澎湖縣", - "YilanCounty": "宜蘭縣" + "HualienCounty": "花蓮縣", + "NantouCounty": "南投縣", + "NewTaipei": "新北市", + "TaitungCounty": "臺東縣", + "YunlinCounty": "雲林縣", + "Tainan": "臺南市", + "Taichung": "臺中市", + "ChanghuaCounty": "彰化縣", + "PingtungCounty": "屏東縣" } }, { @@ -1590,30 +1590,30 @@ "LienchiangCounty" ], "x-enum": { + "PenghuCounty": "澎湖縣", "Taipei": "臺北市", - "YunlinCounty": "雲林縣", - "PingtungCounty": "屏東縣", - "HualienCounty": "花蓮縣", + "YilanCounty": "宜蘭縣", + "LienchiangCounty": "連江縣", + "HsinchuCounty": "新竹縣", "ChiayiCounty": "嘉義縣", - "ChanghuaCounty": "彰化縣", "Hsinchu": "新竹市", "Chiayi": "嘉義市", - "NewTaipei": "新北市", - "MiaoliCounty": "苗栗縣", - "Keelung": "基隆市", - "NantouCounty": "南投縣", "Taoyuan": "桃園市", - "Taichung": "臺中市", - "HsinchuCounty": "新竹縣", - "Tainan": "臺南市", - "TaitungCounty": "臺東縣", + "Keelung": "基隆市", + "MiaoliCounty": "苗栗縣", "Kaohsiung": "高雄市", "KinmenCounty": "金門縣", - "LienchiangCounty": "連江縣", - "PenghuCounty": "澎湖縣", - "YilanCounty": "宜蘭縣" - } - }, + "HualienCounty": "花蓮縣", + "NantouCounty": "南投縣", + "NewTaipei": "新北市", + "TaitungCounty": "臺東縣", + "YunlinCounty": "雲林縣", + "Tainan": "臺南市", + "Taichung": "臺中市", + "ChanghuaCounty": "彰化縣", + "PingtungCounty": "屏東縣" + } + }, { "in": "path", "name": "RouteName", @@ -1742,27 +1742,27 @@ ], "x-enum": { "Keelung": "基隆市", - "ChanghuaCounty": "彰化縣", - "NantouCounty": "南投縣", "PenghuCounty": "澎湖縣", - "ChiayiCounty": "嘉義縣", + "Chiayi": "嘉義市", + "Taichung": "臺中市", + "PingtungCounty": "屏東縣", "HsinchuCounty": "新竹縣", - "KinmenCounty": "金門縣", - "YunlinCounty": "雲林縣", - "Hsinchu": "新竹市", + "TaitungCounty": "臺東縣", "MiaoliCounty": "苗栗縣", - "Taipei": "臺北市", + "NewTaipei": "新北市", + "Taoyuan": "桃園市", + "Hsinchu": "新竹市", "HualienCounty": "花蓮縣", - "Kaohsiung": "高雄市", - "Taichung": "臺中市", - "TaitungCounty": "臺東縣", + "KinmenCounty": "金門縣", "YilanCounty": "宜蘭縣", - "PingtungCounty": "屏東縣", - "Tainan": "臺南市", + "NantouCounty": "南投縣", + "Taipei": "臺北市", + "YunlinCounty": "雲林縣", "LienchiangCounty": "連江縣", - "NewTaipei": "新北市", - "Taoyuan": "桃園市", - "Chiayi": "嘉義市" + "ChanghuaCounty": "彰化縣", + "Kaohsiung": "高雄市", + "Tainan": "臺南市", + "ChiayiCounty": "嘉義縣" } }, { @@ -1850,28 +1850,28 @@ "LienchiangCounty" ], "x-enum": { - "TaitungCounty": "臺東縣", + "HualienCounty": "花蓮縣", + "Keelung": "基隆市", + "NewTaipei": "新北市", + "KinmenCounty": "金門縣", + "Taipei": "臺北市", + "LienchiangCounty": "連江縣", "ChanghuaCounty": "彰化縣", - "Kaohsiung": "高雄市", + "YunlinCounty": "雲林縣", + "Chiayi": "嘉義市", "Taoyuan": "桃園市", "NantouCounty": "南投縣", - "LienchiangCounty": "連江縣", - "Chiayi": "嘉義市", - "YunlinCounty": "雲林縣", - "MiaoliCounty": "苗栗縣", + "Kaohsiung": "高雄市", + "TaitungCounty": "臺東縣", + "ChiayiCounty": "嘉義縣", + "Taichung": "臺中市", + "PingtungCounty": "屏東縣", + "Tainan": "臺南市", "Hsinchu": "新竹市", - "KinmenCounty": "金門縣", "PenghuCounty": "澎湖縣", - "HualienCounty": "花蓮縣", - "Taichung": "臺中市", - "ChiayiCounty": "嘉義縣", + "MiaoliCounty": "苗栗縣", "YilanCounty": "宜蘭縣", - "NewTaipei": "新北市", - "Keelung": "基隆市", - "HsinchuCounty": "新竹縣", - "Tainan": "臺南市", - "PingtungCounty": "屏東縣", - "Taipei": "臺北市" + "HsinchuCounty": "新竹縣" } }, { @@ -1994,28 +1994,28 @@ "LienchiangCounty" ], "x-enum": { - "Taichung": "臺中市", "Tainan": "臺南市", - "Keelung": "基隆市", - "PenghuCounty": "澎湖縣", - "MiaoliCounty": "苗栗縣", - "ChanghuaCounty": "彰化縣", - "HualienCounty": "花蓮縣", + "PingtungCounty": "屏東縣", + "Taoyuan": "桃園市", + "TaitungCounty": "臺東縣", "Taipei": "臺北市", "Hsinchu": "新竹市", - "Taoyuan": "桃園市", - "Chiayi": "嘉義市", - "NewTaipei": "新北市", - "ChiayiCounty": "嘉義縣", + "KinmenCounty": "金門縣", + "PenghuCounty": "澎湖縣", + "YilanCounty": "宜蘭縣", "Kaohsiung": "高雄市", - "NantouCounty": "南投縣", - "PingtungCounty": "屏東縣", - "YunlinCounty": "雲林縣", "HsinchuCounty": "新竹縣", - "KinmenCounty": "金門縣", + "ChanghuaCounty": "彰化縣", + "Taichung": "臺中市", + "HualienCounty": "花蓮縣", + "Keelung": "基隆市", + "MiaoliCounty": "苗栗縣", + "YunlinCounty": "雲林縣", + "NantouCounty": "南投縣", + "NewTaipei": "新北市", + "Chiayi": "嘉義市", "LienchiangCounty": "連江縣", - "TaitungCounty": "臺東縣", - "YilanCounty": "宜蘭縣" + "ChiayiCounty": "嘉義縣" } }, { @@ -2138,28 +2138,28 @@ "LienchiangCounty" ], "x-enum": { - "Taichung": "臺中市", "Tainan": "臺南市", - "Keelung": "基隆市", - "PenghuCounty": "澎湖縣", - "MiaoliCounty": "苗栗縣", - "ChanghuaCounty": "彰化縣", - "HualienCounty": "花蓮縣", + "PingtungCounty": "屏東縣", + "Taoyuan": "桃園市", + "TaitungCounty": "臺東縣", "Taipei": "臺北市", "Hsinchu": "新竹市", - "Taoyuan": "桃園市", - "Chiayi": "嘉義市", - "NewTaipei": "新北市", - "ChiayiCounty": "嘉義縣", + "KinmenCounty": "金門縣", + "PenghuCounty": "澎湖縣", + "YilanCounty": "宜蘭縣", "Kaohsiung": "高雄市", - "NantouCounty": "南投縣", - "PingtungCounty": "屏東縣", - "YunlinCounty": "雲林縣", "HsinchuCounty": "新竹縣", - "KinmenCounty": "金門縣", + "ChanghuaCounty": "彰化縣", + "Taichung": "臺中市", + "HualienCounty": "花蓮縣", + "Keelung": "基隆市", + "MiaoliCounty": "苗栗縣", + "YunlinCounty": "雲林縣", + "NantouCounty": "南投縣", + "NewTaipei": "新北市", + "Chiayi": "嘉義市", "LienchiangCounty": "連江縣", - "TaitungCounty": "臺東縣", - "YilanCounty": "宜蘭縣" + "ChiayiCounty": "嘉義縣" } }, { @@ -2289,28 +2289,28 @@ "Taipei" ], "x-enum": { - "KinmenCounty": "金門縣", + "HualienCounty": "花蓮縣", + "NewTaipei": "新北市", + "YunlinCounty": "雲林縣", + "NantouCounty": "南投縣", + "TaitungCounty": "臺東縣", + "Chiayi": "嘉義市", + "MiaoliCounty": "苗栗縣", + "HsinchuCounty": "新竹縣", + "Taipei": "臺北市", "LienchiangCounty": "連江縣", "Hsinchu": "新竹市", - "Taoyuan": "桃園市", - "Tainan": "臺南市", - "YunlinCounty": "雲林縣", - "ChiayiCounty": "嘉義縣", + "KinmenCounty": "金門縣", + "Keelung": "基隆市", "ChanghuaCounty": "彰化縣", - "MiaoliCounty": "苗栗縣", - "NantouCounty": "南投縣", "PenghuCounty": "澎湖縣", - "Taipei": "臺北市", - "NewTaipei": "新北市", - "PingtungCounty": "屏東縣", "Kaohsiung": "高雄市", - "Chiayi": "嘉義市", + "PingtungCounty": "屏東縣", + "Taoyuan": "桃園市", + "ChiayiCounty": "嘉義縣", + "Tainan": "臺南市", "Taichung": "臺中市", - "HualienCounty": "花蓮縣", - "TaitungCounty": "臺東縣", - "HsinchuCounty": "新竹縣", - "YilanCounty": "宜蘭縣", - "Keelung": "基隆市" + "YilanCounty": "宜蘭縣" } }, { @@ -2437,26 +2437,26 @@ "Taichung" ], "x-enum": { - "NewTaipei": "新北市", - "MiaoliCounty": "苗栗縣", "KinmenCounty": "金門縣", + "ChiayiCounty": "嘉義縣", + "Taoyuan": "桃園市", "PingtungCounty": "屏東縣", + "Tainan": "臺南市", "ChanghuaCounty": "彰化縣", - "YunlinCounty": "雲林縣", - "Taichung": "臺中市", "PenghuCounty": "澎湖縣", - "HualienCounty": "花蓮縣", - "Tainan": "臺南市", - "YilanCounty": "宜蘭縣", + "NewTaipei": "新北市", "TaitungCounty": "臺東縣", - "Taoyuan": "桃園市", + "HualienCounty": "花蓮縣", + "YunlinCounty": "雲林縣", + "NantouCounty": "南投縣", "Hsinchu": "新竹市", + "MiaoliCounty": "苗栗縣", "Taipei": "臺北市", - "HsinchuCounty": "新竹縣", - "Kaohsiung": "高雄市", - "NantouCounty": "南投縣", + "Taichung": "臺中市", "Chiayi": "嘉義市", - "ChiayiCounty": "嘉義縣" + "HsinchuCounty": "新竹縣", + "YilanCounty": "宜蘭縣", + "Kaohsiung": "高雄市" } }, { @@ -2568,11 +2568,11 @@ "Taichung" ], "x-enum": { + "NewTaipei": "新北市", "Taichung": "臺中市", - "Tainan": "臺南市", + "Taipei": "臺北市", "Taoyuan": "桃園市", - "NewTaipei": "新北市", - "Taipei": "臺北市" + "Tainan": "臺南市" } }, { @@ -2657,7 +2657,7 @@ "CityBus" ], "summary": "取得指定[縣市],[路線名稱]的市區公車顯示用路線站序資料", - "description": "市區公車之顯示用路線站序資料,僅台北市與新北市可查詢", + "description": "市區公車之顯示用路線站序資料", "operationId": "CityBusApi_DisplayStopOfRoute_1", "produces": [ "application/json", @@ -2678,11 +2678,11 @@ "Taichung" ], "x-enum": { + "NewTaipei": "新北市", "Taichung": "臺中市", - "Tainan": "臺南市", + "Taipei": "臺北市", "Taoyuan": "桃園市", - "NewTaipei": "新北市", - "Taipei": "臺北市" + "Tainan": "臺南市" } }, { @@ -2812,28 +2812,28 @@ "LienchiangCounty" ], "x-enum": { - "TaitungCounty": "臺東縣", + "Keelung": "基隆市", + "Tainan": "臺南市", + "Hsinchu": "新竹市", "YunlinCounty": "雲林縣", + "NantouCounty": "南投縣", + "HualienCounty": "花蓮縣", + "TaitungCounty": "臺東縣", + "NewTaipei": "新北市", + "Taichung": "臺中市", + "LienchiangCounty": "連江縣", "HsinchuCounty": "新竹縣", - "Taipei": "臺北市", + "Taoyuan": "桃園市", + "YilanCounty": "宜蘭縣", "Kaohsiung": "高雄市", "KinmenCounty": "金門縣", - "YilanCounty": "宜蘭縣", - "ChanghuaCounty": "彰化縣", + "MiaoliCounty": "苗栗縣", + "PingtungCounty": "屏東縣", "ChiayiCounty": "嘉義縣", + "Taipei": "臺北市", + "ChanghuaCounty": "彰化縣", "Chiayi": "嘉義市", - "PenghuCounty": "澎湖縣", - "Keelung": "基隆市", - "NewTaipei": "新北市", - "Taichung": "臺中市", - "PingtungCounty": "屏東縣", - "Hsinchu": "新竹市", - "Tainan": "臺南市", - "HualienCounty": "花蓮縣", - "MiaoliCounty": "苗栗縣", - "Taoyuan": "桃園市", - "LienchiangCounty": "連江縣", - "NantouCounty": "南投縣" + "PenghuCounty": "澎湖縣" } }, { @@ -2956,28 +2956,28 @@ "LienchiangCounty" ], "x-enum": { - "TaitungCounty": "臺東縣", + "Keelung": "基隆市", + "Tainan": "臺南市", + "Hsinchu": "新竹市", "YunlinCounty": "雲林縣", + "NantouCounty": "南投縣", + "HualienCounty": "花蓮縣", + "TaitungCounty": "臺東縣", + "NewTaipei": "新北市", + "Taichung": "臺中市", + "LienchiangCounty": "連江縣", "HsinchuCounty": "新竹縣", - "Taipei": "臺北市", + "Taoyuan": "桃園市", + "YilanCounty": "宜蘭縣", "Kaohsiung": "高雄市", "KinmenCounty": "金門縣", - "YilanCounty": "宜蘭縣", - "ChanghuaCounty": "彰化縣", + "MiaoliCounty": "苗栗縣", + "PingtungCounty": "屏東縣", "ChiayiCounty": "嘉義縣", + "Taipei": "臺北市", + "ChanghuaCounty": "彰化縣", "Chiayi": "嘉義市", - "PenghuCounty": "澎湖縣", - "Keelung": "基隆市", - "NewTaipei": "新北市", - "Taichung": "臺中市", - "PingtungCounty": "屏東縣", - "Hsinchu": "新竹市", - "Tainan": "臺南市", - "HualienCounty": "花蓮縣", - "MiaoliCounty": "苗栗縣", - "Taoyuan": "桃園市", - "LienchiangCounty": "連江縣", - "NantouCounty": "南投縣" + "PenghuCounty": "澎湖縣" } }, { @@ -3106,27 +3106,27 @@ "Kaohsiung" ], "x-enum": { + "PenghuCounty": "澎湖縣", + "Tainan": "臺南市", + "MiaoliCounty": "苗栗縣", "YilanCounty": "宜蘭縣", - "HualienCounty": "花蓮縣", + "NantouCounty": "南投縣", + "Chiayi": "嘉義市", "PingtungCounty": "屏東縣", - "TaitungCounty": "臺東縣", "Hsinchu": "新竹市", - "YunlinCounty": "雲林縣", - "Tainan": "臺南市", + "Taoyuan": "桃園市", + "KinmenCounty": "金門縣", + "HualienCounty": "花蓮縣", + "TaitungCounty": "臺東縣", + "HsinchuCounty": "新竹縣", + "Keelung": "基隆市", "ChiayiCounty": "嘉義縣", "Taipei": "臺北市", - "PenghuCounty": "澎湖縣", - "NewTaipei": "新北市", - "KinmenCounty": "金門縣", - "Taichung": "臺中市", "Kaohsiung": "高雄市", - "Keelung": "基隆市", - "NantouCounty": "南投縣", - "MiaoliCounty": "苗栗縣", "ChanghuaCounty": "彰化縣", - "Chiayi": "嘉義市", - "Taoyuan": "桃園市", - "HsinchuCounty": "新竹縣" + "NewTaipei": "新北市", + "Taichung": "臺中市", + "YunlinCounty": "雲林縣" } }, { @@ -3248,27 +3248,27 @@ "Kaohsiung" ], "x-enum": { + "PenghuCounty": "澎湖縣", + "Tainan": "臺南市", + "MiaoliCounty": "苗栗縣", "YilanCounty": "宜蘭縣", - "HualienCounty": "花蓮縣", + "NantouCounty": "南投縣", + "Chiayi": "嘉義市", "PingtungCounty": "屏東縣", - "TaitungCounty": "臺東縣", "Hsinchu": "新竹市", - "YunlinCounty": "雲林縣", - "Tainan": "臺南市", + "Taoyuan": "桃園市", + "KinmenCounty": "金門縣", + "HualienCounty": "花蓮縣", + "TaitungCounty": "臺東縣", + "HsinchuCounty": "新竹縣", + "Keelung": "基隆市", "ChiayiCounty": "嘉義縣", "Taipei": "臺北市", - "PenghuCounty": "澎湖縣", - "NewTaipei": "新北市", - "KinmenCounty": "金門縣", - "Taichung": "臺中市", "Kaohsiung": "高雄市", - "Keelung": "基隆市", - "NantouCounty": "南投縣", - "MiaoliCounty": "苗栗縣", "ChanghuaCounty": "彰化縣", - "Chiayi": "嘉義市", - "Taoyuan": "桃園市", - "HsinchuCounty": "新竹縣" + "NewTaipei": "新北市", + "Taichung": "臺中市", + "YunlinCounty": "雲林縣" } }, { @@ -3397,28 +3397,28 @@ "LienchiangCounty" ], "x-enum": { - "Keelung": "基隆市", - "HualienCounty": "花蓮縣", "ChiayiCounty": "嘉義縣", "NewTaipei": "新北市", + "Chiayi": "嘉義市", + "PingtungCounty": "屏東縣", "ChanghuaCounty": "彰化縣", - "Taipei": "臺北市", - "Hsinchu": "新竹市", "NantouCounty": "南投縣", - "PingtungCounty": "屏東縣", - "HsinchuCounty": "新竹縣", - "YilanCounty": "宜蘭縣", - "Chiayi": "嘉義市", - "PenghuCounty": "澎湖縣", - "Taichung": "臺中市", + "HualienCounty": "花蓮縣", "MiaoliCounty": "苗栗縣", - "LienchiangCounty": "連江縣", - "KinmenCounty": "金門縣", "YunlinCounty": "雲林縣", - "Kaohsiung": "高雄市", + "Taipei": "臺北市", + "Hsinchu": "新竹市", + "PenghuCounty": "澎湖縣", + "HsinchuCounty": "新竹縣", + "Keelung": "基隆市", "TaitungCounty": "臺東縣", + "Tainan": "臺南市", + "KinmenCounty": "金門縣", "Taoyuan": "桃園市", - "Tainan": "臺南市" + "LienchiangCounty": "連江縣", + "Taichung": "臺中市", + "YilanCounty": "宜蘭縣", + "Kaohsiung": "高雄市" } }, { @@ -3540,27 +3540,27 @@ "PenghuCounty" ], "x-enum": { - "Tainan": "臺南市", - "Kaohsiung": "高雄市", - "Taipei": "臺北市", - "ChiayiCounty": "嘉義縣", - "NantouCounty": "南投縣", - "KinmenCounty": "金門縣", - "TaitungCounty": "臺東縣", - "PingtungCounty": "屏東縣", - "HsinchuCounty": "新竹縣", - "ChanghuaCounty": "彰化縣", - "YunlinCounty": "雲林縣", - "NewTaipei": "新北市", + "Chiayi": "嘉義市", "YilanCounty": "宜蘭縣", + "Taipei": "臺北市", "Hsinchu": "新竹市", - "Chiayi": "嘉義市", + "PingtungCounty": "屏東縣", "Keelung": "基隆市", + "TaitungCounty": "臺東縣", + "Taichung": "臺中市", "Taoyuan": "桃園市", + "NewTaipei": "新北市", + "NantouCounty": "南投縣", "MiaoliCounty": "苗栗縣", + "Tainan": "臺南市", "PenghuCounty": "澎湖縣", + "HsinchuCounty": "新竹縣", + "Kaohsiung": "高雄市", + "ChiayiCounty": "嘉義縣", + "KinmenCounty": "金門縣", "HualienCounty": "花蓮縣", - "Taichung": "臺中市" + "ChanghuaCounty": "彰化縣", + "YunlinCounty": "雲林縣" } }, { @@ -3682,27 +3682,27 @@ "PenghuCounty" ], "x-enum": { - "Tainan": "臺南市", - "Kaohsiung": "高雄市", - "Taipei": "臺北市", - "ChiayiCounty": "嘉義縣", - "NantouCounty": "南投縣", - "KinmenCounty": "金門縣", - "TaitungCounty": "臺東縣", - "PingtungCounty": "屏東縣", - "HsinchuCounty": "新竹縣", - "ChanghuaCounty": "彰化縣", - "YunlinCounty": "雲林縣", - "NewTaipei": "新北市", + "Chiayi": "嘉義市", "YilanCounty": "宜蘭縣", + "Taipei": "臺北市", "Hsinchu": "新竹市", - "Chiayi": "嘉義市", + "PingtungCounty": "屏東縣", "Keelung": "基隆市", + "TaitungCounty": "臺東縣", + "Taichung": "臺中市", "Taoyuan": "桃園市", + "NewTaipei": "新北市", + "NantouCounty": "南投縣", "MiaoliCounty": "苗栗縣", + "Tainan": "臺南市", "PenghuCounty": "澎湖縣", + "HsinchuCounty": "新竹縣", + "Kaohsiung": "高雄市", + "ChiayiCounty": "嘉義縣", + "KinmenCounty": "金門縣", "HualienCounty": "花蓮縣", - "Taichung": "臺中市" + "ChanghuaCounty": "彰化縣", + "YunlinCounty": "雲林縣" } }, { @@ -3826,28 +3826,28 @@ "KinmenCounty" ], "x-enum": { - "NantouCounty": "南投縣", - "PingtungCounty": "屏東縣", - "Taipei": "臺北市", "KinmenCounty": "金門縣", - "MiaoliCounty": "苗栗縣", + "Chiayi": "嘉義市", + "HsinchuCounty": "新竹縣", + "TaitungCounty": "臺東縣", "PenghuCounty": "澎湖縣", - "YunlinCounty": "雲林縣", + "Tainan": "臺南市", "NewTaipei": "新北市", - "HsinchuCounty": "新竹縣", - "ChanghuaCounty": "彰化縣", + "PingtungCounty": "屏東縣", + "Hsinchu": "新竹市", + "YunlinCounty": "雲林縣", + "Kaohsiung": "高雄市", + "HualienCounty": "花蓮縣", + "Keelung": "基隆市", "YilanCounty": "宜蘭縣", - "Chiayi": "嘉義市", - "Taichung": "臺中市", - "ChiayiCounty": "嘉義縣", + "ChanghuaCounty": "彰化縣", "Taoyuan": "桃園市", - "Kaohsiung": "高雄市", + "Taichung": "臺中市", "LienchiangCounty": "連江縣", - "Tainan": "臺南市", - "Keelung": "基隆市", - "TaitungCounty": "臺東縣", - "Hsinchu": "新竹市", - "HualienCounty": "花蓮縣" + "Taipei": "臺北市", + "MiaoliCounty": "苗栗縣", + "ChiayiCounty": "嘉義縣", + "NantouCounty": "南投縣" } }, { @@ -3964,28 +3964,28 @@ "KinmenCounty" ], "x-enum": { - "NantouCounty": "南投縣", - "PingtungCounty": "屏東縣", - "Taipei": "臺北市", "KinmenCounty": "金門縣", - "MiaoliCounty": "苗栗縣", + "Chiayi": "嘉義市", + "HsinchuCounty": "新竹縣", + "TaitungCounty": "臺東縣", "PenghuCounty": "澎湖縣", - "YunlinCounty": "雲林縣", + "Tainan": "臺南市", "NewTaipei": "新北市", - "HsinchuCounty": "新竹縣", - "ChanghuaCounty": "彰化縣", + "PingtungCounty": "屏東縣", + "Hsinchu": "新竹市", + "YunlinCounty": "雲林縣", + "Kaohsiung": "高雄市", + "HualienCounty": "花蓮縣", + "Keelung": "基隆市", "YilanCounty": "宜蘭縣", - "Chiayi": "嘉義市", - "Taichung": "臺中市", - "ChiayiCounty": "嘉義縣", + "ChanghuaCounty": "彰化縣", "Taoyuan": "桃園市", - "Kaohsiung": "高雄市", + "Taichung": "臺中市", "LienchiangCounty": "連江縣", - "Tainan": "臺南市", - "Keelung": "基隆市", - "TaitungCounty": "臺東縣", - "Hsinchu": "新竹市", - "HualienCounty": "花蓮縣" + "Taipei": "臺北市", + "MiaoliCounty": "苗栗縣", + "ChiayiCounty": "嘉義縣", + "NantouCounty": "南投縣" } }, { @@ -4109,28 +4109,32 @@ "PenghuCounty", "Taichung", "Kaohsiung", + "Taipei", + "NewTaipei", "Taoyuan" ], "x-enum": { - "NantouCounty": "南投縣", - "PingtungCounty": "屏東縣", - "Chiayi": "嘉義市", + "Taichung": "臺中市", "Kaohsiung": "高雄市", - "TaitungCounty": "臺東縣", - "MiaoliCounty": "苗栗縣", - "YilanCounty": "宜蘭縣", - "ChanghuaCounty": "彰化縣", - "Keelung": "基隆市", - "YunlinCounty": "雲林縣", + "PenghuCounty": "澎湖縣", "Taoyuan": "桃園市", + "NewTaipei": "新北市", "HsinchuCounty": "新竹縣", + "YilanCounty": "宜蘭縣", + "Taipei": "臺北市", + "Keelung": "基隆市", "Tainan": "臺南市", + "YunlinCounty": "雲林縣", + "ChanghuaCounty": "彰化縣", "KinmenCounty": "金門縣", - "Taichung": "臺中市", - "ChiayiCounty": "嘉義縣", "Hsinchu": "新竹市", - "HualienCounty": "花蓮縣", - "PenghuCounty": "澎湖縣" + "Chiayi": "嘉義市", + "NantouCounty": "南投縣", + "ChiayiCounty": "嘉義縣", + "TaitungCounty": "臺東縣", + "PingtungCounty": "屏東縣", + "MiaoliCounty": "苗栗縣", + "HualienCounty": "花蓮縣" } }, { @@ -4244,19 +4248,19 @@ "PenghuCounty" ], "x-enum": { - "Hsinchu": "新竹市", - "HualienCounty": "花蓮縣", - "ChanghuaCounty": "彰化縣", - "MiaoliCounty": "苗栗縣", "NantouCounty": "南投縣", + "YilanCounty": "宜蘭縣", "TaitungCounty": "臺東縣", + "HualienCounty": "花蓮縣", + "ChanghuaCounty": "彰化縣", "YunlinCounty": "雲林縣", + "Chiayi": "嘉義市", + "ChiayiCounty": "嘉義縣", "PenghuCounty": "澎湖縣", + "MiaoliCounty": "苗栗縣", "HsinchuCounty": "新竹縣", - "Chiayi": "嘉義市", - "PingtungCounty": "屏東縣", - "YilanCounty": "宜蘭縣", - "ChiayiCounty": "嘉義縣" + "Hsinchu": "新竹市", + "PingtungCounty": "屏東縣" } }, { @@ -4362,11 +4366,13 @@ "type": "string", "enum": [ "KinmenCounty", - "Taichung" + "Taichung", + "Taoyuan" ], "x-enum": { "Taichung": "臺中市", - "KinmenCounty": "金門縣" + "KinmenCounty": "金門縣", + "Taoyuan": "桃園市" } }, { @@ -4466,11 +4472,13 @@ "type": "string", "enum": [ "KinmenCounty", - "Taichung" + "Taichung", + "Taoyuan" ], "x-enum": { "Taichung": "臺中市", - "KinmenCounty": "金門縣" + "KinmenCounty": "金門縣", + "Taoyuan": "桃園市" } }, { @@ -4590,24 +4598,26 @@ "TaitungCounty", "PenghuCounty", "Taichung", - "Kaohsiung" + "Kaohsiung", + "Taoyuan" ], "x-enum": { + "Kaohsiung": "高雄市", + "Chiayi": "嘉義市", "TaitungCounty": "臺東縣", - "HsinchuCounty": "新竹縣", + "YilanCounty": "宜蘭縣", + "ChiayiCounty": "嘉義縣", "ChanghuaCounty": "彰化縣", - "HualienCounty": "花蓮縣", - "Kaohsiung": "高雄市", - "PingtungCounty": "屏東縣", - "YunlinCounty": "雲林縣", - "Taichung": "臺中市", - "Hsinchu": "新竹市", "PenghuCounty": "澎湖縣", - "Chiayi": "嘉義市", "MiaoliCounty": "苗栗縣", - "ChiayiCounty": "嘉義縣", - "YilanCounty": "宜蘭縣", - "NantouCounty": "南投縣" + "Taichung": "臺中市", + "Taoyuan": "桃園市", + "Hsinchu": "新竹市", + "PingtungCounty": "屏東縣", + "NantouCounty": "南投縣", + "HsinchuCounty": "新竹縣", + "YunlinCounty": "雲林縣", + "HualienCounty": "花蓮縣" } }, { @@ -4932,28 +4942,28 @@ "PenghuCounty" ], "x-enum": { - "TaitungCounty": "臺東縣", - "HsinchuCounty": "新竹縣", - "PenghuCounty": "澎湖縣", - "HualienCounty": "花蓮縣", - "ChiayiCounty": "嘉義縣", - "NewTaipei": "新北市", "Kaohsiung": "高雄市", "KinmenCounty": "金門縣", + "HsinchuCounty": "新竹縣", "Taoyuan": "桃園市", - "YilanCounty": "宜蘭縣", + "TaitungCounty": "臺東縣", + "ChiayiCounty": "嘉義縣", "Keelung": "基隆市", - "PingtungCounty": "屏東縣", - "LienchiangCounty": "連江縣", + "NewTaipei": "新北市", + "Chiayi": "嘉義市", + "HualienCounty": "花蓮縣", "ChanghuaCounty": "彰化縣", - "MiaoliCounty": "苗栗縣", - "Tainan": "臺南市", - "NantouCounty": "南投縣", + "PingtungCounty": "屏東縣", + "Taichung": "臺中市", + "YunlinCounty": "雲林縣", "Taipei": "臺北市", + "NantouCounty": "南投縣", + "LienchiangCounty": "連江縣", "Hsinchu": "新竹市", - "YunlinCounty": "雲林縣", - "Chiayi": "嘉義市", - "Taichung": "臺中市" + "PenghuCounty": "澎湖縣", + "YilanCounty": "宜蘭縣", + "MiaoliCounty": "苗栗縣", + "Tainan": "臺南市" } }, { @@ -7889,19 +7899,34 @@ } } }, - "/v2/Bus/Stop/NearBy": { + "/v2/Bus/DailyTimeTable/City/{City}": { "get": { "tags": [ - "Advanced" + "CityBus" ], - "summary": "取得指定[位置,範圍]的全臺公車站牌資料", - "description": "取得指定[位置,範圍]的全臺公車站牌資料", - "operationId": "BusApi_Stop_NearBy", + "summary": "取得指定[縣市]的市區公車每日營運時刻表資料", + "description": "市區公車每日營運時刻表資料", + "operationId": "CityBusApi_DailyTimeTable", "produces": [ "application/json", "application/xml" ], "parameters": [ + { + "in": "path", + "name": "City", + "description": "欲查詢縣市", + "required": true, + "type": "string", + "enum": [ + "Taichung", + "Taoyuan" + ], + "x-enum": { + "Taoyuan": "桃園市", + "Taichung": "臺中市" + } + }, { "in": "query", "name": "$select", @@ -7933,13 +7958,6 @@ "description": "跳過前幾筆", "type": "string" }, - { - "in": "query", - "name": "$spatialFilter", - "description": "空間過濾(最大搜尋半徑為1000公尺),語法為nearby({Lat},{Lon},{DistanceInMeters}),例如nearby(25.047675, 121.517055, 100)", - "required": true, - "type": "string" - }, { "in": "query", "name": "health", @@ -7969,7 +7987,7 @@ "title": "Array", "type": "array", "items": { - "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusStop" + "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusDailyTimeTable" } } }, @@ -7985,19 +8003,41 @@ } } }, - "/v2/Bus/Station/NearBy": { + "/v2/Bus/DailyTimeTable/City/{City}/{RouteName}": { "get": { "tags": [ - "Advanced" + "CityBus" ], - "summary": "取得指定[位置,範圍]的全臺公車站位資料", - "description": "取得指定[位置,範圍]的全臺公車站位資料", - "operationId": "BusApi_Station_NearBy", + "summary": "取得指定[縣市],[路線名稱]的市區公車每日營運時刻表資料", + "description": "市區公車之每日營運時刻表資料", + "operationId": "CityBusApi_DailyTimeTable_1", "produces": [ "application/json", "application/xml" ], "parameters": [ + { + "in": "path", + "name": "City", + "description": "欲查詢縣市", + "required": true, + "type": "string", + "enum": [ + "Taichung", + "Taoyuan" + ], + "x-enum": { + "Taoyuan": "桃園市", + "Taichung": "臺中市" + } + }, + { + "in": "path", + "name": "RouteName", + "description": "繁體中文路線名稱,如'307'", + "required": true, + "type": "string" + }, { "in": "query", "name": "$select", @@ -8029,13 +8069,6 @@ "description": "跳過前幾筆", "type": "string" }, - { - "in": "query", - "name": "$spatialFilter", - "description": "空間過濾(最大搜尋半徑為1000公尺),語法為nearby({Lat},{Lon},{DistanceInMeters}),例如nearby(25.047675, 121.517055, 100)", - "required": true, - "type": "string" - }, { "in": "query", "name": "health", @@ -8065,7 +8098,7 @@ "title": "Array", "type": "array", "items": { - "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusStation" + "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusDailyTimeTable" } } }, @@ -8081,19 +8114,32 @@ } } }, - "/v2/Bus/Route/NearBy": { + "/v2/Bus/DailyStopTimeTable/City/{City}": { "get": { "tags": [ - "Advanced" + "CityBus" ], - "summary": "取得指定[位置,範圍]的全臺公車路線資料", - "description": "取得指定[位置,範圍]的全臺公車路線資料", - "operationId": "BusApi_Route_NearBy", + "summary": "取得指定[縣市]的市區公車每日站別時刻表資料", + "description": "市區公車每日站別時刻表資料", + "operationId": "CityBusApi_DailyStopTimeTable", "produces": [ "application/json", "application/xml" ], "parameters": [ + { + "in": "path", + "name": "City", + "description": "欲查詢縣市", + "required": true, + "type": "string", + "enum": [ + "Taichung" + ], + "x-enum": { + "Taichung": "臺中市" + } + }, { "in": "query", "name": "$select", @@ -8125,13 +8171,6 @@ "description": "跳過前幾筆", "type": "string" }, - { - "in": "query", - "name": "$spatialFilter", - "description": "空間過濾(最大搜尋半徑為1000公尺),語法為nearby({Lat},{Lon},{DistanceInMeters}),例如nearby(25.047675, 121.517055, 100)", - "required": true, - "type": "string" - }, { "in": "query", "name": "health", @@ -8161,7 +8200,7 @@ "title": "Array", "type": "array", "items": { - "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusRoute" + "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusDailyStopTimeTable" } } }, @@ -8177,19 +8216,39 @@ } } }, - "/v2/Bus/RealTimeByFrequency/NearBy": { + "/v2/Bus/DailyStopTimeTable/City/{City}/{RouteName}": { "get": { "tags": [ - "Advanced" + "CityBus" ], - "summary": "取得指定[位置,範圍]的全臺公車動態定時資料(A1)", - "description": "取得指定[位置,範圍]的全臺公車動態定時資料(A1)", - "operationId": "BusApi_RealTimeByFrequency_NearBy", + "summary": "取得指定[縣市],[路線名稱]的市區公車每日站別時刻表資料", + "description": "市區公車每日站別時刻表資料", + "operationId": "CityBusApi_DailyStopTimeTable_1", "produces": [ "application/json", "application/xml" ], "parameters": [ + { + "in": "path", + "name": "City", + "description": "欲查詢縣市", + "required": true, + "type": "string", + "enum": [ + "Taichung" + ], + "x-enum": { + "Taichung": "臺中市" + } + }, + { + "in": "path", + "name": "RouteName", + "description": "繁體中文路線名稱,如'307'", + "required": true, + "type": "string" + }, { "in": "query", "name": "$select", @@ -8221,13 +8280,6 @@ "description": "跳過前幾筆", "type": "string" }, - { - "in": "query", - "name": "$spatialFilter", - "description": "空間過濾(最大搜尋半徑為1000公尺),語法為nearby({Lat},{Lon},{DistanceInMeters}),例如nearby(25.047675, 121.517055, 100)", - "required": true, - "type": "string" - }, { "in": "query", "name": "health", @@ -8257,7 +8309,7 @@ "title": "Array", "type": "array", "items": { - "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusA1Data" + "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusDailyStopTimeTable" } } }, @@ -8273,14 +8325,14 @@ } } }, - "/v2/Bus/RealTimeNearStop/NearBy": { + "/v2/Bus/Stop/NearBy": { "get": { "tags": [ "Advanced" ], - "summary": "取得指定[位置,範圍]的全臺公車動態定點資料(A2)", - "description": "取得指定[位置,範圍]的全臺公車動態定點資料(A2)", - "operationId": "BusApi_RealTimeNearStop_NearBy", + "summary": "取得指定[位置,範圍]的全臺公車站牌資料", + "description": "取得指定[位置,範圍]的全臺公車站牌資料", + "operationId": "BusApi_Stop_NearBy", "produces": [ "application/json", "application/xml" @@ -8353,7 +8405,7 @@ "title": "Array", "type": "array", "items": { - "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusA2Data" + "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusStop" } } }, @@ -8369,14 +8421,14 @@ } } }, - "/v2/Bus/EstimatedTimeOfArrival/NearBy": { + "/v2/Bus/Station/NearBy": { "get": { "tags": [ "Advanced" ], - "summary": "取得指定[位置,範圍]的全臺公車預估到站資料(N1)", - "description": "取得指定[位置,範圍]的全臺公車預估到站資料(N1)", - "operationId": "BusApi_EstimatedTimeOfArrival_NearBy", + "summary": "取得指定[位置,範圍]的全臺公車站位資料", + "description": "取得指定[位置,範圍]的全臺公車站位資料", + "operationId": "BusApi_Station_NearBy", "produces": [ "application/json", "application/xml" @@ -8449,7 +8501,7 @@ "title": "Array", "type": "array", "items": { - "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusN1EstimateTime" + "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusStation" } } }, @@ -8464,55 +8516,886 @@ } } } - } - }, - "definitions": { - "PTX.Service.DTO.Bus.Specification.V2.BusA1Data": { - "title": "BusA1Data", - "description": "定時車機資料型別", - "required": [ - "GPSTime", - "PlateNumb", - "UpdateTime" - ], - "type": "object", - "properties": { - "PlateNumb": { - "title": "String", - "description": "車牌號碼", - "type": "string", - "xml": { - "name": "String" - } - }, - "OperatorID": { - "title": "String", - "description": "營運業者代碼", - "type": "string", - "xml": { - "name": "String" - } - }, - "RouteUID": { - "title": "String", - "description": "路線唯一識別代碼,規則為 {業管機關簡碼} + {RouteID},其中 {業管機關簡碼} 可於Authority API中的AuthorityCode欄位查詢", - "type": "string", - "xml": { - "name": "String" - } - }, - "RouteID": { - "title": "String", - "description": "地區既用中之路線代碼(為原資料內碼)", - "type": "string", - "xml": { - "name": "String" - } - }, - "RouteName": { - "title": "NameType", - "description": "路線名稱", - "allOf": [ + }, + "/v2/Bus/Route/NearBy": { + "get": { + "tags": [ + "Advanced" + ], + "summary": "取得指定[位置,範圍]的全臺公車路線資料", + "description": "取得指定[位置,範圍]的全臺公車路線資料", + "operationId": "BusApi_Route_NearBy", + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "query", + "name": "$select", + "description": "挑選", + "type": "string" + }, + { + "in": "query", + "name": "$filter", + "description": "過濾", + "type": "string" + }, + { + "in": "query", + "name": "$orderby", + "description": "排序", + "type": "string" + }, + { + "in": "query", + "name": "$top", + "description": "取前幾筆", + "type": "integer", + "default": 30 + }, + { + "in": "query", + "name": "$skip", + "description": "跳過前幾筆", + "type": "string" + }, + { + "in": "query", + "name": "$spatialFilter", + "description": "空間過濾(最大搜尋半徑為1000公尺),語法為nearby({Lat},{Lon},{DistanceInMeters}),例如nearby(25.047675, 121.517055, 100)", + "required": true, + "type": "string" + }, + { + "in": "query", + "name": "health", + "description": "加入參數'?health=true'即可查詢此API服務的健康狀態", + "type": "string", + "enum": [ + "true", + "false" + ] + }, + { + "in": "query", + "name": "$format", + "description": "指定來源格式", + "required": true, + "type": "string", + "enum": [ + "JSON", + "XML" + ] + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "title": "Array", + "type": "array", + "items": { + "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusRoute" + } + } + }, + "304": { + "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content" + }, + "299": { + "description": "加入參數'?health=true'即可查詢此API服務的健康狀態", + "schema": { + "$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V3.Base.DisplayHealth" + } + } + } + } + }, + "/v2/Bus/RealTimeByFrequency/NearBy": { + "get": { + "tags": [ + "Advanced" + ], + "summary": "取得指定[位置,範圍]的全臺公車動態定時資料(A1)", + "description": "取得指定[位置,範圍]的全臺公車動態定時資料(A1)", + "operationId": "BusApi_RealTimeByFrequency_NearBy", + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "query", + "name": "$select", + "description": "挑選", + "type": "string" + }, + { + "in": "query", + "name": "$filter", + "description": "過濾", + "type": "string" + }, + { + "in": "query", + "name": "$orderby", + "description": "排序", + "type": "string" + }, + { + "in": "query", + "name": "$top", + "description": "取前幾筆", + "type": "integer", + "default": 30 + }, + { + "in": "query", + "name": "$skip", + "description": "跳過前幾筆", + "type": "string" + }, + { + "in": "query", + "name": "$spatialFilter", + "description": "空間過濾(最大搜尋半徑為1000公尺),語法為nearby({Lat},{Lon},{DistanceInMeters}),例如nearby(25.047675, 121.517055, 100)", + "required": true, + "type": "string" + }, + { + "in": "query", + "name": "health", + "description": "加入參數'?health=true'即可查詢此API服務的健康狀態", + "type": "string", + "enum": [ + "true", + "false" + ] + }, + { + "in": "query", + "name": "$format", + "description": "指定來源格式", + "required": true, + "type": "string", + "enum": [ + "JSON", + "XML" + ] + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "title": "Array", + "type": "array", + "items": { + "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusA1Data" + } + } + }, + "304": { + "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content" + }, + "299": { + "description": "加入參數'?health=true'即可查詢此API服務的健康狀態", + "schema": { + "$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V3.Base.DisplayHealth" + } + } + } + } + }, + "/v2/Bus/RealTimeNearStop/NearBy": { + "get": { + "tags": [ + "Advanced" + ], + "summary": "取得指定[位置,範圍]的全臺公車動態定點資料(A2)", + "description": "取得指定[位置,範圍]的全臺公車動態定點資料(A2)", + "operationId": "BusApi_RealTimeNearStop_NearBy", + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "query", + "name": "$select", + "description": "挑選", + "type": "string" + }, + { + "in": "query", + "name": "$filter", + "description": "過濾", + "type": "string" + }, + { + "in": "query", + "name": "$orderby", + "description": "排序", + "type": "string" + }, + { + "in": "query", + "name": "$top", + "description": "取前幾筆", + "type": "integer", + "default": 30 + }, + { + "in": "query", + "name": "$skip", + "description": "跳過前幾筆", + "type": "string" + }, + { + "in": "query", + "name": "$spatialFilter", + "description": "空間過濾(最大搜尋半徑為1000公尺),語法為nearby({Lat},{Lon},{DistanceInMeters}),例如nearby(25.047675, 121.517055, 100)", + "required": true, + "type": "string" + }, + { + "in": "query", + "name": "health", + "description": "加入參數'?health=true'即可查詢此API服務的健康狀態", + "type": "string", + "enum": [ + "true", + "false" + ] + }, + { + "in": "query", + "name": "$format", + "description": "指定來源格式", + "required": true, + "type": "string", + "enum": [ + "JSON", + "XML" + ] + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "title": "Array", + "type": "array", + "items": { + "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusA2Data" + } + } + }, + "304": { + "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content" + }, + "299": { + "description": "加入參數'?health=true'即可查詢此API服務的健康狀態", + "schema": { + "$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V3.Base.DisplayHealth" + } + } + } + } + }, + "/v2/Bus/EstimatedTimeOfArrival/NearBy": { + "get": { + "tags": [ + "Advanced" + ], + "summary": "取得指定[位置,範圍]的全臺公車預估到站資料(N1)", + "description": "取得指定[位置,範圍]的全臺公車預估到站資料(N1)", + "operationId": "BusApi_EstimatedTimeOfArrival_NearBy", + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "query", + "name": "$select", + "description": "挑選", + "type": "string" + }, + { + "in": "query", + "name": "$filter", + "description": "過濾", + "type": "string" + }, + { + "in": "query", + "name": "$orderby", + "description": "排序", + "type": "string" + }, + { + "in": "query", + "name": "$top", + "description": "取前幾筆", + "type": "integer", + "default": 30 + }, + { + "in": "query", + "name": "$skip", + "description": "跳過前幾筆", + "type": "string" + }, + { + "in": "query", + "name": "$spatialFilter", + "description": "空間過濾(最大搜尋半徑為1000公尺),語法為nearby({Lat},{Lon},{DistanceInMeters}),例如nearby(25.047675, 121.517055, 100)", + "required": true, + "type": "string" + }, + { + "in": "query", + "name": "health", + "description": "加入參數'?health=true'即可查詢此API服務的健康狀態", + "type": "string", + "enum": [ + "true", + "false" + ] + }, + { + "in": "query", + "name": "$format", + "description": "指定來源格式", + "required": true, + "type": "string", + "enum": [ + "JSON", + "XML" + ] + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "title": "Array", + "type": "array", + "items": { + "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusN1EstimateTime" + } + } + }, + "304": { + "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content" + }, + "299": { + "description": "加入參數'?health=true'即可查詢此API服務的健康狀態", + "schema": { + "$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V3.Base.DisplayHealth" + } + } + } + } + } + }, + "definitions": { + "PTX.Service.DTO.Bus.Specification.V2.BusA1Data": { + "title": "BusA1Data", + "description": "定時車機資料型別", + "required": [ + "GPSTime", + "PlateNumb", + "UpdateTime" + ], + "type": "object", + "properties": { + "PlateNumb": { + "title": "String", + "description": "車牌號碼", + "type": "string", + "xml": { + "name": "String" + } + }, + "OperatorID": { + "title": "String", + "description": "營運業者代碼", + "type": "string", + "xml": { + "name": "String" + } + }, + "RouteUID": { + "title": "String", + "description": "路線唯一識別代碼,規則為 {業管機關簡碼} + {RouteID},其中 {業管機關簡碼} 可於Authority API中的AuthorityCode欄位查詢", + "type": "string", + "xml": { + "name": "String" + } + }, + "RouteID": { + "title": "String", + "description": "地區既用中之路線代碼(為原資料內碼)", + "type": "string", + "xml": { + "name": "String" + } + }, + "RouteName": { + "title": "NameType", + "description": "路線名稱", + "allOf": [ + { + "$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V2.Base.NameType" + } + ], + "xml": { + "name": "NameType" + } + }, + "SubRouteUID": { + "title": "String", + "description": "子路線唯一識別代碼,規則為 {業管機關簡碼} + {SubRouteID},其中 {業管機關簡碼} 可於Authority API中的AuthorityCode欄位查詢", + "type": "string", + "xml": { + "name": "String" + } + }, + "SubRouteID": { + "title": "String", + "description": "地區既用中之子路線代碼(為原資料內碼)", + "type": "string", + "xml": { + "name": "String" + } + }, + "SubRouteName": { + "title": "NameType", + "description": "子路線名稱", + "allOf": [ + { + "$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V2.Base.NameType" + } + ], + "xml": { + "name": "NameType" + } + }, + "Direction": { + "title": "Int32", + "description": "去返程 : [0:'去程',1:'返程',2:'迴圈',255:'未知']", + "type": "integer" + }, + "BusPosition": { + "title": "PointType", + "description": "車輛位置經度", + "allOf": [ + { + "$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V2.Base.PointType" + } + ], + "xml": { + "name": "PointType" + } + }, + "Speed": { + "format": "double", + "description": "行駛速度(kph)", + "type": "number" + }, + "Azimuth": { + "format": "double", + "description": "方位角", + "type": "number" + }, + "DutyStatus": { + "title": "Int32", + "description": "勤務狀態 : [0:'正常',1:'開始',2:'結束']", + "type": "integer" + }, + "BusStatus": { + "title": "Int32", + "description": "行車狀況 : [0:'正常',1:'車禍',2:'故障',3:'塞車',4:'緊急求援',5:'加油',90:'不明',91:'去回不明',98:'偏移路線',99:'非營運狀態',100:'客滿',101:'包車出租',255:'未知']", + "type": "integer" + }, + "MessageType": { + "title": "Int32", + "description": "資料型態種類 : [0:'未知',1:'定期',2:'非定期']", + "type": "integer" + }, + "GPSTime": { + "format": "date-time", + "title": "DateTime", + "description": "車機時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)", + "type": "string" + }, + "TransTime": { + "format": "date-time", + "description": "車機資料傳輸時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)[多數單位沒有提供此欄位資訊]", + "type": "string" + }, + "SrcRecTime": { + "format": "date-time", + "description": "來源端平台接收時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)", + "type": "string" + }, + "SrcTransTime": { + "format": "date-time", + "description": "來源端平台資料傳出時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)[公總使用動態即時推播故有提供此欄位, 而非公總系統因使用整包資料更新, 故沒有提供此欄位]", + "type": "string" + }, + "SrcUpdateTime": { + "format": "date-time", + "description": "來源端平台資料更新時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)[公總使用動態即時推播故沒有提供此欄位, 而非公總系統因提供整包資料更新, 故有提供此欄]", + "type": "string" + }, + "UpdateTime": { + "format": "date-time", + "title": "DateTime", + "description": "本平台資料更新時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)", + "type": "string" + } + }, + "xml": { + "name": "BusA1Data" + } + }, + "PTX.Service.DTO.Bus.Specification.V2.BusA2Data": { + "title": "BusA2Data", + "description": "定點車機資料型別", + "required": [ + "Direction", + "GPSTime", + "PlateNumb", + "UpdateTime" + ], + "type": "object", + "properties": { + "PlateNumb": { + "title": "String", + "description": "車牌號碼", + "type": "string", + "xml": { + "name": "String" + } + }, + "OperatorID": { + "title": "String", + "description": "營運業者代碼", + "type": "string", + "xml": { + "name": "String" + } + }, + "RouteUID": { + "title": "String", + "description": "路線唯一識別代碼,規則為 {業管機關簡碼} + {RouteID},其中 {業管機關簡碼} 可於Authority API中的AuthorityCode欄位查詢", + "type": "string", + "xml": { + "name": "String" + } + }, + "RouteID": { + "title": "String", + "description": "地區既用中之路線代碼(為原資料內碼)", + "type": "string", + "xml": { + "name": "String" + } + }, + "RouteName": { + "title": "NameType", + "description": "路線名", + "allOf": [ + { + "$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V2.Base.NameType" + } + ], + "xml": { + "name": "NameType" + } + }, + "SubRouteUID": { + "title": "String", + "description": "子路線唯一識別代碼,規則為 {業管機關簡碼} + {SubRouteID},其中 {業管機關簡碼} 可於Authority API中的AuthorityCode欄位查詢", + "type": "string", + "xml": { + "name": "String" + } + }, + "SubRouteID": { + "title": "String", + "description": "地區既用中之子路線代碼(為原資料內碼)", + "type": "string", + "xml": { + "name": "String" + } + }, + "SubRouteName": { + "title": "NameType", + "description": "子路線名稱", + "allOf": [ + { + "$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V2.Base.NameType" + } + ], + "xml": { + "name": "NameType" + } + }, + "Direction": { + "title": "Int32", + "description": "去返程 : [0:'去程',1:'返程',2:'迴圈',255:'未知']", + "type": "integer" + }, + "StopUID": { + "title": "String", + "description": "站牌唯一識別代碼,規則為 {業管機關簡碼} + {StopID},其中 {業管機關簡碼} 可於Authority API中的AuthorityCode欄位查詢", + "type": "string", + "xml": { + "name": "String" + } + }, + "StopID": { + "title": "String", + "description": "地區既用中之站牌代號(為原資料內碼)", + "type": "string", + "xml": { + "name": "String" + } + }, + "StopName": { + "title": "NameType", + "description": "站牌名", + "allOf": [ + { + "$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V2.Base.NameType" + } + ], + "xml": { + "name": "NameType" + } + }, + "StopSequence": { + "format": "int32", + "title": "Int32", + "description": "路線經過站牌之順序", + "type": "integer" + }, + "MessageType": { + "title": "Int32", + "description": "資料型態種類 : [0:'未知',1:'定期',2:'非定期']", + "type": "integer" + }, + "DutyStatus": { + "title": "Int32", + "description": "勤務狀態 : [0:'正常',1:'開始',2:'結束']", + "type": "integer" + }, + "BusStatus": { + "title": "Int32", + "description": "行車狀況 : [0:'正常',1:'車禍',2:'故障',3:'塞車',4:'緊急求援',5:'加油',90:'不明',91:'去回不明',98:'偏移路線',99:'非營運狀態',100:'客滿',101:'包車出租',255:'未知']", + "type": "integer" + }, + "A2EventType": { + "title": "Int32", + "description": "進站離站 : [0:'離站',1:'進站']", + "type": "integer" + }, + "GPSTime": { + "format": "date-time", + "title": "DateTime", + "description": "車機時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz) [觸發到離站的GPS時間]", + "type": "string" + }, + "TransTime": { + "format": "date-time", + "description": "車機資料傳輸時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)[多數單位沒有提供此欄位資訊]", + "type": "string" + }, + "SrcRecTime": { + "format": "date-time", + "description": "來源端平台接收時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)", + "type": "string" + }, + "SrcTransTime": { + "format": "date-time", + "description": "來源端平台資料傳出時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)[公總使用動態即時推播故有提供此欄位, 而非公總系統因使用整包資料更新, 故沒有提供此欄位]", + "type": "string" + }, + "SrcUpdateTime": { + "format": "date-time", + "description": "來源端平台資料更新時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)[公總使用動態即時推播故沒有提供此欄位, 而非公總系統因提供整包資料更新, 故有提供此欄]", + "type": "string" + }, + "UpdateTime": { + "format": "date-time", + "title": "DateTime", + "description": "本平台資料更新時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)", + "type": "string" + } + }, + "xml": { + "name": "BusA2Data" + } + }, + "PTX.Service.DTO.Bus.Specification.V2.BusAlert": { + "title": "BusAlert", + "required": [ + "AlertID", + "Department", + "Description", + "Scope", + "Title" + ], + "type": "object", + "properties": { + "AlertID": { + "title": "String", + "description": "通阻事件原單位發布代碼", + "type": "string", + "xml": { + "name": "String" + } + }, + "Title": { + "title": "String", + "description": "通阻標題", + "type": "string", + "xml": { + "name": "String" + } + }, + "Description": { + "title": "String", + "description": "事件描述", + "type": "string", + "xml": { + "name": "String" + } + }, + "Department": { + "title": "String", + "description": "發布單位", + "type": "string", + "xml": { + "name": "String" + } + }, + "Status": { + "title": "Int32", + "description": "營運狀況 : [0:'全部營運停止',1:'全部營運正常',2:'有異常狀況']", + "type": "integer" + }, + "Cause": { + "title": "Int32", + "description": "原因 : [1:'事故',2:'維護',3:'技術問題',4:'施工',5:'急救',6:'天災',7:'示威遊行',8:'維安',9:'假日',10:'罷工',254:'其他',255:'未知原因']", + "type": "integer" + }, + "Effect": { + "title": "Int32", + "description": "影響 : [1:'車輛改道',2:'服務班次增加',3:'服務班次減少',4:'服務班次取消',5:'服務班次改變',6:'站牌不停靠',7:'重大延遲',254:'其他影響',255:'未知影響']", + "type": "integer" + }, + "Scope": { + "title": "Scope", + "description": "通阻影響範圍", + "allOf": [ + { + "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.Scope" + } + ], + "xml": { + "name": "Scope" + } + }, + "AlertURL": { + "title": "String", + "description": "詳細描述網站連結", + "type": "string", + "xml": { + "name": "String" + } + }, + "PublishTime": { + "format": "date-time", + "description": "消息公告日期時間", + "type": "string" + }, + "StartTime": { + "format": "date-time", + "description": "開始日期時間", + "type": "string" + }, + "EndTime": { + "format": "date-time", + "description": "結束日期時間", + "type": "string" + }, + "SrcUpdateTime": { + "format": "date-time", + "title": "DateTime", + "description": "[來源端平臺]此筆資料最後更新時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)", + "type": "string" + }, + "UpdateTime": { + "format": "date-time", + "title": "DateTime", + "description": "本平台資料更新時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)", + "type": "string" + } + }, + "xml": { + "name": "BusAlert" + } + }, + "PTX.Service.DTO.Bus.Specification.V2.BusDailyStopTimeTable": { + "title": "BusDailyStopTimeTable", + "required": [ + "BusDate", + "DestinationStopID", + "OperatorCode", + "OperatorID", + "RouteID", + "RouteName", + "RouteUID", + "Stops", + "SubRouteID", + "SubRouteUID", + "UpdateTime" + ], + "type": "object", + "properties": { + "BusDate": { + "format": "date-time", + "title": "DateTime", + "description": "適用日期", + "type": "string" + }, + "RouteUID": { + "title": "String", + "description": "路線唯一識別代碼,規則為 {業管機關簡碼} + {RouteID},其中 {業管機關簡碼} 可於Authority API中的AuthorityCode欄位查詢", + "type": "string", + "xml": { + "name": "String" + } + }, + "RouteID": { + "title": "String", + "description": "地區既用中之路線代碼(為原資料內碼)", + "type": "string", + "xml": { + "name": "String" + } + }, + "RouteName": { + "title": "NameType", + "description": "路線名稱", + "allOf": [ { "$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V2.Base.NameType" } @@ -8521,9 +9404,25 @@ "name": "NameType" } }, + "OperatorID": { + "title": "String", + "description": "營運業者代碼", + "type": "string", + "xml": { + "name": "String" + } + }, + "OperatorCode": { + "title": "String", + "description": "營運業者簡碼", + "type": "string", + "xml": { + "name": "String" + } + }, "SubRouteUID": { "title": "String", - "description": "子路線唯一識別代碼,規則為 {業管機關簡碼} + {SubRouteID},其中 {業管機關簡碼} 可於Authority API中的AuthorityCode欄位查詢", + "description": "附屬路線唯一識別代碼,規則為 {業管機關簡碼} + {SubRouteID},其中 {業管機關簡碼} 可於Authority API中的AuthorityCode欄位查詢", "type": "string", "xml": { "name": "String" @@ -8531,7 +9430,7 @@ }, "SubRouteID": { "title": "String", - "description": "地區既用中之子路線代碼(為原資料內碼)", + "description": "地區既用中之附屬路線代碼(為原資料內碼)", "type": "string", "xml": { "name": "String" @@ -8539,7 +9438,7 @@ }, "SubRouteName": { "title": "NameType", - "description": "子路線名稱", + "description": "附屬路線名稱", "allOf": [ { "$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V2.Base.NameType" @@ -8549,112 +9448,175 @@ "name": "NameType" } }, - "Direction": { - "title": "Int32", - "description": "去返程 : [0:'去程',1:'返程',2:'迴圈',255:'未知']", - "type": "integer" + "DestinationStopID": { + "title": "String", + "description": "迄點站站牌代碼,機關定義站牌代號(為原資料內碼)", + "type": "string", + "xml": { + "name": "String" + } }, - "BusPosition": { - "title": "PointType", - "description": "車輛位置經度", + "DestinationStopName": { + "title": "NameType", + "description": "迄點站站牌名稱", "allOf": [ { - "$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V2.Base.PointType" + "$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V2.Base.NameType" } ], "xml": { - "name": "PointType" + "name": "NameType" } }, - "Speed": { - "format": "double", - "description": "行駛速度(kph)", - "type": "number" - }, - "Azimuth": { - "format": "double", - "description": "方位角", - "type": "number" - }, - "DutyStatus": { - "title": "Int32", - "description": "勤務狀態 : [0:'正常',1:'開始',2:'結束']", - "type": "integer" - }, - "BusStatus": { - "title": "Int32", - "description": "行車狀況 : [0:'正常',1:'車禍',2:'故障',3:'塞車',4:'緊急求援',5:'加油',90:'不明',91:'去回不明',98:'偏移路線',99:'非營運狀態',100:'客滿',101:'包車出租',255:'未知']", - "type": "integer" - }, - "MessageType": { - "title": "Int32", - "description": "資料型態種類 : [0:'未知',1:'定期',2:'非定期']", - "type": "integer" + "Stops": { + "title": "Array", + "description": "公車站牌停靠資料", + "type": "array", + "items": { + "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusDailyStopTimeTable+Stop" + }, + "xml": { + "name": "List`1" + } }, - "GPSTime": { + "UpdateTime": { "format": "date-time", "title": "DateTime", - "description": "車機時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)", - "type": "string" - }, - "TransTime": { - "format": "date-time", - "description": "車機資料傳輸時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)[多數單位沒有提供此欄位資訊]", - "type": "string" - }, - "SrcRecTime": { - "format": "date-time", - "description": "來源端平台接收時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)", + "description": "資料更新日期時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)", "type": "string" + } + }, + "xml": { + "name": "BusDailyStopTimeTable" + } + }, + "PTX.Service.DTO.Bus.Specification.V2.BusDailyStopTimeTable+Stop": { + "title": "Stop", + "required": [ + "StopID", + "StopUID" + ], + "type": "object", + "properties": { + "StopUID": { + "title": "String", + "description": "站牌唯一識別代碼,規則為 {業管機關代碼} + {StopID},其中 {業管機關代碼} 可於Authority API中的AuthorityCode欄位查詢", + "type": "string", + "xml": { + "name": "String" + } }, - "SrcTransTime": { - "format": "date-time", - "description": "來源端平台資料傳出時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)[公總使用動態即時推播故有提供此欄位, 而非公總系統因使用整包資料更新, 故沒有提供此欄位]", - "type": "string" + "StopID": { + "title": "String", + "description": "地區既用中之站牌代碼(為原資料內碼)", + "type": "string", + "xml": { + "name": "String" + } }, - "SrcUpdateTime": { - "format": "date-time", - "description": "來源端平台資料更新時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)[公總使用動態即時推播故沒有提供此欄位, 而非公總系統因提供整包資料更新, 故有提供此欄]", - "type": "string" + "StopName": { + "title": "NameType", + "description": "站牌名稱", + "allOf": [ + { + "$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V2.Base.NameType" + } + ], + "xml": { + "name": "NameType" + } }, - "UpdateTime": { - "format": "date-time", - "title": "DateTime", - "description": "本平台資料更新時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)", - "type": "string" + "TimeTables": { + "title": "Array", + "description": "預定班表", + "type": "array", + "items": { + "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusDailyStopTimeTable+TimeTable" + }, + "xml": { + "name": "List`1" + } } }, "xml": { - "name": "BusA1Data" + "name": "Stop" } }, - "PTX.Service.DTO.Bus.Specification.V2.BusA2Data": { - "title": "BusA2Data", - "description": "定點車機資料型別", + "PTX.Service.DTO.Bus.Specification.V2.BusDailyStopTimeTable+TimeTable": { + "title": "TimeTable", "required": [ - "Direction", - "GPSTime", - "PlateNumb", - "UpdateTime" + "ArrivalTime", + "DepartureTime", + "Sequence", + "TimeType" ], "type": "object", "properties": { - "PlateNumb": { + "Sequence": { + "format": "int32", + "title": "Int32", + "description": "發車順序(由1開始)", + "type": "integer" + }, + "TripID": { + "title": "String", + "description": "班次代碼", + "type": "string", + "xml": { + "name": "String" + } + }, + "IsLowFloor": { + "description": "該路線班次是否使用低地板公車車輛 , 0 = 否 , 1 = 是", + "type": "boolean" + }, + "ArrivalTime": { "title": "String", - "description": "車牌號碼", + "description": "到站時間,格式為:HH:mm", "type": "string", "xml": { "name": "String" } }, - "OperatorID": { + "DepartureTime": { "title": "String", - "description": "營運業者代碼", + "description": "離站時間,格式為:HH:mm", "type": "string", "xml": { "name": "String" } }, + "TimeType": { + "title": "Int32", + "description": "時刻表時間類型 : [0:'估算時間',1:'表訂時間']", + "type": "integer" + } + }, + "xml": { + "name": "TimeTable" + } + }, + "PTX.Service.DTO.Bus.Specification.V2.BusDailyTimeTable": { + "title": "BusDailyTimeTable", + "required": [ + "BusDate", + "Direction", + "OperatorCode", + "OperatorID", + "RouteID", + "RouteName", + "RouteUID", + "SubRouteID", + "UpdateTime" + ], + "type": "object", + "properties": { + "BusDate": { + "format": "date-time", + "title": "DateTime", + "description": "適用日期", + "type": "string" + }, "RouteUID": { "title": "String", "description": "路線唯一識別代碼,規則為 {業管機關簡碼} + {RouteID},其中 {業管機關簡碼} 可於Authority API中的AuthorityCode欄位查詢", @@ -8673,7 +9635,7 @@ }, "RouteName": { "title": "NameType", - "description": "路線名", + "description": "路線名稱", "allOf": [ { "$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V2.Base.NameType" @@ -8683,58 +9645,41 @@ "name": "NameType" } }, - "SubRouteUID": { + "OperatorID": { "title": "String", - "description": "子路線唯一識別代碼,規則為 {業管機關簡碼} + {SubRouteID},其中 {業管機關簡碼} 可於Authority API中的AuthorityCode欄位查詢", + "description": "營運業者代碼", "type": "string", "xml": { "name": "String" } }, - "SubRouteID": { + "OperatorCode": { "title": "String", - "description": "地區既用中之子路線代碼(為原資料內碼)", + "description": "營運業者簡碼", "type": "string", "xml": { "name": "String" } }, - "SubRouteName": { - "title": "NameType", - "description": "子路線名稱", - "allOf": [ - { - "$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V2.Base.NameType" - } - ], - "xml": { - "name": "NameType" - } - }, - "Direction": { - "title": "Int32", - "description": "去返程 : [0:'去程',1:'返程',2:'迴圈',255:'未知']", - "type": "integer" - }, - "StopUID": { + "SubRouteUID": { "title": "String", - "description": "站牌唯一識別代碼,規則為 {業管機關簡碼} + {StopID},其中 {業管機關簡碼} 可於Authority API中的AuthorityCode欄位查詢", + "description": "附屬路線唯一識別代碼,規則為 {業管機關簡碼} + {SubRouteID},其中 {業管機關簡碼} 可於Authority API中的AuthorityCode欄位查詢", "type": "string", "xml": { "name": "String" } }, - "StopID": { + "SubRouteID": { "title": "String", - "description": "地區既用中之站牌代號(為原資料內碼)", + "description": "地區既用中之附屬路線代碼(為原資料內碼)", "type": "string", "xml": { "name": "String" } }, - "StopName": { + "SubRouteName": { "title": "NameType", - "description": "站牌名", + "description": "附屬路線名稱", "allOf": [ { "$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V2.Base.NameType" @@ -8744,177 +9689,134 @@ "name": "NameType" } }, - "StopSequence": { - "format": "int32", - "title": "Int32", - "description": "路線經過站牌之順序", - "type": "integer" - }, - "MessageType": { - "title": "Int32", - "description": "資料型態種類 : [0:'未知',1:'定期',2:'非定期']", - "type": "integer" - }, - "DutyStatus": { - "title": "Int32", - "description": "勤務狀態 : [0:'正常',1:'開始',2:'結束']", - "type": "integer" - }, - "BusStatus": { - "title": "Int32", - "description": "行車狀況 : [0:'正常',1:'車禍',2:'故障',3:'塞車',4:'緊急求援',5:'加油',90:'不明',91:'去回不明',98:'偏移路線',99:'非營運狀態',100:'客滿',101:'包車出租',255:'未知']", - "type": "integer" - }, - "A2EventType": { + "Direction": { "title": "Int32", - "description": "進站離站 : [0:'離站',1:'進站']", + "description": "去返程 : [0:'去程',1:'返程',2:'迴圈',255:'未知']", "type": "integer" }, - "GPSTime": { - "format": "date-time", - "title": "DateTime", - "description": "車機時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz) [觸發到離站的GPS時間]", - "type": "string" - }, - "TransTime": { - "format": "date-time", - "description": "車機資料傳輸時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)[多數單位沒有提供此欄位資訊]", - "type": "string" - }, - "SrcRecTime": { - "format": "date-time", - "description": "來源端平台接收時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)", - "type": "string" - }, - "SrcTransTime": { - "format": "date-time", - "description": "來源端平台資料傳出時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)[公總使用動態即時推播故有提供此欄位, 而非公總系統因使用整包資料更新, 故沒有提供此欄位]", - "type": "string" - }, - "SrcUpdateTime": { - "format": "date-time", - "description": "來源端平台資料更新時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)[公總使用動態即時推播故沒有提供此欄位, 而非公總系統因提供整包資料更新, 故有提供此欄]", - "type": "string" + "Timetables": { + "title": "Array", + "description": "預定班表", + "type": "array", + "items": { + "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusDailyTimeTable+TimeTable" + }, + "xml": { + "name": "List`1" + } }, "UpdateTime": { "format": "date-time", "title": "DateTime", - "description": "本平台資料更新時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)", + "description": "資料更新日期時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)", "type": "string" } }, "xml": { - "name": "BusA2Data" + "name": "BusDailyTimeTable" } }, - "PTX.Service.DTO.Bus.Specification.V2.BusAlert": { - "title": "BusAlert", + "PTX.Service.DTO.Bus.Specification.V2.BusDailyTimeTable+StopTime": { + "title": "StopTime", "required": [ - "AlertID", - "Department", - "Description", - "Scope", - "Title" + "ArrivalTime", + "DepartureTime", + "StopID", + "StopSequence", + "StopUID", + "TimeType" ], "type": "object", "properties": { - "AlertID": { + "StopSequence": { + "format": "int32", + "title": "Int32", + "description": "路線經過站牌之順序(由1開始)", + "type": "integer" + }, + "StopUID": { "title": "String", - "description": "通阻事件原單位發布代碼", + "description": "站牌唯一識別代碼,規則為 {業管機關代碼} + {StopID},其中 {業管機關代碼} 可於Authority API中的AuthorityCode欄位查詢", "type": "string", "xml": { "name": "String" } }, - "Title": { + "StopID": { "title": "String", - "description": "通阻標題", + "description": "地區既用中之站牌代碼(為原資料內碼)", "type": "string", "xml": { "name": "String" } }, - "Description": { + "StopName": { + "title": "NameType", + "description": "站牌名稱", + "allOf": [ + { + "$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V2.Base.NameType" + } + ], + "xml": { + "name": "NameType" + } + }, + "ArrivalTime": { "title": "String", - "description": "事件描述", + "description": "到站時間,格式為:HH:mm", "type": "string", "xml": { "name": "String" } }, - "Department": { + "DepartureTime": { "title": "String", - "description": "發布單位", + "description": "離站時間,格式為:HH:mm", "type": "string", "xml": { "name": "String" } }, - "Status": { - "title": "Int32", - "description": "營運狀況 : [0:'全部營運停止',1:'全部營運正常',2:'有異常狀況']", - "type": "integer" - }, - "Cause": { - "title": "Int32", - "description": "原因 : [1:'事故',2:'維護',3:'技術問題',4:'施工',5:'急救',6:'天災',7:'示威遊行',8:'維安',9:'假日',10:'罷工',254:'其他',255:'未知原因']", - "type": "integer" - }, - "Effect": { + "TimeType": { "title": "Int32", - "description": "影響 : [1:'車輛改道',2:'服務班次增加',3:'服務班次減少',4:'服務班次取消',5:'服務班次改變',6:'站牌不停靠',7:'重大延遲',254:'其他影響',255:'未知影響']", + "description": "時刻表時間類型 : [0:'估算時間',1:'表訂時間']", "type": "integer" - }, - "Scope": { - "title": "Scope", - "description": "通阻影響範圍", - "allOf": [ - { - "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.Scope" - } - ], - "xml": { - "name": "Scope" - } - }, - "AlertURL": { + } + }, + "xml": { + "name": "StopTime" + } + }, + "PTX.Service.DTO.Bus.Specification.V2.BusDailyTimeTable+TimeTable": { + "title": "TimeTable", + "required": [ + "StopTimes" + ], + "type": "object", + "properties": { + "TripID": { "title": "String", - "description": "詳細描述網站連結", + "description": "班次代碼", "type": "string", "xml": { "name": "String" } }, - "PublishTime": { - "format": "date-time", - "description": "消息公告日期時間", - "type": "string" - }, - "StartTime": { - "format": "date-time", - "description": "開始日期時間", - "type": "string" - }, - "EndTime": { - "format": "date-time", - "description": "結束日期時間", - "type": "string" - }, - "SrcUpdateTime": { - "format": "date-time", - "title": "DateTime", - "description": "[來源端平臺]此筆資料最後更新時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)", - "type": "string" - }, - "UpdateTime": { - "format": "date-time", - "title": "DateTime", - "description": "本平台資料更新時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)", - "type": "string" + "StopTimes": { + "title": "Array", + "description": "公車停靠時間資料", + "type": "array", + "items": { + "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusDailyTimeTable+StopTime" + }, + "xml": { + "name": "List`1" + } } }, "xml": { - "name": "BusAlert" + "name": "TimeTable" } }, "PTX.Service.DTO.Bus.Specification.V2.BusDiscountPeriods": { @@ -11250,7 +12152,7 @@ "properties": { "TripID": { "title": "String", - "description": "班次代碼,為無意義之編碼", + "description": "班次代碼", "type": "string", "xml": { "name": "String" diff --git a/oas.bus.v3.json b/oas.bus.v3.json index 3a49fa31..bf7d99e6 100644 --- a/oas.bus.v3.json +++ b/oas.bus.v3.json @@ -1215,7 +1215,7 @@ "CityBus" ], "summary": "取得指定[縣市]的市區公車每日營運時刻表", - "operationId": "CityBusApi_DailyTimeTable", + "operationId": "CityBusApi_DailyTimeTable_2", "produces": [ "application/json", "application/xml"